@uploadcare/react-uploader 0.0.1-alpha.4 → 0.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -11
- package/dist/react-uploader.cjs +30 -30
- package/dist/react-uploader.d.ts +10 -5
- package/dist/react-uploader.js +621 -606
- package/package.json +52 -3
package/dist/react-uploader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (s, i, e) => (
|
|
4
|
-
import I, { useMemo as
|
|
5
|
-
var
|
|
6
|
-
function
|
|
1
|
+
var cr = Object.defineProperty;
|
|
2
|
+
var hr = (s, i, e) => i in s ? cr(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
|
|
3
|
+
var u = (s, i, e) => (hr(s, typeof i != "symbol" ? i + "" : i, e), e);
|
|
4
|
+
import I, { useMemo as Pe } from "react";
|
|
5
|
+
var ur = Object.defineProperty, dr = (s, i, e) => i in s ? ur(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e, Dt = (s, i, e) => (dr(s, typeof i != "symbol" ? i + "" : i, e), e);
|
|
6
|
+
function fr(s) {
|
|
7
7
|
let i = (e) => {
|
|
8
8
|
var t;
|
|
9
9
|
for (let r in e)
|
|
@@ -14,7 +14,7 @@ function pr(s) {
|
|
|
14
14
|
}
|
|
15
15
|
var T = class {
|
|
16
16
|
constructor(s) {
|
|
17
|
-
s.constructor === Object ? this.store =
|
|
17
|
+
s.constructor === Object ? this.store = fr(s) : (this._storeIsProxy = !0, this.store = s), this.callbackMap = /* @__PURE__ */ Object.create(null);
|
|
18
18
|
}
|
|
19
19
|
static warn(s, i) {
|
|
20
20
|
console.warn(`Symbiote Data: cannot ${s}. Prop name: ` + i);
|
|
@@ -79,11 +79,11 @@ var _ = Object.freeze({
|
|
|
79
79
|
SET_LATER_KEY: "__toSetLater__",
|
|
80
80
|
USE_TPL: "use-template",
|
|
81
81
|
ROOT_STYLE_ATTR_NAME: "sym-component"
|
|
82
|
-
}), Wi = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",
|
|
82
|
+
}), Wi = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm", pr = Wi.length - 1, te = class {
|
|
83
83
|
static generate(s = "XXXXXXXXX-XXX") {
|
|
84
84
|
let i = "";
|
|
85
85
|
for (let e = 0; e < s.length; e++)
|
|
86
|
-
i += s[e] === "-" ? s[e] : Wi.charAt(Math.random() *
|
|
86
|
+
i += s[e] === "-" ? s[e] : Wi.charAt(Math.random() * pr);
|
|
87
87
|
return i;
|
|
88
88
|
}
|
|
89
89
|
};
|
|
@@ -93,10 +93,10 @@ function qi(s, i, e) {
|
|
|
93
93
|
l < n.length - 1 ? s = s[o] : r = o;
|
|
94
94
|
}), s ? s[r] = e : t = !1, t;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function mr(s) {
|
|
97
97
|
return s.split("-").map((i, e) => i && e ? i[0].toUpperCase() + i.slice(1) : i).join("").split("_").map((i, e) => i && e ? i.toUpperCase() : i).join("");
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function gr(s, i) {
|
|
100
100
|
[...s.querySelectorAll(`[${_.REPEAT_ATTR}]`)].forEach((e) => {
|
|
101
101
|
let t = e.getAttribute(_.REPEAT_ITEM_TAG_ATTR), r;
|
|
102
102
|
if (t && (r = window.customElements.get(t)), !r) {
|
|
@@ -155,7 +155,7 @@ function br(s, i) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
var mi = "__default__";
|
|
158
|
-
function
|
|
158
|
+
function br(s, i) {
|
|
159
159
|
if (i.shadowRoot)
|
|
160
160
|
return;
|
|
161
161
|
let e = [...s.querySelectorAll("slot")];
|
|
@@ -182,18 +182,18 @@ function _r(s, i) {
|
|
|
182
182
|
r.slot.remove();
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function _r(s, i) {
|
|
186
186
|
[...s.querySelectorAll(`[${_.EL_REF_ATTR}]`)].forEach((e) => {
|
|
187
187
|
let t = e.getAttribute(_.EL_REF_ATTR);
|
|
188
188
|
i.ref[t] = e, e.removeAttribute(_.EL_REF_ATTR);
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function yr(s, i) {
|
|
192
192
|
[...s.querySelectorAll(`[${_.BIND_ATTR}]`)].forEach((e) => {
|
|
193
193
|
let r = e.getAttribute(_.BIND_ATTR).split(";");
|
|
194
194
|
[...e.attributes].forEach((n) => {
|
|
195
195
|
if (n.name.startsWith("-") && n.value) {
|
|
196
|
-
let o =
|
|
196
|
+
let o = mr(n.name.replace("-", ""));
|
|
197
197
|
r.push(o + ":" + n.value), e.removeAttribute(n.name);
|
|
198
198
|
}
|
|
199
199
|
}), r.forEach((n) => {
|
|
@@ -211,20 +211,20 @@ function vr(s, i) {
|
|
|
211
211
|
}), e.removeAttribute(_.BIND_ATTR);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
var it = "{{", je = "}}",
|
|
215
|
-
function
|
|
214
|
+
var it = "{{", je = "}}", vr = "skip-text";
|
|
215
|
+
function Cr(s) {
|
|
216
216
|
let i, e = [], t = document.createTreeWalker(s, NodeFilter.SHOW_TEXT, {
|
|
217
217
|
acceptNode: (r) => {
|
|
218
218
|
var n;
|
|
219
|
-
return !((n = r.parentElement) != null && n.hasAttribute(
|
|
219
|
+
return !((n = r.parentElement) != null && n.hasAttribute(vr)) && r.textContent.includes(it) && r.textContent.includes(je) && 1;
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
for (; i = t.nextNode(); )
|
|
223
223
|
e.push(i);
|
|
224
224
|
return e;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
227
|
-
|
|
226
|
+
var wr = function(s, i) {
|
|
227
|
+
Cr(s).forEach((t) => {
|
|
228
228
|
let r = [], n;
|
|
229
229
|
for (; t.textContent.includes(je); )
|
|
230
230
|
t.textContent.startsWith(it) ? (n = t.textContent.indexOf(je) + je.length, t.splitText(n), r.push(t)) : (n = t.textContent.indexOf(it), t.splitText(n)), t = t.nextSibling;
|
|
@@ -235,14 +235,14 @@ var Er = function(s, i) {
|
|
|
235
235
|
});
|
|
236
236
|
});
|
|
237
237
|
});
|
|
238
|
-
},
|
|
238
|
+
}, Er = [gr, br, _r, yr, wr], rt = "'", Le = '"', Ar = /\\([0-9a-fA-F]{1,6} ?)/g;
|
|
239
|
+
function Tr(s) {
|
|
240
|
+
return (s[0] === Le || s[0] === rt) && (s[s.length - 1] === Le || s[s.length - 1] === rt);
|
|
241
|
+
}
|
|
239
242
|
function $r(s) {
|
|
240
|
-
return (s[0] ===
|
|
243
|
+
return (s[0] === Le || s[0] === rt) && (s = s.slice(1)), (s[s.length - 1] === Le || s[s.length - 1] === rt) && (s = s.slice(0, -1)), s;
|
|
241
244
|
}
|
|
242
245
|
function Sr(s) {
|
|
243
|
-
return (s[0] === Pe || s[0] === rt) && (s = s.slice(1)), (s[s.length - 1] === Pe || s[s.length - 1] === rt) && (s = s.slice(0, -1)), s;
|
|
244
|
-
}
|
|
245
|
-
function xr(s) {
|
|
246
246
|
let i = "", e = "";
|
|
247
247
|
for (var t = 0; t < s.length; t++) {
|
|
248
248
|
const r = s[t + 1];
|
|
@@ -250,10 +250,10 @@ function xr(s) {
|
|
|
250
250
|
}
|
|
251
251
|
return i;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function xr(s) {
|
|
254
254
|
let i = s;
|
|
255
|
-
|
|
256
|
-
`, "\\n"), i =
|
|
255
|
+
Tr(s) && (i = $r(i), i = i.replace(Ar, (e, t) => String.fromCodePoint(parseInt(t.trim(), 16))), i = i.replaceAll(`\\
|
|
256
|
+
`, "\\n"), i = Sr(i), i = Le + i + Le);
|
|
257
257
|
try {
|
|
258
258
|
return JSON.parse(i);
|
|
259
259
|
} catch {
|
|
@@ -428,7 +428,7 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
|
|
|
428
428
|
delete this[_.SET_LATER_KEY];
|
|
429
429
|
}
|
|
430
430
|
this.initChildren = [...this.childNodes];
|
|
431
|
-
for (let e of
|
|
431
|
+
for (let e of Er)
|
|
432
432
|
this.addTemplateProcessor(e);
|
|
433
433
|
if (this.pauseRender)
|
|
434
434
|
this.__initCallback();
|
|
@@ -496,7 +496,7 @@ var gi = 0, $e = null, re = null, ue = class extends HTMLElement {
|
|
|
496
496
|
this.__computedStyle || (this.__computedStyle = window.getComputedStyle(this));
|
|
497
497
|
let e = this.__computedStyle.getPropertyValue(s).trim();
|
|
498
498
|
try {
|
|
499
|
-
this.__cssDataCache[s] =
|
|
499
|
+
this.__cssDataCache[s] = xr(e);
|
|
500
500
|
} catch {
|
|
501
501
|
!i && console.warn(`CSS Data error: ${s}`), this.__cssDataCache[s] = null;
|
|
502
502
|
}
|
|
@@ -557,13 +557,13 @@ function Gi(s, i) {
|
|
|
557
557
|
for (let e in i)
|
|
558
558
|
e.includes("-") ? s.style.setProperty(e, i[e]) : s.style[e] = i[e];
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Ir(s, i) {
|
|
561
561
|
for (let e in i)
|
|
562
562
|
i[e].constructor === Boolean ? i[e] ? s.setAttribute(e, "") : s.removeAttribute(e) : s.setAttribute(e, i[e]);
|
|
563
563
|
}
|
|
564
564
|
function zt(s = { tag: "div" }) {
|
|
565
565
|
let i = document.createElement(s.tag);
|
|
566
|
-
if (s.attributes &&
|
|
566
|
+
if (s.attributes && Ir(i, s.attributes), s.styles && Gi(i, s.styles), s.properties)
|
|
567
567
|
for (let e in s.properties)
|
|
568
568
|
i[e] = s.properties[e];
|
|
569
569
|
return s.processors && s.processors.forEach((e) => {
|
|
@@ -573,7 +573,7 @@ function zt(s = { tag: "div" }) {
|
|
|
573
573
|
i.appendChild(t);
|
|
574
574
|
}), i;
|
|
575
575
|
}
|
|
576
|
-
var Xi = "idb-store-ready",
|
|
576
|
+
var Xi = "idb-store-ready", kr = "symbiote-db", Or = "symbiote-idb-update_", Pr = class {
|
|
577
577
|
_notifyWhenReady(s = null) {
|
|
578
578
|
window.dispatchEvent(new CustomEvent(Xi, {
|
|
579
579
|
detail: {
|
|
@@ -584,7 +584,7 @@ var Xi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr
|
|
|
584
584
|
}));
|
|
585
585
|
}
|
|
586
586
|
get _updEventName() {
|
|
587
|
-
return
|
|
587
|
+
return Or + this.name;
|
|
588
588
|
}
|
|
589
589
|
_getUpdateEvent(s) {
|
|
590
590
|
return new CustomEvent(this._updEventName, {
|
|
@@ -677,7 +677,7 @@ var Xi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr
|
|
|
677
677
|
static get readyEventName() {
|
|
678
678
|
return Xi;
|
|
679
679
|
}
|
|
680
|
-
static open(s =
|
|
680
|
+
static open(s = kr, i = "store") {
|
|
681
681
|
let e = s + "/" + i;
|
|
682
682
|
return this._reg[e] || (this._reg[e] = new Pr(s, i)), this._reg[e];
|
|
683
683
|
}
|
|
@@ -688,7 +688,7 @@ var Xi = "idb-store-ready", Or = "symbiote-db", Lr = "symbiote-idb-update_", Pr
|
|
|
688
688
|
}
|
|
689
689
|
};
|
|
690
690
|
Dt(Ki, "_reg", /* @__PURE__ */ Object.create(null));
|
|
691
|
-
const
|
|
691
|
+
const Lr = 20, S = Object.freeze({
|
|
692
692
|
FILE_ADDED: "file-added",
|
|
693
693
|
FILE_REMOVED: "file-removed",
|
|
694
694
|
FILE_UPLOAD_START: "file-upload-start",
|
|
@@ -708,7 +708,7 @@ const Ur = 20, S = Object.freeze({
|
|
|
708
708
|
CHANGE: "change",
|
|
709
709
|
GROUP_CREATED: "group-created"
|
|
710
710
|
});
|
|
711
|
-
class
|
|
711
|
+
class Ur {
|
|
712
712
|
/** @param {(...args: unknown[]) => void} debugPrint */
|
|
713
713
|
constructor(i) {
|
|
714
714
|
/**
|
|
@@ -768,7 +768,7 @@ class Rr {
|
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
770
|
this._timeoutStore.has(i) && window.clearTimeout(this._timeoutStore.get(i));
|
|
771
|
-
const r = typeof t == "number" ? t :
|
|
771
|
+
const r = typeof t == "number" ? t : Lr, n = window.setTimeout(() => {
|
|
772
772
|
this._dispatch(i, typeof e == "function" ? e() : e), this._timeoutStore.delete(i);
|
|
773
773
|
}, r);
|
|
774
774
|
this._timeoutStore.set(i, n);
|
|
@@ -820,17 +820,17 @@ u(nt, "clientsRegistry", /* @__PURE__ */ new Set()), /** @private */
|
|
|
820
820
|
u(nt, "flush", H(() => {
|
|
821
821
|
document.documentElement.style.setProperty(bi, `${window.innerHeight}px`);
|
|
822
822
|
}, 100));
|
|
823
|
-
const Yi = (s, i) => new Intl.PluralRules(s).select(i),
|
|
823
|
+
const Yi = (s, i) => new Intl.PluralRules(s).select(i), Rr = (s) => s, kt = "{{", Ji = "}}", _i = "plural:";
|
|
824
824
|
function Ot(s, i, e = {}) {
|
|
825
825
|
var o;
|
|
826
|
-
let { openToken: t = kt, closeToken: r = Ji, transform: n =
|
|
826
|
+
let { openToken: t = kt, closeToken: r = Ji, transform: n = Rr } = e;
|
|
827
827
|
for (let l in i) {
|
|
828
828
|
let a = (o = i[l]) == null ? void 0 : o.toString();
|
|
829
829
|
s = s.replaceAll(t + l + r, typeof a == "string" ? n(a) : a);
|
|
830
830
|
}
|
|
831
831
|
return s;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function Mr(s) {
|
|
834
834
|
const i = [];
|
|
835
835
|
let e = s.indexOf(kt);
|
|
836
836
|
for (; e !== -1; ) {
|
|
@@ -874,7 +874,7 @@ function vi(s) {
|
|
|
874
874
|
return Object.prototype.toString.call(s) === "[object Object]";
|
|
875
875
|
}
|
|
876
876
|
const Fr = /\W|_/g;
|
|
877
|
-
function
|
|
877
|
+
function Nr(s) {
|
|
878
878
|
return s.split(Fr).map((i, e) => i.charAt(0)[e > 0 ? "toUpperCase" : "toLowerCase"]() + i.slice(1)).join("");
|
|
879
879
|
}
|
|
880
880
|
function Ci(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
|
|
@@ -892,11 +892,11 @@ function he(s, { ignoreKeys: i } = { ignoreKeys: [] }) {
|
|
|
892
892
|
e[t] = r;
|
|
893
893
|
continue;
|
|
894
894
|
}
|
|
895
|
-
vi(r) ? r = he(r, { ignoreKeys: i }) : Array.isArray(r) && (r = Ci(r, { ignoreKeys: i })), e[
|
|
895
|
+
vi(r) ? r = he(r, { ignoreKeys: i }) : Array.isArray(r) && (r = Ci(r, { ignoreKeys: i })), e[Nr(t)] = r;
|
|
896
896
|
}
|
|
897
897
|
return e;
|
|
898
898
|
}
|
|
899
|
-
const
|
|
899
|
+
const Dr = (s) => new Promise((i) => setTimeout(i, s));
|
|
900
900
|
function Qi({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = "", integration: r = "" }) {
|
|
901
901
|
const n = "JavaScript";
|
|
902
902
|
if (typeof e == "string")
|
|
@@ -912,17 +912,17 @@ function Qi({ libraryName: s, libraryVersion: i, userAgent: e, publicKey: t = ""
|
|
|
912
912
|
const o = [s, i, t].filter(Boolean).join("/"), l = [n, r].filter(Boolean).join("; ");
|
|
913
913
|
return `${o} (${l})`;
|
|
914
914
|
}
|
|
915
|
-
const
|
|
915
|
+
const zr = {
|
|
916
916
|
factor: 2,
|
|
917
917
|
time: 100
|
|
918
918
|
};
|
|
919
|
-
function
|
|
919
|
+
function Vr(s, i = zr) {
|
|
920
920
|
let e = 0;
|
|
921
921
|
function t(r) {
|
|
922
922
|
const n = Math.round(i.time * i.factor ** e);
|
|
923
923
|
return r({
|
|
924
924
|
attempt: e,
|
|
925
|
-
retry: (l) =>
|
|
925
|
+
retry: (l) => Dr(l ?? n).then(() => (e += 1, t(r)))
|
|
926
926
|
});
|
|
927
927
|
}
|
|
928
928
|
return t(s);
|
|
@@ -946,7 +946,7 @@ class Ae extends Vt {
|
|
|
946
946
|
this.name = "CancelError", Object.setPrototypeOf(this, Ae.prototype);
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
const
|
|
949
|
+
const Br = 500, es = ({ check: s, interval: i = Br, timeout: e, signal: t }) => new Promise((r, n) => {
|
|
950
950
|
let o, l;
|
|
951
951
|
ut(t, () => {
|
|
952
952
|
o && clearTimeout(o), n(new Ae("Poll cancelled"));
|
|
@@ -965,7 +965,7 @@ const jr = 500, es = ({ check: s, interval: i = jr, timeout: e, signal: t }) =>
|
|
|
965
965
|
}
|
|
966
966
|
};
|
|
967
967
|
o = setTimeout(a, 0);
|
|
968
|
-
}),
|
|
968
|
+
}), E = {
|
|
969
969
|
baseCDN: "https://ucarecdn.com",
|
|
970
970
|
baseURL: "https://upload.uploadcare.com",
|
|
971
971
|
maxContentLength: 50 * 1024 * 1024,
|
|
@@ -1001,9 +1001,9 @@ const jr = 500, es = ({ check: s, interval: i = jr, timeout: e, signal: t }) =>
|
|
|
1001
1001
|
signal: r,
|
|
1002
1002
|
onProgress: n
|
|
1003
1003
|
}, f = a.getAllResponseHeaders().trim().split(/[\r\n]+/), m = {};
|
|
1004
|
-
f.forEach(function(
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1004
|
+
f.forEach(function(A) {
|
|
1005
|
+
const w = A.split(": "), C = w.shift(), y = w.join(": ");
|
|
1006
|
+
C && typeof C < "u" && (m[C] = y);
|
|
1007
1007
|
});
|
|
1008
1008
|
const p = a.response, g = a.status;
|
|
1009
1009
|
o({
|
|
@@ -1022,33 +1022,33 @@ const jr = 500, es = ({ check: s, interval: i = jr, timeout: e, signal: t }) =>
|
|
|
1022
1022
|
}) : n({ isComputable: !1 });
|
|
1023
1023
|
}), e ? a.send(e) : a.send();
|
|
1024
1024
|
});
|
|
1025
|
-
function
|
|
1025
|
+
function jr(s, ...i) {
|
|
1026
1026
|
return s;
|
|
1027
1027
|
}
|
|
1028
|
-
const
|
|
1029
|
-
var
|
|
1030
|
-
const is = (s) => !1, ft = (s) => typeof Blob < "u" && s instanceof Blob, pt = (s) => typeof File < "u" && s instanceof File, mt = (s) => !!s && typeof s == "object" && !Array.isArray(s) && "uri" in s && typeof s.uri == "string", Me = (s) => ft(s) || pt(s) || is() || mt(s),
|
|
1028
|
+
const Hr = ({ name: s }) => s ? [s] : [], Wr = jr;
|
|
1029
|
+
var qr = () => new FormData();
|
|
1030
|
+
const is = (s) => !1, ft = (s) => typeof Blob < "u" && s instanceof Blob, pt = (s) => typeof File < "u" && s instanceof File, mt = (s) => !!s && typeof s == "object" && !Array.isArray(s) && "uri" in s && typeof s.uri == "string", Me = (s) => ft(s) || pt(s) || is() || mt(s), Gr = (s) => typeof s == "string" || typeof s == "number" || typeof s > "u", Xr = (s) => !!s && typeof s == "object" && !Array.isArray(s), Kr = (s) => !!s && typeof s == "object" && "data" in s && Me(s.data);
|
|
1031
1031
|
function ss(s, i, e) {
|
|
1032
1032
|
if (Array.isArray(e))
|
|
1033
1033
|
for (const t of e)
|
|
1034
1034
|
ss(s, `${i}[]`, t);
|
|
1035
|
-
else if (
|
|
1036
|
-
const { name: t, contentType: r } = e, n =
|
|
1035
|
+
else if (Kr(e)) {
|
|
1036
|
+
const { name: t, contentType: r } = e, n = Wr(e.data, t, r ?? dt), o = Hr({ name: t, contentType: r });
|
|
1037
1037
|
s.push([i, n, ...o]);
|
|
1038
|
-
} else if (
|
|
1038
|
+
} else if (Xr(e))
|
|
1039
1039
|
for (const [t, r] of Object.entries(e))
|
|
1040
1040
|
typeof r < "u" && s.push([`${i}[${t}]`, String(r)]);
|
|
1041
1041
|
else
|
|
1042
|
-
|
|
1042
|
+
Gr(e) && e && s.push([i, e.toString()]);
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1044
|
+
function Yr(s) {
|
|
1045
1045
|
const i = [];
|
|
1046
1046
|
for (const [e, t] of Object.entries(s))
|
|
1047
1047
|
ss(i, e, t);
|
|
1048
1048
|
return i;
|
|
1049
1049
|
}
|
|
1050
1050
|
function gt(s) {
|
|
1051
|
-
const i =
|
|
1051
|
+
const i = qr(), e = Yr(s);
|
|
1052
1052
|
for (const t of e) {
|
|
1053
1053
|
const [r, n, ...o] = t;
|
|
1054
1054
|
i.append(r, n, ...o);
|
|
@@ -1065,7 +1065,7 @@ class D extends Vt {
|
|
|
1065
1065
|
this.name = "UploadError", this.message = e, this.code = t, this.request = r, this.response = n, this.headers = o, Object.setPrototypeOf(this, D.prototype);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
const
|
|
1068
|
+
const Jr = (s) => {
|
|
1069
1069
|
const i = new URLSearchParams();
|
|
1070
1070
|
for (const [e, t] of Object.entries(s))
|
|
1071
1071
|
t && typeof t == "object" && !Array.isArray(t) ? Object.entries(t).filter((r) => r[1] ?? !1).forEach((r) => i.set(`${e}[${r[0]}]`, String(r[1]))) : Array.isArray(t) ? t.forEach((r) => {
|
|
@@ -1074,19 +1074,19 @@ const Zr = (s) => {
|
|
|
1074
1074
|
return i.toString();
|
|
1075
1075
|
}, le = (s, i, e) => {
|
|
1076
1076
|
const t = new URL(s);
|
|
1077
|
-
return t.pathname = (t.pathname + i).replace("//", "/"), e && (t.search =
|
|
1077
|
+
return t.pathname = (t.pathname + i).replace("//", "/"), e && (t.search = Jr(e)), t.toString();
|
|
1078
1078
|
};
|
|
1079
|
-
var
|
|
1080
|
-
const
|
|
1079
|
+
var Zr = "6.14.1";
|
|
1080
|
+
const Qr = "UploadcareUploadClient", en = Zr;
|
|
1081
1081
|
function Te(s) {
|
|
1082
1082
|
return Qi({
|
|
1083
|
-
libraryName:
|
|
1084
|
-
libraryVersion:
|
|
1083
|
+
libraryName: Qr,
|
|
1084
|
+
libraryVersion: en,
|
|
1085
1085
|
...s
|
|
1086
1086
|
});
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1089
|
-
function
|
|
1088
|
+
const tn = "RequestThrottledError", wi = 15e3, sn = 1e3;
|
|
1089
|
+
function rn(s) {
|
|
1090
1090
|
const { headers: i } = s || {};
|
|
1091
1091
|
if (!i || typeof i["retry-after"] != "string")
|
|
1092
1092
|
return wi;
|
|
@@ -1095,11 +1095,11 @@ function nn(s) {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
function be(s, i) {
|
|
1097
1097
|
const { retryThrottledRequestMaxTimes: e, retryNetworkErrorMaxTimes: t } = i;
|
|
1098
|
-
return
|
|
1099
|
-
if ("response" in o && (o == null ? void 0 : o.code) ===
|
|
1100
|
-
return n(
|
|
1098
|
+
return Vr(({ attempt: r, retry: n }) => s().catch((o) => {
|
|
1099
|
+
if ("response" in o && (o == null ? void 0 : o.code) === tn && r < e)
|
|
1100
|
+
return n(rn(o));
|
|
1101
1101
|
if (o instanceof Xe && r < t)
|
|
1102
|
-
return n((r + 1) *
|
|
1102
|
+
return n((r + 1) * sn);
|
|
1103
1103
|
throw o;
|
|
1104
1104
|
}));
|
|
1105
1105
|
}
|
|
@@ -1113,7 +1113,7 @@ const rs = (s) => {
|
|
|
1113
1113
|
function Bt(s) {
|
|
1114
1114
|
return typeof s > "u" || s === "auto" ? "auto" : s ? "1" : "0";
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function nn(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = E.baseURL, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h = "local", integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
|
|
1117
1117
|
return be(() => ge({
|
|
1118
1118
|
method: "POST",
|
|
1119
1119
|
url: le(r, "/base/", {
|
|
@@ -1137,18 +1137,18 @@ function on(s, { publicKey: i, fileName: e, contentType: t, baseURL: r = A.baseU
|
|
|
1137
1137
|
}),
|
|
1138
1138
|
signal: a,
|
|
1139
1139
|
onProgress: c
|
|
1140
|
-
}).then(({ data:
|
|
1141
|
-
const y = he(JSON.parse(
|
|
1140
|
+
}).then(({ data: A, headers: w, request: C }) => {
|
|
1141
|
+
const y = he(JSON.parse(A));
|
|
1142
1142
|
if ("error" in y)
|
|
1143
|
-
throw new D(y.error.content, y.error.errorCode,
|
|
1143
|
+
throw new D(y.error.content, y.error.errorCode, C, y, w);
|
|
1144
1144
|
return y;
|
|
1145
1145
|
}), { retryNetworkErrorMaxTimes: p, retryThrottledRequestMaxTimes: m });
|
|
1146
1146
|
}
|
|
1147
|
-
var
|
|
1147
|
+
var Pt;
|
|
1148
1148
|
(function(s) {
|
|
1149
1149
|
s.Token = "token", s.FileInfo = "file_info";
|
|
1150
|
-
})(
|
|
1151
|
-
function
|
|
1150
|
+
})(Pt || (Pt = {}));
|
|
1151
|
+
function on(s, { publicKey: i, baseURL: e = E.baseURL, store: t, fileName: r, checkForUrlDuplicates: n, saveUrlForRecurrentUploads: o, secureSignature: l, secureExpire: a, source: c = "url", signal: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
|
|
1152
1152
|
return be(() => ge({
|
|
1153
1153
|
method: "POST",
|
|
1154
1154
|
headers: {
|
|
@@ -1168,19 +1168,19 @@ function ln(s, { publicKey: i, baseURL: e = A.baseURL, store: t, fileName: r, ch
|
|
|
1168
1168
|
metadata: g
|
|
1169
1169
|
}),
|
|
1170
1170
|
signal: h
|
|
1171
|
-
}).then(({ data:
|
|
1172
|
-
const y = he(JSON.parse(
|
|
1171
|
+
}).then(({ data: A, headers: w, request: C }) => {
|
|
1172
|
+
const y = he(JSON.parse(A));
|
|
1173
1173
|
if ("error" in y)
|
|
1174
|
-
throw new D(y.error.content, y.error.errorCode,
|
|
1174
|
+
throw new D(y.error.content, y.error.errorCode, C, y, w);
|
|
1175
1175
|
return y;
|
|
1176
1176
|
}), { retryNetworkErrorMaxTimes: p, retryThrottledRequestMaxTimes: m });
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1178
|
+
var N;
|
|
1179
1179
|
(function(s) {
|
|
1180
1180
|
s.Unknown = "unknown", s.Waiting = "waiting", s.Progress = "progress", s.Error = "error", s.Success = "success";
|
|
1181
|
-
})(
|
|
1182
|
-
const
|
|
1183
|
-
function
|
|
1181
|
+
})(N || (N = {}));
|
|
1182
|
+
const ln = (s) => "status" in s && s.status === N.Error;
|
|
1183
|
+
function an(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, integration: r, userAgent: n, retryThrottledRequestMaxTimes: o = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: l = E.retryNetworkErrorMaxTimes } = {}) {
|
|
1184
1184
|
return be(() => ge({
|
|
1185
1185
|
method: "GET",
|
|
1186
1186
|
headers: i ? {
|
|
@@ -1197,12 +1197,12 @@ function cn(s, { publicKey: i, baseURL: e = A.baseURL, signal: t, integration: r
|
|
|
1197
1197
|
signal: t
|
|
1198
1198
|
}).then(({ data: a, headers: c, request: h }) => {
|
|
1199
1199
|
const d = he(JSON.parse(a));
|
|
1200
|
-
if ("error" in d && !
|
|
1200
|
+
if ("error" in d && !ln(d))
|
|
1201
1201
|
throw new D(d.error.content, d.error.errorCode, h, d, c);
|
|
1202
1202
|
return d;
|
|
1203
1203
|
}), { retryNetworkErrorMaxTimes: l, retryThrottledRequestMaxTimes: o });
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function cn(s, { publicKey: i, baseURL: e = E.baseURL, jsonpCallback: t, secureSignature: r, secureExpire: n, signal: o, source: l, integration: a, userAgent: c, retryThrottledRequestMaxTimes: h = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: d = E.retryNetworkErrorMaxTimes }) {
|
|
1206
1206
|
return be(() => ge({
|
|
1207
1207
|
method: "POST",
|
|
1208
1208
|
headers: {
|
|
@@ -1227,7 +1227,7 @@ function hn(s, { publicKey: i, baseURL: e = A.baseURL, jsonpCallback: t, secureS
|
|
|
1227
1227
|
return g;
|
|
1228
1228
|
}), { retryNetworkErrorMaxTimes: d, retryThrottledRequestMaxTimes: h });
|
|
1229
1229
|
}
|
|
1230
|
-
function os(s, { publicKey: i, baseURL: e =
|
|
1230
|
+
function os(s, { publicKey: i, baseURL: e = E.baseURL, signal: t, source: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = E.retryNetworkErrorMaxTimes }) {
|
|
1231
1231
|
return be(() => ge({
|
|
1232
1232
|
method: "GET",
|
|
1233
1233
|
headers: {
|
|
@@ -1247,7 +1247,7 @@ function os(s, { publicKey: i, baseURL: e = A.baseURL, signal: t, source: r, int
|
|
|
1247
1247
|
return f;
|
|
1248
1248
|
}), { retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a });
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function hn(s, { publicKey: i, contentType: e, fileName: t, multipartChunkSize: r = E.multipartChunkSize, baseURL: n = "", secureSignature: o, secureExpire: l, store: a, signal: c, source: h = "local", integration: d, userAgent: f, retryThrottledRequestMaxTimes: m = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: p = E.retryNetworkErrorMaxTimes, metadata: g }) {
|
|
1251
1251
|
return be(() => ge({
|
|
1252
1252
|
method: "POST",
|
|
1253
1253
|
url: le(n, "/multipart/start/", { jsonerrors: 1 }),
|
|
@@ -1267,14 +1267,14 @@ function un(s, { publicKey: i, contentType: e, fileName: t, multipartChunkSize:
|
|
|
1267
1267
|
metadata: g
|
|
1268
1268
|
}),
|
|
1269
1269
|
signal: c
|
|
1270
|
-
}).then(({ data:
|
|
1271
|
-
const y = he(JSON.parse(
|
|
1270
|
+
}).then(({ data: A, headers: w, request: C }) => {
|
|
1271
|
+
const y = he(JSON.parse(A));
|
|
1272
1272
|
if ("error" in y)
|
|
1273
|
-
throw new D(y.error.content, y.error.errorCode,
|
|
1273
|
+
throw new D(y.error.content, y.error.errorCode, C, y, w);
|
|
1274
1274
|
return y.parts = Object.keys(y.parts).map((U) => y.parts[Number(U)]), y;
|
|
1275
1275
|
}), { retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p });
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function un(s, i, { contentType: e, signal: t, onProgress: r, retryThrottledRequestMaxTimes: n = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: o = E.retryNetworkErrorMaxTimes }) {
|
|
1278
1278
|
return be(() => ge({
|
|
1279
1279
|
method: "PUT",
|
|
1280
1280
|
url: i,
|
|
@@ -1293,7 +1293,7 @@ function dn(s, i, { contentType: e, signal: t, onProgress: r, retryThrottledRequ
|
|
|
1293
1293
|
retryNetworkErrorMaxTimes: o
|
|
1294
1294
|
});
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function dn(s, { publicKey: i, baseURL: e = E.baseURL, source: t = "local", signal: r, integration: n, userAgent: o, retryThrottledRequestMaxTimes: l = E.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = E.retryNetworkErrorMaxTimes }) {
|
|
1297
1297
|
return be(() => ge({
|
|
1298
1298
|
method: "POST",
|
|
1299
1299
|
url: le(e, "/multipart/complete/", { jsonerrors: 1 }),
|
|
@@ -1328,11 +1328,11 @@ function jt(s, { publicKey: i, baseURL: e, source: t, integration: r, userAgent:
|
|
|
1328
1328
|
signal: a
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function fn(s) {
|
|
1332
1332
|
return "defaultEffects" in s;
|
|
1333
1333
|
}
|
|
1334
|
-
class
|
|
1335
|
-
constructor(i, { baseCDN: e =
|
|
1334
|
+
class Fe {
|
|
1335
|
+
constructor(i, { baseCDN: e = E.baseCDN, fileName: t } = {}) {
|
|
1336
1336
|
u(this, "uuid");
|
|
1337
1337
|
u(this, "name", null);
|
|
1338
1338
|
u(this, "size", null);
|
|
@@ -1349,10 +1349,10 @@ class Ne {
|
|
|
1349
1349
|
u(this, "s3Bucket", null);
|
|
1350
1350
|
u(this, "defaultEffects", null);
|
|
1351
1351
|
const { uuid: r, s3Bucket: n } = i, o = le(e, `${r}/`), l = n ? le(`https://${n}.s3.amazonaws.com/`, `${r}/${i.filename}`) : null;
|
|
1352
|
-
this.uuid = r, this.name = t || i.filename, this.size = i.size, this.isStored = i.isStored, this.isImage = i.isImage, this.mimeType = i.mimeType, this.cdnUrl = o, this.originalFilename = i.originalFilename, this.imageInfo = i.imageInfo, this.videoInfo = i.videoInfo, this.contentInfo = i.contentInfo, this.metadata = i.metadata || null, this.s3Bucket = n || null, this.s3Url = l,
|
|
1352
|
+
this.uuid = r, this.name = t || i.filename, this.size = i.size, this.isStored = i.isStored, this.isImage = i.isImage, this.mimeType = i.mimeType, this.cdnUrl = o, this.originalFilename = i.originalFilename, this.imageInfo = i.imageInfo, this.videoInfo = i.videoInfo, this.contentInfo = i.contentInfo, this.metadata = i.metadata || null, this.s3Bucket = n || null, this.s3Url = l, fn(i) && (this.defaultEffects = i.defaultEffects);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
const
|
|
1355
|
+
const pn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secureExpire: n, store: o, contentType: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, baseCDN: g, metadata: A }) => nn(s, {
|
|
1356
1356
|
publicKey: i,
|
|
1357
1357
|
fileName: e,
|
|
1358
1358
|
contentType: l,
|
|
@@ -1367,8 +1367,8 @@ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
|
|
|
1367
1367
|
userAgent: f,
|
|
1368
1368
|
retryThrottledRequestMaxTimes: m,
|
|
1369
1369
|
retryNetworkErrorMaxTimes: p,
|
|
1370
|
-
metadata:
|
|
1371
|
-
}).then(({ file:
|
|
1370
|
+
metadata: A
|
|
1371
|
+
}).then(({ file: w }) => jt(w, {
|
|
1372
1372
|
publicKey: i,
|
|
1373
1373
|
baseURL: t,
|
|
1374
1374
|
source: h,
|
|
@@ -1378,7 +1378,7 @@ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
|
|
|
1378
1378
|
retryNetworkErrorMaxTimes: p,
|
|
1379
1379
|
onProgress: c,
|
|
1380
1380
|
signal: a
|
|
1381
|
-
})).then((
|
|
1381
|
+
})).then((w) => new Fe(w, { baseCDN: g })), mn = (s, { publicKey: i, fileName: e, baseURL: t, signal: r, onProgress: n, source: o, integration: l, userAgent: a, retryThrottledRequestMaxTimes: c, retryNetworkErrorMaxTimes: h, baseCDN: d }) => os(s, {
|
|
1382
1382
|
publicKey: i,
|
|
1383
1383
|
baseURL: t,
|
|
1384
1384
|
signal: r,
|
|
@@ -1387,10 +1387,10 @@ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
|
|
|
1387
1387
|
userAgent: a,
|
|
1388
1388
|
retryThrottledRequestMaxTimes: c,
|
|
1389
1389
|
retryNetworkErrorMaxTimes: h
|
|
1390
|
-
}).then((f) => new
|
|
1390
|
+
}).then((f) => new Fe(f, { baseCDN: d, fileName: e })).then((f) => (n && n({
|
|
1391
1391
|
isComputable: !0,
|
|
1392
1392
|
value: 1
|
|
1393
|
-
}), f)),
|
|
1393
|
+
}), f)), gn = (s, { signal: i } = {}) => {
|
|
1394
1394
|
let e = null, t = null;
|
|
1395
1395
|
const r = s.map(() => new AbortController()), n = (o) => () => {
|
|
1396
1396
|
t = o, r.forEach((l, a) => a !== o && l.abort());
|
|
@@ -1406,8 +1406,8 @@ const mn = (s, { publicKey: i, fileName: e, baseURL: t, secureSignature: r, secu
|
|
|
1406
1406
|
return o[t];
|
|
1407
1407
|
});
|
|
1408
1408
|
};
|
|
1409
|
-
var
|
|
1410
|
-
class
|
|
1409
|
+
var bn = window.WebSocket;
|
|
1410
|
+
class _n {
|
|
1411
1411
|
constructor() {
|
|
1412
1412
|
u(this, "events", /* @__PURE__ */ Object.create({}));
|
|
1413
1413
|
}
|
|
@@ -1422,8 +1422,8 @@ class yn {
|
|
|
1422
1422
|
e ? this.events[i] = this.events[i].filter((t) => t !== e) : this.events[i] = [];
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
|
-
const
|
|
1426
|
-
class
|
|
1425
|
+
const yn = (s, i) => s === "success" ? { status: N.Success, ...i } : s === "progress" ? { status: N.Progress, ...i } : { status: N.Error, ...i };
|
|
1426
|
+
class vn {
|
|
1427
1427
|
constructor(i, e = 3e4) {
|
|
1428
1428
|
u(this, "key");
|
|
1429
1429
|
u(this, "disconnectTime");
|
|
@@ -1431,14 +1431,14 @@ class Cn {
|
|
|
1431
1431
|
u(this, "queue", []);
|
|
1432
1432
|
u(this, "isConnected", !1);
|
|
1433
1433
|
u(this, "subscribers", 0);
|
|
1434
|
-
u(this, "emmitter", new
|
|
1434
|
+
u(this, "emmitter", new _n());
|
|
1435
1435
|
u(this, "disconnectTimeoutId", null);
|
|
1436
1436
|
this.key = i, this.disconnectTime = e;
|
|
1437
1437
|
}
|
|
1438
1438
|
connect() {
|
|
1439
1439
|
if (this.disconnectTimeoutId && clearTimeout(this.disconnectTimeoutId), !this.isConnected && !this.ws) {
|
|
1440
1440
|
const i = `wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;
|
|
1441
|
-
this.ws = new
|
|
1441
|
+
this.ws = new bn(i), this.ws.addEventListener("error", (e) => {
|
|
1442
1442
|
this.emmitter.emit("error", new Error(e.message));
|
|
1443
1443
|
}), this.emmitter.on("connected", () => {
|
|
1444
1444
|
this.isConnected = !0, this.queue.forEach((e) => this.send(e.event, e.data)), this.queue = [];
|
|
@@ -1456,7 +1456,7 @@ class Cn {
|
|
|
1456
1456
|
case "progress":
|
|
1457
1457
|
case "success":
|
|
1458
1458
|
case "fail":
|
|
1459
|
-
this.emmitter.emit(t.channel,
|
|
1459
|
+
this.emmitter.emit(t.channel, yn(t.event, JSON.parse(t.data)));
|
|
1460
1460
|
}
|
|
1461
1461
|
});
|
|
1462
1462
|
}
|
|
@@ -1499,15 +1499,15 @@ let Et = null;
|
|
|
1499
1499
|
const Ht = (s) => {
|
|
1500
1500
|
if (!Et) {
|
|
1501
1501
|
const i = typeof window > "u" ? 0 : 3e4;
|
|
1502
|
-
Et = new
|
|
1502
|
+
Et = new vn(s, i);
|
|
1503
1503
|
}
|
|
1504
1504
|
return Et;
|
|
1505
|
-
},
|
|
1505
|
+
}, Cn = (s) => {
|
|
1506
1506
|
Ht(s).connect();
|
|
1507
1507
|
};
|
|
1508
|
-
function
|
|
1508
|
+
function wn({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r, retryThrottledRequestMaxTimes: n, retryNetworkErrorMaxTimes: o, onProgress: l, signal: a }) {
|
|
1509
1509
|
return es({
|
|
1510
|
-
check: (c) =>
|
|
1510
|
+
check: (c) => an(s, {
|
|
1511
1511
|
publicKey: i,
|
|
1512
1512
|
baseURL: e,
|
|
1513
1513
|
integration: t,
|
|
@@ -1517,18 +1517,18 @@ function En({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r,
|
|
|
1517
1517
|
signal: c
|
|
1518
1518
|
}).then((h) => {
|
|
1519
1519
|
switch (h.status) {
|
|
1520
|
-
case
|
|
1520
|
+
case N.Error:
|
|
1521
1521
|
return new D(h.error, h.errorCode);
|
|
1522
|
-
case
|
|
1522
|
+
case N.Waiting:
|
|
1523
1523
|
return !1;
|
|
1524
|
-
case
|
|
1524
|
+
case N.Unknown:
|
|
1525
1525
|
return new D(`Token "${s}" was not found.`);
|
|
1526
|
-
case
|
|
1526
|
+
case N.Progress:
|
|
1527
1527
|
return l && (h.total === "unknown" ? l({ isComputable: !1 }) : l({
|
|
1528
1528
|
isComputable: !0,
|
|
1529
1529
|
value: h.done / h.total
|
|
1530
1530
|
})), !1;
|
|
1531
|
-
case
|
|
1531
|
+
case N.Success:
|
|
1532
1532
|
return l && l({
|
|
1533
1533
|
isComputable: !0,
|
|
1534
1534
|
value: h.done / h.total
|
|
@@ -1540,7 +1540,7 @@ function En({ token: s, publicKey: i, baseURL: e, integration: t, userAgent: r,
|
|
|
1540
1540
|
signal: a
|
|
1541
1541
|
});
|
|
1542
1542
|
}
|
|
1543
|
-
const
|
|
1543
|
+
const En = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise((r, n) => {
|
|
1544
1544
|
const o = Ht(i), l = o.onError(n), a = () => {
|
|
1545
1545
|
l(), o.unsubscribe(s);
|
|
1546
1546
|
};
|
|
@@ -1548,25 +1548,25 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1548
1548
|
a(), n(new Ae("pusher cancelled"));
|
|
1549
1549
|
}), o.subscribe(s, (c) => {
|
|
1550
1550
|
switch (c.status) {
|
|
1551
|
-
case
|
|
1551
|
+
case N.Progress: {
|
|
1552
1552
|
t && (c.total === "unknown" ? t({ isComputable: !1 }) : t({
|
|
1553
1553
|
isComputable: !0,
|
|
1554
1554
|
value: c.done / c.total
|
|
1555
1555
|
}));
|
|
1556
1556
|
break;
|
|
1557
1557
|
}
|
|
1558
|
-
case
|
|
1558
|
+
case N.Success: {
|
|
1559
1559
|
a(), t && t({
|
|
1560
1560
|
isComputable: !0,
|
|
1561
1561
|
value: c.done / c.total
|
|
1562
1562
|
}), r(c);
|
|
1563
1563
|
break;
|
|
1564
1564
|
}
|
|
1565
|
-
case
|
|
1565
|
+
case N.Error:
|
|
1566
1566
|
a(), n(new D(c.msg, c.error_code));
|
|
1567
1567
|
}
|
|
1568
1568
|
});
|
|
1569
|
-
}),
|
|
1569
|
+
}), An = (s, { publicKey: i, fileName: e, baseURL: t, baseCDN: r, checkForUrlDuplicates: n, saveUrlForRecurrentUploads: o, secureSignature: l, secureExpire: a, store: c, signal: h, onProgress: d, source: f, integration: m, userAgent: p, retryThrottledRequestMaxTimes: g, pusherKey: A = E.pusherKey, metadata: w }) => Promise.resolve(Cn(A)).then(() => on(s, {
|
|
1570
1570
|
publicKey: i,
|
|
1571
1571
|
fileName: e,
|
|
1572
1572
|
baseURL: t,
|
|
@@ -1580,13 +1580,13 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1580
1580
|
integration: m,
|
|
1581
1581
|
userAgent: p,
|
|
1582
1582
|
retryThrottledRequestMaxTimes: g,
|
|
1583
|
-
metadata:
|
|
1584
|
-
})).catch((
|
|
1585
|
-
const y = Ht(
|
|
1586
|
-
return y == null || y.disconnect(), Promise.reject(
|
|
1587
|
-
}).then((
|
|
1588
|
-
({ signal: y }) =>
|
|
1589
|
-
token:
|
|
1583
|
+
metadata: w
|
|
1584
|
+
})).catch((C) => {
|
|
1585
|
+
const y = Ht(A);
|
|
1586
|
+
return y == null || y.disconnect(), Promise.reject(C);
|
|
1587
|
+
}).then((C) => C.type === Pt.FileInfo ? C : gn([
|
|
1588
|
+
({ signal: y }) => wn({
|
|
1589
|
+
token: C.token,
|
|
1590
1590
|
publicKey: i,
|
|
1591
1591
|
baseURL: t,
|
|
1592
1592
|
integration: m,
|
|
@@ -1595,17 +1595,17 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1595
1595
|
onProgress: d,
|
|
1596
1596
|
signal: y
|
|
1597
1597
|
}),
|
|
1598
|
-
({ signal: y }) =>
|
|
1599
|
-
token:
|
|
1600
|
-
pusherKey:
|
|
1598
|
+
({ signal: y }) => En({
|
|
1599
|
+
token: C.token,
|
|
1600
|
+
pusherKey: A,
|
|
1601
1601
|
signal: y,
|
|
1602
1602
|
onProgress: d
|
|
1603
1603
|
})
|
|
1604
|
-
], { signal: h })).then((
|
|
1605
|
-
if (
|
|
1606
|
-
throw
|
|
1607
|
-
return
|
|
1608
|
-
}).then((
|
|
1604
|
+
], { signal: h })).then((C) => {
|
|
1605
|
+
if (C instanceof D)
|
|
1606
|
+
throw C;
|
|
1607
|
+
return C;
|
|
1608
|
+
}).then((C) => jt(C.uuid, {
|
|
1609
1609
|
publicKey: i,
|
|
1610
1610
|
baseURL: t,
|
|
1611
1611
|
integration: m,
|
|
@@ -1613,7 +1613,7 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1613
1613
|
retryThrottledRequestMaxTimes: g,
|
|
1614
1614
|
onProgress: d,
|
|
1615
1615
|
signal: h
|
|
1616
|
-
})).then((
|
|
1616
|
+
})).then((C) => new Fe(C, { baseCDN: r })), At = /* @__PURE__ */ new WeakMap(), Tn = async (s) => {
|
|
1617
1617
|
if (At.has(s))
|
|
1618
1618
|
return At.get(s);
|
|
1619
1619
|
const i = await fetch(s.uri).then((e) => e.blob());
|
|
@@ -1622,15 +1622,15 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1622
1622
|
if (pt(s) || ft(s))
|
|
1623
1623
|
return s.size;
|
|
1624
1624
|
if (mt(s))
|
|
1625
|
-
return (await
|
|
1625
|
+
return (await Tn(s)).size;
|
|
1626
1626
|
throw new Error("Unknown file type. Cannot determine file size.");
|
|
1627
|
-
},
|
|
1627
|
+
}, $n = (s, i = E.multipartMinFileSize) => s >= i, as = (s) => {
|
|
1628
1628
|
const i = "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", e = new RegExp(i);
|
|
1629
1629
|
return !Me(s) && e.test(s);
|
|
1630
1630
|
}, Wt = (s) => {
|
|
1631
1631
|
const i = "^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$", e = new RegExp(i);
|
|
1632
1632
|
return !Me(s) && e.test(s);
|
|
1633
|
-
},
|
|
1633
|
+
}, Sn = (s, i) => new Promise((e, t) => {
|
|
1634
1634
|
const r = [];
|
|
1635
1635
|
let n = !1, o = i.length;
|
|
1636
1636
|
const l = [...i], a = () => {
|
|
@@ -1643,10 +1643,10 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1643
1643
|
};
|
|
1644
1644
|
for (let c = 0; c < s; c++)
|
|
1645
1645
|
a();
|
|
1646
|
-
}),
|
|
1646
|
+
}), xn = (s, i, e, t) => {
|
|
1647
1647
|
const r = t * i, n = Math.min(r + t, e);
|
|
1648
1648
|
return s.slice(r, n);
|
|
1649
|
-
},
|
|
1649
|
+
}, In = async (s, i, e) => (t) => xn(s, t, i, e), kn = (s, i, { publicKey: e, contentType: t, onProgress: r, signal: n, integration: o, retryThrottledRequestMaxTimes: l, retryNetworkErrorMaxTimes: a }) => un(s, i, {
|
|
1650
1650
|
publicKey: e,
|
|
1651
1651
|
contentType: t,
|
|
1652
1652
|
onProgress: r,
|
|
@@ -1654,7 +1654,7 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1654
1654
|
integration: o,
|
|
1655
1655
|
retryThrottledRequestMaxTimes: l,
|
|
1656
1656
|
retryNetworkErrorMaxTimes: a
|
|
1657
|
-
}),
|
|
1657
|
+
}), On = async (s, { publicKey: i, fileName: e, fileSize: t, baseURL: r, secureSignature: n, secureExpire: o, store: l, signal: a, onProgress: c, source: h, integration: d, userAgent: f, retryThrottledRequestMaxTimes: m, retryNetworkErrorMaxTimes: p, contentType: g, multipartChunkSize: A = E.multipartChunkSize, maxConcurrentRequests: w = E.maxConcurrentRequests, baseCDN: C, metadata: y }) => {
|
|
1658
1658
|
const U = t ?? await ls(s);
|
|
1659
1659
|
let ie;
|
|
1660
1660
|
const ye = (O, R) => {
|
|
@@ -1669,7 +1669,7 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1669
1669
|
}));
|
|
1670
1670
|
};
|
|
1671
1671
|
};
|
|
1672
|
-
return g || (g = rs(s)),
|
|
1672
|
+
return g || (g = rs(s)), hn(U, {
|
|
1673
1673
|
publicKey: i,
|
|
1674
1674
|
contentType: g,
|
|
1675
1675
|
fileName: e || ns(s),
|
|
@@ -1685,10 +1685,10 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1685
1685
|
retryNetworkErrorMaxTimes: p,
|
|
1686
1686
|
metadata: y
|
|
1687
1687
|
}).then(async ({ uuid: O, parts: R }) => {
|
|
1688
|
-
const W = await
|
|
1688
|
+
const W = await In(s, U, A);
|
|
1689
1689
|
return Promise.all([
|
|
1690
1690
|
O,
|
|
1691
|
-
|
|
1691
|
+
Sn(w, R.map((K, se) => () => kn(W(se), K, {
|
|
1692
1692
|
publicKey: i,
|
|
1693
1693
|
contentType: g,
|
|
1694
1694
|
onProgress: ye(R.length, se),
|
|
@@ -1698,7 +1698,7 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1698
1698
|
retryNetworkErrorMaxTimes: p
|
|
1699
1699
|
})))
|
|
1700
1700
|
]);
|
|
1701
|
-
}).then(([O]) =>
|
|
1701
|
+
}).then(([O]) => dn(O, {
|
|
1702
1702
|
publicKey: i,
|
|
1703
1703
|
baseURL: r,
|
|
1704
1704
|
source: h,
|
|
@@ -1716,15 +1716,15 @@ const An = ({ token: s, pusherKey: i, signal: e, onProgress: t }) => new Promise
|
|
|
1716
1716
|
retryNetworkErrorMaxTimes: p,
|
|
1717
1717
|
onProgress: c,
|
|
1718
1718
|
signal: a
|
|
1719
|
-
})).then((O) => new
|
|
1719
|
+
})).then((O) => new Fe(O, { baseCDN: C }));
|
|
1720
1720
|
};
|
|
1721
|
-
async function cs(s, { publicKey: i, fileName: e, baseURL: t =
|
|
1721
|
+
async function cs(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartMinFileSize: g, multipartChunkSize: A, maxConcurrentRequests: w, baseCDN: C = E.baseCDN, checkForUrlDuplicates: y, saveUrlForRecurrentUploads: U, pusherKey: ie, metadata: ye }) {
|
|
1722
1722
|
if (Me(s)) {
|
|
1723
1723
|
const O = await ls(s);
|
|
1724
|
-
return
|
|
1724
|
+
return $n(O, g) ? On(s, {
|
|
1725
1725
|
publicKey: i,
|
|
1726
1726
|
contentType: p,
|
|
1727
|
-
multipartChunkSize:
|
|
1727
|
+
multipartChunkSize: A,
|
|
1728
1728
|
fileSize: O,
|
|
1729
1729
|
fileName: e,
|
|
1730
1730
|
baseURL: t,
|
|
@@ -1736,12 +1736,12 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secure
|
|
|
1736
1736
|
source: c,
|
|
1737
1737
|
integration: h,
|
|
1738
1738
|
userAgent: d,
|
|
1739
|
-
maxConcurrentRequests:
|
|
1739
|
+
maxConcurrentRequests: w,
|
|
1740
1740
|
retryThrottledRequestMaxTimes: f,
|
|
1741
1741
|
retryNetworkErrorMaxTimes: m,
|
|
1742
|
-
baseCDN:
|
|
1742
|
+
baseCDN: C,
|
|
1743
1743
|
metadata: ye
|
|
1744
|
-
}) :
|
|
1744
|
+
}) : pn(s, {
|
|
1745
1745
|
publicKey: i,
|
|
1746
1746
|
fileName: e,
|
|
1747
1747
|
contentType: p,
|
|
@@ -1756,16 +1756,16 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secure
|
|
|
1756
1756
|
userAgent: d,
|
|
1757
1757
|
retryThrottledRequestMaxTimes: f,
|
|
1758
1758
|
retryNetworkErrorMaxTimes: m,
|
|
1759
|
-
baseCDN:
|
|
1759
|
+
baseCDN: C,
|
|
1760
1760
|
metadata: ye
|
|
1761
1761
|
});
|
|
1762
1762
|
}
|
|
1763
1763
|
if (Wt(s))
|
|
1764
|
-
return
|
|
1764
|
+
return An(s, {
|
|
1765
1765
|
publicKey: i,
|
|
1766
1766
|
fileName: e,
|
|
1767
1767
|
baseURL: t,
|
|
1768
|
-
baseCDN:
|
|
1768
|
+
baseCDN: C,
|
|
1769
1769
|
checkForUrlDuplicates: y,
|
|
1770
1770
|
saveUrlForRecurrentUploads: U,
|
|
1771
1771
|
secureSignature: r,
|
|
@@ -1782,7 +1782,7 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secure
|
|
|
1782
1782
|
metadata: ye
|
|
1783
1783
|
});
|
|
1784
1784
|
if (as(s))
|
|
1785
|
-
return
|
|
1785
|
+
return mn(s, {
|
|
1786
1786
|
publicKey: i,
|
|
1787
1787
|
fileName: e,
|
|
1788
1788
|
baseURL: t,
|
|
@@ -1793,12 +1793,12 @@ async function cs(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secure
|
|
|
1793
1793
|
userAgent: d,
|
|
1794
1794
|
retryThrottledRequestMaxTimes: f,
|
|
1795
1795
|
retryNetworkErrorMaxTimes: m,
|
|
1796
|
-
baseCDN:
|
|
1796
|
+
baseCDN: C
|
|
1797
1797
|
});
|
|
1798
1798
|
throw new TypeError(`File uploading from "${s}" is not supported`);
|
|
1799
1799
|
}
|
|
1800
1800
|
class Pn {
|
|
1801
|
-
constructor(i, { baseCDN: e =
|
|
1801
|
+
constructor(i, { baseCDN: e = E.baseCDN } = {}) {
|
|
1802
1802
|
u(this, "uuid");
|
|
1803
1803
|
u(this, "filesCount");
|
|
1804
1804
|
u(this, "totalSize");
|
|
@@ -1810,34 +1810,34 @@ class Pn {
|
|
|
1810
1810
|
u(this, "storedAt", null);
|
|
1811
1811
|
this.uuid = i.id, this.filesCount = i.filesCount;
|
|
1812
1812
|
const t = i.files.filter(Boolean);
|
|
1813
|
-
this.totalSize = Object.values(t).reduce((r, n) => r + n.size, 0), this.isStored = !!i.datetimeStored, this.isImage = !!Object.values(t).filter((r) => r.isImage).length, this.cdnUrl = i.cdnUrl, this.files = t.map((r) => new
|
|
1813
|
+
this.totalSize = Object.values(t).reduce((r, n) => r + n.size, 0), this.isStored = !!i.datetimeStored, this.isImage = !!Object.values(t).filter((r) => r.isImage).length, this.cdnUrl = i.cdnUrl, this.files = t.map((r) => new Fe(r, { baseCDN: e })), this.createdAt = i.datetimeCreated, this.storedAt = i.datetimeStored;
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
|
-
const
|
|
1816
|
+
const Ln = (s) => {
|
|
1817
1817
|
for (const i of s)
|
|
1818
1818
|
if (!Me(i))
|
|
1819
1819
|
return !1;
|
|
1820
1820
|
return !0;
|
|
1821
|
-
},
|
|
1821
|
+
}, Un = (s) => {
|
|
1822
1822
|
for (const i of s)
|
|
1823
1823
|
if (!as(i))
|
|
1824
1824
|
return !1;
|
|
1825
1825
|
return !0;
|
|
1826
|
-
},
|
|
1826
|
+
}, Rn = (s) => {
|
|
1827
1827
|
for (const i of s)
|
|
1828
1828
|
if (!Wt(i))
|
|
1829
1829
|
return !1;
|
|
1830
1830
|
return !0;
|
|
1831
1831
|
};
|
|
1832
|
-
function
|
|
1833
|
-
if (!
|
|
1832
|
+
function Mn(s, { publicKey: i, fileName: e, baseURL: t = E.baseURL, secureSignature: r, secureExpire: n, store: o, signal: l, onProgress: a, source: c, integration: h, userAgent: d, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: p, multipartChunkSize: g = E.multipartChunkSize, baseCDN: A = E.baseCDN, checkForUrlDuplicates: w, saveUrlForRecurrentUploads: C, jsonpCallback: y }) {
|
|
1833
|
+
if (!Ln(s) && !Rn(s) && !Un(s))
|
|
1834
1834
|
throw new TypeError(`Group uploading from "${s}" is not supported`);
|
|
1835
1835
|
let U, ie = !0;
|
|
1836
1836
|
const ye = s.length, O = (R, W) => {
|
|
1837
1837
|
if (!a)
|
|
1838
1838
|
return;
|
|
1839
1839
|
U || (U = Array(R).fill(0));
|
|
1840
|
-
const K = (se) => se.reduce((wt,
|
|
1840
|
+
const K = (se) => se.reduce((wt, ar) => wt + ar) / R;
|
|
1841
1841
|
return (se) => {
|
|
1842
1842
|
if (!se.isComputable || !ie) {
|
|
1843
1843
|
ie = !1, a({ isComputable: !1 });
|
|
@@ -1862,10 +1862,10 @@ function Nn(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secureSignat
|
|
|
1862
1862
|
retryNetworkErrorMaxTimes: m,
|
|
1863
1863
|
contentType: p,
|
|
1864
1864
|
multipartChunkSize: g,
|
|
1865
|
-
baseCDN:
|
|
1866
|
-
checkForUrlDuplicates:
|
|
1867
|
-
saveUrlForRecurrentUploads:
|
|
1868
|
-
}).then((K) => K.uuid) : R)).then((R) =>
|
|
1865
|
+
baseCDN: A,
|
|
1866
|
+
checkForUrlDuplicates: w,
|
|
1867
|
+
saveUrlForRecurrentUploads: C
|
|
1868
|
+
}).then((K) => K.uuid) : R)).then((R) => cn(R, {
|
|
1869
1869
|
publicKey: i,
|
|
1870
1870
|
baseURL: t,
|
|
1871
1871
|
jsonpCallback: y,
|
|
@@ -1877,7 +1877,7 @@ function Nn(s, { publicKey: i, fileName: e, baseURL: t = A.baseURL, secureSignat
|
|
|
1877
1877
|
userAgent: d,
|
|
1878
1878
|
retryThrottledRequestMaxTimes: f,
|
|
1879
1879
|
retryNetworkErrorMaxTimes: m
|
|
1880
|
-
}).then((W) => new Pn(W, { baseCDN:
|
|
1880
|
+
}).then((W) => new Pn(W, { baseCDN: A })).then((W) => (a && a({ isComputable: !0, value: 1 }), W)));
|
|
1881
1881
|
}
|
|
1882
1882
|
class Fn {
|
|
1883
1883
|
constructor(i) {
|
|
@@ -1954,7 +1954,7 @@ const hs = () => ({
|
|
|
1954
1954
|
/** @type {Set<string>} */
|
|
1955
1955
|
"*uploadTrigger": /* @__PURE__ */ new Set()
|
|
1956
1956
|
});
|
|
1957
|
-
function
|
|
1957
|
+
function Nn(s, i) {
|
|
1958
1958
|
[...s.querySelectorAll("[l10n]")].forEach((e) => {
|
|
1959
1959
|
let t = e.getAttribute("l10n"), r = "textContent";
|
|
1960
1960
|
if (t.includes(":")) {
|
|
@@ -1985,7 +1985,7 @@ class k extends ht {
|
|
|
1985
1985
|
for (let t of e)
|
|
1986
1986
|
t.isConnected && t.updateCssData();
|
|
1987
1987
|
});
|
|
1988
|
-
this.addTemplateProcessor(
|
|
1988
|
+
this.addTemplateProcessor(Nn), this.__l10nKeys = [];
|
|
1989
1989
|
}
|
|
1990
1990
|
/**
|
|
1991
1991
|
* @param {String} str
|
|
@@ -1995,7 +1995,7 @@ class k extends ht {
|
|
|
1995
1995
|
l10n(e, t = {}) {
|
|
1996
1996
|
if (!e)
|
|
1997
1997
|
return "";
|
|
1998
|
-
let r = this.getCssData("--l10n-" + e, !0) || e, n =
|
|
1998
|
+
let r = this.getCssData("--l10n-" + e, !0) || e, n = Mr(r);
|
|
1999
1999
|
for (let l of n)
|
|
2000
2000
|
t[l.variable] = this.pluralize(
|
|
2001
2001
|
l.pluralKey,
|
|
@@ -2081,7 +2081,7 @@ class k extends ht {
|
|
|
2081
2081
|
super.disconnectedCallback(), nt.unregisterClient(this);
|
|
2082
2082
|
}
|
|
2083
2083
|
initCallback() {
|
|
2084
|
-
this.$["*blocksRegistry"].add(this), this.$["*eventEmitter"] || (this.$["*eventEmitter"] = new
|
|
2084
|
+
this.$["*blocksRegistry"].add(this), this.$["*eventEmitter"] || (this.$["*eventEmitter"] = new Ur(this.debugPrint.bind(this)));
|
|
2085
2085
|
}
|
|
2086
2086
|
destroyCallback() {
|
|
2087
2087
|
let e = this.$["*blocksRegistry"];
|
|
@@ -2304,7 +2304,7 @@ b.activities = Object.freeze({
|
|
|
2304
2304
|
EXTERNAL: "external",
|
|
2305
2305
|
DETAILS: "details"
|
|
2306
2306
|
});
|
|
2307
|
-
const
|
|
2307
|
+
const Dn = 20, Lt = 24, He = 34, fs = 3, Z = fs / 2, ve = 1, Je = 100 / 3, v = 1, Ai = 24, zn = 6;
|
|
2308
2308
|
function Ie(s, i) {
|
|
2309
2309
|
for (let e in i)
|
|
2310
2310
|
s.setAttributeNS(null, e, i[e].toString());
|
|
@@ -2313,12 +2313,12 @@ function q(s, i = {}) {
|
|
|
2313
2313
|
let e = document.createElementNS("http://www.w3.org/2000/svg", s);
|
|
2314
2314
|
return Ie(e, i), e;
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2316
|
+
function Vn(s, i, e) {
|
|
2317
2317
|
let { x: t, y: r, width: n, height: o } = s, l = i.includes("w") ? 0 : 1, a = i.includes("n") ? 0 : 1, c = [-1, 1][l], h = [-1, 1][a], d = [
|
|
2318
2318
|
t + l * n + Z * c,
|
|
2319
|
-
r + a * o + Z * h -
|
|
2319
|
+
r + a * o + Z * h - Lt * e * h
|
|
2320
2320
|
], f = [t + l * n + Z * c, r + a * o + Z * h], m = [
|
|
2321
|
-
t + l * n -
|
|
2321
|
+
t + l * n - Lt * e * c + Z * c,
|
|
2322
2322
|
r + a * o + Z * h
|
|
2323
2323
|
];
|
|
2324
2324
|
return {
|
|
@@ -2326,7 +2326,7 @@ function Bn(s, i, e) {
|
|
|
2326
2326
|
center: f
|
|
2327
2327
|
};
|
|
2328
2328
|
}
|
|
2329
|
-
function
|
|
2329
|
+
function Bn(s, i, e) {
|
|
2330
2330
|
let { x: t, y: r, width: n, height: o } = s, l = ["n", "s"].includes(i) ? 0.5 : { w: 0, e: 1 }[
|
|
2331
2331
|
/** @type {Extract<import('./types.js').Direction, 'w' | 'e'>} */
|
|
2332
2332
|
i
|
|
@@ -2338,10 +2338,10 @@ function jn(s, i, e) {
|
|
|
2338
2338
|
let m = `M ${d[0]} ${d[1]} L ${f[0]} ${f[1]}`, p = [f[0] - (f[0] - d[0]) / 2, f[1] - (f[1] - d[1]) / 2];
|
|
2339
2339
|
return { d: m, center: p };
|
|
2340
2340
|
}
|
|
2341
|
-
function
|
|
2341
|
+
function jn(s) {
|
|
2342
2342
|
return s === "" ? "move" : ["e", "w"].includes(s) ? "ew-resize" : ["n", "s"].includes(s) ? "ns-resize" : ["nw", "se"].includes(s) ? "nwse-resize" : "nesw-resize";
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2344
|
+
function Hn({ rect: s, delta: [i, e], imageBox: t }) {
|
|
2345
2345
|
return lt(
|
|
2346
2346
|
{
|
|
2347
2347
|
...s,
|
|
@@ -2359,86 +2359,86 @@ function lt(s, i) {
|
|
|
2359
2359
|
y: t
|
|
2360
2360
|
};
|
|
2361
2361
|
}
|
|
2362
|
-
function
|
|
2362
|
+
function Wn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2363
2363
|
const [, r] = i;
|
|
2364
2364
|
let { y: n, width: o, height: l } = s;
|
|
2365
2365
|
n += r, l -= r, e && (o = l * e);
|
|
2366
2366
|
let a = s.x + s.width / 2 - o / 2;
|
|
2367
2367
|
return n <= t.y && (n = t.y, l = s.y + s.height - n, e && (o = l * e, a = s.x + s.width / 2 - o / 2)), a <= t.x && (a = t.x, n = s.y + s.height - l), a + o >= t.x + t.width && (a = Math.max(t.x, t.x + t.width - o), o = t.x + t.width - a, e && (l = o / e), n = s.y + s.height - l), l < v && (l = v, e && (o = l * e, a = s.x + s.width / 2 - o / 2), n = s.y + s.height - l), o < v && (o = v, e && (l = o / e, a = s.x + s.width / 2 - o / 2), n = s.y + s.height - l), { x: a, y: n, width: o, height: l };
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function qn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2370
2370
|
const [r] = i;
|
|
2371
2371
|
let { x: n, width: o, height: l } = s;
|
|
2372
2372
|
n += r, o -= r, e && (l = o / e);
|
|
2373
2373
|
let a = s.y + s.height / 2 - l / 2;
|
|
2374
2374
|
return n <= t.x && (n = t.x, o = s.x + s.width - n, e && (l = o / e, a = s.y + s.height / 2 - l / 2)), a <= t.y && (a = t.y, n = s.x + s.width - o), a + l >= t.y + t.height && (a = Math.max(t.y, t.y + t.height - l), l = t.y + t.height - a, e && (o = l * e), n = s.x + s.width - o), l < v && (l = v, e && (o = l * e), a = s.y + s.height / 2 - l / 2, n = s.x + s.width - o), o < v && (o = v, e && (l = o / e), a = s.y + s.height / 2 - l / 2, n = s.x + s.width - o), { x: n, y: a, width: o, height: l };
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function Gn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2377
2377
|
const [, r] = i;
|
|
2378
2378
|
let { y: n, width: o, height: l } = s;
|
|
2379
2379
|
l += r, e && (o = l * e);
|
|
2380
2380
|
let a = s.x + s.width / 2 - o / 2;
|
|
2381
2381
|
return n + l >= t.y + t.height && (l = t.y + t.height - n, e && (o = l * e), a = s.x + s.width / 2 - o / 2), a <= t.x && (a = t.x, n = s.y), a + o >= t.x + t.width && (a = Math.max(t.x, t.x + t.width - o), o = t.x + t.width - a, e && (l = o / e), n = s.y), l < v && (l = v, e && (o = l * e), a = s.x + s.width / 2 - o / 2), o < v && (o = v, e && (l = o / e), a = s.x + s.width / 2 - o / 2), { x: a, y: n, width: o, height: l };
|
|
2382
2382
|
}
|
|
2383
|
-
function
|
|
2383
|
+
function Xn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2384
2384
|
const [r] = i;
|
|
2385
2385
|
let { x: n, width: o, height: l } = s;
|
|
2386
2386
|
o += r, e && (l = o / e);
|
|
2387
2387
|
let a = s.y + s.height / 2 - l / 2;
|
|
2388
2388
|
return n + o >= t.x + t.width && (o = t.x + t.width - n, e && (l = o / e), a = s.y + s.height / 2 - l / 2), a <= t.y && (a = t.y, n = s.x), a + l >= t.y + t.height && (a = Math.max(t.y, t.y + t.height - l), l = t.y + t.height - a, e && (o = l * e), n = s.x), l < v && (l = v, e && (o = l * e), a = s.y + s.height / 2 - l / 2), o < v && (o = v, e && (l = o / e), a = s.y + s.height / 2 - l / 2), { x: n, y: a, width: o, height: l };
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function Kn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2391
2391
|
let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
|
|
2392
2392
|
return o + r < t.x && (r = t.x - o), l + n < t.y && (n = t.y - l), o += r, a -= r, l += n, c -= n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l -= n, l <= t.y && (c = c - (t.y - l), a = c * e, o = s.x + s.width - a, l = t.y)) : e && (r = c * e - a, a = a + r, o -= r, o <= t.x && (a = a - (t.x - o), c = a / e, o = t.x, l = s.y + s.height - c)), c < v && (c = v, e && (a = c * e), o = s.x + s.width - a, l = s.y + s.height - c), a < v && (a = v, e && (c = a / e), o = s.x + s.width - a, l = s.y + s.height - c), { x: o, y: l, width: a, height: c };
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2394
|
+
function Yn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2395
2395
|
let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
|
|
2396
2396
|
return o + a + r > t.x + t.width && (r = t.x + t.width - o - a), l + n < t.y && (n = t.y - l), a += r, l += n, c -= n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l -= n, l <= t.y && (c = c - (t.y - l), a = c * e, o = s.x, l = t.y)) : e && (r = c * e - a, a += r, o + a >= t.x + t.width && (a = t.x + t.width - o, c = a / e, o = t.x + t.width - a, l = s.y + s.height - c)), c < v && (c = v, e && (a = c * e), l = s.y + s.height - c), a < v && (a = v, e && (c = a / e), l = s.y + s.height - c), { x: o, y: l, width: a, height: c };
|
|
2397
2397
|
}
|
|
2398
|
-
function
|
|
2398
|
+
function Jn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2399
2399
|
let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
|
|
2400
2400
|
return o + r < t.x && (r = t.x - o), l + c + n > t.y + t.height && (n = t.y + t.height - l - c), o += r, a -= r, c += n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l + c >= t.y + t.height && (c = t.y + t.height - l, a = c * e, o = s.x + s.width - a, l = t.y + t.height - c)) : e && (r = c * e - a, a += r, o -= r, o <= t.x && (a = a - (t.x - o), c = a / e, o = t.x, l = s.y)), c < v && (c = v, e && (a = c * e), o = s.x + s.width - a), a < v && (a = v, e && (c = a / e), o = s.x + s.width - a), { x: o, y: l, width: a, height: c };
|
|
2401
2401
|
}
|
|
2402
|
-
function
|
|
2402
|
+
function Zn({ rect: s, delta: i, aspectRatio: e, imageBox: t }) {
|
|
2403
2403
|
let [r, n] = i, { x: o, y: l, width: a, height: c } = s;
|
|
2404
2404
|
return o + a + r > t.x + t.width && (r = t.x + t.width - o - a), l + c + n > t.y + t.height && (n = t.y + t.height - l - c), a += r, c += n, e && Math.abs(a / c) > e ? (n = a / e - c, c += n, l + c >= t.y + t.height && (c = t.y + t.height - l, a = c * e, o = s.x, l = t.y + t.height - c)) : e && (r = c * e - a, a += r, o + a >= t.x + t.width && (a = t.x + t.width - o, c = a / e, o = t.x + t.width - a, l = s.y)), c < v && (c = v, e && (a = c * e)), a < v && (a = v, e && (c = a / e)), { x: o, y: l, width: a, height: c };
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2406
|
+
function Qn({ direction: s, ...i }) {
|
|
2407
2407
|
switch (s) {
|
|
2408
2408
|
case "n":
|
|
2409
|
-
return
|
|
2409
|
+
return Wn(i);
|
|
2410
2410
|
case "w":
|
|
2411
|
-
return
|
|
2411
|
+
return qn(i);
|
|
2412
2412
|
case "s":
|
|
2413
|
-
return
|
|
2413
|
+
return Gn(i);
|
|
2414
2414
|
case "e":
|
|
2415
|
-
return
|
|
2415
|
+
return Xn(i);
|
|
2416
2416
|
case "nw":
|
|
2417
|
-
return
|
|
2417
|
+
return Kn(i);
|
|
2418
2418
|
case "ne":
|
|
2419
|
-
return
|
|
2419
|
+
return Yn(i);
|
|
2420
2420
|
case "sw":
|
|
2421
|
-
return
|
|
2421
|
+
return Jn(i);
|
|
2422
2422
|
case "se":
|
|
2423
|
-
return
|
|
2423
|
+
return Zn(i);
|
|
2424
2424
|
default:
|
|
2425
2425
|
return i.rect;
|
|
2426
2426
|
}
|
|
2427
2427
|
}
|
|
2428
|
-
function
|
|
2428
|
+
function eo(s, [i, e]) {
|
|
2429
2429
|
return s.x <= i && i <= s.x + s.width && s.y <= e && e <= s.y + s.height;
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2431
|
+
function to(s, i) {
|
|
2432
2432
|
return s.x >= i.x && s.y >= i.y && s.x + s.width <= i.x + i.width && s.y + s.height <= i.y + i.height;
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function io(s, i) {
|
|
2435
2435
|
return Math.abs(s.width / s.height - i) < 0.1;
|
|
2436
2436
|
}
|
|
2437
2437
|
function ze({ width: s, height: i }, e) {
|
|
2438
2438
|
let t = e / 90 % 2 !== 0;
|
|
2439
2439
|
return { width: t ? i : s, height: t ? s : i };
|
|
2440
2440
|
}
|
|
2441
|
-
function
|
|
2441
|
+
function so(s, i, e) {
|
|
2442
2442
|
const t = s / i;
|
|
2443
2443
|
let r, n;
|
|
2444
2444
|
t > e ? (r = Math.round(i * e), n = i) : (r = s, n = Math.round(s / e));
|
|
@@ -2472,8 +2472,8 @@ const ps = (s) => {
|
|
|
2472
2472
|
CAMERA: "camera",
|
|
2473
2473
|
EXTERNAL: "external",
|
|
2474
2474
|
API: "js-api"
|
|
2475
|
-
}),
|
|
2476
|
-
function
|
|
2475
|
+
}), ro = (s) => s ? s.split(",").map((i) => i.trim()) : [], qt = (s) => s ? s.join(",") : "", Gt = "blocks", bt = "0.36.0";
|
|
2476
|
+
function no(s) {
|
|
2477
2477
|
return Qi({
|
|
2478
2478
|
...s,
|
|
2479
2479
|
libraryName: Gt,
|
|
@@ -2500,12 +2500,12 @@ function bs(s) {
|
|
|
2500
2500
|
let i = new URL(s), e = i.pathname + i.search + i.hash, t = e.lastIndexOf("http"), r = e.lastIndexOf("/"), n = "";
|
|
2501
2501
|
return t >= 0 ? n = e.slice(t) : r >= 0 && (n = e.slice(r + 1)), n;
|
|
2502
2502
|
}
|
|
2503
|
-
function
|
|
2503
|
+
function oo(s) {
|
|
2504
2504
|
let i = new URL(s), { pathname: e } = i;
|
|
2505
2505
|
const t = e.indexOf("/"), r = e.indexOf("/", t + 1);
|
|
2506
2506
|
return e.substring(t + 1, r);
|
|
2507
2507
|
}
|
|
2508
|
-
function
|
|
2508
|
+
function lo(s) {
|
|
2509
2509
|
let i = _s(s), e = new URL(i), t = e.pathname.indexOf("/-/");
|
|
2510
2510
|
return t === -1 ? [] : e.pathname.substring(t).split("/-/").filter(Boolean).map((n) => gs(n));
|
|
2511
2511
|
}
|
|
@@ -2549,7 +2549,7 @@ const V = (s, i, e) => {
|
|
|
2549
2549
|
".heics",
|
|
2550
2550
|
".avif",
|
|
2551
2551
|
".avifs"
|
|
2552
|
-
], Ti = (s) => s ? s.filter((i) => typeof i == "string").map((i) => ce(i)).flat() : [], Cs = (s, i) => i.some((e) => e.endsWith("*") ? (e = e.replace("*", ""), s.startsWith(e)) : s === e),
|
|
2552
|
+
], Ti = (s) => s ? s.filter((i) => typeof i == "string").map((i) => ce(i)).flat() : [], Cs = (s, i) => i.some((e) => e.endsWith("*") ? (e = e.replace("*", ""), s.startsWith(e)) : s === e), ao = (s, i) => i.some((e) => e.startsWith(".") ? s.toLowerCase().endsWith(e.toLowerCase()) : !1), Rt = (s) => {
|
|
2553
2553
|
let i = s == null ? void 0 : s.type;
|
|
2554
2554
|
return i ? Cs(i, Ut) : !1;
|
|
2555
2555
|
}, Y = 1e3, Ce = Object.freeze({
|
|
@@ -2560,7 +2560,7 @@ const V = (s, i, e) => {
|
|
|
2560
2560
|
GB: "gb",
|
|
2561
2561
|
TB: "tb",
|
|
2562
2562
|
PB: "pb"
|
|
2563
|
-
}), Ve = (s) => Math.ceil(s * 100) / 100,
|
|
2563
|
+
}), Ve = (s) => Math.ceil(s * 100) / 100, co = (s, i = Ce.AUTO) => {
|
|
2564
2564
|
const e = i === Ce.AUTO;
|
|
2565
2565
|
if (i === Ce.BYTE || e && s < Y ** 1) {
|
|
2566
2566
|
const t = (
|
|
@@ -2573,8 +2573,8 @@ const V = (s, i, e) => {
|
|
|
2573
2573
|
return `${s} ${r}`;
|
|
2574
2574
|
}
|
|
2575
2575
|
return i === Ce.KB || e && s < Y ** 2 ? `${Ve(s / Y ** 1)} KB` : i === Ce.MB || e && s < Y ** 3 ? `${Ve(s / Y ** 2)} MB` : i === Ce.GB || e && s < Y ** 4 ? `${Ve(s / Y ** 3)} GB` : i === Ce.TB || e && s < Y ** 5 ? `${Ve(s / Y ** 4)} TB` : `${Ve(s / Y ** 5)} PB`;
|
|
2576
|
-
}, $i = "[Typed State] Wrong property name: ",
|
|
2577
|
-
class
|
|
2576
|
+
}, $i = "[Typed State] Wrong property name: ", ho = "[Typed State] Wrong property type: ";
|
|
2577
|
+
class uo {
|
|
2578
2578
|
/**
|
|
2579
2579
|
* @param {Object<string, { type: any; value: any; nullable?: Boolean }>} typedSchema
|
|
2580
2580
|
* @param {String} [ctxName]
|
|
@@ -2600,7 +2600,7 @@ class fo {
|
|
|
2600
2600
|
this.__data.pub(i, e);
|
|
2601
2601
|
return;
|
|
2602
2602
|
}
|
|
2603
|
-
console.warn(
|
|
2603
|
+
console.warn(ho + i);
|
|
2604
2604
|
}
|
|
2605
2605
|
/** @param {Object<string, any>} updObj */
|
|
2606
2606
|
setMultipleValues(i) {
|
|
@@ -2626,7 +2626,7 @@ class fo {
|
|
|
2626
2626
|
T.deleteCtx(this.__ctxId);
|
|
2627
2627
|
}
|
|
2628
2628
|
}
|
|
2629
|
-
class
|
|
2629
|
+
class fo {
|
|
2630
2630
|
/**
|
|
2631
2631
|
* @param {Object} options
|
|
2632
2632
|
* @param {Object<string, { type: any; value: any }>} options.typedSchema
|
|
@@ -2669,7 +2669,7 @@ class po {
|
|
|
2669
2669
|
* @returns {string}
|
|
2670
2670
|
*/
|
|
2671
2671
|
add(i) {
|
|
2672
|
-
let e = new
|
|
2672
|
+
let e = new uo(this.__typedSchema);
|
|
2673
2673
|
for (let t in i)
|
|
2674
2674
|
e.setValue(t, i[t]);
|
|
2675
2675
|
return this.__items.add(e.uid), this.notify(), this.__data.add(e.uid, e), this.__added.add(e), this.__watchList.forEach((t) => {
|
|
@@ -2749,7 +2749,7 @@ class po {
|
|
|
2749
2749
|
}), delete this.__subsMap[i];
|
|
2750
2750
|
}
|
|
2751
2751
|
}
|
|
2752
|
-
const
|
|
2752
|
+
const po = (s) => {
|
|
2753
2753
|
const i = /* @__PURE__ */ new Map();
|
|
2754
2754
|
return (
|
|
2755
2755
|
/** @type {T} */
|
|
@@ -2762,7 +2762,7 @@ const mo = (s) => {
|
|
|
2762
2762
|
}
|
|
2763
2763
|
);
|
|
2764
2764
|
};
|
|
2765
|
-
function
|
|
2765
|
+
function mo(s) {
|
|
2766
2766
|
let i = !1;
|
|
2767
2767
|
return setTimeout(() => {
|
|
2768
2768
|
i = !0;
|
|
@@ -2771,7 +2771,7 @@ function go(s) {
|
|
|
2771
2771
|
(...r) => (i && ot(s), t(...r))
|
|
2772
2772
|
);
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function go(s) {
|
|
2775
2775
|
const i = {
|
|
2776
2776
|
/** @returns {number} */
|
|
2777
2777
|
progress: () => s.$["*commonProgress"],
|
|
@@ -2796,14 +2796,14 @@ function bo(s) {
|
|
|
2796
2796
|
/** @type {import('../index.js').OutputCollectionState<TCollectionStatus, TGroupFlag>} */
|
|
2797
2797
|
/** @type {unknown} */
|
|
2798
2798
|
{}
|
|
2799
|
-
), t =
|
|
2799
|
+
), t = mo(
|
|
2800
2800
|
"You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`"
|
|
2801
2801
|
);
|
|
2802
2802
|
for (const [r, n] of Object.entries(i)) {
|
|
2803
2803
|
const o = (
|
|
2804
2804
|
/** @type {keyof typeof getters} */
|
|
2805
2805
|
r
|
|
2806
|
-
), a =
|
|
2806
|
+
), a = po(t(
|
|
2807
2807
|
/** @type {(typeof getters)[name]} */
|
|
2808
2808
|
n
|
|
2809
2809
|
));
|
|
@@ -2814,7 +2814,7 @@ function bo(s) {
|
|
|
2814
2814
|
}
|
|
2815
2815
|
return e;
|
|
2816
2816
|
}
|
|
2817
|
-
const
|
|
2817
|
+
const bo = Object.freeze({
|
|
2818
2818
|
file: {
|
|
2819
2819
|
type: File,
|
|
2820
2820
|
value: null
|
|
@@ -2867,7 +2867,7 @@ const _o = Object.freeze({
|
|
|
2867
2867
|
value: null
|
|
2868
2868
|
},
|
|
2869
2869
|
fileInfo: {
|
|
2870
|
-
type:
|
|
2870
|
+
type: Fe,
|
|
2871
2871
|
value: null
|
|
2872
2872
|
},
|
|
2873
2873
|
isUploading: {
|
|
@@ -2916,11 +2916,11 @@ const _o = Object.freeze({
|
|
|
2916
2916
|
type: Boolean,
|
|
2917
2917
|
value: !1
|
|
2918
2918
|
}
|
|
2919
|
-
}),
|
|
2919
|
+
}), _o = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i, yo = new RegExp(`^/?(${_o.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`, "i"), vo = ({ url: s, cdnBase: i }) => {
|
|
2920
2920
|
const e = new URL(i), t = new URL(s);
|
|
2921
2921
|
if (e.host !== t.host)
|
|
2922
2922
|
return null;
|
|
2923
|
-
const [, r, n, o] =
|
|
2923
|
+
const [, r, n, o] = yo.exec(t.pathname);
|
|
2924
2924
|
return {
|
|
2925
2925
|
uuid: r,
|
|
2926
2926
|
cdnUrlModifiers: n || "",
|
|
@@ -3128,8 +3128,8 @@ class $ extends b {
|
|
|
3128
3128
|
}
|
|
3129
3129
|
initCallback() {
|
|
3130
3130
|
if (super.initCallback(), !this.$["*uploadCollection"]) {
|
|
3131
|
-
let e = new
|
|
3132
|
-
typedSchema:
|
|
3131
|
+
let e = new fo({
|
|
3132
|
+
typedSchema: bo,
|
|
3133
3133
|
watchList: ["uploadProgress", "uploadError", "fileInfo", "errors", "cdnUrl", "isUploading"]
|
|
3134
3134
|
});
|
|
3135
3135
|
this.$["*uploadCollection"] = e;
|
|
@@ -3186,7 +3186,7 @@ class $ extends b {
|
|
|
3186
3186
|
* @returns {import('../types').OutputFileEntry<'idle'>}
|
|
3187
3187
|
*/
|
|
3188
3188
|
addFileFromCdnUrl(e, { silent: t, fileName: r, source: n } = {}) {
|
|
3189
|
-
const o =
|
|
3189
|
+
const o = vo({ url: e, cdnBase: this.cfg.cdnCname });
|
|
3190
3190
|
if (!o)
|
|
3191
3191
|
throw new Error("Invalid CDN URL");
|
|
3192
3192
|
const l = this.uploadCollection.add({
|
|
@@ -3303,7 +3303,7 @@ class $ extends b {
|
|
|
3303
3303
|
const o = e.mimeType, l = e.name;
|
|
3304
3304
|
if (!o || !l)
|
|
3305
3305
|
return;
|
|
3306
|
-
const a = Cs(o, n), c =
|
|
3306
|
+
const a = Cs(o, n), c = ao(l, n);
|
|
3307
3307
|
if (!a && !c)
|
|
3308
3308
|
return Se({
|
|
3309
3309
|
type: "FORBIDDEN_FILE_TYPE",
|
|
@@ -3320,7 +3320,7 @@ class $ extends b {
|
|
|
3320
3320
|
if (t && r && r > t)
|
|
3321
3321
|
return Se({
|
|
3322
3322
|
type: "FILE_SIZE_EXCEEDED",
|
|
3323
|
-
message: this.l10n("files-max-size-limit-error", { maxFileSize:
|
|
3323
|
+
message: this.l10n("files-max-size-limit-error", { maxFileSize: co(t) }),
|
|
3324
3324
|
entry: e
|
|
3325
3325
|
});
|
|
3326
3326
|
}
|
|
@@ -3414,7 +3414,7 @@ class $ extends b {
|
|
|
3414
3414
|
* @param {import('../types').OutputCollectionState} collectionState
|
|
3415
3415
|
*/
|
|
3416
3416
|
async _createGroup(e) {
|
|
3417
|
-
const t = this.getUploadClientOptions(), r = e.allEntries.map((a) => a.uuid + (a.cdnUrlModifiers ? `/${a.cdnUrlModifiers}` : "")), n = new AbortController(), o = await
|
|
3417
|
+
const t = this.getUploadClientOptions(), r = e.allEntries.map((a) => a.uuid + (a.cdnUrlModifiers ? `/${a.cdnUrlModifiers}` : "")), n = new AbortController(), o = await Mn(r, { ...t, signal: n.signal });
|
|
3418
3418
|
if (this.$["*collectionState"] !== e) {
|
|
3419
3419
|
n.abort();
|
|
3420
3420
|
return;
|
|
@@ -3437,7 +3437,7 @@ class $ extends b {
|
|
|
3437
3437
|
}
|
|
3438
3438
|
).map((n) => this.uploadCollection.read(n));
|
|
3439
3439
|
for (const n of r) {
|
|
3440
|
-
const o = n.getValue("fileInfo"), { width: l, height: a } = o.imageInfo, c = t.width / t.height, h =
|
|
3440
|
+
const o = n.getValue("fileInfo"), { width: l, height: a } = o.imageInfo, c = t.width / t.height, h = so(l, a, c), d = ae(
|
|
3441
3441
|
`crop/${h.width}x${h.height}/${h.x},${h.y}`,
|
|
3442
3442
|
"preview"
|
|
3443
3443
|
);
|
|
@@ -3468,7 +3468,7 @@ class $ extends b {
|
|
|
3468
3468
|
publicKey: this.cfg.pubkey,
|
|
3469
3469
|
baseCDN: this.cfg.cdnCname,
|
|
3470
3470
|
baseURL: this.cfg.baseUrl,
|
|
3471
|
-
userAgent:
|
|
3471
|
+
userAgent: no,
|
|
3472
3472
|
integration: this.cfg.userAgentIntegration,
|
|
3473
3473
|
secureSignature: this.cfg.secureSignature,
|
|
3474
3474
|
secureExpire: this.cfg.secureExpire,
|
|
@@ -3529,7 +3529,7 @@ class $ extends b {
|
|
|
3529
3529
|
getOutputCollectionState() {
|
|
3530
3530
|
return (
|
|
3531
3531
|
/** @type {ReturnType<typeof buildOutputCollectionState<TStatus>>} */
|
|
3532
|
-
|
|
3532
|
+
go(this)
|
|
3533
3533
|
);
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
@@ -3585,7 +3585,7 @@ const j = Object.freeze({
|
|
|
3585
3585
|
"crop"
|
|
3586
3586
|
]
|
|
3587
3587
|
);
|
|
3588
|
-
function
|
|
3588
|
+
function Co(s, i) {
|
|
3589
3589
|
if (typeof i == "number") {
|
|
3590
3590
|
const e = i;
|
|
3591
3591
|
return j[s] !== e ? `${s}/${e}` : "";
|
|
@@ -3616,14 +3616,14 @@ function _t(s) {
|
|
|
3616
3616
|
(i) => typeof s[i] < "u" && s[i] !== null
|
|
3617
3617
|
).map((i) => {
|
|
3618
3618
|
let e = s[i];
|
|
3619
|
-
return
|
|
3619
|
+
return Co(i, e);
|
|
3620
3620
|
}).filter((i) => !!i)
|
|
3621
3621
|
);
|
|
3622
3622
|
}
|
|
3623
|
-
const Es = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ? Number(s) : void 0, Si = () => !0,
|
|
3623
|
+
const Es = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ? Number(s) : void 0, Si = () => !0, wo = ([s, i]) => ({
|
|
3624
3624
|
name: s,
|
|
3625
3625
|
amount: typeof i < "u" ? Number(i) : 100
|
|
3626
|
-
}),
|
|
3626
|
+
}), Eo = ([s, i]) => {
|
|
3627
3627
|
if (!/\d+x\d+/.test(s) || !/\d+,\d+/.test(i))
|
|
3628
3628
|
throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");
|
|
3629
3629
|
return (
|
|
@@ -3633,7 +3633,7 @@ const Es = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ?
|
|
|
3633
3633
|
coords: ce(i).map(Number)
|
|
3634
3634
|
}
|
|
3635
3635
|
);
|
|
3636
|
-
},
|
|
3636
|
+
}, Ao = Object.freeze({
|
|
3637
3637
|
enhance: ne,
|
|
3638
3638
|
brightness: ne,
|
|
3639
3639
|
exposure: ne,
|
|
@@ -3642,13 +3642,13 @@ const Es = Xt("format/auto", "progressive/yes"), ne = ([s]) => typeof s < "u" ?
|
|
|
3642
3642
|
saturation: ne,
|
|
3643
3643
|
vibrance: ne,
|
|
3644
3644
|
warmth: ne,
|
|
3645
|
-
filter:
|
|
3645
|
+
filter: wo,
|
|
3646
3646
|
mirror: Si,
|
|
3647
3647
|
flip: Si,
|
|
3648
3648
|
rotate: ne,
|
|
3649
|
-
crop:
|
|
3649
|
+
crop: Eo
|
|
3650
3650
|
});
|
|
3651
|
-
function
|
|
3651
|
+
function To(s) {
|
|
3652
3652
|
const i = {};
|
|
3653
3653
|
for (const e of s) {
|
|
3654
3654
|
const [t, ...r] = e.split("/");
|
|
@@ -3657,7 +3657,7 @@ function $o(s) {
|
|
|
3657
3657
|
const n = (
|
|
3658
3658
|
/** @type {(typeof SUPPORTED_OPERATIONS_ORDERED)[number]} */
|
|
3659
3659
|
t
|
|
3660
|
-
), o =
|
|
3660
|
+
), o = Ao[n];
|
|
3661
3661
|
try {
|
|
3662
3662
|
const l = o(r);
|
|
3663
3663
|
i[n] = l;
|
|
@@ -3677,11 +3677,11 @@ function $o(s) {
|
|
|
3677
3677
|
i
|
|
3678
3678
|
);
|
|
3679
3679
|
}
|
|
3680
|
-
const
|
|
3680
|
+
const L = Object.freeze({
|
|
3681
3681
|
CROP: "crop",
|
|
3682
3682
|
TUNING: "tuning",
|
|
3683
3683
|
FILTERS: "filters"
|
|
3684
|
-
}), ee = [
|
|
3684
|
+
}), ee = [L.CROP, L.TUNING, L.FILTERS], $o = [
|
|
3685
3685
|
"brightness",
|
|
3686
3686
|
"exposure",
|
|
3687
3687
|
"gamma",
|
|
@@ -3690,7 +3690,7 @@ const P = Object.freeze({
|
|
|
3690
3690
|
"vibrance",
|
|
3691
3691
|
"warmth",
|
|
3692
3692
|
"enhance"
|
|
3693
|
-
],
|
|
3693
|
+
], So = [
|
|
3694
3694
|
"adaris",
|
|
3695
3695
|
"briaril",
|
|
3696
3696
|
"calarel",
|
|
@@ -3731,7 +3731,7 @@ const P = Object.freeze({
|
|
|
3731
3731
|
"yllara",
|
|
3732
3732
|
"zatvel",
|
|
3733
3733
|
"zevcen"
|
|
3734
|
-
],
|
|
3734
|
+
], xo = ["rotate", "mirror", "flip"], Ue = Object.freeze({
|
|
3735
3735
|
brightness: {
|
|
3736
3736
|
zero: j.brightness,
|
|
3737
3737
|
range: [-100, 100],
|
|
@@ -3777,7 +3777,7 @@ const P = Object.freeze({
|
|
|
3777
3777
|
range: [0, 100],
|
|
3778
3778
|
keypointsNumber: 1
|
|
3779
3779
|
}
|
|
3780
|
-
}),
|
|
3780
|
+
}), Io = "https://ucarecdn.com", ko = "https://upload.uploadcare.com", Oo = "https://social.uploadcare.com", Oe = {
|
|
3781
3781
|
pubkey: "",
|
|
3782
3782
|
multiple: !0,
|
|
3783
3783
|
multipleMin: 0,
|
|
@@ -3803,9 +3803,9 @@ const P = Object.freeze({
|
|
|
3803
3803
|
modalBackdropStrokes: !1,
|
|
3804
3804
|
sourceListWrap: !0,
|
|
3805
3805
|
remoteTabSessionKey: "",
|
|
3806
|
-
cdnCname:
|
|
3807
|
-
baseUrl:
|
|
3808
|
-
socialBaseUrl:
|
|
3806
|
+
cdnCname: Io,
|
|
3807
|
+
baseUrl: ko,
|
|
3808
|
+
socialBaseUrl: Oo,
|
|
3809
3809
|
secureSignature: "",
|
|
3810
3810
|
secureExpire: "",
|
|
3811
3811
|
secureDeliveryProxy: "",
|
|
@@ -3821,7 +3821,7 @@ const P = Object.freeze({
|
|
|
3821
3821
|
userAgentIntegration: "",
|
|
3822
3822
|
debug: !1,
|
|
3823
3823
|
metadata: null
|
|
3824
|
-
},
|
|
3824
|
+
}, P = (s) => String(s), J = (s) => {
|
|
3825
3825
|
const i = Number(s);
|
|
3826
3826
|
if (Number.isNaN(i))
|
|
3827
3827
|
throw new Error(`Invalid number: "${s}"`);
|
|
@@ -3836,43 +3836,43 @@ const P = Object.freeze({
|
|
|
3836
3836
|
if (s === "false")
|
|
3837
3837
|
return !1;
|
|
3838
3838
|
throw new Error(`Invalid boolean: "${s}"`);
|
|
3839
|
-
}, Po = (s) => s === "auto" ? s : x(s),
|
|
3840
|
-
const i =
|
|
3839
|
+
}, Po = (s) => s === "auto" ? s : x(s), Lo = (s) => {
|
|
3840
|
+
const i = P(s);
|
|
3841
3841
|
if (i !== "user" && i !== "environment" && i !== "")
|
|
3842
3842
|
throw new Error(`Invalid "cameraCapture" value: "${i}"`);
|
|
3843
3843
|
return i;
|
|
3844
|
-
},
|
|
3845
|
-
pubkey:
|
|
3844
|
+
}, Uo = {
|
|
3845
|
+
pubkey: P,
|
|
3846
3846
|
multiple: x,
|
|
3847
3847
|
multipleMin: J,
|
|
3848
3848
|
multipleMax: J,
|
|
3849
3849
|
confirmUpload: x,
|
|
3850
3850
|
imgOnly: x,
|
|
3851
|
-
accept:
|
|
3852
|
-
externalSourcesPreferredTypes:
|
|
3851
|
+
accept: P,
|
|
3852
|
+
externalSourcesPreferredTypes: P,
|
|
3853
3853
|
store: Po,
|
|
3854
3854
|
cameraMirror: x,
|
|
3855
|
-
cameraCapture:
|
|
3856
|
-
sourceList:
|
|
3855
|
+
cameraCapture: Lo,
|
|
3856
|
+
sourceList: P,
|
|
3857
3857
|
maxLocalFileSizeBytes: J,
|
|
3858
3858
|
thumbSize: J,
|
|
3859
3859
|
showEmptyList: x,
|
|
3860
3860
|
useLocalImageEditor: x,
|
|
3861
3861
|
useCloudImageEditor: x,
|
|
3862
|
-
cloudImageEditorTabs:
|
|
3862
|
+
cloudImageEditorTabs: P,
|
|
3863
3863
|
removeCopyright: x,
|
|
3864
|
-
cropPreset:
|
|
3865
|
-
imageShrink:
|
|
3864
|
+
cropPreset: P,
|
|
3865
|
+
imageShrink: P,
|
|
3866
3866
|
modalScrollLock: x,
|
|
3867
3867
|
modalBackdropStrokes: x,
|
|
3868
3868
|
sourceListWrap: x,
|
|
3869
|
-
remoteTabSessionKey:
|
|
3870
|
-
cdnCname:
|
|
3871
|
-
baseUrl:
|
|
3872
|
-
socialBaseUrl:
|
|
3873
|
-
secureSignature:
|
|
3874
|
-
secureExpire:
|
|
3875
|
-
secureDeliveryProxy:
|
|
3869
|
+
remoteTabSessionKey: P,
|
|
3870
|
+
cdnCname: P,
|
|
3871
|
+
baseUrl: P,
|
|
3872
|
+
socialBaseUrl: P,
|
|
3873
|
+
secureSignature: P,
|
|
3874
|
+
secureExpire: P,
|
|
3875
|
+
secureDeliveryProxy: P,
|
|
3876
3876
|
retryThrottledRequestMaxTimes: J,
|
|
3877
3877
|
multipartMinFileSize: J,
|
|
3878
3878
|
multipartChunkSize: J,
|
|
@@ -3882,28 +3882,28 @@ const P = Object.freeze({
|
|
|
3882
3882
|
checkForUrlDuplicates: x,
|
|
3883
3883
|
saveUrlForRecurrentUploads: x,
|
|
3884
3884
|
groupOutput: x,
|
|
3885
|
-
userAgentIntegration:
|
|
3885
|
+
userAgentIntegration: P,
|
|
3886
3886
|
debug: x
|
|
3887
|
-
},
|
|
3887
|
+
}, Ro = (s, i) => {
|
|
3888
3888
|
if (!(typeof i > "u" || i === null))
|
|
3889
3889
|
try {
|
|
3890
|
-
return
|
|
3890
|
+
return Uo[s](i);
|
|
3891
3891
|
} catch (e) {
|
|
3892
3892
|
return console.error(`Invalid value for config key "${s}".`, e), Oe[s];
|
|
3893
3893
|
}
|
|
3894
3894
|
}, Re = (
|
|
3895
3895
|
/** @type {(keyof import('../../types').ConfigType)[]} */
|
|
3896
3896
|
Object.keys(Oe)
|
|
3897
|
-
),
|
|
3897
|
+
), Mo = ["metadata"], Fo = (s) => Mo.includes(s), at = (
|
|
3898
3898
|
/** @type {(keyof import('../../types').ConfigPlainType)[]} */
|
|
3899
3899
|
Re.filter((s) => !Fo(s))
|
|
3900
|
-
),
|
|
3900
|
+
), No = (
|
|
3901
3901
|
/** @type {Record<keyof import('../../types').ConfigAttributesType, keyof import('../../types').ConfigPlainType>} */
|
|
3902
3902
|
{
|
|
3903
3903
|
...Object.fromEntries(at.map((s) => [we(s), s])),
|
|
3904
3904
|
...Object.fromEntries(at.map((s) => [s.toLowerCase(), s]))
|
|
3905
3905
|
}
|
|
3906
|
-
),
|
|
3906
|
+
), Do = (
|
|
3907
3907
|
/** @type {Record<keyof import('../../types').ConfigAttributesType, string>} */
|
|
3908
3908
|
{
|
|
3909
3909
|
...Object.fromEntries(Re.map((s) => [we(s), z(s)])),
|
|
@@ -3972,14 +3972,14 @@ class Kt extends k {
|
|
|
3972
3972
|
attributeChangedCallback(e, t, r) {
|
|
3973
3973
|
if (t === r)
|
|
3974
3974
|
return;
|
|
3975
|
-
const n =
|
|
3975
|
+
const n = No[e], l = Ro(n, r) ?? Oe[n], a = (
|
|
3976
3976
|
/** @type {typeof this & any} */
|
|
3977
3977
|
this
|
|
3978
3978
|
);
|
|
3979
3979
|
a[n] = l;
|
|
3980
3980
|
}
|
|
3981
3981
|
}
|
|
3982
|
-
Kt.bindAttributes(
|
|
3982
|
+
Kt.bindAttributes(Do);
|
|
3983
3983
|
for (const s of Re) {
|
|
3984
3984
|
const i = "__" + s;
|
|
3985
3985
|
Object.defineProperty(Kt.prototype, s, {
|
|
@@ -4031,7 +4031,7 @@ Yt.bindAttributes({
|
|
|
4031
4031
|
name: "name",
|
|
4032
4032
|
size: "size"
|
|
4033
4033
|
});
|
|
4034
|
-
const
|
|
4034
|
+
const zo = (s) => [...new Set(s)], Vo = (s) => Object.entries(s).filter(([i, e]) => e !== void 0 && e !== "").map(([i, e]) => i === "cdn-operations" || i === "analytics" ? e : `${i}/${e}`), Bo = "https://ucarecdn.com", ct = Object.freeze({
|
|
4035
4035
|
"dev-mode": {},
|
|
4036
4036
|
pubkey: {},
|
|
4037
4037
|
uuid: {},
|
|
@@ -4046,7 +4046,7 @@ const Vo = (s) => [...new Set(s)], Bo = (s) => Object.entries(s).filter(([i, e])
|
|
|
4046
4046
|
// '200, 300, 400'
|
|
4047
4047
|
},
|
|
4048
4048
|
"cdn-cname": {
|
|
4049
|
-
default:
|
|
4049
|
+
default: Bo
|
|
4050
4050
|
},
|
|
4051
4051
|
"proxy-cname": {},
|
|
4052
4052
|
"secure-delivery-proxy": {},
|
|
@@ -4063,14 +4063,14 @@ const Vo = (s) => [...new Set(s)], Bo = (s) => Object.entries(s).filter(([i, e])
|
|
|
4063
4063
|
"is-preview-blur": {
|
|
4064
4064
|
default: 1
|
|
4065
4065
|
}
|
|
4066
|
-
}), We = "--lr-img-", xi = "unresolved", Ze = 2, Qe = 3, Ii = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), ki = 3e3, Oi = 5e3,
|
|
4066
|
+
}), We = "--lr-img-", xi = "unresolved", Ze = 2, Qe = 3, Ii = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), ki = 3e3, Oi = 5e3, Pi = Object.freeze({
|
|
4067
4067
|
PREVIEW: "PREVIEW",
|
|
4068
4068
|
MAIN: "MAIN"
|
|
4069
4069
|
}), Ts = /* @__PURE__ */ Object.create(null);
|
|
4070
4070
|
var Hi;
|
|
4071
4071
|
for (let s in ct)
|
|
4072
4072
|
Ts[We + s] = ((Hi = ct[s]) == null ? void 0 : Hi.default) || "";
|
|
4073
|
-
class
|
|
4073
|
+
class jo extends ht {
|
|
4074
4074
|
constructor() {
|
|
4075
4075
|
super(...arguments);
|
|
4076
4076
|
u(this, "cssInit$", Ts);
|
|
@@ -4133,7 +4133,7 @@ class Ho extends ht {
|
|
|
4133
4133
|
});
|
|
4134
4134
|
}
|
|
4135
4135
|
}
|
|
4136
|
-
class
|
|
4136
|
+
class Ho extends jo {
|
|
4137
4137
|
constructor() {
|
|
4138
4138
|
super(...arguments);
|
|
4139
4139
|
u(this, "_img", new Image());
|
|
@@ -4178,7 +4178,7 @@ class Wo extends Ho {
|
|
|
4178
4178
|
"cdn-operations": this.$$("cdn-operations"),
|
|
4179
4179
|
analytics: this.analyticsParams()
|
|
4180
4180
|
};
|
|
4181
|
-
return ae(...
|
|
4181
|
+
return ae(...Vo(r));
|
|
4182
4182
|
}
|
|
4183
4183
|
/**
|
|
4184
4184
|
* @private
|
|
@@ -4266,10 +4266,10 @@ class Wo extends Ho {
|
|
|
4266
4266
|
}
|
|
4267
4267
|
get currentImg() {
|
|
4268
4268
|
return this.hasPreviewImage ? {
|
|
4269
|
-
type:
|
|
4269
|
+
type: Pi.PREVIEW,
|
|
4270
4270
|
img: this._imgPreview
|
|
4271
4271
|
} : {
|
|
4272
|
-
type:
|
|
4272
|
+
type: Pi.MAIN,
|
|
4273
4273
|
img: this.img
|
|
4274
4274
|
};
|
|
4275
4275
|
}
|
|
@@ -4282,7 +4282,7 @@ class Wo extends Ho {
|
|
|
4282
4282
|
get breakpoints() {
|
|
4283
4283
|
if (this.$$("breakpoints")) {
|
|
4284
4284
|
const e = ce(this.$$("breakpoints"));
|
|
4285
|
-
return
|
|
4285
|
+
return zo(e.map((t) => parseInt(t, 10)));
|
|
4286
4286
|
} else
|
|
4287
4287
|
return null;
|
|
4288
4288
|
}
|
|
@@ -4369,7 +4369,7 @@ class Wo extends Ho {
|
|
|
4369
4369
|
this.bgSelector ? this.renderBackground() : this.renderImage();
|
|
4370
4370
|
}
|
|
4371
4371
|
}
|
|
4372
|
-
class
|
|
4372
|
+
class Wo extends Ho {
|
|
4373
4373
|
initCallback() {
|
|
4374
4374
|
super.initCallback(), this.sub$$("src", () => {
|
|
4375
4375
|
this.init();
|
|
@@ -4433,7 +4433,7 @@ class $s extends b {
|
|
|
4433
4433
|
}
|
|
4434
4434
|
$s.template = /* HTML */
|
|
4435
4435
|
' <div class="content"><slot></slot></div> ';
|
|
4436
|
-
function
|
|
4436
|
+
function qo(s) {
|
|
4437
4437
|
return new Promise((i) => {
|
|
4438
4438
|
typeof window.FileReader != "function" && i(!1);
|
|
4439
4439
|
try {
|
|
@@ -4450,7 +4450,7 @@ function Go(s) {
|
|
|
4450
4450
|
}
|
|
4451
4451
|
});
|
|
4452
4452
|
}
|
|
4453
|
-
function
|
|
4453
|
+
function Go(s, i) {
|
|
4454
4454
|
return new Promise((e) => {
|
|
4455
4455
|
let t = 0;
|
|
4456
4456
|
const r = [], n = (l) => {
|
|
@@ -4478,7 +4478,7 @@ function Xo(s, i) {
|
|
|
4478
4478
|
n(s);
|
|
4479
4479
|
});
|
|
4480
4480
|
}
|
|
4481
|
-
function
|
|
4481
|
+
function Xo(s) {
|
|
4482
4482
|
const i = [], e = [];
|
|
4483
4483
|
for (let t = 0; t < s.items.length; t++) {
|
|
4484
4484
|
let r = s.items[t];
|
|
@@ -4492,7 +4492,7 @@ function Ko(s) {
|
|
|
4492
4492
|
r.getAsEntry()
|
|
4493
4493
|
);
|
|
4494
4494
|
e.push(
|
|
4495
|
-
|
|
4495
|
+
Go(l, n).then((a) => {
|
|
4496
4496
|
a && i.push(...a);
|
|
4497
4497
|
})
|
|
4498
4498
|
);
|
|
@@ -4500,7 +4500,7 @@ function Ko(s) {
|
|
|
4500
4500
|
}
|
|
4501
4501
|
const o = r.getAsFile();
|
|
4502
4502
|
o && e.push(
|
|
4503
|
-
|
|
4503
|
+
qo(o).then((l) => {
|
|
4504
4504
|
l || i.push({
|
|
4505
4505
|
type: "file",
|
|
4506
4506
|
file: o
|
|
@@ -4521,49 +4521,49 @@ function Ko(s) {
|
|
|
4521
4521
|
}
|
|
4522
4522
|
return Promise.all(e).then(() => i);
|
|
4523
4523
|
}
|
|
4524
|
-
const
|
|
4524
|
+
const F = {
|
|
4525
4525
|
ACTIVE: 0,
|
|
4526
4526
|
INACTIVE: 1,
|
|
4527
4527
|
NEAR: 2,
|
|
4528
4528
|
OVER: 3
|
|
4529
4529
|
};
|
|
4530
|
-
let
|
|
4531
|
-
function
|
|
4530
|
+
let Li = ["focus"], Ko = 100, St = /* @__PURE__ */ new Map();
|
|
4531
|
+
function Yo(s, i) {
|
|
4532
4532
|
let e = Math.max(Math.min(s[0], i.x + i.width), i.x), t = Math.max(Math.min(s[1], i.y + i.height), i.y);
|
|
4533
4533
|
return Math.sqrt((s[0] - e) * (s[0] - e) + (s[1] - t) * (s[1] - t));
|
|
4534
4534
|
}
|
|
4535
4535
|
function Ui(s) {
|
|
4536
|
-
let i = 0, e = document.body, t = /* @__PURE__ */ new Set(), r = (p) => t.add(p), n =
|
|
4537
|
-
s.shouldIgnore() && p !==
|
|
4536
|
+
let i = 0, e = document.body, t = /* @__PURE__ */ new Set(), r = (p) => t.add(p), n = F.INACTIVE, o = (p) => {
|
|
4537
|
+
s.shouldIgnore() && p !== F.INACTIVE || (n !== p && t.forEach((g) => g(p)), n = p);
|
|
4538
4538
|
}, l = () => i > 0;
|
|
4539
4539
|
r((p) => s.onChange(p));
|
|
4540
4540
|
let a = () => {
|
|
4541
|
-
i = 0, o(
|
|
4541
|
+
i = 0, o(F.INACTIVE);
|
|
4542
4542
|
}, c = () => {
|
|
4543
|
-
i += 1, n ===
|
|
4543
|
+
i += 1, n === F.INACTIVE && o(F.ACTIVE);
|
|
4544
4544
|
}, h = () => {
|
|
4545
|
-
i -= 1, l() || o(
|
|
4545
|
+
i -= 1, l() || o(F.INACTIVE);
|
|
4546
4546
|
}, d = (p) => {
|
|
4547
|
-
p.preventDefault(), i = 0, o(
|
|
4547
|
+
p.preventDefault(), i = 0, o(F.INACTIVE);
|
|
4548
4548
|
}, f = (p) => {
|
|
4549
4549
|
if (s.shouldIgnore())
|
|
4550
4550
|
return;
|
|
4551
4551
|
l() || (i += 1);
|
|
4552
|
-
let g = [p.x, p.y],
|
|
4553
|
-
St.set(s.element,
|
|
4554
|
-
let U = Math.min(...St.values()) ===
|
|
4555
|
-
y && U ? (p.preventDefault(), o(
|
|
4552
|
+
let g = [p.x, p.y], A = s.element.getBoundingClientRect(), w = Math.floor(Yo(g, A)), C = w < Ko, y = p.composedPath().includes(s.element);
|
|
4553
|
+
St.set(s.element, w);
|
|
4554
|
+
let U = Math.min(...St.values()) === w;
|
|
4555
|
+
y && U ? (p.preventDefault(), o(F.OVER)) : o(C && U ? F.NEAR : F.ACTIVE);
|
|
4556
4556
|
}, m = async (p) => {
|
|
4557
4557
|
if (s.shouldIgnore())
|
|
4558
4558
|
return;
|
|
4559
4559
|
p.preventDefault();
|
|
4560
|
-
let g = await
|
|
4561
|
-
s.onItems(g), o(
|
|
4560
|
+
let g = await Xo(p.dataTransfer);
|
|
4561
|
+
s.onItems(g), o(F.INACTIVE);
|
|
4562
4562
|
};
|
|
4563
|
-
return e.addEventListener("drop", d), e.addEventListener("dragleave", h), e.addEventListener("dragenter", c), e.addEventListener("dragover", f), s.element.addEventListener("drop", m),
|
|
4563
|
+
return e.addEventListener("drop", d), e.addEventListener("dragleave", h), e.addEventListener("dragenter", c), e.addEventListener("dragover", f), s.element.addEventListener("drop", m), Li.forEach((p) => {
|
|
4564
4564
|
window.addEventListener(p, a);
|
|
4565
4565
|
}), () => {
|
|
4566
|
-
St.delete(s.element), e.removeEventListener("drop", d), e.removeEventListener("dragleave", h), e.removeEventListener("dragenter", c), e.removeEventListener("dragover", f), s.element.removeEventListener("drop", m),
|
|
4566
|
+
St.delete(s.element), e.removeEventListener("drop", d), e.removeEventListener("dragleave", h), e.removeEventListener("dragenter", c), e.removeEventListener("dragover", f), s.element.removeEventListener("drop", m), Li.forEach((p) => {
|
|
4567
4567
|
window.removeEventListener(p, a);
|
|
4568
4568
|
});
|
|
4569
4569
|
};
|
|
@@ -4573,7 +4573,7 @@ class Zt extends $ {
|
|
|
4573
4573
|
constructor() {
|
|
4574
4574
|
super(), this.init$ = {
|
|
4575
4575
|
...this.init$,
|
|
4576
|
-
state:
|
|
4576
|
+
state: F.INACTIVE,
|
|
4577
4577
|
withIcon: !1,
|
|
4578
4578
|
isClickable: !1,
|
|
4579
4579
|
isFullscreen: !1,
|
|
@@ -4642,7 +4642,7 @@ class Zt extends $ {
|
|
|
4642
4642
|
/** @param {DropzoneState} state */
|
|
4643
4643
|
onChange: (e) => {
|
|
4644
4644
|
var r;
|
|
4645
|
-
const t = (r = Object.entries(
|
|
4645
|
+
const t = (r = Object.entries(F).find(([, n]) => n === e)) == null ? void 0 : r[0].toLowerCase();
|
|
4646
4646
|
t && i.setAttribute("drag-state", t);
|
|
4647
4647
|
},
|
|
4648
4648
|
onItems: () => {
|
|
@@ -4650,7 +4650,7 @@ class Zt extends $ {
|
|
|
4650
4650
|
shouldIgnore: () => this._shouldIgnore()
|
|
4651
4651
|
})), this.sub("state", (e) => {
|
|
4652
4652
|
var r;
|
|
4653
|
-
const t = (r = Object.entries(
|
|
4653
|
+
const t = (r = Object.entries(F).find(([, n]) => n === e)) == null ? void 0 : r[0].toLowerCase();
|
|
4654
4654
|
t && this.setAttribute("drag-state", t);
|
|
4655
4655
|
}), this.subConfigValue("sourceList", (e) => {
|
|
4656
4656
|
const t = ce(e);
|
|
@@ -4709,7 +4709,7 @@ Zt.bindAttributes({
|
|
|
4709
4709
|
// @ts-expect-error TODO: fix types inside symbiote
|
|
4710
4710
|
disabled: null
|
|
4711
4711
|
});
|
|
4712
|
-
const
|
|
4712
|
+
const Jo = "src-type-";
|
|
4713
4713
|
class Qt extends $ {
|
|
4714
4714
|
constructor() {
|
|
4715
4715
|
super();
|
|
@@ -4789,7 +4789,7 @@ class Qt extends $ {
|
|
|
4789
4789
|
return;
|
|
4790
4790
|
}
|
|
4791
4791
|
const { textKey: r = e, icon: n = e } = t;
|
|
4792
|
-
this.applyL10nKey("src-type", `${
|
|
4792
|
+
this.applyL10nKey("src-type", `${Jo}${r}`), this.$.iconName = n, this.onclick = () => {
|
|
4793
4793
|
this.activate();
|
|
4794
4794
|
};
|
|
4795
4795
|
}
|
|
@@ -4803,7 +4803,7 @@ Qt.bindAttributes({
|
|
|
4803
4803
|
// @ts-expect-error symbiote types bug
|
|
4804
4804
|
type: null
|
|
4805
4805
|
});
|
|
4806
|
-
class
|
|
4806
|
+
class Zo extends k {
|
|
4807
4807
|
initCallback() {
|
|
4808
4808
|
super.initCallback(), this.subConfigValue("sourceList", (i) => {
|
|
4809
4809
|
let e = ce(i), t = "";
|
|
@@ -4862,7 +4862,7 @@ const yt = () => {
|
|
|
4862
4862
|
});
|
|
4863
4863
|
})
|
|
4864
4864
|
};
|
|
4865
|
-
},
|
|
4865
|
+
}, Qo = async (s) => {
|
|
4866
4866
|
const i = [], { promiseReadJpegChunks: e, stack: t } = yt();
|
|
4867
4867
|
return await e(s), t.forEach(({ marker: r, view: n }) => {
|
|
4868
4868
|
r === 226 && // check for "ICC_PROFILE\0"
|
|
@@ -4887,13 +4887,13 @@ const yt = () => {
|
|
|
4887
4887
|
type: s.type
|
|
4888
4888
|
});
|
|
4889
4889
|
}
|
|
4890
|
-
},
|
|
4890
|
+
}, el = 226, Is = (s, i) => xs(s, el, i.map((e) => e.buffer)), tl = async (s) => {
|
|
4891
4891
|
try {
|
|
4892
4892
|
return await Is(s, []);
|
|
4893
4893
|
} catch (i) {
|
|
4894
4894
|
throw new Error(`Failed to strip ICC profile: ${i}`);
|
|
4895
4895
|
}
|
|
4896
|
-
},
|
|
4896
|
+
}, il = (s, i, e) => new Promise((t, r) => {
|
|
4897
4897
|
const n = (o) => {
|
|
4898
4898
|
if (!o) {
|
|
4899
4899
|
r("Failed to convert canvas to blob");
|
|
@@ -4908,7 +4908,7 @@ const yt = () => {
|
|
|
4908
4908
|
canvas: s,
|
|
4909
4909
|
ctx: i
|
|
4910
4910
|
};
|
|
4911
|
-
},
|
|
4911
|
+
}, sl = (s) => {
|
|
4912
4912
|
const { ctx: e, canvas: t } = Ge();
|
|
4913
4913
|
t.width = t.height = 50, e.drawImage(s, 0, 0, 50, 50);
|
|
4914
4914
|
const r = e.getImageData(0, 0, 50, 50).data;
|
|
@@ -4917,7 +4917,7 @@ const yt = () => {
|
|
|
4917
4917
|
if (r[n] < 254)
|
|
4918
4918
|
return !0;
|
|
4919
4919
|
return !1;
|
|
4920
|
-
},
|
|
4920
|
+
}, rl = async (s) => {
|
|
4921
4921
|
let i = null;
|
|
4922
4922
|
const { promiseReadJpegChunks: e, stack: t } = yt();
|
|
4923
4923
|
return await e(s), t.forEach(({ marker: r, view: n }) => {
|
|
@@ -4927,18 +4927,18 @@ const yt = () => {
|
|
|
4927
4927
|
return;
|
|
4928
4928
|
}
|
|
4929
4929
|
}), i;
|
|
4930
|
-
},
|
|
4930
|
+
}, nl = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";
|
|
4931
4931
|
let et;
|
|
4932
|
-
const
|
|
4932
|
+
const ol = () => new Promise((s) => {
|
|
4933
4933
|
if (et !== void 0)
|
|
4934
4934
|
s(et);
|
|
4935
4935
|
else {
|
|
4936
4936
|
const i = new Image();
|
|
4937
4937
|
i.addEventListener("load", () => {
|
|
4938
4938
|
et = i.naturalWidth < i.naturalHeight, i.src = "//:0", s(et);
|
|
4939
|
-
}), i.src =
|
|
4939
|
+
}), i.src = nl;
|
|
4940
4940
|
}
|
|
4941
|
-
}),
|
|
4941
|
+
}), ll = (s, i) => {
|
|
4942
4942
|
let e, t, r, n;
|
|
4943
4943
|
if (!s || s.byteLength < 14 || s.getUint32(0) !== 1165519206 || s.getUint16(4) !== 0)
|
|
4944
4944
|
return;
|
|
@@ -4957,20 +4957,20 @@ const ll = () => new Promise((s) => {
|
|
|
4957
4957
|
return;
|
|
4958
4958
|
s.getUint16(r, t) === 274 && i(r + 8, t), r += 12;
|
|
4959
4959
|
}
|
|
4960
|
-
},
|
|
4961
|
-
|
|
4962
|
-
},
|
|
4960
|
+
}, al = (s, i) => {
|
|
4961
|
+
ll(s, (e, t) => s.setUint16(e, i, t));
|
|
4962
|
+
}, cl = async (s, i, e) => (e && al(i, 1), xs(s, 225, [i.buffer])), hl = (s, i) => new Promise((e, t) => {
|
|
4963
4963
|
i && (s.src = i), s.complete ? e(s) : (s.addEventListener("load", () => {
|
|
4964
4964
|
e(s);
|
|
4965
4965
|
}), s.addEventListener("error", () => {
|
|
4966
4966
|
t(new Error("Failed to load image. Probably not an image."));
|
|
4967
4967
|
}));
|
|
4968
|
-
}),
|
|
4968
|
+
}), ul = (s) => hl(new Image(), s), dl = [
|
|
4969
4969
|
1,
|
|
4970
4970
|
// L (black-white)
|
|
4971
4971
|
3
|
|
4972
4972
|
// RGB
|
|
4973
|
-
],
|
|
4973
|
+
], fl = [
|
|
4974
4974
|
192,
|
|
4975
4975
|
// ("SOF0", "Baseline DCT", SOF)
|
|
4976
4976
|
193,
|
|
@@ -5041,13 +5041,13 @@ const ll = () => new Promise((s) => {
|
|
|
5041
5041
|
// but we will not use them
|
|
5042
5042
|
65535
|
|
5043
5043
|
]
|
|
5044
|
-
},
|
|
5044
|
+
}, pl = async (s) => {
|
|
5045
5045
|
let i = !1;
|
|
5046
5046
|
const { promiseReadJpegChunks: e, stack: t } = yt();
|
|
5047
5047
|
return await e(s).then(() => (t.forEach(({ marker: r, view: n }) => {
|
|
5048
|
-
if (!i &&
|
|
5048
|
+
if (!i && fl.indexOf(r) >= 0) {
|
|
5049
5049
|
const o = n.getUint8(5);
|
|
5050
|
-
|
|
5050
|
+
dl.indexOf(o) < 0 && (i = !0);
|
|
5051
5051
|
}
|
|
5052
5052
|
}), i)).catch(() => i);
|
|
5053
5053
|
}, ks = (s, i) => {
|
|
@@ -5069,12 +5069,12 @@ const ll = () => new Promise((s) => {
|
|
|
5069
5069
|
G: 110,
|
|
5070
5070
|
B: 165,
|
|
5071
5071
|
A: 255
|
|
5072
|
-
},
|
|
5072
|
+
}, ml = `rgba(${de.R}, ${de.G}, ${de.B}, ${de.A / 255})`, Ps = (s, i) => {
|
|
5073
5073
|
try {
|
|
5074
5074
|
const e = [s - 1, i - 1, 1, 1], { canvas: t, ctx: r } = Ge();
|
|
5075
5075
|
t.width = 1, t.height = 1;
|
|
5076
5076
|
const { canvas: n, ctx: o } = Ge();
|
|
5077
|
-
n.width = s, n.height = i, o && (o.fillStyle =
|
|
5077
|
+
n.width = s, n.height = i, o && (o.fillStyle = ml, o.fillRect(...e), r.drawImage(n, s - 1, i - 1, 1, 1, 0, 0, 1, 1));
|
|
5078
5078
|
const l = r && r.getImageData(0, 0, 1, 1).data;
|
|
5079
5079
|
let a = !1;
|
|
5080
5080
|
return l && (a = l[0] === de.R && l[1] === de.G && l[2] === de.B && l[3] === de.A), n.width = n.height = 1, a;
|
|
@@ -5082,7 +5082,7 @@ const ll = () => new Promise((s) => {
|
|
|
5082
5082
|
return console.error(`Failed to test for max canvas size of ${s}x${i}.`), !1;
|
|
5083
5083
|
}
|
|
5084
5084
|
};
|
|
5085
|
-
function
|
|
5085
|
+
function Ls(s) {
|
|
5086
5086
|
return (...i) => new Promise((e) => {
|
|
5087
5087
|
setTimeout(() => {
|
|
5088
5088
|
const t = s(...i);
|
|
@@ -5090,13 +5090,13 @@ function Ps(s) {
|
|
|
5090
5090
|
}, 0);
|
|
5091
5091
|
});
|
|
5092
5092
|
}
|
|
5093
|
-
const
|
|
5093
|
+
const gl = Ls(ks(Ps, Os)), bl = Ls(ks(Ps, Os)), Us = async (s, i) => {
|
|
5094
5094
|
const e = Ri.squareSide.find((o) => o * o >= s * i), t = Ri.dimension.find((o) => o >= s && o >= i);
|
|
5095
5095
|
if (!e || !t)
|
|
5096
5096
|
throw new Error("Not supported");
|
|
5097
5097
|
const [r, n] = await Promise.all([
|
|
5098
|
-
|
|
5099
|
-
|
|
5098
|
+
gl(e, e),
|
|
5099
|
+
bl(t, 1)
|
|
5100
5100
|
]);
|
|
5101
5101
|
if (r && n)
|
|
5102
5102
|
return !0;
|
|
@@ -5108,38 +5108,38 @@ const bl = Ps(ks(Ls, Os)), _l = Ps(ks(Ls, Os)), Us = async (s, i) => {
|
|
|
5108
5108
|
} catch (t) {
|
|
5109
5109
|
throw new Error("Canvas resize error", { cause: t });
|
|
5110
5110
|
}
|
|
5111
|
-
},
|
|
5111
|
+
}, _l = ({ img: s, targetW: i, targetH: e }) => Rs(s, i, e), yl = function({ sourceW: s, targetW: i, targetH: e, step: t }) {
|
|
5112
5112
|
const r = [];
|
|
5113
5113
|
let n = i, o = e;
|
|
5114
5114
|
do
|
|
5115
5115
|
r.push([n, o]), n = Math.round(n / t), o = Math.round(o / t);
|
|
5116
5116
|
while (n < s * t);
|
|
5117
5117
|
return r.reverse();
|
|
5118
|
-
},
|
|
5118
|
+
}, vl = ({ img: s, sourceW: i, targetW: e, targetH: t, step: r }) => yl({ sourceW: i, targetW: e, targetH: t, step: r }).reduce((o, [l, a]) => o.then((c) => Us(l, a).then(() => Rs(c, l, a)).catch(() => c)), Promise.resolve(s)), Cl = () => /iPad|iPhone|iPod/.test(navigator.platform) ? !0 : navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), wl = navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), xt = 0.71, El = (s, i) => {
|
|
5119
5119
|
if (s.width * xt * s.height * xt < i.size)
|
|
5120
5120
|
throw new Error("Not required");
|
|
5121
5121
|
const e = s.width, t = s.height, r = e / t, n = Math.floor(Math.sqrt(i.size * r)), o = Math.floor(i.size / Math.sqrt(i.size * r));
|
|
5122
5122
|
return Us(n, o).then(() => {
|
|
5123
5123
|
const { ctx: l } = Ge();
|
|
5124
|
-
return "imageSmoothingQuality" in l && !
|
|
5124
|
+
return "imageSmoothingQuality" in l && !Cl() && !wl ? _l({ img: s, targetW: n, targetH: o }) : vl({ img: s, sourceW: e, targetW: n, targetH: o, step: xt });
|
|
5125
5125
|
}).catch(() => Promise.reject("Not supported"));
|
|
5126
|
-
},
|
|
5126
|
+
}, Al = async (s, i) => {
|
|
5127
5127
|
try {
|
|
5128
|
-
if (await
|
|
5128
|
+
if (await pl(s))
|
|
5129
5129
|
throw new Error("Should skipped");
|
|
5130
5130
|
const t = await Promise.allSettled([
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
]), n = !t.some((g) => g.status === "rejected"), [o, l, a] = t, c = await
|
|
5131
|
+
rl(s),
|
|
5132
|
+
ol(),
|
|
5133
|
+
Qo(s)
|
|
5134
|
+
]), n = !t.some((g) => g.status === "rejected"), [o, l, a] = t, c = await tl(s).catch(() => s), h = await ul(URL.createObjectURL(c));
|
|
5135
5135
|
URL.revokeObjectURL(h.src);
|
|
5136
|
-
const d = await
|
|
5136
|
+
const d = await El(h, i);
|
|
5137
5137
|
let f = "image/jpeg", m = (i == null ? void 0 : i.quality) || 0.8;
|
|
5138
|
-
!n &&
|
|
5139
|
-
let p = await
|
|
5138
|
+
!n && sl(d) && (f = "image/png", m = void 0);
|
|
5139
|
+
let p = await il(d, f, m);
|
|
5140
5140
|
if (n && o.status === "fulfilled" && o.value) {
|
|
5141
|
-
const g = o.value,
|
|
5142
|
-
p = await
|
|
5141
|
+
const g = o.value, A = l.status === "fulfilled" ? l.value : !1;
|
|
5142
|
+
p = await cl(p, g, A);
|
|
5143
5143
|
}
|
|
5144
5144
|
return n && a.status === "fulfilled" && a.value.length > 0 && (p = await Is(p, a.value)), p;
|
|
5145
5145
|
} catch (e) {
|
|
@@ -5153,7 +5153,7 @@ function Ms(s) {
|
|
|
5153
5153
|
});
|
|
5154
5154
|
return URL.createObjectURL(i);
|
|
5155
5155
|
}
|
|
5156
|
-
function
|
|
5156
|
+
function Tl(s = "#fff", i = "rgba(0, 0, 0, .1)") {
|
|
5157
5157
|
return Ms(
|
|
5158
5158
|
/*svg*/
|
|
5159
5159
|
`<svg height="20" width="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -5173,7 +5173,7 @@ function Mt(s = "hsl(209, 21%, 65%)", i = 32, e = 32) {
|
|
|
5173
5173
|
`
|
|
5174
5174
|
);
|
|
5175
5175
|
}
|
|
5176
|
-
function
|
|
5176
|
+
function $l(s, i = 40) {
|
|
5177
5177
|
if (s.type === "image/svg+xml")
|
|
5178
5178
|
return URL.createObjectURL(s);
|
|
5179
5179
|
let e = document.createElement("canvas"), t = e.getContext("2d"), r = new Image(), n = new Promise((o, l) => {
|
|
@@ -5193,8 +5193,8 @@ function Sl(s, i = 40) {
|
|
|
5193
5193
|
});
|
|
5194
5194
|
return r.src = URL.createObjectURL(s), n;
|
|
5195
5195
|
}
|
|
5196
|
-
const Mi = 16384,
|
|
5197
|
-
const i =
|
|
5196
|
+
const Mi = 16384, Sl = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, xl = (s) => {
|
|
5197
|
+
const i = Sl.exec(s == null ? void 0 : s.toLocaleLowerCase()) || [];
|
|
5198
5198
|
if (!i.length)
|
|
5199
5199
|
return !1;
|
|
5200
5200
|
const e = i[1] * i[2], t = Mi * Mi;
|
|
@@ -5297,7 +5297,7 @@ class Ee extends $ {
|
|
|
5297
5297
|
if (!e.getValue("thumbUrl"))
|
|
5298
5298
|
if ((t = e.getValue("file")) != null && t.type.includes("image"))
|
|
5299
5299
|
try {
|
|
5300
|
-
let r = await
|
|
5300
|
+
let r = await $l(e.getValue("file"), this.cfg.thumbSize);
|
|
5301
5301
|
e.setValue("thumbUrl", r);
|
|
5302
5302
|
} catch {
|
|
5303
5303
|
let n = window.getComputedStyle(this).getPropertyValue("--clr-generic-file-icon");
|
|
@@ -5389,14 +5389,14 @@ class Ee extends $ {
|
|
|
5389
5389
|
super.disconnectedCallback(), this._debouncedGenerateThumb.cancel(), (e = this._observer) == null || e.disconnect();
|
|
5390
5390
|
}
|
|
5391
5391
|
_settingsOfShrink() {
|
|
5392
|
-
return
|
|
5392
|
+
return xl(this.cfg.imageShrink);
|
|
5393
5393
|
}
|
|
5394
5394
|
/**
|
|
5395
5395
|
* @private
|
|
5396
5396
|
* @param {File} file
|
|
5397
5397
|
*/
|
|
5398
5398
|
_processShrink(e) {
|
|
5399
|
-
return
|
|
5399
|
+
return Al(e, this._settingsOfShrink());
|
|
5400
5400
|
}
|
|
5401
5401
|
async upload() {
|
|
5402
5402
|
var r, n;
|
|
@@ -5540,7 +5540,7 @@ ei.template = /* HTML */
|
|
|
5540
5540
|
<slot></slot>
|
|
5541
5541
|
</dialog>
|
|
5542
5542
|
`;
|
|
5543
|
-
const
|
|
5543
|
+
const Fs = (s, i) => {
|
|
5544
5544
|
let e, t, r;
|
|
5545
5545
|
const n = (...o) => {
|
|
5546
5546
|
e ? (clearTimeout(t), t = setTimeout(
|
|
@@ -5561,7 +5561,7 @@ const Ns = (s, i) => {
|
|
|
5561
5561
|
/** @type {unknown} */
|
|
5562
5562
|
n;
|
|
5563
5563
|
};
|
|
5564
|
-
class
|
|
5564
|
+
class Ns extends $ {
|
|
5565
5565
|
constructor() {
|
|
5566
5566
|
super();
|
|
5567
5567
|
// Context owner should have access to CSS l10n
|
|
@@ -5570,7 +5570,7 @@ class Fs extends $ {
|
|
|
5570
5570
|
u(this, "historyTracked", !0);
|
|
5571
5571
|
u(this, "activityType", b.activities.UPLOAD_LIST);
|
|
5572
5572
|
/** @private */
|
|
5573
|
-
u(this, "_throttledHandleCollectionUpdate",
|
|
5573
|
+
u(this, "_throttledHandleCollectionUpdate", Fs(() => {
|
|
5574
5574
|
this.isConnected && (this._updateUploadsState(), !this.couldOpenActivity && this.$["*currentActivity"] === this.activityType && this.historyBack());
|
|
5575
5575
|
}, 300));
|
|
5576
5576
|
this.init$ = {
|
|
@@ -5665,7 +5665,7 @@ class Fs extends $ {
|
|
|
5665
5665
|
super.destroyCallback(), this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate);
|
|
5666
5666
|
}
|
|
5667
5667
|
}
|
|
5668
|
-
|
|
5668
|
+
Ns.template = /* HTML */
|
|
5669
5669
|
`
|
|
5670
5670
|
<lr-activity-header>
|
|
5671
5671
|
<span class="header-text">{{headerText}}</span>
|
|
@@ -5764,7 +5764,7 @@ Ds.template = /* HTML */
|
|
|
5764
5764
|
></button>
|
|
5765
5765
|
</form>
|
|
5766
5766
|
`;
|
|
5767
|
-
const
|
|
5767
|
+
const Fi = () => typeof navigator.permissions < "u";
|
|
5768
5768
|
class zs extends $ {
|
|
5769
5769
|
constructor() {
|
|
5770
5770
|
super(...arguments);
|
|
@@ -5779,7 +5779,7 @@ class zs extends $ {
|
|
|
5779
5779
|
shotBtnDisabled: !0,
|
|
5780
5780
|
videoHidden: !0,
|
|
5781
5781
|
messageHidden: !0,
|
|
5782
|
-
requestBtnHidden:
|
|
5782
|
+
requestBtnHidden: Fi(),
|
|
5783
5783
|
l10nMessage: null,
|
|
5784
5784
|
originalErrorMessage: null,
|
|
5785
5785
|
cameraSelectOptions: null,
|
|
@@ -5799,7 +5799,7 @@ class zs extends $ {
|
|
|
5799
5799
|
});
|
|
5800
5800
|
/** @private */
|
|
5801
5801
|
u(this, "_onActivate", () => {
|
|
5802
|
-
|
|
5802
|
+
Fi() && this._subscribePermissions(), this._capture();
|
|
5803
5803
|
});
|
|
5804
5804
|
/** @private */
|
|
5805
5805
|
u(this, "_onDeactivate", () => {
|
|
@@ -5955,7 +5955,7 @@ class Vs extends $ {
|
|
|
5955
5955
|
}
|
|
5956
5956
|
}
|
|
5957
5957
|
Vs.EventType = S;
|
|
5958
|
-
const
|
|
5958
|
+
const Ft = (
|
|
5959
5959
|
/** @type {UploadCtxProvider} */
|
|
5960
5960
|
/** @type {unknown} */
|
|
5961
5961
|
Vs
|
|
@@ -6097,7 +6097,7 @@ Bs.template = /* HTML */
|
|
|
6097
6097
|
</div>
|
|
6098
6098
|
</div>
|
|
6099
6099
|
`;
|
|
6100
|
-
class
|
|
6100
|
+
class Il {
|
|
6101
6101
|
constructor() {
|
|
6102
6102
|
u(this, "captionL10nStr", "confirm-your-action");
|
|
6103
6103
|
u(this, "messageL10Str", "are-you-sure");
|
|
@@ -6116,7 +6116,7 @@ class js extends b {
|
|
|
6116
6116
|
super(...arguments);
|
|
6117
6117
|
u(this, "activityType", b.activities.CONFIRMATION);
|
|
6118
6118
|
/** @private */
|
|
6119
|
-
u(this, "_defaults", new
|
|
6119
|
+
u(this, "_defaults", new Il());
|
|
6120
6120
|
u(this, "init$", {
|
|
6121
6121
|
...this.init$,
|
|
6122
6122
|
activityCaption: "",
|
|
@@ -6237,7 +6237,7 @@ class ti extends k {
|
|
|
6237
6237
|
}
|
|
6238
6238
|
initCallback() {
|
|
6239
6239
|
super.initCallback(), this.sub("checkerboard", () => {
|
|
6240
|
-
this.style.backgroundImage = this.hasAttribute("checkerboard") ? `url(${
|
|
6240
|
+
this.style.backgroundImage = this.hasAttribute("checkerboard") ? `url(${Tl()})` : "unset";
|
|
6241
6241
|
});
|
|
6242
6242
|
}
|
|
6243
6243
|
destroyCallback() {
|
|
@@ -6265,14 +6265,14 @@ ti.template = /* HTML */
|
|
|
6265
6265
|
ti.bindAttributes({
|
|
6266
6266
|
checkerboard: "checkerboard"
|
|
6267
6267
|
});
|
|
6268
|
-
const
|
|
6268
|
+
const Ni = "--cfg-ctx-name";
|
|
6269
6269
|
class _e extends k {
|
|
6270
6270
|
/**
|
|
6271
6271
|
* @private
|
|
6272
6272
|
* @returns {string}
|
|
6273
6273
|
*/
|
|
6274
6274
|
get cfgCssCtxName() {
|
|
6275
|
-
return this.getCssData(
|
|
6275
|
+
return this.getCssData(Ni, !0);
|
|
6276
6276
|
}
|
|
6277
6277
|
/** @private */
|
|
6278
6278
|
get cfgCtxName() {
|
|
@@ -6286,7 +6286,7 @@ class _e extends k {
|
|
|
6286
6286
|
var i;
|
|
6287
6287
|
if (!this.connectedOnce) {
|
|
6288
6288
|
const e = (i = this.getAttribute("ctx-name")) == null ? void 0 : i.trim();
|
|
6289
|
-
e && this.style.setProperty(
|
|
6289
|
+
e && this.style.setProperty(Ni, `'${e}'`);
|
|
6290
6290
|
}
|
|
6291
6291
|
super.connectedCallback();
|
|
6292
6292
|
}
|
|
@@ -6320,15 +6320,15 @@ function X(...s) {
|
|
|
6320
6320
|
let i = qs(...s);
|
|
6321
6321
|
return Object.keys(i).reduce((e, t) => (i[t] && e.push(t), e), []).join(" ");
|
|
6322
6322
|
}
|
|
6323
|
-
function
|
|
6323
|
+
function kl(s, ...i) {
|
|
6324
6324
|
let e = qs(...i);
|
|
6325
6325
|
for (let t of Object.keys(e))
|
|
6326
6326
|
s.classList.toggle(t, e[t]);
|
|
6327
6327
|
}
|
|
6328
|
-
const
|
|
6328
|
+
const Ol = (s) => {
|
|
6329
6329
|
if (!s)
|
|
6330
6330
|
return ee;
|
|
6331
|
-
const i =
|
|
6331
|
+
const i = ro(s).filter((e) => ee.includes(e));
|
|
6332
6332
|
return i.length === 0 ? ee : i;
|
|
6333
6333
|
};
|
|
6334
6334
|
function Pl(s) {
|
|
@@ -6345,7 +6345,7 @@ function Pl(s) {
|
|
|
6345
6345
|
/** @type {import('./types.js').CropPresetList} */
|
|
6346
6346
|
"*cropPresetList": [],
|
|
6347
6347
|
"*tabList": ee,
|
|
6348
|
-
"*tabId":
|
|
6348
|
+
"*tabId": L.CROP,
|
|
6349
6349
|
entry: null,
|
|
6350
6350
|
extension: null,
|
|
6351
6351
|
editorMode: !1,
|
|
@@ -6401,7 +6401,7 @@ function Pl(s) {
|
|
|
6401
6401
|
}
|
|
6402
6402
|
};
|
|
6403
6403
|
}
|
|
6404
|
-
const
|
|
6404
|
+
const Ll = (
|
|
6405
6405
|
/* HTML */
|
|
6406
6406
|
`
|
|
6407
6407
|
<div class="wrapper wrapper_desktop">
|
|
@@ -6436,7 +6436,7 @@ const Ul = (
|
|
|
6436
6436
|
</div>
|
|
6437
6437
|
`
|
|
6438
6438
|
);
|
|
6439
|
-
class
|
|
6439
|
+
class Ne extends _e {
|
|
6440
6440
|
constructor() {
|
|
6441
6441
|
super();
|
|
6442
6442
|
/** @private */
|
|
@@ -6479,11 +6479,11 @@ class Fe extends _e {
|
|
|
6479
6479
|
async updateImage() {
|
|
6480
6480
|
if (this.isConnected) {
|
|
6481
6481
|
if (await this._waitForSize(), this.$.cdnUrl) {
|
|
6482
|
-
const e =
|
|
6482
|
+
const e = oo(this.$.cdnUrl), t = qe(this.$.cdnUrl, e);
|
|
6483
6483
|
if (t === this.$["*originalUrl"])
|
|
6484
6484
|
return;
|
|
6485
6485
|
this.$["*originalUrl"] = t;
|
|
6486
|
-
const r =
|
|
6486
|
+
const r = lo(this.$.cdnUrl), n = To(r);
|
|
6487
6487
|
this.$["*editorTransformations"] = n;
|
|
6488
6488
|
} else if (this.$.uuid) {
|
|
6489
6489
|
const e = qe(this.cfg.cdnCname, this.$.uuid);
|
|
@@ -6492,13 +6492,13 @@ class Fe extends _e {
|
|
|
6492
6492
|
this.$["*originalUrl"] = e, this.$["*editorTransformations"] = {};
|
|
6493
6493
|
} else
|
|
6494
6494
|
throw new Error("No UUID nor CDN URL provided");
|
|
6495
|
-
this.$["*tabId"] ===
|
|
6495
|
+
this.$["*tabId"] === L.CROP ? this.$["*cropperEl"].deactivate({ reset: !0 }) : this.$["*faderEl"].deactivate();
|
|
6496
6496
|
try {
|
|
6497
6497
|
const e = V(this.$["*originalUrl"], ae("json")), t = await fetch(e).then((o) => o.json()), { width: r, height: n } = (
|
|
6498
6498
|
/** @type {{ width: number; height: number }} */
|
|
6499
6499
|
t
|
|
6500
6500
|
);
|
|
6501
|
-
this.$["*imageSize"] = { width: r, height: n }, this.$["*tabId"] ===
|
|
6501
|
+
this.$["*imageSize"] = { width: r, height: n }, this.$["*tabId"] === L.CROP ? this.$["*cropperEl"].activate(this.$["*imageSize"]) : this.$["*faderEl"].activate({ url: this.$["*originalUrl"] });
|
|
6502
6502
|
} catch (e) {
|
|
6503
6503
|
e && console.error("Failed to load image info", e);
|
|
6504
6504
|
}
|
|
@@ -6524,12 +6524,12 @@ class Fe extends _e {
|
|
|
6524
6524
|
"tabs",
|
|
6525
6525
|
/** @param {string} val */
|
|
6526
6526
|
(e) => {
|
|
6527
|
-
this.$["*tabList"] =
|
|
6527
|
+
this.$["*tabList"] = Ol(e);
|
|
6528
6528
|
}
|
|
6529
6529
|
), this.sub("*tabId", (e) => {
|
|
6530
6530
|
this.ref["img-el"].className = X("image", {
|
|
6531
|
-
image_hidden_to_cropper: e ===
|
|
6532
|
-
image_hidden_effects: e !==
|
|
6531
|
+
image_hidden_to_cropper: e === L.CROP,
|
|
6532
|
+
image_hidden_effects: e !== L.CROP
|
|
6533
6533
|
});
|
|
6534
6534
|
}), this.classList.add("editor_ON"), this.sub("*networkProblems", (e) => {
|
|
6535
6535
|
this.$["presence.networkProblems"] = e, this.$["presence.modalCaption"] = !e;
|
|
@@ -6556,9 +6556,9 @@ class Fe extends _e {
|
|
|
6556
6556
|
), this.sub("uuid", (e) => e && this.updateImage()), this.sub("cdnUrl", (e) => e && this.updateImage());
|
|
6557
6557
|
}
|
|
6558
6558
|
}
|
|
6559
|
-
u(
|
|
6560
|
-
|
|
6561
|
-
|
|
6559
|
+
u(Ne, "className", "cloud-image-editor");
|
|
6560
|
+
Ne.template = Ll;
|
|
6561
|
+
Ne.bindAttributes({
|
|
6562
6562
|
uuid: "uuid",
|
|
6563
6563
|
"cdn-url": "cdnUrl",
|
|
6564
6564
|
"crop-preset": "cropPreset",
|
|
@@ -6647,25 +6647,25 @@ class Gs extends _e {
|
|
|
6647
6647
|
Ie(n, p);
|
|
6648
6648
|
} else {
|
|
6649
6649
|
const p = ke(
|
|
6650
|
-
Math.min(d, f) / (
|
|
6650
|
+
Math.min(d, f) / (Lt * 2 + He) / 2,
|
|
6651
6651
|
0,
|
|
6652
6652
|
1
|
|
6653
6653
|
);
|
|
6654
|
-
let { d: g, center:
|
|
6654
|
+
let { d: g, center: A } = a ? Vn(i, t, p) : Bn(
|
|
6655
6655
|
i,
|
|
6656
6656
|
/** @type {Extract<import('./types.js').Direction, 'n' | 's' | 'w' | 'e'>} */
|
|
6657
6657
|
t,
|
|
6658
6658
|
p
|
|
6659
6659
|
);
|
|
6660
|
-
const
|
|
6660
|
+
const w = Math.max(
|
|
6661
6661
|
Ai * ke(Math.min(d, f) / Ai / 3, 0, 1),
|
|
6662
|
-
|
|
6662
|
+
zn
|
|
6663
6663
|
);
|
|
6664
6664
|
Ie(n, {
|
|
6665
|
-
x:
|
|
6666
|
-
y:
|
|
6667
|
-
width:
|
|
6668
|
-
height:
|
|
6665
|
+
x: A[0] - w,
|
|
6666
|
+
y: A[1] - w,
|
|
6667
|
+
width: w * 2,
|
|
6668
|
+
height: w * 2
|
|
6669
6669
|
}), Ie(r, { d: g });
|
|
6670
6670
|
}
|
|
6671
6671
|
let m = this._shouldThumbBeDisabled(t);
|
|
@@ -6805,7 +6805,7 @@ class Gs extends _e {
|
|
|
6805
6805
|
this._dragStartCrop ?? this.$["*cropBox"]
|
|
6806
6806
|
);
|
|
6807
6807
|
const l = (c = this.$["*cropPresetList"]) == null ? void 0 : c[0], a = l ? l.width / l.height : void 0;
|
|
6808
|
-
if (i === "" ? o =
|
|
6808
|
+
if (i === "" ? o = Hn({ rect: o, delta: [t, r], imageBox: n }) : o = Qn({ rect: o, delta: [t, r], direction: i, aspectRatio: a, imageBox: n }), !Object.values(o).every((h) => Number.isFinite(h) && h >= 0)) {
|
|
6809
6809
|
console.error("CropFrame is trying to create invalid rectangle", {
|
|
6810
6810
|
payload: o
|
|
6811
6811
|
});
|
|
@@ -6829,14 +6829,14 @@ class Gs extends _e {
|
|
|
6829
6829
|
width: n.width,
|
|
6830
6830
|
height: n.height
|
|
6831
6831
|
};
|
|
6832
|
-
return
|
|
6832
|
+
return eo(o, [i.x, i.y]);
|
|
6833
6833
|
});
|
|
6834
6834
|
this._hoverThumb = e, this._updateCursor();
|
|
6835
6835
|
}
|
|
6836
6836
|
/** @private */
|
|
6837
6837
|
_updateCursor() {
|
|
6838
6838
|
let i = this._hoverThumb;
|
|
6839
|
-
this.ref["svg-el"].style.cursor = i ?
|
|
6839
|
+
this.ref["svg-el"].style.cursor = i ? jn(i.direction) : "initial";
|
|
6840
6840
|
}
|
|
6841
6841
|
/** @private */
|
|
6842
6842
|
_render() {
|
|
@@ -6910,19 +6910,19 @@ vt.template = /* HTML */
|
|
|
6910
6910
|
<lr-icon size="20" set="@name: icon;"></lr-icon>
|
|
6911
6911
|
<div class="title" ref="title-el">{{title}}</div>
|
|
6912
6912
|
`;
|
|
6913
|
-
function
|
|
6913
|
+
function Ul(s) {
|
|
6914
6914
|
let i = s + 90;
|
|
6915
6915
|
return i = i >= 360 ? 0 : i, i;
|
|
6916
6916
|
}
|
|
6917
|
-
function
|
|
6918
|
-
return s === "rotate" ?
|
|
6917
|
+
function Rl(s, i) {
|
|
6918
|
+
return s === "rotate" ? Ul(i) : ["mirror", "flip"].includes(s) ? !i : null;
|
|
6919
6919
|
}
|
|
6920
6920
|
class Xs extends vt {
|
|
6921
6921
|
initCallback() {
|
|
6922
6922
|
super.initCallback(), this.defineAccessor("operation", (i) => {
|
|
6923
6923
|
i && (this._operation = i, this.$.icon = i);
|
|
6924
6924
|
}), this.$["on.click"] = (i) => {
|
|
6925
|
-
let e = this.$["*cropperEl"].getValue(this._operation), t =
|
|
6925
|
+
let e = this.$["*cropperEl"].getValue(this._operation), t = Rl(this._operation, e);
|
|
6926
6926
|
this.$["*cropperEl"].setValue(this._operation, t);
|
|
6927
6927
|
};
|
|
6928
6928
|
}
|
|
@@ -7014,7 +7014,7 @@ function ii(s) {
|
|
|
7014
7014
|
i.naturalWidth === 0 && (i.src = me);
|
|
7015
7015
|
} };
|
|
7016
7016
|
}
|
|
7017
|
-
function
|
|
7017
|
+
function Nt(s) {
|
|
7018
7018
|
let i = [];
|
|
7019
7019
|
for (let n of s) {
|
|
7020
7020
|
let o = ii(n);
|
|
@@ -7130,7 +7130,7 @@ class Ys extends vt {
|
|
|
7130
7130
|
});
|
|
7131
7131
|
}
|
|
7132
7132
|
}
|
|
7133
|
-
function
|
|
7133
|
+
function Ml(s, i) {
|
|
7134
7134
|
let e = {};
|
|
7135
7135
|
for (let t of i) {
|
|
7136
7136
|
let r = s[t];
|
|
@@ -7161,7 +7161,7 @@ class Js extends _e {
|
|
|
7161
7161
|
super(), this.init$ = {
|
|
7162
7162
|
...this.init$,
|
|
7163
7163
|
image: null,
|
|
7164
|
-
"*padding":
|
|
7164
|
+
"*padding": Dn,
|
|
7165
7165
|
/** @type {Operations} */
|
|
7166
7166
|
"*operations": {
|
|
7167
7167
|
rotate: 0,
|
|
@@ -7182,7 +7182,7 @@ class Js extends _e {
|
|
|
7182
7182
|
width: 0,
|
|
7183
7183
|
height: 0
|
|
7184
7184
|
}
|
|
7185
|
-
}, this._commitDebounced = H(this._commit.bind(this), 300), this._handleResizeThrottled =
|
|
7185
|
+
}, this._commitDebounced = H(this._commit.bind(this), 300), this._handleResizeThrottled = Fs(this._handleResize.bind(this), 100), this._imageSize = { width: 0, height: 0 };
|
|
7186
7186
|
}
|
|
7187
7187
|
/** @private */
|
|
7188
7188
|
_handleResize() {
|
|
@@ -7190,7 +7190,7 @@ class Js extends _e {
|
|
|
7190
7190
|
}
|
|
7191
7191
|
/** @private */
|
|
7192
7192
|
_syncTransformations() {
|
|
7193
|
-
let i = this.$["*editorTransformations"], e =
|
|
7193
|
+
let i = this.$["*editorTransformations"], e = Ml(i, Object.keys(this.$["*operations"])), t = { ...this.$["*operations"], ...e };
|
|
7194
7194
|
this.$["*operations"] = t;
|
|
7195
7195
|
}
|
|
7196
7196
|
/** @private */
|
|
@@ -7226,19 +7226,19 @@ class Js extends _e {
|
|
|
7226
7226
|
let {
|
|
7227
7227
|
dimensions: [f, m],
|
|
7228
7228
|
coords: [p, g]
|
|
7229
|
-
} = n, { width:
|
|
7229
|
+
} = n, { width: A } = ze(this._imageSize, r), w = o / A;
|
|
7230
7230
|
i = lt(
|
|
7231
7231
|
st({
|
|
7232
|
-
x: l + p *
|
|
7233
|
-
y: a + g *
|
|
7234
|
-
width: f *
|
|
7235
|
-
height: m *
|
|
7232
|
+
x: l + p * w,
|
|
7233
|
+
y: a + g * w,
|
|
7234
|
+
width: f * w,
|
|
7235
|
+
height: m * w
|
|
7236
7236
|
}),
|
|
7237
7237
|
this.$["*imageBox"]
|
|
7238
7238
|
);
|
|
7239
7239
|
}
|
|
7240
7240
|
const c = (d = this.$["*cropPresetList"]) == null ? void 0 : d[0], h = c ? c.width / c.height : void 0;
|
|
7241
|
-
if (!
|
|
7241
|
+
if (!to(i, e) || h && !io(i, h)) {
|
|
7242
7242
|
const f = e.width / e.height;
|
|
7243
7243
|
let m = e.width, p = e.height;
|
|
7244
7244
|
h && (f > h ? m = Math.min(e.height * h, e.width) : p = Math.min(e.width / h, e.height)), i = {
|
|
@@ -7294,7 +7294,7 @@ class Js extends _e {
|
|
|
7294
7294
|
* @returns {import('./types.js').Transformations['crop']}
|
|
7295
7295
|
*/
|
|
7296
7296
|
_getCropTransformation() {
|
|
7297
|
-
let i = this.$["*cropBox"], e = this.$["*imageBox"], t = this.$["*operations"], { rotate: r } = t, { width: n, height: o, x: l, y: a } = e, { width: c, height: h } = ze(this._imageSize, r), { x: d, y: f } = i, m = n / c, p = o / h, g = this._getCropDimensions(),
|
|
7297
|
+
let i = this.$["*cropBox"], e = this.$["*imageBox"], t = this.$["*operations"], { rotate: r } = t, { width: n, height: o, x: l, y: a } = e, { width: c, height: h } = ze(this._imageSize, r), { x: d, y: f } = i, m = n / c, p = o / h, g = this._getCropDimensions(), A = {
|
|
7298
7298
|
dimensions: g,
|
|
7299
7299
|
coords: (
|
|
7300
7300
|
/** @type {[Number, Number]} */
|
|
@@ -7304,14 +7304,14 @@ class Js extends _e {
|
|
|
7304
7304
|
]
|
|
7305
7305
|
)
|
|
7306
7306
|
};
|
|
7307
|
-
if (!Fl(
|
|
7307
|
+
if (!Fl(A)) {
|
|
7308
7308
|
console.error("Cropper is trying to create invalid crop object", {
|
|
7309
|
-
payload:
|
|
7309
|
+
payload: A
|
|
7310
7310
|
});
|
|
7311
7311
|
return;
|
|
7312
7312
|
}
|
|
7313
7313
|
if (!(g[0] === c && g[1] === h))
|
|
7314
|
-
return
|
|
7314
|
+
return A;
|
|
7315
7315
|
}
|
|
7316
7316
|
/** @private */
|
|
7317
7317
|
_commit() {
|
|
@@ -7443,20 +7443,20 @@ function Di(s, i, e) {
|
|
|
7443
7443
|
t[r] = Math.ceil((r * i + (e - r) * s) / e);
|
|
7444
7444
|
return t;
|
|
7445
7445
|
}
|
|
7446
|
-
function
|
|
7446
|
+
function Nl(s) {
|
|
7447
7447
|
return s.reduce(
|
|
7448
7448
|
(i, e, t) => t < s.length - 1 ? [...i, [e, s[t + 1]]] : i,
|
|
7449
7449
|
[]
|
|
7450
7450
|
);
|
|
7451
7451
|
}
|
|
7452
|
-
function
|
|
7453
|
-
let t =
|
|
7452
|
+
function Dl(s, i, e) {
|
|
7453
|
+
let t = Nl(s).find(([r, n]) => r <= i && i <= n);
|
|
7454
7454
|
return s.map((r) => {
|
|
7455
7455
|
let n = Math.abs(t[0] - t[1]), o = Math.abs(i - t[0]) / n;
|
|
7456
7456
|
return t[0] === r ? i > e ? 1 : 1 - o : t[1] === r ? i >= e ? o : 1 : 0;
|
|
7457
7457
|
});
|
|
7458
7458
|
}
|
|
7459
|
-
function
|
|
7459
|
+
function zl(s, i) {
|
|
7460
7460
|
return s.map((e, t) => e < i ? s.length - t : t);
|
|
7461
7461
|
}
|
|
7462
7462
|
function zi(s, i) {
|
|
@@ -7465,7 +7465,7 @@ function zi(s, i) {
|
|
|
7465
7465
|
(n, o) => n - o
|
|
7466
7466
|
);
|
|
7467
7467
|
}
|
|
7468
|
-
class
|
|
7468
|
+
class Vl extends _e {
|
|
7469
7469
|
constructor() {
|
|
7470
7470
|
super(), this._isActive = !1, this._hidden = !0, this._addKeypointDebounced = H(this._addKeypoint.bind(this), 600), this.classList.add("inactive_to_cropper");
|
|
7471
7471
|
}
|
|
@@ -7572,7 +7572,7 @@ class Bl extends _e {
|
|
|
7572
7572
|
*/
|
|
7573
7573
|
_update(i, e) {
|
|
7574
7574
|
this._operation = i, this._value = e;
|
|
7575
|
-
let { zero: t } = Ue[i], r = this._keypoints.map((l) => l.value), n =
|
|
7575
|
+
let { zero: t } = Ue[i], r = this._keypoints.map((l) => l.value), n = Dl(r, e, t), o = zl(r, t);
|
|
7576
7576
|
for (let [l, a] of Object.entries(this._keypoints))
|
|
7577
7577
|
a.opacity = n[l], a.zIndex = o[l];
|
|
7578
7578
|
this._flush();
|
|
@@ -7588,7 +7588,7 @@ class Bl extends _e {
|
|
|
7588
7588
|
this._previewImage = this._previewImage || this._createPreviewImage(), !this.contains(this._previewImage) && i.appendChild(this._previewImage);
|
|
7589
7589
|
let e = document.createElement("div");
|
|
7590
7590
|
i.appendChild(e);
|
|
7591
|
-
let t = this._keypoints.map((c) => c.src), { images: r, promise: n, cancel: o } =
|
|
7591
|
+
let t = this._keypoints.map((c) => c.src), { images: r, promise: n, cancel: o } = Nt(t);
|
|
7592
7592
|
r.forEach((c) => {
|
|
7593
7593
|
let h = this._handleImageLoading(c.src);
|
|
7594
7594
|
c.addEventListener("load", h), c.addEventListener("error", h);
|
|
@@ -7623,7 +7623,7 @@ class Bl extends _e {
|
|
|
7623
7623
|
*/
|
|
7624
7624
|
preload({ url: i, filter: e, operation: t, value: r }) {
|
|
7625
7625
|
this._cancelBatchPreload && this._cancelBatchPreload();
|
|
7626
|
-
let o = zi(t, r).map((a) => this._imageSrc({ url: i, filter: e, operation: t, value: a })), { cancel: l } =
|
|
7626
|
+
let o = zi(t, r).map((a) => this._imageSrc({ url: i, filter: e, operation: t, value: a })), { cancel: l } = Nt(o);
|
|
7627
7627
|
this._cancelBatchPreload = l;
|
|
7628
7628
|
}
|
|
7629
7629
|
/** @private */
|
|
@@ -7688,19 +7688,19 @@ class Bl extends _e {
|
|
|
7688
7688
|
)) : this._container && this._container.remove();
|
|
7689
7689
|
}
|
|
7690
7690
|
}
|
|
7691
|
-
const
|
|
7691
|
+
const Bl = 1;
|
|
7692
7692
|
class Zs extends _e {
|
|
7693
7693
|
initCallback() {
|
|
7694
7694
|
super.initCallback(), this.addEventListener("wheel", (i) => {
|
|
7695
7695
|
i.preventDefault();
|
|
7696
7696
|
let { deltaY: e, deltaX: t } = i;
|
|
7697
|
-
Math.abs(t) >
|
|
7697
|
+
Math.abs(t) > Bl ? this.scrollLeft += t : this.scrollLeft += e;
|
|
7698
7698
|
});
|
|
7699
7699
|
}
|
|
7700
7700
|
}
|
|
7701
7701
|
Zs.template = /* HTML */
|
|
7702
7702
|
" <slot></slot> ";
|
|
7703
|
-
function
|
|
7703
|
+
function jl(s) {
|
|
7704
7704
|
return (
|
|
7705
7705
|
/* HTML */
|
|
7706
7706
|
`
|
|
@@ -7718,7 +7718,7 @@ function Hl(s) {
|
|
|
7718
7718
|
`
|
|
7719
7719
|
);
|
|
7720
7720
|
}
|
|
7721
|
-
function
|
|
7721
|
+
function Hl(s) {
|
|
7722
7722
|
return (
|
|
7723
7723
|
/* HTML */
|
|
7724
7724
|
`
|
|
@@ -7739,13 +7739,13 @@ class Qs extends _e {
|
|
|
7739
7739
|
var o, l;
|
|
7740
7740
|
const e = this.$["*editorTransformations"], t = this.$["*currentOperation"];
|
|
7741
7741
|
let r = "", n = !1;
|
|
7742
|
-
if (this.$["*tabId"] ===
|
|
7742
|
+
if (this.$["*tabId"] === L.FILTERS)
|
|
7743
7743
|
if (n = !0, this.$["*currentFilter"] && ((o = e == null ? void 0 : e.filter) == null ? void 0 : o.name) === this.$["*currentFilter"]) {
|
|
7744
7744
|
let a = ((l = e == null ? void 0 : e.filter) == null ? void 0 : l.amount) || 100;
|
|
7745
7745
|
r = this.l10n(this.$["*currentFilter"]) + " " + a;
|
|
7746
7746
|
} else
|
|
7747
7747
|
r = this.l10n(fe);
|
|
7748
|
-
else if (this.$["*tabId"] ===
|
|
7748
|
+
else if (this.$["*tabId"] === L.TUNING && t) {
|
|
7749
7749
|
n = !0;
|
|
7750
7750
|
let a = (e == null ? void 0 : e[t]) || Ue[t].zero;
|
|
7751
7751
|
r = t + " " + a;
|
|
@@ -7761,9 +7761,9 @@ class Qs extends _e {
|
|
|
7761
7761
|
"*currentFilter": fe,
|
|
7762
7762
|
"*currentOperation": null,
|
|
7763
7763
|
showLoader: !1,
|
|
7764
|
-
filters:
|
|
7765
|
-
colorOperations:
|
|
7766
|
-
cropOperations:
|
|
7764
|
+
filters: So,
|
|
7765
|
+
colorOperations: $o,
|
|
7766
|
+
cropOperations: xo,
|
|
7767
7767
|
"*operationTooltip": null,
|
|
7768
7768
|
"l10n.cancel": this.l10n("cancel"),
|
|
7769
7769
|
"l10n.apply": this.l10n("apply"),
|
|
@@ -7820,7 +7820,7 @@ class Qs extends _e {
|
|
|
7820
7820
|
}
|
|
7821
7821
|
/** @private */
|
|
7822
7822
|
_onSliderClose() {
|
|
7823
|
-
this.$["*showSlider"] = !1, this.$["*tabId"] ===
|
|
7823
|
+
this.$["*showSlider"] = !1, this.$["*tabId"] === L.TUNING && this.ref["tooltip-el"].classList.toggle("info-tooltip_visible", !1);
|
|
7824
7824
|
}
|
|
7825
7825
|
/**
|
|
7826
7826
|
* @private
|
|
@@ -7852,16 +7852,16 @@ class Qs extends _e {
|
|
|
7852
7852
|
*/
|
|
7853
7853
|
_renderControlsList(e) {
|
|
7854
7854
|
let t = this.ref[`controls-list-${e}`], r = document.createDocumentFragment();
|
|
7855
|
-
e ===
|
|
7855
|
+
e === L.CROP ? this.$.cropOperations.forEach(
|
|
7856
7856
|
/** @param {string} operation */
|
|
7857
7857
|
(n) => {
|
|
7858
7858
|
let o = this._createToggleControl(n);
|
|
7859
7859
|
r.appendChild(o);
|
|
7860
7860
|
}
|
|
7861
|
-
) : e ===
|
|
7861
|
+
) : e === L.FILTERS ? [fe, ...this.$.filters].forEach((n) => {
|
|
7862
7862
|
let o = this._createFilterControl(n);
|
|
7863
7863
|
r.appendChild(o);
|
|
7864
|
-
}) : e ===
|
|
7864
|
+
}) : e === L.TUNING && this.$.colorOperations.forEach(
|
|
7865
7865
|
/** @param {string} operation */
|
|
7866
7866
|
(n) => {
|
|
7867
7867
|
let o = this._createOperationControl(n);
|
|
@@ -7877,7 +7877,7 @@ class Qs extends _e {
|
|
|
7877
7877
|
* @param {{ fromViewer?: Boolean }} options
|
|
7878
7878
|
*/
|
|
7879
7879
|
_activateTab(e, { fromViewer: t }) {
|
|
7880
|
-
this.$["*tabId"] = e, e ===
|
|
7880
|
+
this.$["*tabId"] = e, e === L.CROP ? (this.$["*faderEl"].deactivate(), this.$["*cropperEl"].activate(this.$["*imageSize"], { fromViewer: t })) : (this.$["*faderEl"].activate({ url: this.$["*originalUrl"], fromViewer: t }), this.$["*cropperEl"].deactivate());
|
|
7881
7881
|
for (let r of ee) {
|
|
7882
7882
|
let n = r === e, o = this.ref[`tab-toggle-${r}`];
|
|
7883
7883
|
o.active = n, n ? (this._renderControlsList(e), this._syncTabIndicator()) : this._unmountTabControls(r), this.$[`presence.tabContent.${r}`] = n;
|
|
@@ -7901,7 +7901,7 @@ class Qs extends _e {
|
|
|
7901
7901
|
if (this.$["*imgContainerEl"] && this.$["*originalUrl"]) {
|
|
7902
7902
|
let e = this.$["*imgContainerEl"].offsetWidth, t = this.proxyUrl(ri(this.$["*originalUrl"], e, this.$["*editorTransformations"]));
|
|
7903
7903
|
this._cancelPreload && this._cancelPreload();
|
|
7904
|
-
let { cancel: r } =
|
|
7904
|
+
let { cancel: r } = Nt([t]);
|
|
7905
7905
|
this._cancelPreload = () => {
|
|
7906
7906
|
r(), this._cancelPreload = void 0;
|
|
7907
7907
|
};
|
|
@@ -7968,12 +7968,12 @@ Qs.template = /* HTML */
|
|
|
7968
7968
|
</div>
|
|
7969
7969
|
<div class="toolbar-container">
|
|
7970
7970
|
<lr-presence-toggle class="sub-toolbar" set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles">
|
|
7971
|
-
<div class="tab-content-row">${ee.map(
|
|
7971
|
+
<div class="tab-content-row">${ee.map(Hl).join("")}</div>
|
|
7972
7972
|
<div class="controls-row">
|
|
7973
7973
|
<lr-btn-ui theme="boring" icon="closeMax" set="onclick: on.cancel"> </lr-btn-ui>
|
|
7974
7974
|
<lr-presence-toggle class="tab-toggles" set="visible: presence.tabToggles; styles: presence.tabTogglesStyles">
|
|
7975
7975
|
<div ref="tabs-indicator" class="tab-toggles_indicator"></div>
|
|
7976
|
-
${ee.map(
|
|
7976
|
+
${ee.map(jl).join("")}
|
|
7977
7977
|
</lr-presence-toggle>
|
|
7978
7978
|
<lr-btn-ui theme="primary" icon="done" set="onclick: on.apply"> </lr-btn-ui>
|
|
7979
7979
|
</div>
|
|
@@ -8071,7 +8071,7 @@ class tr extends k {
|
|
|
8071
8071
|
});
|
|
8072
8072
|
}
|
|
8073
8073
|
_handleVisible() {
|
|
8074
|
-
this.style.visibility = this._visible ? "inherit" : "hidden",
|
|
8074
|
+
this.style.visibility = this._visible ? "inherit" : "hidden", kl(this, {
|
|
8075
8075
|
[tt.transition]: !this._externalTransitions,
|
|
8076
8076
|
[this._visibleStyle]: this._visible,
|
|
8077
8077
|
[this._hiddenStyle]: !this._visible
|
|
@@ -8186,7 +8186,7 @@ ir.template = /* HTML */
|
|
|
8186
8186
|
set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;"
|
|
8187
8187
|
/>
|
|
8188
8188
|
`;
|
|
8189
|
-
class
|
|
8189
|
+
class Wl extends $ {
|
|
8190
8190
|
constructor() {
|
|
8191
8191
|
super();
|
|
8192
8192
|
u(this, "couldBeCtxOwner", !0);
|
|
@@ -8224,7 +8224,7 @@ class ql extends $ {
|
|
|
8224
8224
|
this.historyBack();
|
|
8225
8225
|
}
|
|
8226
8226
|
mountEditor() {
|
|
8227
|
-
const e = new
|
|
8227
|
+
const e = new Ne(), t = this.$.cdnUrl, r = this.cfg.cropPreset, n = this.cfg.cloudImageEditorTabs;
|
|
8228
8228
|
e.setAttribute("ctx-name", this.ctxName), e.setAttribute("cdn-url", t), r && e.setAttribute("crop-preset", r), n && e.setAttribute("tabs", n), e.addEventListener("apply", (o) => {
|
|
8229
8229
|
const l = (
|
|
8230
8230
|
/** @type {CustomEvent<import('../CloudImageEditor/src/types.js').ApplyResult>} */
|
|
@@ -8249,22 +8249,22 @@ class ql extends $ {
|
|
|
8249
8249
|
this._instance = void 0, this.innerHTML = "";
|
|
8250
8250
|
}
|
|
8251
8251
|
}
|
|
8252
|
-
const
|
|
8252
|
+
const ql = function(s) {
|
|
8253
8253
|
return s.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
8254
|
-
},
|
|
8255
|
-
const e = s.split("*").map(
|
|
8254
|
+
}, Gl = function(s, i = "i") {
|
|
8255
|
+
const e = s.split("*").map(ql);
|
|
8256
8256
|
return new RegExp("^" + e.join(".+") + "$", i);
|
|
8257
8257
|
};
|
|
8258
|
-
let
|
|
8258
|
+
let Xl = (s) => Object.keys(s).reduce((e, t) => {
|
|
8259
8259
|
let r = s[t], n = Object.keys(r).reduce((o, l) => {
|
|
8260
8260
|
let a = r[l];
|
|
8261
8261
|
return o + `${l}: ${a};`;
|
|
8262
8262
|
}, "");
|
|
8263
8263
|
return e + `${t}{${n}}`;
|
|
8264
8264
|
}, "");
|
|
8265
|
-
function
|
|
8265
|
+
function Kl({ textColor: s, backgroundColor: i, linkColor: e, linkColorHover: t, shadeColor: r }) {
|
|
8266
8266
|
let n = `solid 1px ${r}`;
|
|
8267
|
-
return
|
|
8267
|
+
return Xl({
|
|
8268
8268
|
body: {
|
|
8269
8269
|
color: s,
|
|
8270
8270
|
"background-color": i
|
|
@@ -8345,12 +8345,12 @@ window.addEventListener("message", (s) => {
|
|
|
8345
8345
|
s.source === t && r(i);
|
|
8346
8346
|
}
|
|
8347
8347
|
});
|
|
8348
|
-
const
|
|
8348
|
+
const Yl = function(s, i, e) {
|
|
8349
8349
|
s in pe || (pe[s] = []), pe[s].push([i, e]);
|
|
8350
|
-
},
|
|
8350
|
+
}, Jl = function(s, i) {
|
|
8351
8351
|
s in pe && (pe[s] = pe[s].filter((e) => e[0] !== i));
|
|
8352
8352
|
};
|
|
8353
|
-
function
|
|
8353
|
+
function Zl(s) {
|
|
8354
8354
|
let i = [];
|
|
8355
8355
|
for (let [e, t] of Object.entries(s))
|
|
8356
8356
|
t == null || typeof t == "string" && t.length === 0 || i.push(`${e}=${encodeURIComponent(t)}`);
|
|
@@ -8418,7 +8418,7 @@ class sr extends $ {
|
|
|
8418
8418
|
if (e.alternatives) {
|
|
8419
8419
|
const t = ce(this.cfg.externalSourcesPreferredTypes);
|
|
8420
8420
|
for (const r of t) {
|
|
8421
|
-
const n =
|
|
8421
|
+
const n = Gl(r);
|
|
8422
8422
|
for (const [o, l] of Object.entries(e.alternatives))
|
|
8423
8423
|
if (n.test(o))
|
|
8424
8424
|
return l;
|
|
@@ -8463,7 +8463,7 @@ class sr extends $ {
|
|
|
8463
8463
|
};
|
|
8464
8464
|
this.sendMessage({
|
|
8465
8465
|
type: "embed-css",
|
|
8466
|
-
style:
|
|
8466
|
+
style: Kl(e)
|
|
8467
8467
|
});
|
|
8468
8468
|
}
|
|
8469
8469
|
/** @private */
|
|
@@ -8476,7 +8476,7 @@ class sr extends $ {
|
|
|
8476
8476
|
pass_window_open: !1,
|
|
8477
8477
|
session_key: this.cfg.remoteTabSessionKey
|
|
8478
8478
|
}, o = new URL(this.cfg.socialBaseUrl);
|
|
8479
|
-
return o.pathname = `/window3/${r}`, o.search =
|
|
8479
|
+
return o.pathname = `/window3/${r}`, o.search = Zl(n), o.toString();
|
|
8480
8480
|
}
|
|
8481
8481
|
/** @private */
|
|
8482
8482
|
mountIframe() {
|
|
@@ -8490,11 +8490,11 @@ class sr extends $ {
|
|
|
8490
8490
|
allowTransparency: !0
|
|
8491
8491
|
}
|
|
8492
8492
|
});
|
|
8493
|
-
e.addEventListener("load", this.handleIframeLoad.bind(this)), this.ref.iframeWrapper.innerHTML = "", this.ref.iframeWrapper.appendChild(e),
|
|
8493
|
+
e.addEventListener("load", this.handleIframeLoad.bind(this)), this.ref.iframeWrapper.innerHTML = "", this.ref.iframeWrapper.appendChild(e), Yl("file-selected", e.contentWindow, this.handleFileSelected.bind(this)), this._iframe = e, this.$.selectedList = [];
|
|
8494
8494
|
}
|
|
8495
8495
|
/** @private */
|
|
8496
8496
|
unmountIframe() {
|
|
8497
|
-
this._iframe &&
|
|
8497
|
+
this._iframe && Jl("file-selected", this._iframe.contentWindow), this.ref.iframeWrapper.innerHTML = "", this._iframe = null, this.$.selectedList = [], this.$.counter = 0;
|
|
8498
8498
|
}
|
|
8499
8499
|
}
|
|
8500
8500
|
sr.template = /* HTML */
|
|
@@ -8568,7 +8568,7 @@ oi.template = /* HTML */
|
|
|
8568
8568
|
<slot></slot>
|
|
8569
8569
|
</div>
|
|
8570
8570
|
`;
|
|
8571
|
-
class
|
|
8571
|
+
class Ql extends $ {
|
|
8572
8572
|
constructor() {
|
|
8573
8573
|
super(...arguments);
|
|
8574
8574
|
u(this, "requireCtxName", !0);
|
|
@@ -8623,7 +8623,7 @@ class ea extends $ {
|
|
|
8623
8623
|
);
|
|
8624
8624
|
}
|
|
8625
8625
|
}
|
|
8626
|
-
class
|
|
8626
|
+
class ea extends b {
|
|
8627
8627
|
}
|
|
8628
8628
|
class rr extends k {
|
|
8629
8629
|
constructor() {
|
|
@@ -8852,7 +8852,7 @@ oe.bindAttributes({
|
|
|
8852
8852
|
video: "video",
|
|
8853
8853
|
src: "src"
|
|
8854
8854
|
});
|
|
8855
|
-
const
|
|
8855
|
+
const ta = "css-src";
|
|
8856
8856
|
function li(s) {
|
|
8857
8857
|
return class extends s {
|
|
8858
8858
|
constructor() {
|
|
@@ -8882,7 +8882,7 @@ function li(s) {
|
|
|
8882
8882
|
initCallback() {
|
|
8883
8883
|
super.initCallback(), this.setAttribute("hidden", ""), Zi({
|
|
8884
8884
|
element: this,
|
|
8885
|
-
attribute:
|
|
8885
|
+
attribute: ta,
|
|
8886
8886
|
onSuccess: (e) => {
|
|
8887
8887
|
this.attachShadow({
|
|
8888
8888
|
mode: "open"
|
|
@@ -9049,7 +9049,7 @@ lr.template = /* HTML */
|
|
|
9049
9049
|
<lr-external-source></lr-external-source>
|
|
9050
9050
|
<lr-progress-bar></lr-progress-bar>
|
|
9051
9051
|
<lr-cloud-image-editor-activity></lr-cloud-image-editor-activity>`;
|
|
9052
|
-
class
|
|
9052
|
+
class ia extends li(Ne) {
|
|
9053
9053
|
shadowReadyCallback() {
|
|
9054
9054
|
this.__shadowReady = !0, this.$["*faderEl"] = this.ref["fader-el"], this.$["*cropperEl"] = this.ref["cropper-el"], this.$["*imgContainerEl"] = this.ref["img-container-el"], this.initEditor();
|
|
9055
9055
|
}
|
|
@@ -9064,7 +9064,7 @@ function Ke(s) {
|
|
|
9064
9064
|
}
|
|
9065
9065
|
}
|
|
9066
9066
|
const It = "LR";
|
|
9067
|
-
async function
|
|
9067
|
+
async function sa(s, i = !1) {
|
|
9068
9068
|
return new Promise((e, t) => {
|
|
9069
9069
|
if (typeof document != "object") {
|
|
9070
9070
|
e(null);
|
|
@@ -9086,13 +9086,13 @@ async function ra(s, i = !1) {
|
|
|
9086
9086
|
const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9087
9087
|
__proto__: null,
|
|
9088
9088
|
ActivityBlock: b,
|
|
9089
|
-
ActivityHeader:
|
|
9089
|
+
ActivityHeader: ea,
|
|
9090
9090
|
BaseComponent: ht,
|
|
9091
9091
|
Block: k,
|
|
9092
9092
|
CameraSource: zs,
|
|
9093
|
-
CloudImageEditor:
|
|
9094
|
-
CloudImageEditorActivity:
|
|
9095
|
-
CloudImageEditorBlock:
|
|
9093
|
+
CloudImageEditor: ia,
|
|
9094
|
+
CloudImageEditorActivity: Wl,
|
|
9095
|
+
CloudImageEditorBlock: Ne,
|
|
9096
9096
|
Config: As,
|
|
9097
9097
|
ConfirmationDialog: js,
|
|
9098
9098
|
Copyright: or,
|
|
@@ -9102,7 +9102,7 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9102
9102
|
EditorCropButtonControl: Xs,
|
|
9103
9103
|
EditorFilterControl: si,
|
|
9104
9104
|
EditorImageCropper: Js,
|
|
9105
|
-
EditorImageFader:
|
|
9105
|
+
EditorImageFader: Vl,
|
|
9106
9106
|
EditorOperationControl: Ys,
|
|
9107
9107
|
EditorScroller: Zs,
|
|
9108
9108
|
EditorSlider: Ks,
|
|
@@ -9113,9 +9113,9 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9113
9113
|
FileUploaderInline: lr,
|
|
9114
9114
|
FileUploaderMinimal: Ct,
|
|
9115
9115
|
FileUploaderRegular: ci,
|
|
9116
|
-
FormInput:
|
|
9116
|
+
FormInput: Ql,
|
|
9117
9117
|
Icon: Yt,
|
|
9118
|
-
Img:
|
|
9118
|
+
Img: Wo,
|
|
9119
9119
|
LineLoaderUi: er,
|
|
9120
9120
|
LrBtnUi: ni,
|
|
9121
9121
|
Modal: ei,
|
|
@@ -9129,111 +9129,110 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9129
9129
|
SimpleBtn: Jt,
|
|
9130
9130
|
SliderUi: ir,
|
|
9131
9131
|
SourceBtn: Qt,
|
|
9132
|
-
SourceList:
|
|
9132
|
+
SourceList: Zo,
|
|
9133
9133
|
StartFrom: $s,
|
|
9134
9134
|
Tabs: oi,
|
|
9135
9135
|
UID: te,
|
|
9136
|
-
UploadCtxProvider:
|
|
9136
|
+
UploadCtxProvider: Ft,
|
|
9137
9137
|
UploadDetails: Bs,
|
|
9138
|
-
UploadList:
|
|
9138
|
+
UploadList: Ns,
|
|
9139
9139
|
UploaderBlock: $,
|
|
9140
9140
|
UrlSource: Ds,
|
|
9141
9141
|
Video: oe,
|
|
9142
|
-
connectBlocksFrom:
|
|
9142
|
+
connectBlocksFrom: sa,
|
|
9143
9143
|
registerBlocks: Ke,
|
|
9144
9144
|
shadowed: li,
|
|
9145
9145
|
toKebabCase: we
|
|
9146
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
9146
|
+
}, Symbol.toStringTag, { value: "Module" })), ra = /* @__PURE__ */ new Set([
|
|
9147
9147
|
"children",
|
|
9148
|
-
"localName",
|
|
9149
9148
|
"ref",
|
|
9150
9149
|
"style",
|
|
9151
9150
|
"className"
|
|
9152
|
-
]),
|
|
9151
|
+
]), na = (s = {}) => Object == null ? void 0 : Object.keys(s).reduce((i, e) => {
|
|
9152
|
+
var t, r;
|
|
9153
|
+
const n = s == null ? void 0 : s[e], o = `on${(r = (t = n == null ? void 0 : n.split("-")) == null ? void 0 : t.map((l) => l.charAt(0).toUpperCase() + l.slice(1))) == null ? void 0 : r.join("")}`;
|
|
9154
|
+
return i[o] = n, i;
|
|
9155
|
+
}, {}), Bi = /* @__PURE__ */ new WeakMap(), oa = (s) => {
|
|
9153
9156
|
let i = Bi.get(s);
|
|
9154
9157
|
return i || (i = /* @__PURE__ */ new Map(), Bi.set(s, i)), i;
|
|
9155
|
-
},
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9158
|
+
}, ji = ({
|
|
9159
|
+
node: s,
|
|
9160
|
+
nameProp: i,
|
|
9161
|
+
valueProp: e,
|
|
9162
|
+
prevValueProp: t,
|
|
9163
|
+
event: r
|
|
9164
|
+
}) => {
|
|
9165
|
+
if (r !== void 0 && e !== t) {
|
|
9166
|
+
const n = oa(s), o = n.has(r);
|
|
9167
|
+
if (e) {
|
|
9168
|
+
const l = {
|
|
9169
|
+
handleEvent: e
|
|
9170
|
+
};
|
|
9171
|
+
o || s.addEventListener(r, l), n.set(r, l);
|
|
9172
|
+
} else if (o) {
|
|
9173
|
+
const l = n.get(r);
|
|
9174
|
+
s.removeEventListener(r, l), n.delete(r);
|
|
9175
|
+
}
|
|
9168
9176
|
return;
|
|
9169
9177
|
}
|
|
9170
9178
|
s[i] = e, e == null && i in HTMLElement.prototype && s.removeAttribute(i);
|
|
9171
|
-
},
|
|
9172
|
-
var t, r;
|
|
9173
|
-
const n = s == null ? void 0 : s[e], o = `on${(r = (t = n == null ? void 0 : n.split("-")) == null ? void 0 : t.map((l) => l.charAt(0).toUpperCase() + l.slice(1))) == null ? void 0 : r.join("")}`;
|
|
9174
|
-
return i[o] = n, i;
|
|
9175
|
-
}, {}), ca = (s, i) => {
|
|
9176
|
-
ar.forEach((e) => {
|
|
9177
|
-
e in i.prototype && !(e in HTMLElement.prototype) && console.warn(
|
|
9178
|
-
`${s} contains property ${e} which is a React reserved property.`
|
|
9179
|
-
);
|
|
9180
|
-
});
|
|
9181
|
-
}, ha = (s, i, e) => {
|
|
9179
|
+
}, la = (s, i, e) => {
|
|
9182
9180
|
const t = {}, r = {};
|
|
9183
9181
|
return Object.entries(s).forEach(([n, o]) => {
|
|
9184
|
-
|
|
9185
|
-
}), { reactProps: t,
|
|
9182
|
+
ra.has(n) ? t[n === "className" ? "class" : n] = o : i.has(n) || n in e.prototype ? r[n] = o : t[n] = o;
|
|
9183
|
+
}), { reactProps: t, customElProps: r };
|
|
9186
9184
|
}, Ye = ({
|
|
9187
9185
|
react: s,
|
|
9188
9186
|
// https://react.dev/warnings/invalid-hook-call-warning
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
schema: r
|
|
9187
|
+
tag: i,
|
|
9188
|
+
elClass: e,
|
|
9189
|
+
schemaEvents: t
|
|
9193
9190
|
}) => {
|
|
9194
|
-
const
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
(
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9191
|
+
const r = na(t), n = new Set(Object.keys(r ?? {})), o = s.forwardRef(
|
|
9192
|
+
(l, a) => {
|
|
9193
|
+
const c = s.useRef(/* @__PURE__ */ new Map()), h = s.useRef(null), { reactProps: d, customElProps: f } = la(l, n, e);
|
|
9194
|
+
return s.useLayoutEffect(() => {
|
|
9195
|
+
if (h.current === null)
|
|
9196
|
+
return;
|
|
9197
|
+
const m = /* @__PURE__ */ new Map();
|
|
9198
|
+
for (const p in f)
|
|
9199
|
+
ji({
|
|
9200
|
+
node: h.current,
|
|
9201
|
+
nameProp: p,
|
|
9202
|
+
valueProp: f[p],
|
|
9203
|
+
prevValueProp: c.current.get(p),
|
|
9204
|
+
event: r[p]
|
|
9205
|
+
}), c.current.delete(p), m.set(p, l[p]);
|
|
9206
|
+
for (const [p, g] of c.current)
|
|
9207
|
+
ji({
|
|
9208
|
+
node: h.current,
|
|
9209
|
+
nameProp: p,
|
|
9210
|
+
valueProp: void 0,
|
|
9211
|
+
prevValueProp: g,
|
|
9212
|
+
event: r[p]
|
|
9213
|
+
});
|
|
9214
|
+
c.current = m;
|
|
9215
|
+
}), s.createElement(i ?? e.__tag, {
|
|
9216
|
+
...d,
|
|
9217
|
+
ref: s.useCallback(
|
|
9218
|
+
(m) => {
|
|
9219
|
+
h.current = m, typeof a == "function" ? a(m) : a !== null && (a.current = m);
|
|
9220
|
+
},
|
|
9221
|
+
[a]
|
|
9222
|
+
)
|
|
9223
|
+
});
|
|
9224
|
+
}
|
|
9225
|
+
);
|
|
9226
|
+
return o.displayName = e.name, o;
|
|
9228
9227
|
}, ui = Ye({
|
|
9229
9228
|
react: I,
|
|
9230
|
-
|
|
9231
|
-
|
|
9229
|
+
tag: "lr-config",
|
|
9230
|
+
elClass: As
|
|
9232
9231
|
}), di = Ye({
|
|
9233
9232
|
react: I,
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9233
|
+
tag: "lr-upload-ctx-provider",
|
|
9234
|
+
elClass: Ft,
|
|
9235
|
+
schemaEvents: Ft.EventType
|
|
9237
9236
|
}), fi = (s) => `https://cdn.jsdelivr.net/npm/@uploadcare/blocks@${bt}/web/lr-file-uploader-${s}.min.css`, pi = (s) => {
|
|
9238
9237
|
const i = {}, e = {};
|
|
9239
9238
|
return Object.entries(s).forEach(([t, r]) => {
|
|
@@ -9244,85 +9243,101 @@ const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9244
9243
|
};
|
|
9245
9244
|
};
|
|
9246
9245
|
Ke(hi);
|
|
9247
|
-
const
|
|
9246
|
+
const aa = Ye({
|
|
9248
9247
|
react: I,
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
}),
|
|
9252
|
-
|
|
9253
|
-
|
|
9248
|
+
tag: "lr-file-uploader-regular",
|
|
9249
|
+
elClass: ci
|
|
9250
|
+
}), ca = fi("regular"), ya = ({
|
|
9251
|
+
ctxName: s,
|
|
9252
|
+
className: i,
|
|
9253
|
+
refUploadCtxProvider: e,
|
|
9254
|
+
...t
|
|
9254
9255
|
}) => {
|
|
9255
|
-
const
|
|
9256
|
-
() =>
|
|
9257
|
-
[
|
|
9256
|
+
const r = Pe(
|
|
9257
|
+
() => s ?? te.generate(),
|
|
9258
|
+
[s, te.generate]
|
|
9259
|
+
), { eventHandlers: n, config: o } = Pe(
|
|
9260
|
+
() => pi(t),
|
|
9261
|
+
[t]
|
|
9258
9262
|
);
|
|
9259
|
-
return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name":
|
|
9263
|
+
return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": r, ...o }), /* @__PURE__ */ I.createElement(
|
|
9260
9264
|
di,
|
|
9261
9265
|
{
|
|
9262
|
-
ref:
|
|
9263
|
-
"ctx-name":
|
|
9264
|
-
...
|
|
9266
|
+
ref: e,
|
|
9267
|
+
"ctx-name": r,
|
|
9268
|
+
...n
|
|
9265
9269
|
}
|
|
9266
9270
|
), /* @__PURE__ */ I.createElement(
|
|
9267
|
-
|
|
9271
|
+
aa,
|
|
9268
9272
|
{
|
|
9269
|
-
"ctx-name":
|
|
9270
|
-
"css-src":
|
|
9273
|
+
"ctx-name": r,
|
|
9274
|
+
"css-src": ca
|
|
9271
9275
|
}
|
|
9272
9276
|
));
|
|
9273
9277
|
};
|
|
9274
9278
|
Ke(hi);
|
|
9275
|
-
const
|
|
9279
|
+
const ha = Ye({
|
|
9276
9280
|
react: I,
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
}),
|
|
9280
|
-
|
|
9281
|
-
|
|
9281
|
+
tag: "lr-file-uploader-minimal",
|
|
9282
|
+
elClass: Ct
|
|
9283
|
+
}), ua = fi("minimal"), va = ({
|
|
9284
|
+
ctxName: s,
|
|
9285
|
+
className: i,
|
|
9286
|
+
refUploadCtxProvider: e,
|
|
9287
|
+
...t
|
|
9282
9288
|
}) => {
|
|
9283
|
-
const
|
|
9284
|
-
() =>
|
|
9285
|
-
[
|
|
9289
|
+
const r = Pe(
|
|
9290
|
+
() => s ?? te.generate(),
|
|
9291
|
+
[s, te.generate]
|
|
9292
|
+
), { eventHandlers: n, config: o } = Pe(
|
|
9293
|
+
() => pi(t),
|
|
9294
|
+
[t]
|
|
9286
9295
|
);
|
|
9287
|
-
return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name":
|
|
9296
|
+
return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": r, ...o }), /* @__PURE__ */ I.createElement(
|
|
9288
9297
|
di,
|
|
9289
9298
|
{
|
|
9290
|
-
ref:
|
|
9291
|
-
"ctx-name":
|
|
9292
|
-
...
|
|
9299
|
+
ref: e,
|
|
9300
|
+
"ctx-name": r,
|
|
9301
|
+
...n
|
|
9293
9302
|
}
|
|
9294
9303
|
), /* @__PURE__ */ I.createElement(
|
|
9295
|
-
|
|
9304
|
+
ha,
|
|
9296
9305
|
{
|
|
9297
|
-
"ctx-name":
|
|
9298
|
-
"css-src":
|
|
9306
|
+
"ctx-name": r,
|
|
9307
|
+
"css-src": ua
|
|
9299
9308
|
}
|
|
9300
9309
|
));
|
|
9301
9310
|
};
|
|
9302
9311
|
Ke(hi);
|
|
9303
|
-
const
|
|
9312
|
+
const da = Ye({
|
|
9304
9313
|
react: I,
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
}),
|
|
9308
|
-
|
|
9309
|
-
|
|
9314
|
+
tag: "lr-file-uploader-inline",
|
|
9315
|
+
elClass: Ct
|
|
9316
|
+
}), fa = fi("inline"), Ca = ({
|
|
9317
|
+
ctxName: s,
|
|
9318
|
+
className: i,
|
|
9319
|
+
refUploadCtxProvider: e,
|
|
9320
|
+
...t
|
|
9310
9321
|
}) => {
|
|
9311
|
-
const
|
|
9312
|
-
() =>
|
|
9313
|
-
[
|
|
9322
|
+
const r = Pe(
|
|
9323
|
+
() => s ?? te.generate(),
|
|
9324
|
+
[s, te.generate]
|
|
9325
|
+
), { eventHandlers: n, config: o } = Pe(
|
|
9326
|
+
() => pi(t),
|
|
9327
|
+
[t]
|
|
9314
9328
|
);
|
|
9315
|
-
return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name":
|
|
9329
|
+
return /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(ui, { "ctx-name": r, ...o }), /* @__PURE__ */ I.createElement(
|
|
9316
9330
|
di,
|
|
9317
9331
|
{
|
|
9318
|
-
ref:
|
|
9319
|
-
"ctx-name":
|
|
9320
|
-
...
|
|
9332
|
+
ref: e,
|
|
9333
|
+
"ctx-name": r,
|
|
9334
|
+
...n
|
|
9321
9335
|
}
|
|
9322
|
-
), /* @__PURE__ */ I.createElement(
|
|
9336
|
+
), /* @__PURE__ */ I.createElement(da, { "ctx-name": r, "css-src": fa }));
|
|
9323
9337
|
};
|
|
9324
9338
|
export {
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9339
|
+
Ca as FileUploaderInline,
|
|
9340
|
+
va as FileUploaderMinimal,
|
|
9341
|
+
ya as FileUploaderRegular,
|
|
9342
|
+
Ft as UploadCtxProvider
|
|
9328
9343
|
};
|