@oub/fusion 0.2.107 → 0.2.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fusion.js +652 -651
- package/dist/fusion.umd.cjs +5 -5
- package/package.json +4 -3
package/dist/fusion.js
CHANGED
|
@@ -14451,7 +14451,343 @@ function j0(e, t, a, r, n, o) {
|
|
|
14451
14451
|
], 8, q0);
|
|
14452
14452
|
}
|
|
14453
14453
|
const o2 = /* @__PURE__ */ he(E0, [["render", j0], ["__scopeId", "data-v-1a58f07d"]]);
|
|
14454
|
-
|
|
14454
|
+
class ao extends Error {
|
|
14455
|
+
constructor(a, r = null) {
|
|
14456
|
+
super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");
|
|
14457
|
+
Le(this, "cause");
|
|
14458
|
+
Le(this, "isNetworkError");
|
|
14459
|
+
Le(this, "request");
|
|
14460
|
+
this.cause = a, this.isNetworkError = !0, this.request = r;
|
|
14461
|
+
}
|
|
14462
|
+
}
|
|
14463
|
+
var ca, Oa, pn, xa;
|
|
14464
|
+
class X0 {
|
|
14465
|
+
constructor(t, a) {
|
|
14466
|
+
Ie(this, ca);
|
|
14467
|
+
Ie(this, Oa, !1);
|
|
14468
|
+
Ie(this, pn);
|
|
14469
|
+
Ie(this, xa);
|
|
14470
|
+
We(this, xa, t), We(this, pn, () => a(t));
|
|
14471
|
+
}
|
|
14472
|
+
progress() {
|
|
14473
|
+
W(this, Oa) || W(this, xa) > 0 && (clearTimeout(W(this, ca)), We(this, ca, setTimeout(W(this, pn), W(this, xa))));
|
|
14474
|
+
}
|
|
14475
|
+
done() {
|
|
14476
|
+
W(this, Oa) || (clearTimeout(W(this, ca)), We(this, ca, void 0), We(this, Oa, !0));
|
|
14477
|
+
}
|
|
14478
|
+
}
|
|
14479
|
+
ca = new WeakMap(), Oa = new WeakMap(), pn = new WeakMap(), xa = new WeakMap();
|
|
14480
|
+
const On = () => {
|
|
14481
|
+
};
|
|
14482
|
+
function W0(e, t = {}) {
|
|
14483
|
+
const { body: a = null, headers: r = {}, method: n = "GET", onBeforeRequest: o = On, onUploadProgress: s = On, shouldRetry: i = () => !0, onAfterResponse: l = On, onTimeout: u = On, responseType: p, retries: f = 3, signal: m = null, timeout: b = 3e4, withCredentials: A = !1 } = t, B = (F) => 0.3 * 2 ** (F - 1) * 1e3, E = new X0(b, u);
|
|
14484
|
+
function O(F = 0) {
|
|
14485
|
+
return new Promise(async (Y, D) => {
|
|
14486
|
+
const L = new XMLHttpRequest(), J = (Q) => {
|
|
14487
|
+
i(L) && F < f ? setTimeout(() => {
|
|
14488
|
+
O(F + 1).then(Y, D);
|
|
14489
|
+
}, B(F)) : (E.done(), D(Q));
|
|
14490
|
+
};
|
|
14491
|
+
L.open(n, e, !0), L.withCredentials = A, p && (L.responseType = p), m == null || m.addEventListener("abort", () => {
|
|
14492
|
+
L.abort(), D(new DOMException("Aborted", "AbortError"));
|
|
14493
|
+
}), L.onload = async () => {
|
|
14494
|
+
try {
|
|
14495
|
+
await l(L, F);
|
|
14496
|
+
} catch (Q) {
|
|
14497
|
+
Q.request = L, J(Q);
|
|
14498
|
+
return;
|
|
14499
|
+
}
|
|
14500
|
+
L.status >= 200 && L.status < 300 ? (E.done(), Y(L)) : i(L) && F < f ? setTimeout(() => {
|
|
14501
|
+
O(F + 1).then(Y, D);
|
|
14502
|
+
}, B(F)) : (E.done(), D(new ao(L.statusText, L)));
|
|
14503
|
+
}, L.onerror = () => J(new ao(L.statusText, L)), L.upload.onprogress = (Q) => {
|
|
14504
|
+
E.progress(), s(Q);
|
|
14505
|
+
}, r && Object.keys(r).forEach((Q) => {
|
|
14506
|
+
L.setRequestHeader(Q, r[Q]);
|
|
14507
|
+
}), await o(L, F), L.send(a);
|
|
14508
|
+
});
|
|
14509
|
+
}
|
|
14510
|
+
return O();
|
|
14511
|
+
}
|
|
14512
|
+
function K0(e) {
|
|
14513
|
+
const t = (a) => "error" in a && !!a.error;
|
|
14514
|
+
return e.filter((a) => !t(a));
|
|
14515
|
+
}
|
|
14516
|
+
function G0(e) {
|
|
14517
|
+
return e.filter((t) => {
|
|
14518
|
+
var a;
|
|
14519
|
+
return !((a = t.progress) != null && a.uploadStarted) || !t.isRestored;
|
|
14520
|
+
});
|
|
14521
|
+
}
|
|
14522
|
+
function tl(e) {
|
|
14523
|
+
const t = e.lastIndexOf(".");
|
|
14524
|
+
return t === -1 || t === e.length - 1 ? {
|
|
14525
|
+
name: e,
|
|
14526
|
+
extension: void 0
|
|
14527
|
+
} : {
|
|
14528
|
+
name: e.slice(0, t),
|
|
14529
|
+
extension: e.slice(t + 1)
|
|
14530
|
+
};
|
|
14531
|
+
}
|
|
14532
|
+
const Ps = {
|
|
14533
|
+
__proto__: null,
|
|
14534
|
+
md: "text/markdown",
|
|
14535
|
+
markdown: "text/markdown",
|
|
14536
|
+
mp4: "video/mp4",
|
|
14537
|
+
mp3: "audio/mp3",
|
|
14538
|
+
svg: "image/svg+xml",
|
|
14539
|
+
jpg: "image/jpeg",
|
|
14540
|
+
png: "image/png",
|
|
14541
|
+
webp: "image/webp",
|
|
14542
|
+
gif: "image/gif",
|
|
14543
|
+
heic: "image/heic",
|
|
14544
|
+
heif: "image/heif",
|
|
14545
|
+
yaml: "text/yaml",
|
|
14546
|
+
yml: "text/yaml",
|
|
14547
|
+
csv: "text/csv",
|
|
14548
|
+
tsv: "text/tab-separated-values",
|
|
14549
|
+
tab: "text/tab-separated-values",
|
|
14550
|
+
avi: "video/x-msvideo",
|
|
14551
|
+
mks: "video/x-matroska",
|
|
14552
|
+
mkv: "video/x-matroska",
|
|
14553
|
+
mov: "video/quicktime",
|
|
14554
|
+
dicom: "application/dicom",
|
|
14555
|
+
doc: "application/msword",
|
|
14556
|
+
msg: "application/vnd.ms-outlook",
|
|
14557
|
+
docm: "application/vnd.ms-word.document.macroenabled.12",
|
|
14558
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
14559
|
+
dot: "application/msword",
|
|
14560
|
+
dotm: "application/vnd.ms-word.template.macroenabled.12",
|
|
14561
|
+
dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
|
|
14562
|
+
xla: "application/vnd.ms-excel",
|
|
14563
|
+
xlam: "application/vnd.ms-excel.addin.macroenabled.12",
|
|
14564
|
+
xlc: "application/vnd.ms-excel",
|
|
14565
|
+
xlf: "application/x-xliff+xml",
|
|
14566
|
+
xlm: "application/vnd.ms-excel",
|
|
14567
|
+
xls: "application/vnd.ms-excel",
|
|
14568
|
+
xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
|
|
14569
|
+
xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
|
|
14570
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
14571
|
+
xlt: "application/vnd.ms-excel",
|
|
14572
|
+
xltm: "application/vnd.ms-excel.template.macroenabled.12",
|
|
14573
|
+
xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
14574
|
+
xlw: "application/vnd.ms-excel",
|
|
14575
|
+
txt: "text/plain",
|
|
14576
|
+
text: "text/plain",
|
|
14577
|
+
conf: "text/plain",
|
|
14578
|
+
log: "text/plain",
|
|
14579
|
+
pdf: "application/pdf",
|
|
14580
|
+
zip: "application/zip",
|
|
14581
|
+
"7z": "application/x-7z-compressed",
|
|
14582
|
+
rar: "application/x-rar-compressed",
|
|
14583
|
+
tar: "application/x-tar",
|
|
14584
|
+
gz: "application/gzip",
|
|
14585
|
+
dmg: "application/x-apple-diskimage"
|
|
14586
|
+
};
|
|
14587
|
+
function al(e) {
|
|
14588
|
+
var a;
|
|
14589
|
+
if (e.type)
|
|
14590
|
+
return e.type;
|
|
14591
|
+
const t = e.name ? (a = tl(e.name).extension) == null ? void 0 : a.toLowerCase() : null;
|
|
14592
|
+
return t && t in Ps ? Ps[t] : "application/octet-stream";
|
|
14593
|
+
}
|
|
14594
|
+
function Z0(e) {
|
|
14595
|
+
return e.charCodeAt(0).toString(32);
|
|
14596
|
+
}
|
|
14597
|
+
function Fs(e) {
|
|
14598
|
+
let t = "";
|
|
14599
|
+
return e.replace(/[^A-Z0-9]/gi, (a) => (t += `-${Z0(a)}`, "/")) + t;
|
|
14600
|
+
}
|
|
14601
|
+
function _0(e, t) {
|
|
14602
|
+
let a = t || "uppy";
|
|
14603
|
+
return typeof e.name == "string" && (a += `-${Fs(e.name.toLowerCase())}`), e.type !== void 0 && (a += `-${e.type}`), e.meta && typeof e.meta.relativePath == "string" && (a += `-${Fs(e.meta.relativePath.toLowerCase())}`), e.data.size !== void 0 && (a += `-${e.data.size}`), e.data.lastModified !== void 0 && (a += `-${e.data.lastModified}`), a;
|
|
14604
|
+
}
|
|
14605
|
+
function $0(e) {
|
|
14606
|
+
return !e.isRemote || !e.remote ? !1 : (/* @__PURE__ */ new Set([
|
|
14607
|
+
"box",
|
|
14608
|
+
"dropbox",
|
|
14609
|
+
"drive",
|
|
14610
|
+
"facebook",
|
|
14611
|
+
"unsplash"
|
|
14612
|
+
])).has(e.remote.provider);
|
|
14613
|
+
}
|
|
14614
|
+
function ey(e, t) {
|
|
14615
|
+
if ($0(e))
|
|
14616
|
+
return e.id;
|
|
14617
|
+
const a = al(e);
|
|
14618
|
+
return _0({
|
|
14619
|
+
...e,
|
|
14620
|
+
type: a
|
|
14621
|
+
}, t);
|
|
14622
|
+
}
|
|
14623
|
+
function Ds(e, t) {
|
|
14624
|
+
return e === !0 ? Object.keys(t) : Array.isArray(e) ? e : [];
|
|
14625
|
+
}
|
|
14626
|
+
function wr(e) {
|
|
14627
|
+
return e < 10 ? `0${e}` : e.toString();
|
|
14628
|
+
}
|
|
14629
|
+
function Vn() {
|
|
14630
|
+
const e = /* @__PURE__ */ new Date(), t = wr(e.getHours()), a = wr(e.getMinutes()), r = wr(e.getSeconds());
|
|
14631
|
+
return `${t}:${a}:${r}`;
|
|
14632
|
+
}
|
|
14633
|
+
function ty(e) {
|
|
14634
|
+
return e ? e.readyState !== 0 && e.readyState !== 4 || e.status === 0 : !1;
|
|
14635
|
+
}
|
|
14636
|
+
function ay(e) {
|
|
14637
|
+
return new Error("Cancelled", { cause: e });
|
|
14638
|
+
}
|
|
14639
|
+
function Bs(e) {
|
|
14640
|
+
var t;
|
|
14641
|
+
if (e != null) {
|
|
14642
|
+
const a = () => this.abort(e.reason);
|
|
14643
|
+
e.addEventListener("abort", a, { once: !0 });
|
|
14644
|
+
const r = () => {
|
|
14645
|
+
e.removeEventListener("abort", a);
|
|
14646
|
+
};
|
|
14647
|
+
(t = this.then) == null || t.call(this, r, r);
|
|
14648
|
+
}
|
|
14649
|
+
return this;
|
|
14650
|
+
}
|
|
14651
|
+
var Yt, Vt, jt, Ua, Lt, Ia, pa, ut, no, _a, nl, rl, ol, zn, Ma;
|
|
14652
|
+
class ny {
|
|
14653
|
+
constructor(t) {
|
|
14654
|
+
Ie(this, ut);
|
|
14655
|
+
Ie(this, Yt, 0);
|
|
14656
|
+
Ie(this, Vt, []);
|
|
14657
|
+
Ie(this, jt, !1);
|
|
14658
|
+
Ie(this, Ua);
|
|
14659
|
+
Ie(this, Lt, 1);
|
|
14660
|
+
Ie(this, Ia);
|
|
14661
|
+
Ie(this, pa);
|
|
14662
|
+
Le(this, "limit");
|
|
14663
|
+
Ie(this, zn, () => this.resume());
|
|
14664
|
+
Ie(this, Ma, () => {
|
|
14665
|
+
if (W(this, jt)) {
|
|
14666
|
+
We(this, pa, setTimeout(W(this, Ma), 0));
|
|
14667
|
+
return;
|
|
14668
|
+
}
|
|
14669
|
+
We(this, Lt, this.limit), this.limit = Math.ceil((W(this, Ia) + W(this, Lt)) / 2);
|
|
14670
|
+
for (let t = W(this, Lt); t <= this.limit; t++)
|
|
14671
|
+
Ae(this, ut, _a).call(this);
|
|
14672
|
+
W(this, Ia) - W(this, Lt) > 3 ? We(this, pa, setTimeout(W(this, Ma), 2e3)) : We(this, Lt, Math.floor(W(this, Lt) / 2));
|
|
14673
|
+
});
|
|
14674
|
+
typeof t != "number" || t === 0 ? this.limit = 1 / 0 : this.limit = t;
|
|
14675
|
+
}
|
|
14676
|
+
run(t, a) {
|
|
14677
|
+
return !W(this, jt) && W(this, Yt) < this.limit ? Ae(this, ut, no).call(this, t) : Ae(this, ut, rl).call(this, t, a);
|
|
14678
|
+
}
|
|
14679
|
+
wrapSyncFunction(t, a) {
|
|
14680
|
+
return (...r) => {
|
|
14681
|
+
const n = this.run(() => (t(...r), queueMicrotask(() => n.done()), () => {
|
|
14682
|
+
}), a);
|
|
14683
|
+
return {
|
|
14684
|
+
abortOn: Bs,
|
|
14685
|
+
abort() {
|
|
14686
|
+
n.abort();
|
|
14687
|
+
}
|
|
14688
|
+
};
|
|
14689
|
+
};
|
|
14690
|
+
}
|
|
14691
|
+
wrapPromiseFunction(t, a) {
|
|
14692
|
+
return (...r) => {
|
|
14693
|
+
let n;
|
|
14694
|
+
const o = new Promise((s, i) => {
|
|
14695
|
+
n = this.run(() => {
|
|
14696
|
+
let l, u;
|
|
14697
|
+
try {
|
|
14698
|
+
u = Promise.resolve(t(...r));
|
|
14699
|
+
} catch (p) {
|
|
14700
|
+
u = Promise.reject(p);
|
|
14701
|
+
}
|
|
14702
|
+
return u.then((p) => {
|
|
14703
|
+
l ? i(l) : (n.done(), s(p));
|
|
14704
|
+
}, (p) => {
|
|
14705
|
+
l ? i(l) : (n.done(), i(p));
|
|
14706
|
+
}), (p) => {
|
|
14707
|
+
l = ay(p);
|
|
14708
|
+
};
|
|
14709
|
+
}, a);
|
|
14710
|
+
});
|
|
14711
|
+
return o.abort = (s) => {
|
|
14712
|
+
n.abort(s);
|
|
14713
|
+
}, o.abortOn = Bs, o;
|
|
14714
|
+
};
|
|
14715
|
+
}
|
|
14716
|
+
resume() {
|
|
14717
|
+
We(this, jt, !1), clearTimeout(W(this, Ua));
|
|
14718
|
+
for (let t = 0; t < this.limit; t++)
|
|
14719
|
+
Ae(this, ut, _a).call(this);
|
|
14720
|
+
}
|
|
14721
|
+
/**
|
|
14722
|
+
* Freezes the queue for a while or indefinitely.
|
|
14723
|
+
*
|
|
14724
|
+
* @param {number | null } [duration] Duration for the pause to happen, in milliseconds.
|
|
14725
|
+
* If omitted, the queue won't resume automatically.
|
|
14726
|
+
*/
|
|
14727
|
+
pause(t = null) {
|
|
14728
|
+
We(this, jt, !0), clearTimeout(W(this, Ua)), t != null && We(this, Ua, setTimeout(W(this, zn), t));
|
|
14729
|
+
}
|
|
14730
|
+
/**
|
|
14731
|
+
* Pauses the queue for a duration, and lower the limit of concurrent requests
|
|
14732
|
+
* when the queue resumes. When the queue resumes, it tries to progressively
|
|
14733
|
+
* increase the limit in `this.#increaseLimit` until another call is made to
|
|
14734
|
+
* `this.rateLimit`.
|
|
14735
|
+
* Call this function when using the RateLimitedQueue for network requests and
|
|
14736
|
+
* the remote server responds with 429 HTTP code.
|
|
14737
|
+
*
|
|
14738
|
+
* @param {number} duration in milliseconds.
|
|
14739
|
+
*/
|
|
14740
|
+
rateLimit(t) {
|
|
14741
|
+
clearTimeout(W(this, pa)), this.pause(t), this.limit > 1 && Number.isFinite(this.limit) && (We(this, Ia, this.limit - 1), this.limit = W(this, Lt), We(this, pa, setTimeout(W(this, Ma), t)));
|
|
14742
|
+
}
|
|
14743
|
+
get isPaused() {
|
|
14744
|
+
return W(this, jt);
|
|
14745
|
+
}
|
|
14746
|
+
}
|
|
14747
|
+
Yt = new WeakMap(), Vt = new WeakMap(), jt = new WeakMap(), Ua = new WeakMap(), Lt = new WeakMap(), Ia = new WeakMap(), pa = new WeakMap(), ut = new WeakSet(), no = function(t) {
|
|
14748
|
+
We(this, Yt, W(this, Yt) + 1);
|
|
14749
|
+
let a = !1, r;
|
|
14750
|
+
try {
|
|
14751
|
+
r = t();
|
|
14752
|
+
} catch (n) {
|
|
14753
|
+
throw We(this, Yt, W(this, Yt) - 1), n;
|
|
14754
|
+
}
|
|
14755
|
+
return {
|
|
14756
|
+
abort: (n) => {
|
|
14757
|
+
a || (a = !0, We(this, Yt, W(this, Yt) - 1), r == null || r(n), Ae(this, ut, _a).call(this));
|
|
14758
|
+
},
|
|
14759
|
+
done: () => {
|
|
14760
|
+
a || (a = !0, We(this, Yt, W(this, Yt) - 1), Ae(this, ut, _a).call(this));
|
|
14761
|
+
}
|
|
14762
|
+
};
|
|
14763
|
+
}, _a = function() {
|
|
14764
|
+
queueMicrotask(() => Ae(this, ut, nl).call(this));
|
|
14765
|
+
}, nl = function() {
|
|
14766
|
+
if (W(this, jt) || W(this, Yt) >= this.limit || W(this, Vt).length === 0)
|
|
14767
|
+
return;
|
|
14768
|
+
const t = W(this, Vt).shift();
|
|
14769
|
+
if (t == null)
|
|
14770
|
+
throw new Error("Invariant violation: next is null");
|
|
14771
|
+
const a = Ae(this, ut, no).call(this, t.fn);
|
|
14772
|
+
t.abort = a.abort, t.done = a.done;
|
|
14773
|
+
}, rl = function(t, a) {
|
|
14774
|
+
const r = {
|
|
14775
|
+
fn: t,
|
|
14776
|
+
priority: (a == null ? void 0 : a.priority) || 0,
|
|
14777
|
+
abort: () => {
|
|
14778
|
+
Ae(this, ut, ol).call(this, r);
|
|
14779
|
+
},
|
|
14780
|
+
done: () => {
|
|
14781
|
+
throw new Error("Cannot mark a queued request as done: this indicates a bug");
|
|
14782
|
+
}
|
|
14783
|
+
}, n = W(this, Vt).findIndex((o) => r.priority > o.priority);
|
|
14784
|
+
return n === -1 ? W(this, Vt).push(r) : W(this, Vt).splice(n, 0, r), r;
|
|
14785
|
+
}, ol = function(t) {
|
|
14786
|
+
const a = W(this, Vt).indexOf(t);
|
|
14787
|
+
a !== -1 && W(this, Vt).splice(a, 1);
|
|
14788
|
+
}, zn = new WeakMap(), Ma = new WeakMap();
|
|
14789
|
+
const Cr = Symbol("__queue");
|
|
14790
|
+
function ry(e, t, a) {
|
|
14455
14791
|
const r = [];
|
|
14456
14792
|
return e.forEach((n) => typeof n != "string" ? r.push(n) : t[Symbol.split](n).forEach((o, s, i) => {
|
|
14457
14793
|
o !== "" && r.push(o), s < i.length - 1 && r.push(a);
|
|
@@ -14467,7 +14803,7 @@ function X0(e, t, a) {
|
|
|
14467
14803
|
* @param phrase that needs interpolation, with placeholders
|
|
14468
14804
|
* @param options with values that will be used to replace placeholders
|
|
14469
14805
|
*/
|
|
14470
|
-
function
|
|
14806
|
+
function Os(e, t) {
|
|
14471
14807
|
const a = /\$/g, r = "$$$$";
|
|
14472
14808
|
let n = [e];
|
|
14473
14809
|
if (t == null)
|
|
@@ -14475,25 +14811,25 @@ function Ps(e, t) {
|
|
|
14475
14811
|
for (const o of Object.keys(t))
|
|
14476
14812
|
if (o !== "_") {
|
|
14477
14813
|
let s = t[o];
|
|
14478
|
-
typeof s == "string" && (s = a[Symbol.replace](s, r)), n =
|
|
14814
|
+
typeof s == "string" && (s = a[Symbol.replace](s, r)), n = ry(n, new RegExp(`%\\{${o}\\}`, "g"), s);
|
|
14479
14815
|
}
|
|
14480
14816
|
return n;
|
|
14481
14817
|
}
|
|
14482
|
-
const
|
|
14818
|
+
const oy = (e) => {
|
|
14483
14819
|
throw new Error(`missing string: ${e}`);
|
|
14484
14820
|
};
|
|
14485
|
-
var
|
|
14486
|
-
class
|
|
14487
|
-
constructor(t, { onMissingKey: a =
|
|
14488
|
-
Ie(this,
|
|
14821
|
+
var fn, hn, ro;
|
|
14822
|
+
class sl {
|
|
14823
|
+
constructor(t, { onMissingKey: a = oy } = {}) {
|
|
14824
|
+
Ie(this, hn);
|
|
14489
14825
|
Le(this, "locale");
|
|
14490
|
-
Ie(this,
|
|
14826
|
+
Ie(this, fn);
|
|
14491
14827
|
this.locale = {
|
|
14492
14828
|
strings: {},
|
|
14493
14829
|
pluralize(r) {
|
|
14494
14830
|
return r === 1 ? 0 : 1;
|
|
14495
14831
|
}
|
|
14496
|
-
}, Array.isArray(t) ? t.forEach(Ae(this,
|
|
14832
|
+
}, Array.isArray(t) ? t.forEach(Ae(this, hn, ro), this) : Ae(this, hn, ro).call(this, t), We(this, fn, a);
|
|
14497
14833
|
}
|
|
14498
14834
|
/**
|
|
14499
14835
|
* Public translate method
|
|
@@ -14512,19 +14848,19 @@ class tl {
|
|
|
14512
14848
|
*/
|
|
14513
14849
|
translateArray(t, a) {
|
|
14514
14850
|
let r = this.locale.strings[t];
|
|
14515
|
-
if (r == null && (W(this,
|
|
14851
|
+
if (r == null && (W(this, fn).call(this, t), r = t), typeof r == "object") {
|
|
14516
14852
|
if (a && typeof a.smart_count < "u") {
|
|
14517
14853
|
const o = this.locale.pluralize(a.smart_count);
|
|
14518
|
-
return
|
|
14854
|
+
return Os(r[o], a);
|
|
14519
14855
|
}
|
|
14520
14856
|
throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}");
|
|
14521
14857
|
}
|
|
14522
14858
|
if (typeof r != "string")
|
|
14523
14859
|
throw new Error("string was not a string");
|
|
14524
|
-
return
|
|
14860
|
+
return Os(r, a);
|
|
14525
14861
|
}
|
|
14526
14862
|
}
|
|
14527
|
-
|
|
14863
|
+
fn = new WeakMap(), hn = new WeakSet(), ro = function(t) {
|
|
14528
14864
|
if (!(t != null && t.strings))
|
|
14529
14865
|
return;
|
|
14530
14866
|
const a = this.locale;
|
|
@@ -14533,7 +14869,7 @@ pn = new WeakMap(), fn = new WeakSet(), ao = function(t) {
|
|
|
14533
14869
|
pluralize: t.pluralize || a.pluralize
|
|
14534
14870
|
});
|
|
14535
14871
|
};
|
|
14536
|
-
class
|
|
14872
|
+
class sy {
|
|
14537
14873
|
constructor(t, a) {
|
|
14538
14874
|
Le(this, "uppy");
|
|
14539
14875
|
Le(this, "opts");
|
|
@@ -14565,7 +14901,7 @@ class K0 {
|
|
|
14565
14901
|
this.opts = { ...this.opts, ...t }, this.setPluginState(void 0), this.i18nInit();
|
|
14566
14902
|
}
|
|
14567
14903
|
i18nInit() {
|
|
14568
|
-
const t = new
|
|
14904
|
+
const t = new sl([
|
|
14569
14905
|
this.defaultLocale,
|
|
14570
14906
|
this.uppy.locale,
|
|
14571
14907
|
this.opts.locale
|
|
@@ -14591,223 +14927,171 @@ class K0 {
|
|
|
14591
14927
|
afterUpdate() {
|
|
14592
14928
|
}
|
|
14593
14929
|
}
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14930
|
+
var Nt, mn;
|
|
14931
|
+
class iy {
|
|
14932
|
+
constructor(t) {
|
|
14933
|
+
Ie(this, Nt);
|
|
14934
|
+
Ie(this, mn, []);
|
|
14935
|
+
We(this, Nt, t);
|
|
14936
|
+
}
|
|
14937
|
+
on(t, a) {
|
|
14938
|
+
return W(this, mn).push([t, a]), W(this, Nt).on(t, a);
|
|
14939
|
+
}
|
|
14940
|
+
remove() {
|
|
14941
|
+
for (const [t, a] of W(this, mn).splice(0))
|
|
14942
|
+
W(this, Nt).off(t, a);
|
|
14943
|
+
}
|
|
14944
|
+
onFilePause(t, a) {
|
|
14945
|
+
this.on("upload-pause", (r, n) => {
|
|
14946
|
+
t === (r == null ? void 0 : r.id) && a(n);
|
|
14947
|
+
});
|
|
14948
|
+
}
|
|
14949
|
+
onFileRemove(t, a) {
|
|
14950
|
+
this.on("file-removed", (r) => {
|
|
14951
|
+
t === r.id && a(r.id);
|
|
14952
|
+
});
|
|
14953
|
+
}
|
|
14954
|
+
onPause(t, a) {
|
|
14955
|
+
this.on("upload-pause", (r, n) => {
|
|
14956
|
+
t === (r == null ? void 0 : r.id) && a(n);
|
|
14957
|
+
});
|
|
14958
|
+
}
|
|
14959
|
+
onRetry(t, a) {
|
|
14960
|
+
this.on("upload-retry", (r) => {
|
|
14961
|
+
t === (r == null ? void 0 : r.id) && a();
|
|
14962
|
+
});
|
|
14963
|
+
}
|
|
14964
|
+
onRetryAll(t, a) {
|
|
14965
|
+
this.on("retry-all", () => {
|
|
14966
|
+
W(this, Nt).getFile(t) && a();
|
|
14967
|
+
});
|
|
14968
|
+
}
|
|
14969
|
+
onPauseAll(t, a) {
|
|
14970
|
+
this.on("pause-all", () => {
|
|
14971
|
+
W(this, Nt).getFile(t) && a();
|
|
14972
|
+
});
|
|
14973
|
+
}
|
|
14974
|
+
onCancelAll(t, a) {
|
|
14975
|
+
this.on("cancel-all", (...r) => {
|
|
14976
|
+
W(this, Nt).getFile(t) && a(...r);
|
|
14977
|
+
});
|
|
14978
|
+
}
|
|
14979
|
+
onResumeAll(t, a) {
|
|
14980
|
+
this.on("resume-all", () => {
|
|
14981
|
+
W(this, Nt).getFile(t) && a();
|
|
14982
|
+
});
|
|
14983
|
+
}
|
|
14600
14984
|
}
|
|
14601
|
-
|
|
14985
|
+
Nt = new WeakMap(), mn = new WeakMap();
|
|
14986
|
+
const ly = {
|
|
14602
14987
|
debug: () => {
|
|
14603
14988
|
},
|
|
14604
14989
|
warn: () => {
|
|
14605
14990
|
},
|
|
14606
14991
|
error: (...e) => console.error(`[Uppy] [${Vn()}]`, ...e)
|
|
14607
|
-
},
|
|
14992
|
+
}, uy = {
|
|
14608
14993
|
debug: (...e) => console.debug(`[Uppy] [${Vn()}]`, ...e),
|
|
14609
14994
|
warn: (...e) => console.warn(`[Uppy] [${Vn()}]`, ...e),
|
|
14610
14995
|
error: (...e) => console.error(`[Uppy] [${Vn()}]`, ...e)
|
|
14611
|
-
},
|
|
14612
|
-
version:
|
|
14996
|
+
}, dy = "5.0.0", cy = {
|
|
14997
|
+
version: dy
|
|
14613
14998
|
};
|
|
14614
|
-
var
|
|
14615
|
-
class
|
|
14999
|
+
var Va, Jn, ll;
|
|
15000
|
+
class il {
|
|
14616
15001
|
constructor() {
|
|
14617
|
-
Ie(this,
|
|
15002
|
+
Ie(this, Jn);
|
|
14618
15003
|
Le(this, "state", {});
|
|
14619
|
-
Ie(this,
|
|
15004
|
+
Ie(this, Va, /* @__PURE__ */ new Set());
|
|
14620
15005
|
}
|
|
14621
15006
|
getState() {
|
|
14622
15007
|
return this.state;
|
|
14623
15008
|
}
|
|
14624
15009
|
setState(t) {
|
|
14625
15010
|
const a = { ...this.state }, r = { ...this.state, ...t };
|
|
14626
|
-
this.state = r, Ae(this,
|
|
15011
|
+
this.state = r, Ae(this, Jn, ll).call(this, a, r, t);
|
|
14627
15012
|
}
|
|
14628
15013
|
subscribe(t) {
|
|
14629
|
-
return W(this,
|
|
14630
|
-
W(this,
|
|
15014
|
+
return W(this, Va).add(t), () => {
|
|
15015
|
+
W(this, Va).delete(t);
|
|
14631
15016
|
};
|
|
14632
15017
|
}
|
|
14633
15018
|
}
|
|
14634
|
-
|
|
14635
|
-
W(this,
|
|
15019
|
+
Va = new WeakMap(), Jn = new WeakSet(), ll = function(...t) {
|
|
15020
|
+
W(this, Va).forEach((a) => {
|
|
14636
15021
|
a(...t);
|
|
14637
15022
|
});
|
|
14638
|
-
}, Le(
|
|
14639
|
-
|
|
14640
|
-
const t = e.lastIndexOf(".");
|
|
14641
|
-
return t === -1 || t === e.length - 1 ? {
|
|
14642
|
-
name: e,
|
|
14643
|
-
extension: void 0
|
|
14644
|
-
} : {
|
|
14645
|
-
name: e.slice(0, t),
|
|
14646
|
-
extension: e.slice(t + 1)
|
|
14647
|
-
};
|
|
14648
|
-
}
|
|
14649
|
-
const Fs = {
|
|
14650
|
-
__proto__: null,
|
|
14651
|
-
md: "text/markdown",
|
|
14652
|
-
markdown: "text/markdown",
|
|
14653
|
-
mp4: "video/mp4",
|
|
14654
|
-
mp3: "audio/mp3",
|
|
14655
|
-
svg: "image/svg+xml",
|
|
14656
|
-
jpg: "image/jpeg",
|
|
14657
|
-
png: "image/png",
|
|
14658
|
-
webp: "image/webp",
|
|
14659
|
-
gif: "image/gif",
|
|
14660
|
-
heic: "image/heic",
|
|
14661
|
-
heif: "image/heif",
|
|
14662
|
-
yaml: "text/yaml",
|
|
14663
|
-
yml: "text/yaml",
|
|
14664
|
-
csv: "text/csv",
|
|
14665
|
-
tsv: "text/tab-separated-values",
|
|
14666
|
-
tab: "text/tab-separated-values",
|
|
14667
|
-
avi: "video/x-msvideo",
|
|
14668
|
-
mks: "video/x-matroska",
|
|
14669
|
-
mkv: "video/x-matroska",
|
|
14670
|
-
mov: "video/quicktime",
|
|
14671
|
-
dicom: "application/dicom",
|
|
14672
|
-
doc: "application/msword",
|
|
14673
|
-
msg: "application/vnd.ms-outlook",
|
|
14674
|
-
docm: "application/vnd.ms-word.document.macroenabled.12",
|
|
14675
|
-
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
14676
|
-
dot: "application/msword",
|
|
14677
|
-
dotm: "application/vnd.ms-word.template.macroenabled.12",
|
|
14678
|
-
dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
|
|
14679
|
-
xla: "application/vnd.ms-excel",
|
|
14680
|
-
xlam: "application/vnd.ms-excel.addin.macroenabled.12",
|
|
14681
|
-
xlc: "application/vnd.ms-excel",
|
|
14682
|
-
xlf: "application/x-xliff+xml",
|
|
14683
|
-
xlm: "application/vnd.ms-excel",
|
|
14684
|
-
xls: "application/vnd.ms-excel",
|
|
14685
|
-
xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
|
|
14686
|
-
xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
|
|
14687
|
-
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
14688
|
-
xlt: "application/vnd.ms-excel",
|
|
14689
|
-
xltm: "application/vnd.ms-excel.template.macroenabled.12",
|
|
14690
|
-
xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
14691
|
-
xlw: "application/vnd.ms-excel",
|
|
14692
|
-
txt: "text/plain",
|
|
14693
|
-
text: "text/plain",
|
|
14694
|
-
conf: "text/plain",
|
|
14695
|
-
log: "text/plain",
|
|
14696
|
-
pdf: "application/pdf",
|
|
14697
|
-
zip: "application/zip",
|
|
14698
|
-
"7z": "application/x-7z-compressed",
|
|
14699
|
-
rar: "application/x-rar-compressed",
|
|
14700
|
-
tar: "application/x-tar",
|
|
14701
|
-
gz: "application/gzip",
|
|
14702
|
-
dmg: "application/x-apple-diskimage"
|
|
14703
|
-
};
|
|
14704
|
-
function ol(e) {
|
|
14705
|
-
var a;
|
|
14706
|
-
if (e.type)
|
|
14707
|
-
return e.type;
|
|
14708
|
-
const t = e.name ? (a = rl(e.name).extension) == null ? void 0 : a.toLowerCase() : null;
|
|
14709
|
-
return t && t in Fs ? Fs[t] : "application/octet-stream";
|
|
14710
|
-
}
|
|
14711
|
-
function ey(e) {
|
|
14712
|
-
return e.charCodeAt(0).toString(32);
|
|
14713
|
-
}
|
|
14714
|
-
function Ds(e) {
|
|
14715
|
-
let t = "";
|
|
14716
|
-
return e.replace(/[^A-Z0-9]/gi, (a) => (t += `-${ey(a)}`, "/")) + t;
|
|
14717
|
-
}
|
|
14718
|
-
function ty(e, t) {
|
|
14719
|
-
let a = t || "uppy";
|
|
14720
|
-
return typeof e.name == "string" && (a += `-${Ds(e.name.toLowerCase())}`), e.type !== void 0 && (a += `-${e.type}`), e.meta && typeof e.meta.relativePath == "string" && (a += `-${Ds(e.meta.relativePath.toLowerCase())}`), e.data.size !== void 0 && (a += `-${e.data.size}`), e.data.lastModified !== void 0 && (a += `-${e.data.lastModified}`), a;
|
|
14721
|
-
}
|
|
14722
|
-
function ay(e) {
|
|
14723
|
-
return !e.isRemote || !e.remote ? !1 : (/* @__PURE__ */ new Set([
|
|
14724
|
-
"box",
|
|
14725
|
-
"dropbox",
|
|
14726
|
-
"drive",
|
|
14727
|
-
"facebook",
|
|
14728
|
-
"unsplash"
|
|
14729
|
-
])).has(e.remote.provider);
|
|
14730
|
-
}
|
|
14731
|
-
function ny(e, t) {
|
|
14732
|
-
if (ay(e))
|
|
14733
|
-
return e.id;
|
|
14734
|
-
const a = ol(e);
|
|
14735
|
-
return ty({
|
|
14736
|
-
...e,
|
|
14737
|
-
type: a
|
|
14738
|
-
}, t);
|
|
14739
|
-
}
|
|
14740
|
-
var On = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
15023
|
+
}, Le(il, "VERSION", cy.version);
|
|
15024
|
+
var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14741
15025
|
function _n(e) {
|
|
14742
15026
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
14743
15027
|
}
|
|
14744
|
-
var
|
|
15028
|
+
var Sr, xs;
|
|
14745
15029
|
function Xo() {
|
|
14746
|
-
if (
|
|
14747
|
-
|
|
15030
|
+
if (xs) return Sr;
|
|
15031
|
+
xs = 1;
|
|
14748
15032
|
function e(t) {
|
|
14749
15033
|
var a = typeof t;
|
|
14750
15034
|
return t != null && (a == "object" || a == "function");
|
|
14751
15035
|
}
|
|
14752
|
-
return Cr = e, Cr;
|
|
14753
|
-
}
|
|
14754
|
-
var Sr, Os;
|
|
14755
|
-
function ry() {
|
|
14756
|
-
if (Os) return Sr;
|
|
14757
|
-
Os = 1;
|
|
14758
|
-
var e = typeof On == "object" && On && On.Object === Object && On;
|
|
14759
15036
|
return Sr = e, Sr;
|
|
14760
15037
|
}
|
|
14761
|
-
var Tr,
|
|
14762
|
-
function
|
|
14763
|
-
if (
|
|
14764
|
-
xs = 1;
|
|
14765
|
-
var e = ry(), t = typeof self == "object" && self && self.Object === Object && self, a = e || t || Function("return this")();
|
|
14766
|
-
return Tr = a, Tr;
|
|
14767
|
-
}
|
|
14768
|
-
var Pr, Us;
|
|
14769
|
-
function oy() {
|
|
14770
|
-
if (Us) return Pr;
|
|
15038
|
+
var Tr, Us;
|
|
15039
|
+
function py() {
|
|
15040
|
+
if (Us) return Tr;
|
|
14771
15041
|
Us = 1;
|
|
14772
|
-
var e =
|
|
15042
|
+
var e = typeof xn == "object" && xn && xn.Object === Object && xn;
|
|
15043
|
+
return Tr = e, Tr;
|
|
15044
|
+
}
|
|
15045
|
+
var Pr, Is;
|
|
15046
|
+
function ul() {
|
|
15047
|
+
if (Is) return Pr;
|
|
15048
|
+
Is = 1;
|
|
15049
|
+
var e = py(), t = typeof self == "object" && self && self.Object === Object && self, a = e || t || Function("return this")();
|
|
15050
|
+
return Pr = a, Pr;
|
|
15051
|
+
}
|
|
15052
|
+
var Fr, Ms;
|
|
15053
|
+
function fy() {
|
|
15054
|
+
if (Ms) return Fr;
|
|
15055
|
+
Ms = 1;
|
|
15056
|
+
var e = ul(), t = function() {
|
|
14773
15057
|
return e.Date.now();
|
|
14774
15058
|
};
|
|
14775
|
-
return
|
|
15059
|
+
return Fr = t, Fr;
|
|
14776
15060
|
}
|
|
14777
|
-
var
|
|
14778
|
-
function
|
|
14779
|
-
if (
|
|
14780
|
-
|
|
15061
|
+
var Dr, Vs;
|
|
15062
|
+
function hy() {
|
|
15063
|
+
if (Vs) return Dr;
|
|
15064
|
+
Vs = 1;
|
|
14781
15065
|
var e = /\s/;
|
|
14782
15066
|
function t(a) {
|
|
14783
15067
|
for (var r = a.length; r-- && e.test(a.charAt(r)); )
|
|
14784
15068
|
;
|
|
14785
15069
|
return r;
|
|
14786
15070
|
}
|
|
14787
|
-
return
|
|
15071
|
+
return Dr = t, Dr;
|
|
14788
15072
|
}
|
|
14789
|
-
var
|
|
14790
|
-
function
|
|
14791
|
-
if (
|
|
14792
|
-
|
|
14793
|
-
var e =
|
|
15073
|
+
var Br, Ls;
|
|
15074
|
+
function my() {
|
|
15075
|
+
if (Ls) return Br;
|
|
15076
|
+
Ls = 1;
|
|
15077
|
+
var e = hy(), t = /^\s+/;
|
|
14794
15078
|
function a(r) {
|
|
14795
15079
|
return r && r.slice(0, e(r) + 1).replace(t, "");
|
|
14796
15080
|
}
|
|
14797
|
-
return
|
|
15081
|
+
return Br = a, Br;
|
|
14798
15082
|
}
|
|
14799
|
-
var
|
|
14800
|
-
function
|
|
14801
|
-
if (
|
|
14802
|
-
|
|
14803
|
-
var e =
|
|
14804
|
-
return
|
|
15083
|
+
var Or, Ns;
|
|
15084
|
+
function dl() {
|
|
15085
|
+
if (Ns) return Or;
|
|
15086
|
+
Ns = 1;
|
|
15087
|
+
var e = ul(), t = e.Symbol;
|
|
15088
|
+
return Or = t, Or;
|
|
14805
15089
|
}
|
|
14806
|
-
var
|
|
14807
|
-
function
|
|
14808
|
-
if (
|
|
14809
|
-
|
|
14810
|
-
var e =
|
|
15090
|
+
var xr, Qs;
|
|
15091
|
+
function gy() {
|
|
15092
|
+
if (Qs) return xr;
|
|
15093
|
+
Qs = 1;
|
|
15094
|
+
var e = dl(), t = Object.prototype, a = t.hasOwnProperty, r = t.toString, n = e ? e.toStringTag : void 0;
|
|
14811
15095
|
function o(s) {
|
|
14812
15096
|
var i = a.call(s, n), l = s[n];
|
|
14813
15097
|
try {
|
|
@@ -14818,52 +15102,52 @@ function ly() {
|
|
|
14818
15102
|
var p = r.call(s);
|
|
14819
15103
|
return u && (i ? s[n] = l : delete s[n]), p;
|
|
14820
15104
|
}
|
|
14821
|
-
return
|
|
15105
|
+
return xr = o, xr;
|
|
14822
15106
|
}
|
|
14823
|
-
var
|
|
14824
|
-
function
|
|
14825
|
-
if (
|
|
14826
|
-
|
|
15107
|
+
var Ur, Rs;
|
|
15108
|
+
function vy() {
|
|
15109
|
+
if (Rs) return Ur;
|
|
15110
|
+
Rs = 1;
|
|
14827
15111
|
var e = Object.prototype, t = e.toString;
|
|
14828
15112
|
function a(r) {
|
|
14829
15113
|
return t.call(r);
|
|
14830
15114
|
}
|
|
14831
|
-
return
|
|
15115
|
+
return Ur = a, Ur;
|
|
14832
15116
|
}
|
|
14833
|
-
var
|
|
14834
|
-
function
|
|
14835
|
-
if (
|
|
14836
|
-
|
|
14837
|
-
var e =
|
|
15117
|
+
var Ir, Es;
|
|
15118
|
+
function yy() {
|
|
15119
|
+
if (Es) return Ir;
|
|
15120
|
+
Es = 1;
|
|
15121
|
+
var e = dl(), t = gy(), a = vy(), r = "[object Null]", n = "[object Undefined]", o = e ? e.toStringTag : void 0;
|
|
14838
15122
|
function s(i) {
|
|
14839
15123
|
return i == null ? i === void 0 ? n : r : o && o in Object(i) ? t(i) : a(i);
|
|
14840
15124
|
}
|
|
14841
|
-
return
|
|
15125
|
+
return Ir = s, Ir;
|
|
14842
15126
|
}
|
|
14843
|
-
var
|
|
14844
|
-
function
|
|
14845
|
-
if (
|
|
14846
|
-
|
|
15127
|
+
var Mr, qs;
|
|
15128
|
+
function by() {
|
|
15129
|
+
if (qs) return Mr;
|
|
15130
|
+
qs = 1;
|
|
14847
15131
|
function e(t) {
|
|
14848
15132
|
return t != null && typeof t == "object";
|
|
14849
15133
|
}
|
|
14850
|
-
return
|
|
15134
|
+
return Mr = e, Mr;
|
|
14851
15135
|
}
|
|
14852
|
-
var
|
|
14853
|
-
function
|
|
14854
|
-
if (
|
|
14855
|
-
|
|
14856
|
-
var e =
|
|
15136
|
+
var Vr, Hs;
|
|
15137
|
+
function ky() {
|
|
15138
|
+
if (Hs) return Vr;
|
|
15139
|
+
Hs = 1;
|
|
15140
|
+
var e = yy(), t = by(), a = "[object Symbol]";
|
|
14857
15141
|
function r(n) {
|
|
14858
15142
|
return typeof n == "symbol" || t(n) && e(n) == a;
|
|
14859
15143
|
}
|
|
14860
|
-
return
|
|
15144
|
+
return Vr = r, Vr;
|
|
14861
15145
|
}
|
|
14862
|
-
var
|
|
14863
|
-
function
|
|
14864
|
-
if (
|
|
14865
|
-
|
|
14866
|
-
var e =
|
|
15146
|
+
var Lr, zs;
|
|
15147
|
+
function Ay() {
|
|
15148
|
+
if (zs) return Lr;
|
|
15149
|
+
zs = 1;
|
|
15150
|
+
var e = my(), t = Xo(), a = ky(), r = NaN, n = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, s = /^0o[0-7]+$/i, i = parseInt;
|
|
14867
15151
|
function l(u) {
|
|
14868
15152
|
if (typeof u == "number")
|
|
14869
15153
|
return u;
|
|
@@ -14879,13 +15163,13 @@ function fy() {
|
|
|
14879
15163
|
var f = o.test(u);
|
|
14880
15164
|
return f || s.test(u) ? i(u.slice(2), f ? 2 : 8) : n.test(u) ? r : +u;
|
|
14881
15165
|
}
|
|
14882
|
-
return
|
|
15166
|
+
return Lr = l, Lr;
|
|
14883
15167
|
}
|
|
14884
|
-
var
|
|
14885
|
-
function
|
|
14886
|
-
if (
|
|
14887
|
-
|
|
14888
|
-
var e = Xo(), t =
|
|
15168
|
+
var Nr, Js;
|
|
15169
|
+
function wy() {
|
|
15170
|
+
if (Js) return Nr;
|
|
15171
|
+
Js = 1;
|
|
15172
|
+
var e = Xo(), t = fy(), a = Ay(), r = "Expected a function", n = Math.max, o = Math.min;
|
|
14889
15173
|
function s(i, l, u) {
|
|
14890
15174
|
var p, f, m, b, A, B, E = 0, O = !1, F = !1, Y = !0;
|
|
14891
15175
|
if (typeof i != "function")
|
|
@@ -14933,13 +15217,13 @@ function hy() {
|
|
|
14933
15217
|
}
|
|
14934
15218
|
return q.cancel = w, q.flush = U, q;
|
|
14935
15219
|
}
|
|
14936
|
-
return
|
|
15220
|
+
return Nr = s, Nr;
|
|
14937
15221
|
}
|
|
14938
|
-
var
|
|
14939
|
-
function
|
|
14940
|
-
if (
|
|
14941
|
-
|
|
14942
|
-
var e =
|
|
15222
|
+
var Qr, Ys;
|
|
15223
|
+
function Cy() {
|
|
15224
|
+
if (Ys) return Qr;
|
|
15225
|
+
Ys = 1;
|
|
15226
|
+
var e = wy(), t = Xo(), a = "Expected a function";
|
|
14943
15227
|
function r(n, o, s) {
|
|
14944
15228
|
var i = !0, l = !0;
|
|
14945
15229
|
if (typeof n != "function")
|
|
@@ -14950,13 +15234,13 @@ function my() {
|
|
|
14950
15234
|
trailing: l
|
|
14951
15235
|
});
|
|
14952
15236
|
}
|
|
14953
|
-
return
|
|
15237
|
+
return Qr = r, Qr;
|
|
14954
15238
|
}
|
|
14955
|
-
var
|
|
14956
|
-
const
|
|
14957
|
-
var
|
|
14958
|
-
function
|
|
14959
|
-
return
|
|
15239
|
+
var Sy = Cy();
|
|
15240
|
+
const Ty = /* @__PURE__ */ _n(Sy);
|
|
15241
|
+
var Rr, js;
|
|
15242
|
+
function Py() {
|
|
15243
|
+
return js || (js = 1, Rr = function() {
|
|
14960
15244
|
var t = {}, a = t._fns = {};
|
|
14961
15245
|
t.emit = function(s, i, l, u, p, f, m) {
|
|
14962
15246
|
var b = r(s);
|
|
@@ -14994,23 +15278,23 @@ function yy() {
|
|
|
14994
15278
|
s[l].event = o, s[l].apply(s[l], i);
|
|
14995
15279
|
}
|
|
14996
15280
|
return t;
|
|
14997
|
-
}),
|
|
15281
|
+
}), Rr;
|
|
14998
15282
|
}
|
|
14999
|
-
var
|
|
15000
|
-
const
|
|
15001
|
-
let
|
|
15283
|
+
var Fy = Py();
|
|
15284
|
+
const Dy = /* @__PURE__ */ _n(Fy);
|
|
15285
|
+
let By = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Oy = (e = 21) => {
|
|
15002
15286
|
let t = "", a = e | 0;
|
|
15003
15287
|
for (; a--; )
|
|
15004
|
-
t +=
|
|
15288
|
+
t += By[Math.random() * 64 | 0];
|
|
15005
15289
|
return t;
|
|
15006
15290
|
};
|
|
15007
|
-
const
|
|
15008
|
-
version:
|
|
15291
|
+
const xy = "5.0.1", Uy = {
|
|
15292
|
+
version: xy
|
|
15009
15293
|
};
|
|
15010
|
-
function
|
|
15294
|
+
function Iy(e, t) {
|
|
15011
15295
|
return t.name ? t.name : e.split("/")[0] === "image" ? `${e.split("/")[0]}.${e.split("/")[1]}` : "noname";
|
|
15012
15296
|
}
|
|
15013
|
-
const
|
|
15297
|
+
const My = {
|
|
15014
15298
|
strings: {
|
|
15015
15299
|
addBulkFilesFailed: {
|
|
15016
15300
|
0: "Failed to add %{smart_count} file due to an internal error",
|
|
@@ -15075,9 +15359,9 @@ const Py = {
|
|
|
15075
15359
|
pleaseWait: "Please wait"
|
|
15076
15360
|
}
|
|
15077
15361
|
};
|
|
15078
|
-
var
|
|
15079
|
-
function
|
|
15080
|
-
return
|
|
15362
|
+
var Er, Xs;
|
|
15363
|
+
function Vy() {
|
|
15364
|
+
return Xs || (Xs = 1, Er = function(t) {
|
|
15081
15365
|
if (typeof t != "number" || Number.isNaN(t))
|
|
15082
15366
|
throw new TypeError(`Expected a number, got ${typeof t}`);
|
|
15083
15367
|
const a = t < 0;
|
|
@@ -15086,14 +15370,14 @@ function Fy() {
|
|
|
15086
15370
|
return "0 B";
|
|
15087
15371
|
const n = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], o = Math.min(Math.floor(Math.log(r) / Math.log(1024)), n.length - 1), s = Number(r / 1024 ** o), i = n[o];
|
|
15088
15372
|
return `${s >= 10 || s % 1 === 0 ? Math.round(s) : s.toFixed(1)} ${i}`;
|
|
15089
|
-
}),
|
|
15090
|
-
}
|
|
15091
|
-
var
|
|
15092
|
-
const
|
|
15093
|
-
var
|
|
15094
|
-
function
|
|
15095
|
-
if (
|
|
15096
|
-
|
|
15373
|
+
}), Er;
|
|
15374
|
+
}
|
|
15375
|
+
var Ly = Vy();
|
|
15376
|
+
const Un = /* @__PURE__ */ _n(Ly);
|
|
15377
|
+
var qr, Ws;
|
|
15378
|
+
function Ny() {
|
|
15379
|
+
if (Ws) return qr;
|
|
15380
|
+
Ws = 1;
|
|
15097
15381
|
function e(t, a) {
|
|
15098
15382
|
this.text = t = t || "", this.hasWild = ~t.indexOf("*"), this.separator = a, this.parts = t.split(a);
|
|
15099
15383
|
}
|
|
@@ -15116,26 +15400,26 @@ function By() {
|
|
|
15116
15400
|
this.match(i) && (a[i] = t[i]);
|
|
15117
15401
|
}
|
|
15118
15402
|
return a;
|
|
15119
|
-
},
|
|
15403
|
+
}, qr = function(t, a, r) {
|
|
15120
15404
|
var n = new e(t, r || /[\/\.]/);
|
|
15121
15405
|
return typeof a < "u" ? n.match(a) : n;
|
|
15122
|
-
},
|
|
15123
|
-
}
|
|
15124
|
-
var
|
|
15125
|
-
function
|
|
15126
|
-
if (
|
|
15127
|
-
|
|
15128
|
-
var e =
|
|
15129
|
-
return
|
|
15406
|
+
}, qr;
|
|
15407
|
+
}
|
|
15408
|
+
var Hr, Ks;
|
|
15409
|
+
function Qy() {
|
|
15410
|
+
if (Ks) return Hr;
|
|
15411
|
+
Ks = 1;
|
|
15412
|
+
var e = Ny(), t = /[\/\+\.]/;
|
|
15413
|
+
return Hr = function(a, r) {
|
|
15130
15414
|
function n(o) {
|
|
15131
15415
|
var s = e(o, a, t);
|
|
15132
15416
|
return s && s.length >= 2;
|
|
15133
15417
|
}
|
|
15134
15418
|
return r ? n(r.split(";")[0]) : n;
|
|
15135
|
-
},
|
|
15419
|
+
}, Hr;
|
|
15136
15420
|
}
|
|
15137
|
-
var
|
|
15138
|
-
const
|
|
15421
|
+
var Ry = Qy();
|
|
15422
|
+
const Ey = /* @__PURE__ */ _n(Ry), qy = {
|
|
15139
15423
|
maxFileSize: null,
|
|
15140
15424
|
minFileSize: null,
|
|
15141
15425
|
maxTotalFileSize: null,
|
|
@@ -15153,7 +15437,7 @@ class Ft extends Error {
|
|
|
15153
15437
|
this.isUserFacing = (r == null ? void 0 : r.isUserFacing) ?? !0, r != null && r.file && (this.file = r.file);
|
|
15154
15438
|
}
|
|
15155
15439
|
}
|
|
15156
|
-
class
|
|
15440
|
+
class Hy {
|
|
15157
15441
|
constructor(t, a) {
|
|
15158
15442
|
Le(this, "getI18n");
|
|
15159
15443
|
Le(this, "getOpts");
|
|
@@ -15176,14 +15460,14 @@ class My {
|
|
|
15176
15460
|
const o = [...t, ...a].reduce((s, i) => s + (i.size ?? 0), 0);
|
|
15177
15461
|
if (o > r)
|
|
15178
15462
|
throw new Ft(this.getI18n()("aggregateExceedsSize", {
|
|
15179
|
-
sizeAllowed:
|
|
15180
|
-
size:
|
|
15463
|
+
sizeAllowed: Un(r),
|
|
15464
|
+
size: Un(o)
|
|
15181
15465
|
}));
|
|
15182
15466
|
}
|
|
15183
15467
|
}
|
|
15184
15468
|
validateSingleFile(t) {
|
|
15185
15469
|
const { maxFileSize: a, minFileSize: r, allowedFileTypes: n } = this.getOpts().restrictions;
|
|
15186
|
-
if (n && !n.some((s) => s.includes("/") ? t.type ?
|
|
15470
|
+
if (n && !n.some((s) => s.includes("/") ? t.type ? Ey(t.type.replace(/;.*?$/, ""), s) : !1 : s[0] === "." && t.extension ? t.extension.toLowerCase() === s.slice(1).toLowerCase() : !1)) {
|
|
15187
15471
|
const s = n.join(", ");
|
|
15188
15472
|
throw new Ft(this.getI18n()("youCanOnlyUploadFileTypes", {
|
|
15189
15473
|
types: s
|
|
@@ -15191,12 +15475,12 @@ class My {
|
|
|
15191
15475
|
}
|
|
15192
15476
|
if (a && t.size != null && t.size > a)
|
|
15193
15477
|
throw new Ft(this.getI18n()("exceedsSize", {
|
|
15194
|
-
size:
|
|
15478
|
+
size: Un(a),
|
|
15195
15479
|
file: t.name ?? this.getI18n()("unnamed")
|
|
15196
15480
|
}), { file: t });
|
|
15197
15481
|
if (r && t.size != null && t.size < r)
|
|
15198
15482
|
throw new Ft(this.getI18n()("inferiorSize", {
|
|
15199
|
-
size:
|
|
15483
|
+
size: Un(r)
|
|
15200
15484
|
}), { file: t });
|
|
15201
15485
|
}
|
|
15202
15486
|
validate(t, a) {
|
|
@@ -15220,7 +15504,7 @@ class My {
|
|
|
15220
15504
|
return { missingFields: n, error: a };
|
|
15221
15505
|
}
|
|
15222
15506
|
}
|
|
15223
|
-
function
|
|
15507
|
+
function zy(e) {
|
|
15224
15508
|
if (e == null && typeof navigator < "u" && (e = navigator.userAgent), !e)
|
|
15225
15509
|
return !0;
|
|
15226
15510
|
const t = /Edge\/(\d+\.\d+)/.exec(e);
|
|
@@ -15229,14 +15513,14 @@ function Vy(e) {
|
|
|
15229
15513
|
const r = t[1].split(".", 2), n = parseInt(r[0], 10), o = parseInt(r[1], 10);
|
|
15230
15514
|
return n < 15 || n === 15 && o < 15063 || n > 18 || n === 18 && o >= 18218;
|
|
15231
15515
|
}
|
|
15232
|
-
const
|
|
15516
|
+
const In = {
|
|
15233
15517
|
totalProgress: 0,
|
|
15234
15518
|
allowNewUpload: !0,
|
|
15235
15519
|
error: null,
|
|
15236
15520
|
recoveredState: null
|
|
15237
15521
|
};
|
|
15238
|
-
var Tt, Pt,
|
|
15239
|
-
const
|
|
15522
|
+
var Tt, Pt, gn, fa, La, Na, ha, ke, da, so, cl, io, pl, lo, uo, co, po, Yn, fo, ma, fl, hl, $t, vn, $a, ml, Ln, en;
|
|
15523
|
+
const jn = class jn {
|
|
15240
15524
|
/**
|
|
15241
15525
|
* Instantiate Uppy
|
|
15242
15526
|
*/
|
|
@@ -15244,11 +15528,11 @@ const Yn = class Yn {
|
|
|
15244
15528
|
Ie(this, ke);
|
|
15245
15529
|
Ie(this, Tt, /* @__PURE__ */ Object.create(null));
|
|
15246
15530
|
Ie(this, Pt);
|
|
15247
|
-
Ie(this,
|
|
15248
|
-
Ie(this,
|
|
15249
|
-
Ie(this,
|
|
15250
|
-
Ie(this,
|
|
15251
|
-
Ie(this,
|
|
15531
|
+
Ie(this, gn);
|
|
15532
|
+
Ie(this, fa, Dy());
|
|
15533
|
+
Ie(this, La, /* @__PURE__ */ new Set());
|
|
15534
|
+
Ie(this, Na, /* @__PURE__ */ new Set());
|
|
15535
|
+
Ie(this, ha, /* @__PURE__ */ new Set());
|
|
15252
15536
|
Le(this, "defaultLocale");
|
|
15253
15537
|
Le(this, "locale");
|
|
15254
15538
|
// The user optionally passes in options, but we set defaults for missing options.
|
|
@@ -15260,7 +15544,7 @@ const Yn = class Yn {
|
|
|
15260
15544
|
Le(this, "i18nArray");
|
|
15261
15545
|
Le(this, "scheduledAutoProceed", null);
|
|
15262
15546
|
Le(this, "wasOffline", !1);
|
|
15263
|
-
Ie(this,
|
|
15547
|
+
Ie(this, Yn, (t, a) => {
|
|
15264
15548
|
const r = t ? this.getFile(t.id) : void 0;
|
|
15265
15549
|
if (t == null || !r) {
|
|
15266
15550
|
this.log(`Not setting progress for a file that has been removed: ${t == null ? void 0 : t.id}`);
|
|
@@ -15286,7 +15570,7 @@ const Yn = class Yn {
|
|
|
15286
15570
|
...r.progress,
|
|
15287
15571
|
...n
|
|
15288
15572
|
}
|
|
15289
|
-
}), W(this,
|
|
15573
|
+
}), W(this, ma).call(this);
|
|
15290
15574
|
});
|
|
15291
15575
|
// ___Why throttle at 500ms?
|
|
15292
15576
|
// - We must throttle at >250ms for superfocus in Dashboard to work well
|
|
@@ -15295,7 +15579,7 @@ const Yn = class Yn {
|
|
|
15295
15579
|
// and click 'ADD MORE FILES', - focus won't activate in Firefox.
|
|
15296
15580
|
// - We must throttle at around >500ms to avoid performance lags.
|
|
15297
15581
|
// [Practical Check] Firefox, try to upload a big file for a prolonged period of time. Laptop will start to heat up.
|
|
15298
|
-
Ie(this,
|
|
15582
|
+
Ie(this, ma, Ty(() => Ae(this, ke, fo).call(this), 500, { leading: !0, trailing: !0 }));
|
|
15299
15583
|
Ie(this, $t, this.updateOnlineStatus.bind(this));
|
|
15300
15584
|
// We need to store request clients by a unique ID, so we can share RequestClient instances across files
|
|
15301
15585
|
// this allows us to do rate limiting and synchronous operations like refreshing provider tokens
|
|
@@ -15307,19 +15591,19 @@ const Yn = class Yn {
|
|
|
15307
15591
|
// back when we had a requestclient per file, once an access token expired,
|
|
15308
15592
|
// all 6 files would go ahead and refresh the token at the same time
|
|
15309
15593
|
// (calling /refresh-token up to 6 times), which will probably fail for some providers
|
|
15310
|
-
Ie(this,
|
|
15311
|
-
this.defaultLocale =
|
|
15594
|
+
Ie(this, vn, /* @__PURE__ */ new Map());
|
|
15595
|
+
this.defaultLocale = My;
|
|
15312
15596
|
const a = {
|
|
15313
15597
|
id: "uppy",
|
|
15314
15598
|
autoProceed: !1,
|
|
15315
15599
|
allowMultipleUploadBatches: !0,
|
|
15316
15600
|
debug: !1,
|
|
15317
|
-
restrictions:
|
|
15601
|
+
restrictions: qy,
|
|
15318
15602
|
meta: {},
|
|
15319
15603
|
onBeforeFileAdded: (n, o) => !Object.hasOwn(o, n.id),
|
|
15320
15604
|
onBeforeUpload: (n) => n,
|
|
15321
|
-
store: new
|
|
15322
|
-
logger:
|
|
15605
|
+
store: new il(),
|
|
15606
|
+
logger: ly,
|
|
15323
15607
|
infoTimeout: 5e3
|
|
15324
15608
|
}, r = { ...a, ...t };
|
|
15325
15609
|
this.opts = {
|
|
@@ -15328,33 +15612,33 @@ const Yn = class Yn {
|
|
|
15328
15612
|
...a.restrictions,
|
|
15329
15613
|
...t == null ? void 0 : t.restrictions
|
|
15330
15614
|
}
|
|
15331
|
-
}, t != null && t.logger && t.debug ? this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.", "warning") : t != null && t.debug && (this.opts.logger =
|
|
15332
|
-
...
|
|
15615
|
+
}, t != null && t.logger && t.debug ? this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.", "warning") : t != null && t.debug && (this.opts.logger = uy), this.log(`Using Core v${jn.VERSION}`), this.i18nInit(), this.store = this.opts.store, this.setState({
|
|
15616
|
+
...In,
|
|
15333
15617
|
plugins: {},
|
|
15334
15618
|
files: {},
|
|
15335
15619
|
currentUploads: {},
|
|
15336
15620
|
capabilities: {
|
|
15337
|
-
uploadProgress:
|
|
15621
|
+
uploadProgress: zy(),
|
|
15338
15622
|
individualCancellation: !0,
|
|
15339
15623
|
resumableUploads: !1
|
|
15340
15624
|
},
|
|
15341
15625
|
meta: { ...this.opts.meta },
|
|
15342
15626
|
info: []
|
|
15343
|
-
}), We(this, Pt, new
|
|
15627
|
+
}), We(this, Pt, new Hy(() => this.opts, () => this.i18n)), We(this, gn, this.store.subscribe((n, o, s) => {
|
|
15344
15628
|
this.emit("state-update", n, o, s), this.updateAll(o);
|
|
15345
|
-
})), this.opts.debug && typeof window < "u" && (window[this.opts.id] = this), Ae(this, ke,
|
|
15629
|
+
})), this.opts.debug && typeof window < "u" && (window[this.opts.id] = this), Ae(this, ke, hl).call(this);
|
|
15346
15630
|
}
|
|
15347
15631
|
emit(t, ...a) {
|
|
15348
|
-
W(this,
|
|
15632
|
+
W(this, fa).emit(t, ...a);
|
|
15349
15633
|
}
|
|
15350
15634
|
on(t, a) {
|
|
15351
|
-
return W(this,
|
|
15635
|
+
return W(this, fa).on(t, a), this;
|
|
15352
15636
|
}
|
|
15353
15637
|
once(t, a) {
|
|
15354
|
-
return W(this,
|
|
15638
|
+
return W(this, fa).once(t, a), this;
|
|
15355
15639
|
}
|
|
15356
15640
|
off(t, a) {
|
|
15357
|
-
return W(this,
|
|
15641
|
+
return W(this, fa).off(t, a), this;
|
|
15358
15642
|
}
|
|
15359
15643
|
/**
|
|
15360
15644
|
* Iterate on all plugins and run `update` on them.
|
|
@@ -15402,7 +15686,7 @@ const Yn = class Yn {
|
|
|
15402
15686
|
this.patchFilesState({ [t]: a });
|
|
15403
15687
|
}
|
|
15404
15688
|
i18nInit() {
|
|
15405
|
-
const t = (r) => this.log(`Missing i18n string: ${r}`, "error"), a = new
|
|
15689
|
+
const t = (r) => this.log(`Missing i18n string: ${r}`, "error"), a = new sl([this.defaultLocale, this.opts.locale], {
|
|
15406
15690
|
onMissingKey: t
|
|
15407
15691
|
});
|
|
15408
15692
|
this.i18n = a.translate.bind(a), this.i18nArray = a.translateArray.bind(a), this.locale = a.locale;
|
|
@@ -15439,31 +15723,31 @@ const Yn = class Yn {
|
|
|
15439
15723
|
tus: void 0,
|
|
15440
15724
|
transloadit: void 0
|
|
15441
15725
|
};
|
|
15442
|
-
}), this.setState({ files: r, ...
|
|
15726
|
+
}), this.setState({ files: r, ...In });
|
|
15443
15727
|
}
|
|
15444
15728
|
clear() {
|
|
15445
15729
|
const { capabilities: t, currentUploads: a } = this.getState();
|
|
15446
15730
|
if (Object.keys(a).length > 0 && !t.individualCancellation)
|
|
15447
15731
|
throw new Error("The installed uploader plugin does not allow removing files during an upload.");
|
|
15448
|
-
this.setState({ ...
|
|
15732
|
+
this.setState({ ...In, files: {} });
|
|
15449
15733
|
}
|
|
15450
15734
|
addPreProcessor(t) {
|
|
15451
|
-
W(this,
|
|
15735
|
+
W(this, La).add(t);
|
|
15452
15736
|
}
|
|
15453
15737
|
removePreProcessor(t) {
|
|
15454
|
-
return W(this,
|
|
15738
|
+
return W(this, La).delete(t);
|
|
15455
15739
|
}
|
|
15456
15740
|
addPostProcessor(t) {
|
|
15457
|
-
W(this,
|
|
15741
|
+
W(this, ha).add(t);
|
|
15458
15742
|
}
|
|
15459
15743
|
removePostProcessor(t) {
|
|
15460
|
-
return W(this,
|
|
15744
|
+
return W(this, ha).delete(t);
|
|
15461
15745
|
}
|
|
15462
15746
|
addUploader(t) {
|
|
15463
|
-
W(this,
|
|
15747
|
+
W(this, Na).add(t);
|
|
15464
15748
|
}
|
|
15465
15749
|
removeUploader(t) {
|
|
15466
|
-
return W(this,
|
|
15750
|
+
return W(this, Na).delete(t);
|
|
15467
15751
|
}
|
|
15468
15752
|
setMeta(t) {
|
|
15469
15753
|
const a = { ...this.getState().meta, ...t }, r = { ...this.getState().files };
|
|
@@ -15561,13 +15845,13 @@ const Yn = class Yn {
|
|
|
15561
15845
|
* and start an upload if `autoProceed === true`.
|
|
15562
15846
|
*/
|
|
15563
15847
|
addFile(t) {
|
|
15564
|
-
Ae(this, ke,
|
|
15565
|
-
const { nextFilesState: a, validFilesToAdd: r, errors: n } = Ae(this, ke,
|
|
15848
|
+
Ae(this, ke, io).call(this, t);
|
|
15849
|
+
const { nextFilesState: a, validFilesToAdd: r, errors: n } = Ae(this, ke, uo).call(this, [t]), o = n.filter((i) => i.isRestriction);
|
|
15566
15850
|
if (Ae(this, ke, da).call(this, o), n.length > 0)
|
|
15567
15851
|
throw n[0];
|
|
15568
15852
|
this.setState({ files: a });
|
|
15569
15853
|
const [s] = r;
|
|
15570
|
-
return this.emit("file-added", s), this.emit("files-added", r), this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`), Ae(this, ke,
|
|
15854
|
+
return this.emit("file-added", s), this.emit("files-added", r), this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`), Ae(this, ke, lo).call(this), s.id;
|
|
15571
15855
|
}
|
|
15572
15856
|
/**
|
|
15573
15857
|
* Add multiple files to `state.files`. See the `addFile()` documentation.
|
|
@@ -15577,8 +15861,8 @@ const Yn = class Yn {
|
|
|
15577
15861
|
* Programmatic users should usually still use `addFile()` on individual files.
|
|
15578
15862
|
*/
|
|
15579
15863
|
addFiles(t) {
|
|
15580
|
-
Ae(this, ke,
|
|
15581
|
-
const { nextFilesState: a, validFilesToAdd: r, errors: n } = Ae(this, ke,
|
|
15864
|
+
Ae(this, ke, io).call(this);
|
|
15865
|
+
const { nextFilesState: a, validFilesToAdd: r, errors: n } = Ae(this, ke, uo).call(this, t), o = n.filter((i) => i.isRestriction);
|
|
15582
15866
|
Ae(this, ke, da).call(this, o);
|
|
15583
15867
|
const s = n.filter((i) => !i.isRestriction);
|
|
15584
15868
|
if (s.length > 0) {
|
|
@@ -15605,7 +15889,7 @@ const Yn = class Yn {
|
|
|
15605
15889
|
this.log(`Added file: ${i.name}
|
|
15606
15890
|
id: ${i.id}
|
|
15607
15891
|
type: ${i.type}`);
|
|
15608
|
-
}), r.length > 0 && Ae(this, ke,
|
|
15892
|
+
}), r.length > 0 && Ae(this, ke, lo).call(this);
|
|
15609
15893
|
}
|
|
15610
15894
|
removeFiles(t) {
|
|
15611
15895
|
const { files: a, currentUploads: r } = this.getState(), n = { ...a }, o = { ...r }, s = /* @__PURE__ */ Object.create(null);
|
|
@@ -15633,7 +15917,7 @@ const Yn = class Yn {
|
|
|
15633
15917
|
currentUploads: o,
|
|
15634
15918
|
files: n
|
|
15635
15919
|
};
|
|
15636
|
-
Object.keys(n).length === 0 && (l.allowNewUpload = !0, l.error = null, l.recoveredState = null), this.setState(l), W(this,
|
|
15920
|
+
Object.keys(n).length === 0 && (l.allowNewUpload = !0, l.error = null, l.recoveredState = null), this.setState(l), W(this, ma).call(this);
|
|
15637
15921
|
const u = Object.keys(s);
|
|
15638
15922
|
u.forEach((p) => {
|
|
15639
15923
|
this.emit("file-removed", s[p]);
|
|
@@ -15669,24 +15953,24 @@ const Yn = class Yn {
|
|
|
15669
15953
|
}), this.setState({ files: t }), this.emit("resume-all");
|
|
15670
15954
|
}
|
|
15671
15955
|
async retryAll() {
|
|
15672
|
-
const t = await Ae(this, ke,
|
|
15956
|
+
const t = await Ae(this, ke, po).call(this);
|
|
15673
15957
|
return this.emit("complete", t), t;
|
|
15674
15958
|
}
|
|
15675
15959
|
cancelAll() {
|
|
15676
15960
|
this.emit("cancel-all");
|
|
15677
15961
|
const { files: t } = this.getState(), a = Object.keys(t);
|
|
15678
|
-
a.length && this.removeFiles(a), this.setState(
|
|
15962
|
+
a.length && this.removeFiles(a), this.setState(In);
|
|
15679
15963
|
}
|
|
15680
15964
|
retryUpload(t) {
|
|
15681
15965
|
this.setFileState(t, {
|
|
15682
15966
|
error: null,
|
|
15683
15967
|
isPaused: !1
|
|
15684
15968
|
}), this.emit("upload-retry", this.getFile(t));
|
|
15685
|
-
const a = Ae(this, ke,
|
|
15969
|
+
const a = Ae(this, ke, $a).call(this, [t], {
|
|
15686
15970
|
forceAllowNewUpload: !0
|
|
15687
15971
|
// create new upload even if allowNewUpload: false
|
|
15688
15972
|
});
|
|
15689
|
-
return Ae(this, ke,
|
|
15973
|
+
return Ae(this, ke, en).call(this, a);
|
|
15690
15974
|
}
|
|
15691
15975
|
logout() {
|
|
15692
15976
|
this.iteratePlugins((t) => {
|
|
@@ -15695,7 +15979,7 @@ const Yn = class Yn {
|
|
|
15695
15979
|
});
|
|
15696
15980
|
}
|
|
15697
15981
|
[Symbol.for("uppy test: updateTotalProgress")]() {
|
|
15698
|
-
return Ae(this, ke,
|
|
15982
|
+
return Ae(this, ke, fo).call(this);
|
|
15699
15983
|
}
|
|
15700
15984
|
updateOnlineStatus() {
|
|
15701
15985
|
window.navigator.onLine ?? !0 ? (this.emit("is-online"), this.wasOffline && (this.emit("back-online"), this.info(this.i18n("connectedToInternet"), "success", 3e3), this.wasOffline = !1)) : (this.emit("is-offline"), this.info(this.i18n("noInternetConnection"), "error", 0), this.wasOffline = !0);
|
|
@@ -15765,7 +16049,7 @@ Uppy plugins must have unique \`id\` options.`;
|
|
|
15765
16049
|
* Uninstall all plugins and close down this Uppy instance.
|
|
15766
16050
|
*/
|
|
15767
16051
|
destroy() {
|
|
15768
|
-
this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`), this.cancelAll(), W(this,
|
|
16052
|
+
this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`), this.cancelAll(), W(this, gn).call(this), this.iteratePlugins((t) => {
|
|
15769
16053
|
this.removePlugin(t);
|
|
15770
16054
|
}), typeof window < "u" && window.removeEventListener && (window.removeEventListener("online", W(this, $t)), window.removeEventListener("offline", W(this, $t)));
|
|
15771
16055
|
}
|
|
@@ -15809,13 +16093,13 @@ Uppy plugins must have unique \`id\` options.`;
|
|
|
15809
16093
|
}
|
|
15810
16094
|
}
|
|
15811
16095
|
registerRequestClient(t, a) {
|
|
15812
|
-
W(this,
|
|
16096
|
+
W(this, vn).set(t, a);
|
|
15813
16097
|
}
|
|
15814
16098
|
/** @protected */
|
|
15815
16099
|
getRequestClientForFile(t) {
|
|
15816
16100
|
if (!t.remote)
|
|
15817
16101
|
throw new Error(`Tried to get RequestClient for a non-remote file ${t.id}`);
|
|
15818
|
-
const a = W(this,
|
|
16102
|
+
const a = W(this, vn).get(t.remote.requestClientId);
|
|
15819
16103
|
if (a == null)
|
|
15820
16104
|
throw new Error(`requestClientId "${t.remote.requestClientId}" not registered for file "${t.id}"`);
|
|
15821
16105
|
return a;
|
|
@@ -15824,16 +16108,16 @@ Uppy plugins must have unique \`id\` options.`;
|
|
|
15824
16108
|
* Restore an upload by its ID.
|
|
15825
16109
|
*/
|
|
15826
16110
|
restore(t) {
|
|
15827
|
-
return this.log(`Core: attempting to restore upload "${t}"`), this.getState().currentUploads[t] ? Ae(this, ke,
|
|
16111
|
+
return this.log(`Core: attempting to restore upload "${t}"`), this.getState().currentUploads[t] ? Ae(this, ke, en).call(this, t) : (Ae(this, ke, Ln).call(this, t), Promise.reject(new Error("Nonexistent upload")));
|
|
15828
16112
|
}
|
|
15829
16113
|
[Symbol.for("uppy test: createUpload")](...t) {
|
|
15830
|
-
return Ae(this, ke,
|
|
16114
|
+
return Ae(this, ke, $a).call(this, ...t);
|
|
15831
16115
|
}
|
|
15832
16116
|
/**
|
|
15833
16117
|
* Add data to an upload's result object.
|
|
15834
16118
|
*/
|
|
15835
16119
|
addResultData(t, a) {
|
|
15836
|
-
if (!Ae(this, ke,
|
|
16120
|
+
if (!Ae(this, ke, ml).call(this, t)) {
|
|
15837
16121
|
this.log(`Not setting result for an upload that has been removed: ${t}`);
|
|
15838
16122
|
return;
|
|
15839
16123
|
}
|
|
@@ -15852,8 +16136,8 @@ Uppy plugins must have unique \`id\` options.`;
|
|
|
15852
16136
|
var n;
|
|
15853
16137
|
(n = W(this, Tt).uploader) != null && n.length || this.log("No uploader type plugins are used", "warning");
|
|
15854
16138
|
let { files: t } = this.getState();
|
|
15855
|
-
if (Ae(this, ke,
|
|
15856
|
-
const o = await Ae(this, ke,
|
|
16139
|
+
if (Ae(this, ke, co).call(this).length > 0) {
|
|
16140
|
+
const o = await Ae(this, ke, po).call(this);
|
|
15857
16141
|
if (!(this.getFiles().filter((i) => i.progress.uploadStarted == null).length > 0))
|
|
15858
16142
|
return this.emit("complete", o), o;
|
|
15859
16143
|
({ files: t } = this.getState());
|
|
@@ -15864,7 +16148,7 @@ Uppy plugins must have unique \`id\` options.`;
|
|
|
15864
16148
|
})), Promise.resolve().then(() => W(this, Pt).validateMinNumberOfFiles(t)).catch((o) => {
|
|
15865
16149
|
throw Ae(this, ke, da).call(this, [o]), o;
|
|
15866
16150
|
}).then(() => {
|
|
15867
|
-
if (!Ae(this, ke,
|
|
16151
|
+
if (!Ae(this, ke, cl).call(this, t))
|
|
15868
16152
|
throw new Ft(this.i18n("missingRequiredMetaField"));
|
|
15869
16153
|
}).catch((o) => {
|
|
15870
16154
|
throw o;
|
|
@@ -15874,14 +16158,14 @@ Uppy plugins must have unique \`id\` options.`;
|
|
|
15874
16158
|
const f = this.getFile(p);
|
|
15875
16159
|
!f.progress.uploadStarted && s.indexOf(p) === -1 && i.push(f.id);
|
|
15876
16160
|
});
|
|
15877
|
-
const l = Ae(this, ke,
|
|
16161
|
+
const l = Ae(this, ke, $a).call(this, i), u = await Ae(this, ke, en).call(this, l);
|
|
15878
16162
|
return this.emit("complete", u), u;
|
|
15879
16163
|
}).catch((o) => {
|
|
15880
16164
|
throw this.emit("error", o), this.log(o, "error"), o;
|
|
15881
16165
|
}));
|
|
15882
16166
|
}
|
|
15883
16167
|
};
|
|
15884
|
-
Tt = new WeakMap(), Pt = new WeakMap(),
|
|
16168
|
+
Tt = new WeakMap(), Pt = new WeakMap(), gn = new WeakMap(), fa = new WeakMap(), La = new WeakMap(), Na = new WeakMap(), ha = new WeakMap(), ke = new WeakSet(), da = function(t) {
|
|
15885
16169
|
for (const s of t)
|
|
15886
16170
|
s.isRestriction ? this.emit("restriction-failed", s.file, s) : this.emit("error", s, s.file), this.log(s, "warning");
|
|
15887
16171
|
const a = t.filter((s) => s.isUserFacing), r = 4, n = a.slice(0, r), o = a.slice(r);
|
|
@@ -15892,7 +16176,7 @@ Tt = new WeakMap(), Pt = new WeakMap(), hn = new WeakMap(), ca = new WeakMap(),
|
|
|
15892
16176
|
count: o.length
|
|
15893
16177
|
})
|
|
15894
16178
|
});
|
|
15895
|
-
},
|
|
16179
|
+
}, so = function(t) {
|
|
15896
16180
|
const { missingFields: a, error: r } = W(this, Pt).getMissingRequiredMetaFields(t);
|
|
15897
16181
|
return a.length > 0 ? (this.setFileState(t.id, {
|
|
15898
16182
|
missingRequiredMetaFields: a,
|
|
@@ -15900,12 +16184,12 @@ Tt = new WeakMap(), Pt = new WeakMap(), hn = new WeakMap(), ca = new WeakMap(),
|
|
|
15900
16184
|
}), this.log(r.message), this.emit("restriction-failed", t, r), !1) : (a.length === 0 && t.missingRequiredMetaFields && this.setFileState(t.id, {
|
|
15901
16185
|
missingRequiredMetaFields: []
|
|
15902
16186
|
}), !0);
|
|
15903
|
-
},
|
|
16187
|
+
}, cl = function(t) {
|
|
15904
16188
|
let a = !0;
|
|
15905
16189
|
for (const r of Object.values(t))
|
|
15906
|
-
Ae(this, ke,
|
|
16190
|
+
Ae(this, ke, so).call(this, r) || (a = !1);
|
|
15907
16191
|
return a;
|
|
15908
|
-
},
|
|
16192
|
+
}, io = function(t) {
|
|
15909
16193
|
const { allowNewUpload: a } = this.getState();
|
|
15910
16194
|
if (a === !1) {
|
|
15911
16195
|
const r = new Ft(this.i18n("noMoreFilesAllowed"), {
|
|
@@ -15916,13 +16200,13 @@ Tt = new WeakMap(), Pt = new WeakMap(), hn = new WeakMap(), ca = new WeakMap(),
|
|
|
15916
16200
|
}, /**
|
|
15917
16201
|
* Create a file state object based on user-provided `addFile()` options.
|
|
15918
16202
|
*/
|
|
15919
|
-
|
|
16203
|
+
pl = function(t) {
|
|
15920
16204
|
const a = t instanceof File ? {
|
|
15921
16205
|
name: t.name,
|
|
15922
16206
|
type: t.type,
|
|
15923
16207
|
size: t.size,
|
|
15924
16208
|
data: t
|
|
15925
|
-
} : t, r =
|
|
16209
|
+
} : t, r = al(a), n = Iy(r, a), o = tl(n).extension, s = ey(a, this.getID()), i = a.meta || {};
|
|
15926
16210
|
i.name = n, i.type = r;
|
|
15927
16211
|
const l = Number.isFinite(a.data.size) ? a.data.size : null;
|
|
15928
16212
|
return {
|
|
@@ -15950,19 +16234,19 @@ ul = function(t) {
|
|
|
15950
16234
|
preview: a.preview
|
|
15951
16235
|
};
|
|
15952
16236
|
}, // Schedule an upload if `autoProceed` is enabled.
|
|
15953
|
-
|
|
16237
|
+
lo = function() {
|
|
15954
16238
|
this.opts.autoProceed && !this.scheduledAutoProceed && (this.scheduledAutoProceed = setTimeout(() => {
|
|
15955
16239
|
this.scheduledAutoProceed = null, this.upload().catch((t) => {
|
|
15956
16240
|
t.isRestriction || this.log(t.stack || t.message || t);
|
|
15957
16241
|
});
|
|
15958
16242
|
}, 4));
|
|
15959
|
-
},
|
|
16243
|
+
}, uo = function(t) {
|
|
15960
16244
|
var s;
|
|
15961
16245
|
let { files: a } = this.getState(), r = { ...a };
|
|
15962
16246
|
const n = [], o = [];
|
|
15963
16247
|
for (const i of t)
|
|
15964
16248
|
try {
|
|
15965
|
-
let l = Ae(this, ke,
|
|
16249
|
+
let l = Ae(this, ke, pl).call(this, i);
|
|
15966
16250
|
const u = (s = a[l.id]) == null ? void 0 : s.isGhost;
|
|
15967
16251
|
u && (l = {
|
|
15968
16252
|
...a[l.id],
|
|
@@ -15994,14 +16278,14 @@ so = function() {
|
|
|
15994
16278
|
validFilesToAdd: n,
|
|
15995
16279
|
errors: o
|
|
15996
16280
|
};
|
|
15997
|
-
},
|
|
16281
|
+
}, co = function() {
|
|
15998
16282
|
const { files: t } = this.getState();
|
|
15999
16283
|
return Object.keys(t).filter((a) => {
|
|
16000
16284
|
const r = t[a];
|
|
16001
16285
|
return r.error && (!r.missingRequiredMetaFields || r.missingRequiredMetaFields.length === 0);
|
|
16002
16286
|
});
|
|
16003
|
-
},
|
|
16004
|
-
const t = Ae(this, ke,
|
|
16287
|
+
}, po = async function() {
|
|
16288
|
+
const t = Ae(this, ke, co).call(this), a = { ...this.getState().files };
|
|
16005
16289
|
if (t.forEach((n) => {
|
|
16006
16290
|
a[n] = {
|
|
16007
16291
|
...a[n],
|
|
@@ -16016,18 +16300,18 @@ so = function() {
|
|
|
16016
16300
|
successful: [],
|
|
16017
16301
|
failed: []
|
|
16018
16302
|
};
|
|
16019
|
-
const r = Ae(this, ke,
|
|
16303
|
+
const r = Ae(this, ke, $a).call(this, t, {
|
|
16020
16304
|
forceAllowNewUpload: !0
|
|
16021
16305
|
// create new upload even if allowNewUpload: false
|
|
16022
16306
|
});
|
|
16023
|
-
return Ae(this, ke,
|
|
16024
|
-
},
|
|
16025
|
-
const t = Ae(this, ke,
|
|
16307
|
+
return Ae(this, ke, en).call(this, r);
|
|
16308
|
+
}, Yn = new WeakMap(), fo = function() {
|
|
16309
|
+
const t = Ae(this, ke, fl).call(this);
|
|
16026
16310
|
let a = null;
|
|
16027
16311
|
t != null && (a = Math.round(t * 100), a > 100 ? a = 100 : a < 0 && (a = 0)), this.emit("progress", a ?? 0), this.setState({
|
|
16028
16312
|
totalProgress: a ?? 0
|
|
16029
16313
|
});
|
|
16030
|
-
},
|
|
16314
|
+
}, ma = new WeakMap(), fl = function() {
|
|
16031
16315
|
const a = this.getFiles().filter((l) => l.progress.uploadStarted || l.progress.preprocess || l.progress.postprocess);
|
|
16032
16316
|
if (a.length === 0)
|
|
16033
16317
|
return 0;
|
|
@@ -16042,7 +16326,7 @@ so = function() {
|
|
|
16042
16326
|
* Registers listeners for all global actions, like:
|
|
16043
16327
|
* `error`, `file-removed`, `upload-progress`
|
|
16044
16328
|
*/
|
|
16045
|
-
|
|
16329
|
+
hl = function() {
|
|
16046
16330
|
const t = (n, o, s) => {
|
|
16047
16331
|
let i = n.message || "Unknown error";
|
|
16048
16332
|
n.details && (i += ` ${n.details}`), this.setState({ error: i }), o != null && o.id in this.getState().files && this.setFileState(o.id, {
|
|
@@ -16084,7 +16368,7 @@ cl = function() {
|
|
|
16084
16368
|
]));
|
|
16085
16369
|
this.patchFilesState(s);
|
|
16086
16370
|
};
|
|
16087
|
-
this.on("upload-start", r), this.on("upload-progress", W(this,
|
|
16371
|
+
this.on("upload-start", r), this.on("upload-progress", W(this, Yn)), this.on("upload-success", (n, o) => {
|
|
16088
16372
|
if (n == null || !this.getFile(n.id)) {
|
|
16089
16373
|
this.log(`Not setting progress for a file that has been removed: ${n == null ? void 0 : n.id}`);
|
|
16090
16374
|
return;
|
|
@@ -16093,7 +16377,7 @@ cl = function() {
|
|
|
16093
16377
|
this.setFileState(n.id, {
|
|
16094
16378
|
progress: {
|
|
16095
16379
|
...s,
|
|
16096
|
-
postprocess: W(this,
|
|
16380
|
+
postprocess: W(this, ha).size > 0 ? {
|
|
16097
16381
|
mode: "indeterminate"
|
|
16098
16382
|
} : void 0,
|
|
16099
16383
|
uploadComplete: !0,
|
|
@@ -16105,7 +16389,7 @@ cl = function() {
|
|
|
16105
16389
|
isPaused: !1
|
|
16106
16390
|
}), n.size == null && this.setFileState(n.id, {
|
|
16107
16391
|
size: o.bytesUploaded || s.bytesTotal
|
|
16108
|
-
}), W(this,
|
|
16392
|
+
}), W(this, ma).call(this);
|
|
16109
16393
|
}), this.on("preprocess-progress", (n, o) => {
|
|
16110
16394
|
if (n == null || !this.getFile(n.id)) {
|
|
16111
16395
|
this.log(`Not setting progress for a file that has been removed: ${n == null ? void 0 : n.id}`);
|
|
@@ -16150,19 +16434,19 @@ cl = function() {
|
|
|
16150
16434
|
}
|
|
16151
16435
|
}, delete o[n.id].progress.postprocess, this.setState({ files: o });
|
|
16152
16436
|
}), this.on("restored", () => {
|
|
16153
|
-
W(this,
|
|
16437
|
+
W(this, ma).call(this);
|
|
16154
16438
|
}), this.on("dashboard:file-edit-complete", (n) => {
|
|
16155
|
-
n && Ae(this, ke,
|
|
16439
|
+
n && Ae(this, ke, so).call(this, n);
|
|
16156
16440
|
}), typeof window < "u" && window.addEventListener && (window.addEventListener("online", W(this, $t)), window.addEventListener("offline", W(this, $t)), setTimeout(W(this, $t), 3e3));
|
|
16157
|
-
}, $t = new WeakMap(),
|
|
16441
|
+
}, $t = new WeakMap(), vn = new WeakMap(), /**
|
|
16158
16442
|
* Create an upload for a bunch of files.
|
|
16159
16443
|
*
|
|
16160
16444
|
*/
|
|
16161
|
-
|
|
16445
|
+
$a = function(t, a = {}) {
|
|
16162
16446
|
const { forceAllowNewUpload: r = !1 } = a, { allowNewUpload: n, currentUploads: o } = this.getState();
|
|
16163
16447
|
if (!n && !r)
|
|
16164
16448
|
throw new Error("Cannot create a new upload: already uploading.");
|
|
16165
|
-
const s =
|
|
16449
|
+
const s = Oy();
|
|
16166
16450
|
return this.emit("upload", s, this.getFilesByIds(t)), this.setState({
|
|
16167
16451
|
allowNewUpload: this.opts.allowMultipleUploadBatches !== !1 && this.opts.allowMultipleUploads !== !1,
|
|
16168
16452
|
currentUploads: {
|
|
@@ -16174,7 +16458,7 @@ _a = function(t, a = {}) {
|
|
|
16174
16458
|
}
|
|
16175
16459
|
}
|
|
16176
16460
|
}), s;
|
|
16177
|
-
},
|
|
16461
|
+
}, ml = function(t) {
|
|
16178
16462
|
const { currentUploads: a } = this.getState();
|
|
16179
16463
|
return a[t];
|
|
16180
16464
|
}, /**
|
|
@@ -16186,16 +16470,16 @@ Ln = function(t) {
|
|
|
16186
16470
|
delete a[t], this.setState({
|
|
16187
16471
|
currentUploads: a
|
|
16188
16472
|
});
|
|
16189
|
-
},
|
|
16473
|
+
}, en = async function(t) {
|
|
16190
16474
|
const a = () => {
|
|
16191
16475
|
const { currentUploads: s } = this.getState();
|
|
16192
16476
|
return s[t];
|
|
16193
16477
|
};
|
|
16194
16478
|
let r = a();
|
|
16195
16479
|
const n = [
|
|
16196
|
-
...W(this,
|
|
16197
|
-
...W(this,
|
|
16198
|
-
...W(this,
|
|
16480
|
+
...W(this, La),
|
|
16481
|
+
...W(this, Na),
|
|
16482
|
+
...W(this, ha)
|
|
16199
16483
|
];
|
|
16200
16484
|
try {
|
|
16201
16485
|
for (let s = r.step || 0; s < n.length && r; s++) {
|
|
@@ -16229,292 +16513,9 @@ Ln = function(t) {
|
|
|
16229
16513
|
failed: [],
|
|
16230
16514
|
uploadID: t
|
|
16231
16515
|
}), o;
|
|
16232
|
-
}, Le(
|
|
16233
|
-
let
|
|
16234
|
-
|
|
16235
|
-
class Ly {
|
|
16236
|
-
constructor(t) {
|
|
16237
|
-
Ie(this, Vt);
|
|
16238
|
-
Ie(this, gn, []);
|
|
16239
|
-
We(this, Vt, t);
|
|
16240
|
-
}
|
|
16241
|
-
on(t, a) {
|
|
16242
|
-
return W(this, gn).push([t, a]), W(this, Vt).on(t, a);
|
|
16243
|
-
}
|
|
16244
|
-
remove() {
|
|
16245
|
-
for (const [t, a] of W(this, gn).splice(0))
|
|
16246
|
-
W(this, Vt).off(t, a);
|
|
16247
|
-
}
|
|
16248
|
-
onFilePause(t, a) {
|
|
16249
|
-
this.on("upload-pause", (r, n) => {
|
|
16250
|
-
t === (r == null ? void 0 : r.id) && a(n);
|
|
16251
|
-
});
|
|
16252
|
-
}
|
|
16253
|
-
onFileRemove(t, a) {
|
|
16254
|
-
this.on("file-removed", (r) => {
|
|
16255
|
-
t === r.id && a(r.id);
|
|
16256
|
-
});
|
|
16257
|
-
}
|
|
16258
|
-
onPause(t, a) {
|
|
16259
|
-
this.on("upload-pause", (r, n) => {
|
|
16260
|
-
t === (r == null ? void 0 : r.id) && a(n);
|
|
16261
|
-
});
|
|
16262
|
-
}
|
|
16263
|
-
onRetry(t, a) {
|
|
16264
|
-
this.on("upload-retry", (r) => {
|
|
16265
|
-
t === (r == null ? void 0 : r.id) && a();
|
|
16266
|
-
});
|
|
16267
|
-
}
|
|
16268
|
-
onRetryAll(t, a) {
|
|
16269
|
-
this.on("retry-all", () => {
|
|
16270
|
-
W(this, Vt).getFile(t) && a();
|
|
16271
|
-
});
|
|
16272
|
-
}
|
|
16273
|
-
onPauseAll(t, a) {
|
|
16274
|
-
this.on("pause-all", () => {
|
|
16275
|
-
W(this, Vt).getFile(t) && a();
|
|
16276
|
-
});
|
|
16277
|
-
}
|
|
16278
|
-
onCancelAll(t, a) {
|
|
16279
|
-
this.on("cancel-all", (...r) => {
|
|
16280
|
-
W(this, Vt).getFile(t) && a(...r);
|
|
16281
|
-
});
|
|
16282
|
-
}
|
|
16283
|
-
onResumeAll(t, a) {
|
|
16284
|
-
this.on("resume-all", () => {
|
|
16285
|
-
W(this, Vt).getFile(t) && a();
|
|
16286
|
-
});
|
|
16287
|
-
}
|
|
16288
|
-
}
|
|
16289
|
-
Vt = new WeakMap(), gn = new WeakMap();
|
|
16290
|
-
class po extends Error {
|
|
16291
|
-
constructor(a, r = null) {
|
|
16292
|
-
super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");
|
|
16293
|
-
Le(this, "cause");
|
|
16294
|
-
Le(this, "isNetworkError");
|
|
16295
|
-
Le(this, "request");
|
|
16296
|
-
this.cause = a, this.isNetworkError = !0, this.request = r;
|
|
16297
|
-
}
|
|
16298
|
-
}
|
|
16299
|
-
var ha, Ia, vn, Ma;
|
|
16300
|
-
class Ny {
|
|
16301
|
-
constructor(t, a) {
|
|
16302
|
-
Ie(this, ha);
|
|
16303
|
-
Ie(this, Ia, !1);
|
|
16304
|
-
Ie(this, vn);
|
|
16305
|
-
Ie(this, Ma);
|
|
16306
|
-
We(this, Ma, t), We(this, vn, () => a(t));
|
|
16307
|
-
}
|
|
16308
|
-
progress() {
|
|
16309
|
-
W(this, Ia) || W(this, Ma) > 0 && (clearTimeout(W(this, ha)), We(this, ha, setTimeout(W(this, vn), W(this, Ma))));
|
|
16310
|
-
}
|
|
16311
|
-
done() {
|
|
16312
|
-
W(this, Ia) || (clearTimeout(W(this, ha)), We(this, ha, void 0), We(this, Ia, !0));
|
|
16313
|
-
}
|
|
16314
|
-
}
|
|
16315
|
-
ha = new WeakMap(), Ia = new WeakMap(), vn = new WeakMap(), Ma = new WeakMap();
|
|
16316
|
-
const In = () => {
|
|
16317
|
-
};
|
|
16318
|
-
function Qy(e, t = {}) {
|
|
16319
|
-
const { body: a = null, headers: r = {}, method: n = "GET", onBeforeRequest: o = In, onUploadProgress: s = In, shouldRetry: i = () => !0, onAfterResponse: l = In, onTimeout: u = In, responseType: p, retries: f = 3, signal: m = null, timeout: b = 3e4, withCredentials: A = !1 } = t, B = (F) => 0.3 * 2 ** (F - 1) * 1e3, E = new Ny(b, u);
|
|
16320
|
-
function O(F = 0) {
|
|
16321
|
-
return new Promise(async (Y, D) => {
|
|
16322
|
-
const L = new XMLHttpRequest(), J = (Q) => {
|
|
16323
|
-
i(L) && F < f ? setTimeout(() => {
|
|
16324
|
-
O(F + 1).then(Y, D);
|
|
16325
|
-
}, B(F)) : (E.done(), D(Q));
|
|
16326
|
-
};
|
|
16327
|
-
L.open(n, e, !0), L.withCredentials = A, p && (L.responseType = p), m == null || m.addEventListener("abort", () => {
|
|
16328
|
-
L.abort(), D(new DOMException("Aborted", "AbortError"));
|
|
16329
|
-
}), L.onload = async () => {
|
|
16330
|
-
try {
|
|
16331
|
-
await l(L, F);
|
|
16332
|
-
} catch (Q) {
|
|
16333
|
-
Q.request = L, J(Q);
|
|
16334
|
-
return;
|
|
16335
|
-
}
|
|
16336
|
-
L.status >= 200 && L.status < 300 ? (E.done(), Y(L)) : i(L) && F < f ? setTimeout(() => {
|
|
16337
|
-
O(F + 1).then(Y, D);
|
|
16338
|
-
}, B(F)) : (E.done(), D(new po(L.statusText, L)));
|
|
16339
|
-
}, L.onerror = () => J(new po(L.statusText, L)), L.upload.onprogress = (Q) => {
|
|
16340
|
-
E.progress(), s(Q);
|
|
16341
|
-
}, r && Object.keys(r).forEach((Q) => {
|
|
16342
|
-
L.setRequestHeader(Q, r[Q]);
|
|
16343
|
-
}), await o(L, F), L.send(a);
|
|
16344
|
-
});
|
|
16345
|
-
}
|
|
16346
|
-
return O();
|
|
16347
|
-
}
|
|
16348
|
-
function Ry(e) {
|
|
16349
|
-
const t = (a) => "error" in a && !!a.error;
|
|
16350
|
-
return e.filter((a) => !t(a));
|
|
16351
|
-
}
|
|
16352
|
-
function Ey(e) {
|
|
16353
|
-
return e.filter((t) => {
|
|
16354
|
-
var a;
|
|
16355
|
-
return !((a = t.progress) != null && a.uploadStarted) || !t.isRestored;
|
|
16356
|
-
});
|
|
16357
|
-
}
|
|
16358
|
-
function Ws(e, t) {
|
|
16359
|
-
return e === !0 ? Object.keys(t) : Array.isArray(e) ? e : [];
|
|
16360
|
-
}
|
|
16361
|
-
function qy(e) {
|
|
16362
|
-
return e ? e.readyState !== 0 && e.readyState !== 4 || e.status === 0 : !1;
|
|
16363
|
-
}
|
|
16364
|
-
function Hy(e) {
|
|
16365
|
-
return new Error("Cancelled", { cause: e });
|
|
16366
|
-
}
|
|
16367
|
-
function Ks(e) {
|
|
16368
|
-
var t;
|
|
16369
|
-
if (e != null) {
|
|
16370
|
-
const a = () => this.abort(e.reason);
|
|
16371
|
-
e.addEventListener("abort", a, { once: !0 });
|
|
16372
|
-
const r = () => {
|
|
16373
|
-
e.removeEventListener("abort", a);
|
|
16374
|
-
};
|
|
16375
|
-
(t = this.then) == null || t.call(this, r, r);
|
|
16376
|
-
}
|
|
16377
|
-
return this;
|
|
16378
|
-
}
|
|
16379
|
-
var Yt, Lt, jt, Va, Nt, La, ma, ut, fo, en, fl, hl, ml, jn, Na;
|
|
16380
|
-
class zy {
|
|
16381
|
-
constructor(t) {
|
|
16382
|
-
Ie(this, ut);
|
|
16383
|
-
Ie(this, Yt, 0);
|
|
16384
|
-
Ie(this, Lt, []);
|
|
16385
|
-
Ie(this, jt, !1);
|
|
16386
|
-
Ie(this, Va);
|
|
16387
|
-
Ie(this, Nt, 1);
|
|
16388
|
-
Ie(this, La);
|
|
16389
|
-
Ie(this, ma);
|
|
16390
|
-
Le(this, "limit");
|
|
16391
|
-
Ie(this, jn, () => this.resume());
|
|
16392
|
-
Ie(this, Na, () => {
|
|
16393
|
-
if (W(this, jt)) {
|
|
16394
|
-
We(this, ma, setTimeout(W(this, Na), 0));
|
|
16395
|
-
return;
|
|
16396
|
-
}
|
|
16397
|
-
We(this, Nt, this.limit), this.limit = Math.ceil((W(this, La) + W(this, Nt)) / 2);
|
|
16398
|
-
for (let t = W(this, Nt); t <= this.limit; t++)
|
|
16399
|
-
Ae(this, ut, en).call(this);
|
|
16400
|
-
W(this, La) - W(this, Nt) > 3 ? We(this, ma, setTimeout(W(this, Na), 2e3)) : We(this, Nt, Math.floor(W(this, Nt) / 2));
|
|
16401
|
-
});
|
|
16402
|
-
typeof t != "number" || t === 0 ? this.limit = 1 / 0 : this.limit = t;
|
|
16403
|
-
}
|
|
16404
|
-
run(t, a) {
|
|
16405
|
-
return !W(this, jt) && W(this, Yt) < this.limit ? Ae(this, ut, fo).call(this, t) : Ae(this, ut, hl).call(this, t, a);
|
|
16406
|
-
}
|
|
16407
|
-
wrapSyncFunction(t, a) {
|
|
16408
|
-
return (...r) => {
|
|
16409
|
-
const n = this.run(() => (t(...r), queueMicrotask(() => n.done()), () => {
|
|
16410
|
-
}), a);
|
|
16411
|
-
return {
|
|
16412
|
-
abortOn: Ks,
|
|
16413
|
-
abort() {
|
|
16414
|
-
n.abort();
|
|
16415
|
-
}
|
|
16416
|
-
};
|
|
16417
|
-
};
|
|
16418
|
-
}
|
|
16419
|
-
wrapPromiseFunction(t, a) {
|
|
16420
|
-
return (...r) => {
|
|
16421
|
-
let n;
|
|
16422
|
-
const o = new Promise((s, i) => {
|
|
16423
|
-
n = this.run(() => {
|
|
16424
|
-
let l, u;
|
|
16425
|
-
try {
|
|
16426
|
-
u = Promise.resolve(t(...r));
|
|
16427
|
-
} catch (p) {
|
|
16428
|
-
u = Promise.reject(p);
|
|
16429
|
-
}
|
|
16430
|
-
return u.then((p) => {
|
|
16431
|
-
l ? i(l) : (n.done(), s(p));
|
|
16432
|
-
}, (p) => {
|
|
16433
|
-
l ? i(l) : (n.done(), i(p));
|
|
16434
|
-
}), (p) => {
|
|
16435
|
-
l = Hy(p);
|
|
16436
|
-
};
|
|
16437
|
-
}, a);
|
|
16438
|
-
});
|
|
16439
|
-
return o.abort = (s) => {
|
|
16440
|
-
n.abort(s);
|
|
16441
|
-
}, o.abortOn = Ks, o;
|
|
16442
|
-
};
|
|
16443
|
-
}
|
|
16444
|
-
resume() {
|
|
16445
|
-
We(this, jt, !1), clearTimeout(W(this, Va));
|
|
16446
|
-
for (let t = 0; t < this.limit; t++)
|
|
16447
|
-
Ae(this, ut, en).call(this);
|
|
16448
|
-
}
|
|
16449
|
-
/**
|
|
16450
|
-
* Freezes the queue for a while or indefinitely.
|
|
16451
|
-
*
|
|
16452
|
-
* @param {number | null } [duration] Duration for the pause to happen, in milliseconds.
|
|
16453
|
-
* If omitted, the queue won't resume automatically.
|
|
16454
|
-
*/
|
|
16455
|
-
pause(t = null) {
|
|
16456
|
-
We(this, jt, !0), clearTimeout(W(this, Va)), t != null && We(this, Va, setTimeout(W(this, jn), t));
|
|
16457
|
-
}
|
|
16458
|
-
/**
|
|
16459
|
-
* Pauses the queue for a duration, and lower the limit of concurrent requests
|
|
16460
|
-
* when the queue resumes. When the queue resumes, it tries to progressively
|
|
16461
|
-
* increase the limit in `this.#increaseLimit` until another call is made to
|
|
16462
|
-
* `this.rateLimit`.
|
|
16463
|
-
* Call this function when using the RateLimitedQueue for network requests and
|
|
16464
|
-
* the remote server responds with 429 HTTP code.
|
|
16465
|
-
*
|
|
16466
|
-
* @param {number} duration in milliseconds.
|
|
16467
|
-
*/
|
|
16468
|
-
rateLimit(t) {
|
|
16469
|
-
clearTimeout(W(this, ma)), this.pause(t), this.limit > 1 && Number.isFinite(this.limit) && (We(this, La, this.limit - 1), this.limit = W(this, Nt), We(this, ma, setTimeout(W(this, Na), t)));
|
|
16470
|
-
}
|
|
16471
|
-
get isPaused() {
|
|
16472
|
-
return W(this, jt);
|
|
16473
|
-
}
|
|
16474
|
-
}
|
|
16475
|
-
Yt = new WeakMap(), Lt = new WeakMap(), jt = new WeakMap(), Va = new WeakMap(), Nt = new WeakMap(), La = new WeakMap(), ma = new WeakMap(), ut = new WeakSet(), fo = function(t) {
|
|
16476
|
-
We(this, Yt, W(this, Yt) + 1);
|
|
16477
|
-
let a = !1, r;
|
|
16478
|
-
try {
|
|
16479
|
-
r = t();
|
|
16480
|
-
} catch (n) {
|
|
16481
|
-
throw We(this, Yt, W(this, Yt) - 1), n;
|
|
16482
|
-
}
|
|
16483
|
-
return {
|
|
16484
|
-
abort: (n) => {
|
|
16485
|
-
a || (a = !0, We(this, Yt, W(this, Yt) - 1), r == null || r(n), Ae(this, ut, en).call(this));
|
|
16486
|
-
},
|
|
16487
|
-
done: () => {
|
|
16488
|
-
a || (a = !0, We(this, Yt, W(this, Yt) - 1), Ae(this, ut, en).call(this));
|
|
16489
|
-
}
|
|
16490
|
-
};
|
|
16491
|
-
}, en = function() {
|
|
16492
|
-
queueMicrotask(() => Ae(this, ut, fl).call(this));
|
|
16493
|
-
}, fl = function() {
|
|
16494
|
-
if (W(this, jt) || W(this, Yt) >= this.limit || W(this, Lt).length === 0)
|
|
16495
|
-
return;
|
|
16496
|
-
const t = W(this, Lt).shift();
|
|
16497
|
-
if (t == null)
|
|
16498
|
-
throw new Error("Invariant violation: next is null");
|
|
16499
|
-
const a = Ae(this, ut, fo).call(this, t.fn);
|
|
16500
|
-
t.abort = a.abort, t.done = a.done;
|
|
16501
|
-
}, hl = function(t, a) {
|
|
16502
|
-
const r = {
|
|
16503
|
-
fn: t,
|
|
16504
|
-
priority: (a == null ? void 0 : a.priority) || 0,
|
|
16505
|
-
abort: () => {
|
|
16506
|
-
Ae(this, ut, ml).call(this, r);
|
|
16507
|
-
},
|
|
16508
|
-
done: () => {
|
|
16509
|
-
throw new Error("Cannot mark a queued request as done: this indicates a bug");
|
|
16510
|
-
}
|
|
16511
|
-
}, n = W(this, Lt).findIndex((o) => r.priority > o.priority);
|
|
16512
|
-
return n === -1 ? W(this, Lt).push(r) : W(this, Lt).splice(n, 0, r), r;
|
|
16513
|
-
}, ml = function(t) {
|
|
16514
|
-
const a = W(this, Lt).indexOf(t);
|
|
16515
|
-
a !== -1 && W(this, Lt).splice(a, 1);
|
|
16516
|
-
}, jn = new WeakMap(), Na = new WeakMap();
|
|
16517
|
-
const Hr = Symbol("__queue"), Jy = "4.4.2", Yy = {
|
|
16516
|
+
}, Le(jn, "VERSION", Uy.version);
|
|
16517
|
+
let oo = jn;
|
|
16518
|
+
const Jy = "5.0.0", Yy = {
|
|
16518
16519
|
version: Jy
|
|
16519
16520
|
}, jy = {
|
|
16520
16521
|
strings: {
|
|
@@ -16524,7 +16525,7 @@ const Hr = Symbol("__queue"), Jy = "4.4.2", Yy = {
|
|
|
16524
16525
|
};
|
|
16525
16526
|
function Xy(e, t) {
|
|
16526
16527
|
let a = t;
|
|
16527
|
-
return a || (a = new Error("Upload error")), typeof a == "string" && (a = new Error(a)), a instanceof Error || (a = Object.assign(new Error("Upload error"), { data: a })),
|
|
16528
|
+
return a || (a = new Error("Upload error")), typeof a == "string" && (a = new Error(a)), a instanceof Error || (a = Object.assign(new Error("Upload error"), { data: a })), ty(e) ? (a = new ao(a, e), a) : (a.request = e, a);
|
|
16528
16529
|
}
|
|
16529
16530
|
function Gs(e) {
|
|
16530
16531
|
return e.data.slice(0, e.data.size, e.meta.type);
|
|
@@ -16542,7 +16543,7 @@ const Wy = {
|
|
|
16542
16543
|
responseType: ""
|
|
16543
16544
|
};
|
|
16544
16545
|
var Qa, Ht, vl, yl, bl, kl, yn;
|
|
16545
|
-
class gl extends
|
|
16546
|
+
class gl extends sy {
|
|
16546
16547
|
constructor(a, r) {
|
|
16547
16548
|
super(a, {
|
|
16548
16549
|
...Wy,
|
|
@@ -16558,8 +16559,8 @@ class gl extends K0 {
|
|
|
16558
16559
|
this.uppy.log("[XHRUpload] No files to upload!");
|
|
16559
16560
|
return;
|
|
16560
16561
|
}
|
|
16561
|
-
this.opts.limit === 0 && !this.opts[
|
|
16562
|
-
const r = this.uppy.getFilesByIds(a), n =
|
|
16562
|
+
this.opts.limit === 0 && !this.opts[Cr] && this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0", "warning"), this.uppy.log("[XHRUpload] Uploading...");
|
|
16563
|
+
const r = this.uppy.getFilesByIds(a), n = K0(r), o = G0(n);
|
|
16563
16564
|
if (this.uppy.emit("upload-start", o), this.opts.bundle) {
|
|
16564
16565
|
if (n.some((i) => i.isRemote))
|
|
16565
16566
|
throw new Error("Can’t upload remote files when the `bundle: true` option is set");
|
|
@@ -16569,7 +16570,7 @@ class gl extends K0 {
|
|
|
16569
16570
|
} else
|
|
16570
16571
|
await Ae(this, Ht, kl).call(this, n);
|
|
16571
16572
|
});
|
|
16572
|
-
if (this.type = "uploader", this.id = this.opts.id || "XHRUpload", this.defaultLocale = jy, this.i18nInit(),
|
|
16573
|
+
if (this.type = "uploader", this.id = this.opts.id || "XHRUpload", this.defaultLocale = jy, this.i18nInit(), Cr in this.opts ? this.requests = this.opts[Cr] : this.requests = new ny(this.opts.limit), this.opts.bundle && !this.opts.formData)
|
|
16573
16574
|
throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");
|
|
16574
16575
|
if (this.opts.bundle && typeof this.opts.headers == "function")
|
|
16575
16576
|
throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");
|
|
@@ -16578,7 +16579,7 @@ class gl extends K0 {
|
|
|
16578
16579
|
this.uploaderEvents = /* @__PURE__ */ Object.create(null), We(this, Qa, (n) => async (o, s) => {
|
|
16579
16580
|
var i, l;
|
|
16580
16581
|
try {
|
|
16581
|
-
const u = await
|
|
16582
|
+
const u = await W0(o, {
|
|
16582
16583
|
...s,
|
|
16583
16584
|
onBeforeRequest: (m, b) => {
|
|
16584
16585
|
var A, B;
|
|
@@ -16639,7 +16640,7 @@ class gl extends K0 {
|
|
|
16639
16640
|
return typeof n == "function" ? o.headers = n(a) : Object.assign(o.headers, this.opts.headers), r && Object.assign(o.headers, r.headers), a.xhrUpload && Object.assign(o.headers, a.xhrUpload.headers), o;
|
|
16640
16641
|
}
|
|
16641
16642
|
addMetadata(a, r, n) {
|
|
16642
|
-
|
|
16643
|
+
Ds(n.allowedMetaFields, r).forEach((s) => {
|
|
16643
16644
|
const i = r[s];
|
|
16644
16645
|
Array.isArray(i) ? i.forEach((l) => a.append(s, l)) : a.append(s, i);
|
|
16645
16646
|
});
|
|
@@ -16683,7 +16684,7 @@ class gl extends K0 {
|
|
|
16683
16684
|
}
|
|
16684
16685
|
}
|
|
16685
16686
|
Qa = new WeakMap(), Ht = new WeakSet(), vl = async function(a) {
|
|
16686
|
-
const r = new
|
|
16687
|
+
const r = new iy(this.uppy), n = new AbortController(), o = this.requests.wrapPromiseFunction(async () => {
|
|
16687
16688
|
const s = this.getOptions(a), i = W(this, Qa).call(this, [a]), l = s.formData ? this.createFormDataUpload(a, s) : a.data, u = typeof s.endpoint == "string" ? s.endpoint : await s.endpoint(a);
|
|
16688
16689
|
return i(u, {
|
|
16689
16690
|
...s,
|
|
@@ -16729,7 +16730,7 @@ Qa = new WeakMap(), Ht = new WeakSet(), vl = async function(a) {
|
|
|
16729
16730
|
}
|
|
16730
16731
|
}, bl = function(a) {
|
|
16731
16732
|
var o;
|
|
16732
|
-
const r = this.getOptions(a), n =
|
|
16733
|
+
const r = this.getOptions(a), n = Ds(r.allowedMetaFields, a.meta);
|
|
16733
16734
|
return {
|
|
16734
16735
|
...(o = a.remote) == null ? void 0 : o.body,
|
|
16735
16736
|
protocol: "multipart",
|
|
@@ -17020,7 +17021,7 @@ const gb = /* @__PURE__ */ he(fb, [["render", mb]]), vb = ue({
|
|
|
17020
17021
|
return this.allowedFileTypes.join(",");
|
|
17021
17022
|
},
|
|
17022
17023
|
uppyClient() {
|
|
17023
|
-
return new
|
|
17024
|
+
return new oo({
|
|
17024
17025
|
// https://uppy.io/docs/uppy/#options
|
|
17025
17026
|
restrictions: {
|
|
17026
17027
|
maxNumberOfFiles: this.maxFiles,
|