@caspingus/lt
Version:
A utility library of helpers and extensions useful when working with Learnosity APIs.
1,494 lines • 445 kB
JavaScript
import { r as e, t } from "../../chunk-BPfpcrXh.js";
import { r as n, t as r } from "../../extensionsFactory-hk5ijx1G.js";
import { i } from "../../app-22BVhJD9.js";
import { t as a } from "../../styling-D2uWYs0R.js";
//#region node_modules/@uppy/utils/lib/dataURItoBlob.js
var o = /^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;
function s(e, t, n) {
let r = o.exec(e), i = t.mimeType ?? r?.[1] ?? "plain/text", a;
if (r?.[2] != null) {
let e = atob(decodeURIComponent(r[3])), t = new Uint8Array(e.length);
for (let n = 0; n < e.length; n++) t[n] = e.charCodeAt(n);
a = [t];
} else r?.[3] != null && (a = [decodeURIComponent(r[3])]);
return n ? new File(a, t.name || "", { type: i }) : new Blob(a, { type: i });
}
//#endregion
//#region node_modules/@uppy/utils/lib/emaFilter.js
function c(e, t, n, r) {
return n === 0 || e === t ? e : r === 0 ? t : e + (t - e) * 2 ** (-r / n);
}
//#endregion
//#region node_modules/@uppy/utils/lib/FOCUSABLE_ELEMENTS.js
var l = [
"a[href]:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])",
"area[href]:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])",
"input:not([disabled]):not([inert]):not([aria-hidden])",
"select:not([disabled]):not([inert]):not([aria-hidden])",
"textarea:not([disabled]):not([inert]):not([aria-hidden])",
"button:not([disabled]):not([inert]):not([aria-hidden])",
"iframe:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])",
"object:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])",
"embed:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])",
"[contenteditable]:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])",
"[tabindex]:not([tabindex^=\"-\"]):not([inert]):not([aria-hidden])"
];
//#endregion
//#region node_modules/@uppy/utils/lib/isDOMElement.js
function u(e) {
return typeof e != "object" || !e || !("nodeType" in e) ? !1 : e.nodeType === Node.ELEMENT_NODE;
}
//#endregion
//#region node_modules/@uppy/utils/lib/findAllDOMElements.js
function d(e) {
if (typeof e == "string") {
let t = document.querySelectorAll(e);
return t.length === 0 ? null : Array.from(t);
}
return typeof e == "object" && u(e) ? [e] : null;
}
//#endregion
//#region node_modules/@uppy/utils/lib/findDOMElement.js
function f(e, t = document) {
return typeof e == "string" ? t.querySelector(e) : u(e) ? e : null;
}
//#endregion
//#region node_modules/@uppy/utils/lib/getFileNameAndExtension.js
function p(e) {
let t = e.lastIndexOf(".");
return t === -1 || t === e.length - 1 ? {
name: e,
extension: void 0
} : {
name: e.slice(0, t),
extension: e.slice(t + 1)
};
}
//#endregion
//#region node_modules/@uppy/utils/lib/mimeTypes.js
var m = {
__proto__: null,
md: "text/markdown",
markdown: "text/markdown",
mp4: "video/mp4",
mp3: "audio/mp3",
svg: "image/svg+xml",
jpg: "image/jpeg",
png: "image/png",
webp: "image/webp",
gif: "image/gif",
heic: "image/heic",
heif: "image/heif",
yaml: "text/yaml",
yml: "text/yaml",
csv: "text/csv",
tsv: "text/tab-separated-values",
tab: "text/tab-separated-values",
avi: "video/x-msvideo",
mks: "video/x-matroska",
mkv: "video/x-matroska",
mov: "video/quicktime",
dicom: "application/dicom",
doc: "application/msword",
msg: "application/vnd.ms-outlook",
docm: "application/vnd.ms-word.document.macroenabled.12",
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
dot: "application/msword",
dotm: "application/vnd.ms-word.template.macroenabled.12",
dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
xla: "application/vnd.ms-excel",
xlam: "application/vnd.ms-excel.addin.macroenabled.12",
xlc: "application/vnd.ms-excel",
xlf: "application/x-xliff+xml",
xlm: "application/vnd.ms-excel",
xls: "application/vnd.ms-excel",
xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
xlt: "application/vnd.ms-excel",
xltm: "application/vnd.ms-excel.template.macroenabled.12",
xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
xlw: "application/vnd.ms-excel",
txt: "text/plain",
text: "text/plain",
conf: "text/plain",
log: "text/plain",
pdf: "application/pdf",
zip: "application/zip",
"7z": "application/x-7z-compressed",
rar: "application/x-rar-compressed",
tar: "application/x-tar",
gz: "application/gzip",
dmg: "application/x-apple-diskimage"
};
//#endregion
//#region node_modules/@uppy/utils/lib/getFileType.js
function h(e) {
if (e.type) return e.type;
let t = e.name ? p(e.name).extension?.toLowerCase() : null;
return t && t in m ? m[t] : "application/octet-stream";
}
//#endregion
//#region node_modules/@uppy/utils/lib/generateFileID.js
function g(e) {
return e.charCodeAt(0).toString(32);
}
function _(e) {
let t = "";
return e.replace(/[^A-Z0-9]/gi, (e) => (t += `-${g(e)}`, "/")) + t;
}
function v(e, t) {
let n = t || "uppy";
return typeof e.name == "string" && (n += `-${_(e.name.toLowerCase())}`), e.type !== void 0 && (n += `-${e.type}`), e.meta && typeof e.meta.relativePath == "string" && (n += `-${_(e.meta.relativePath.toLowerCase())}`), e.data?.size !== void 0 && (n += `-${e.data.size}`), e.data.lastModified !== void 0 && (n += `-${e.data.lastModified}`), n;
}
function y(e) {
return !e.isRemote || !e.remote ? !1 : new Set([
"box",
"dropbox",
"drive",
"facebook",
"unsplash"
]).has(e.remote.provider);
}
function b(e, t) {
if (y(e)) return e.id;
let n = h(e);
return v({
...e,
type: n
}, t);
}
//#endregion
//#region node_modules/@uppy/utils/lib/toArray.js
var x = Array.from;
//#endregion
//#region node_modules/@uppy/utils/lib/getDroppedFiles/utils/fallbackApi.js
function S(e) {
let t = x(e.files);
return Promise.resolve(t);
}
//#endregion
//#region node_modules/@uppy/utils/lib/getDroppedFiles/utils/webkitGetAsEntryApi/getFilesAndDirectoriesFromDirectory.js
function C(e, t, n, { onSuccess: r }) {
e.readEntries((i) => {
let a = [...t, ...i];
i.length ? queueMicrotask(() => {
C(e, a, n, { onSuccess: r });
}) : r(a);
}, (e) => {
n(e), r(t);
});
}
//#endregion
//#region node_modules/@uppy/utils/lib/getDroppedFiles/utils/webkitGetAsEntryApi/index.js
function w(e, t) {
return e == null ? e : {
kind: e.isFile ? "file" : e.isDirectory ? "directory" : void 0,
name: e.name,
getFile() {
return new Promise((t, n) => e.file(t, n));
},
async *values() {
let n = e.createReader();
yield* await new Promise((e) => {
C(n, [], t, { onSuccess: (n) => e(n.map((e) => w(e, t))) });
});
},
isSameEntry: void 0
};
}
async function* T(e, t, n = void 0) {
let r = () => `${t}/${e.name}`;
if (e.kind === "file") {
let i = await e.getFile();
i == null ? n != null && (yield n) : (i.relativePath = t ? r() : null, yield i);
} else if (e.kind === "directory") for await (let n of e.values()) yield* T(n, t ? r() : e.name);
else n != null && (yield n);
}
async function* E(e, t) {
let n = await Promise.all(Array.from(e.items, async (e) => {
let n;
return n ??= w(typeof e.getAsEntry == "function" ? e.getAsEntry() : e.webkitGetAsEntry(), t), {
fileSystemHandle: n,
lastResortFile: e.getAsFile()
};
}));
for (let { lastResortFile: e, fileSystemHandle: r } of n) if (r != null) try {
yield* T(r, "", e);
} catch (n) {
e == null ? t(n) : yield e;
}
else e != null && (yield e);
}
//#endregion
//#region node_modules/@uppy/utils/lib/getDroppedFiles/index.js
async function D(e, t) {
let n = t?.logDropError ?? Function.prototype;
try {
let t = [];
for await (let r of E(e, n)) t.push(r);
return t;
} catch {
return S(e);
}
}
//#endregion
//#region node_modules/@uppy/utils/lib/getTextDirection.js
function O(e) {
for (; e && !e.dir;) e = e.parentNode;
return e?.dir;
}
//#endregion
//#region node_modules/@uppy/utils/lib/getTimeStamp.js
function k(e) {
return e < 10 ? `0${e}` : e.toString();
}
function A() {
let e = /* @__PURE__ */ new Date();
return `${k(e.getHours())}:${k(e.getMinutes())}:${k(e.getSeconds())}`;
}
//#endregion
//#region node_modules/@uppy/utils/lib/isDragDropSupported.js
function j() {
if (typeof window > "u") return !1;
let e = document.body;
return !(e == null || window == null || !("draggable" in e) || !("ondragstart" in e) || !("ondrop" in e) || !("FormData" in window) || !("FileReader" in window));
}
//#endregion
//#region node_modules/@uppy/utils/lib/isObjectURL.js
function M(e) {
return e.startsWith("blob:");
}
//#endregion
//#region node_modules/@uppy/utils/lib/isPreviewSupported.js
function N(e) {
return e ? /^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e) : !1;
}
//#endregion
//#region node_modules/@uppy/utils/lib/secondsToTime.js
function P(e) {
return {
hours: Math.floor(e / 3600) % 24,
minutes: Math.floor(e / 60) % 60,
seconds: Math.floor(e % 60)
};
}
//#endregion
//#region node_modules/@uppy/utils/lib/prettyETA.js
function F(e) {
let t = P(e);
return `${t.hours === 0 ? "" : `${t.hours}h`}${t.minutes === 0 ? "" : `${t.hours === 0 ? t.minutes : ` ${t.minutes.toString(10).padStart(2, "0")}`}m`}${t.hours === 0 ? `${t.minutes === 0 ? t.seconds : ` ${t.seconds.toString(10).padStart(2, "0")}`}s` : ""}`;
}
//#endregion
//#region node_modules/@uppy/utils/lib/RateLimitedQueue.js
function ee(e) {
return Error("Cancelled", { cause: e });
}
function te(e) {
if (e != null) {
let t = () => this.abort(e.reason);
e.addEventListener("abort", t, { once: !0 });
let n = () => {
e.removeEventListener("abort", t);
};
this.then?.(n, n);
}
return this;
}
var ne = class {
#e = 0;
#t = [];
#n = !1;
#r;
#i = 1;
#a;
#o;
limit;
constructor(e) {
typeof e != "number" || e === 0 ? this.limit = Infinity : this.limit = e;
}
#s(e) {
this.#e += 1;
let t = !1, n;
try {
n = e();
} catch (e) {
throw --this.#e, e;
}
return {
abort: (e) => {
t || (t = !0, --this.#e, n?.(e), this.#c());
},
done: () => {
t || (t = !0, --this.#e, this.#c());
}
};
}
#c() {
queueMicrotask(() => this.#l());
}
#l() {
if (this.#n || this.#e >= this.limit || this.#t.length === 0) return;
let e = this.#t.shift();
if (e == null) throw Error("Invariant violation: next is null");
let t = this.#s(e.fn);
e.abort = t.abort, e.done = t.done;
}
#u(e, t) {
let n = {
fn: e,
priority: t?.priority || 0,
abort: () => {
this.#d(n);
},
done: () => {
throw Error("Cannot mark a queued request as done: this indicates a bug");
}
}, r = this.#t.findIndex((e) => n.priority > e.priority);
return r === -1 ? this.#t.push(n) : this.#t.splice(r, 0, n), n;
}
#d(e) {
let t = this.#t.indexOf(e);
t !== -1 && this.#t.splice(t, 1);
}
run(e, t) {
return !this.#n && this.#e < this.limit ? this.#s(e) : this.#u(e, t);
}
wrapSyncFunction(e, t) {
return (...n) => {
let r = this.run(() => (e(...n), queueMicrotask(() => r.done()), () => {}), t);
return {
abortOn: te,
abort() {
r.abort();
}
};
};
}
wrapPromiseFunction(e, t) {
return (...n) => {
let r, i = new Promise((i, a) => {
r = this.run(() => {
let t, o;
try {
o = Promise.resolve(e(...n));
} catch (e) {
o = Promise.reject(e);
}
return o.then((e) => {
t ? a(t) : (r.done(), i(e));
}, (e) => {
t ? a(t) : (r.done(), a(e));
}), (e) => {
t = ee(e);
};
}, t);
});
return i.abort = (e) => {
r.abort(e);
}, i.abortOn = te, i;
};
}
resume() {
this.#n = !1, clearTimeout(this.#r);
for (let e = 0; e < this.limit; e++) this.#c();
}
#f = () => this.resume();
pause(e = null) {
this.#n = !0, clearTimeout(this.#r), e != null && (this.#r = setTimeout(this.#f, e));
}
rateLimit(e) {
clearTimeout(this.#o), this.pause(e), this.limit > 1 && Number.isFinite(this.limit) && (this.#a = this.limit - 1, this.limit = this.#i, this.#o = setTimeout(this.#p, e));
}
#p = () => {
if (this.#n) {
this.#o = setTimeout(this.#p, 0);
return;
}
this.#i = this.limit, this.limit = Math.ceil((this.#a + this.#i) / 2);
for (let e = this.#i; e <= this.limit; e++) this.#c();
this.#a - this.#i > 3 ? this.#o = setTimeout(this.#p, 2e3) : this.#i = Math.floor(this.#i / 2);
};
get isPaused() {
return this.#n;
}
};
//#endregion
//#region node_modules/@uppy/utils/lib/remoteFileObjToLocal.js
function re(e) {
return {
...e,
type: e.mimeType,
extension: e.name ? p(e.name).extension : null
};
}
//#endregion
//#region node_modules/@uppy/utils/lib/Translator.js
function ie(e, t, n) {
let r = [];
return e.forEach((e) => typeof e == "string" ? t[Symbol.split](e).forEach((e, t, i) => {
e !== "" && r.push(e), t < i.length - 1 && r.push(n);
}) : r.push(e)), r;
}
function ae(e, t) {
let n = /\$/g, r = [e];
if (t == null) return r;
for (let e of Object.keys(t)) if (e !== "_") {
let i = t[e];
typeof i == "string" && (i = n[Symbol.replace](i, "$$$$")), r = ie(r, RegExp(`%\\{${e}\\}`, "g"), i);
}
return r;
}
var oe = (e) => {
throw Error(`missing string: ${e}`);
}, se = class {
locale;
constructor(e, { onMissingKey: t = oe } = {}) {
this.locale = {
strings: {},
pluralize(e) {
return e === 1 ? 0 : 1;
}
}, Array.isArray(e) ? e.forEach(this.#t, this) : this.#t(e), this.#e = t;
}
#e;
#t(e) {
if (!e?.strings) return;
let t = this.locale;
Object.assign(this.locale, {
strings: {
...t.strings,
...e.strings
},
pluralize: e.pluralize || t.pluralize
});
}
translate(e, t) {
return this.translateArray(e, t).join("");
}
translateArray(e, t) {
let n = this.locale.strings[e];
if (n ??= (this.#e(e), e), typeof n == "object") {
if (t && t.smart_count !== void 0) {
let e = this.locale.pluralize(t.smart_count);
return ae(n[e], t);
}
throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}");
}
if (typeof n != "string") throw Error("string was not a string");
return ae(n, t);
}
}, ce = "...";
function le(e, t) {
if (t === 0) return "";
if (e.length <= t) return e;
if (t <= 4) return `${e.slice(0, t - 1)}…`;
let n = t - 3, r = Math.ceil(n / 2), i = Math.floor(n / 2);
return e.slice(0, r) + ce + e.slice(-i);
}
//#endregion
//#region node_modules/preact/dist/preact.module.js
var ue, I, de, fe, pe, me, he, ge, _e, ve, ye, be, xe, Se, Ce = {}, we = [], Te = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ee = Array.isArray;
function De(e, t) {
for (var n in t) e[n] = t[n];
return e;
}
function Oe(e) {
e && e.parentNode && e.parentNode.removeChild(e);
}
function ke(e, t, n) {
var r, i, a, o = {};
for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];
if (arguments.length > 2 && (o.children = arguments.length > 3 ? ue.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);
return Ae(e, o, r, i, null);
}
function Ae(e, t, n, r, i) {
var a = {
type: e,
props: t,
key: n,
ref: r,
__k: null,
__: null,
__b: 0,
__e: null,
__c: null,
constructor: void 0,
__v: i ?? ++de,
__i: -1,
__u: 0
};
return i == null && I.vnode != null && I.vnode(a), a;
}
function je() {
return { current: null };
}
function L(e) {
return e.children;
}
function R(e, t) {
this.props = e, this.context = t;
}
function Me(e, t) {
if (t == null) return e.__ ? Me(e.__, e.__i + 1) : null;
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
return typeof e.type == "function" ? Me(e) : null;
}
function Ne(e) {
if (e.__P && e.__d) {
var t = e.__v, n = t.__e, r = [], i = [], a = De({}, t);
a.__v = t.__v + 1, I.vnode && I.vnode(a), He(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? Me(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, Ue(r, a, i), t.__e = t.__ = null, a.__e != n && Pe(a);
}
}
function Pe(e) {
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
}), Pe(e);
}
function Fe(e) {
(!e.__d && (e.__d = !0) && fe.push(e) && !z.__r++ || pe != I.debounceRendering) && ((pe = I.debounceRendering) || me)(z);
}
function z() {
try {
for (var e, t = 1; fe.length;) fe.length > t && fe.sort(he), e = fe.shift(), t = fe.length, Ne(e);
} finally {
fe.length = z.__r = 0;
}
}
function Ie(e, t, n, r, i, a, o, s, c, l, u) {
var d, f, p, m, h, g, _, v = r && r.__k || we, y = t.length;
for (c = Le(n, t, v, c, y), d = 0; d < y; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && v[p.__i] || Ce, p.__i = d, g = He(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Ke(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), (_ = !!(4 & p.__u)) || f.__k === p.__k ? (c = B(p, c, e, _), _ && f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
return n.__e = h, c;
}
function Le(e, t, n, r, i) {
var a, o, s, c, l, u = n.length, d = u, f = 0;
for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = Ae(null, o, null, null, null) : Ee(o) ? o = e.__k[a] = Ae(L, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = Ae(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = Re(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = Me(s)), qe(s, s));
return r;
}
function B(e, t, n, r) {
var i, a;
if (typeof e.type == "function") {
for (i = e.__k, a = 0; i && a < i.length; a++) i[a] && (i[a].__ = e, t = B(i[a], t, n, r));
return t;
}
e.__e != t && (r && (t && e.type && !t.parentNode && (t = Me(e)), n.insertBefore(e.__e, t || null)), t = e.__e);
do
t &&= t.nextSibling;
while (t != null && t.nodeType == 8);
return t;
}
function V(e, t) {
return t ||= [], e == null || typeof e == "boolean" || (Ee(e) ? e.some(function(e) {
V(e, t);
}) : t.push(e)), t;
}
function Re(e, t, n, r) {
var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && (2 & l.__u) == 0;
if (l === null && s == null || u && s == l.key && c == l.type) return n;
if (r > +!!u) {
for (i = n - 1, a = n + 1; i >= 0 || a < t.length;) if ((l = t[o = i >= 0 ? i-- : a++]) != null && !(2 & l.__u) && s == l.key && c == l.type) return o;
}
return -1;
}
function ze(e, t, n) {
t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Te.test(t) ? n : n + "px";
}
function Be(e, t, n, r, i) {
var a, o;
n: if (t == "style") if (typeof n == "string") e.style.cssText = n;
else {
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ze(e.style, t, "");
if (n) for (t in n) r && n[t] == r[t] || ze(e.style, t, n[t]);
}
else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(ye, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[ve] = r[ve] : (n[ve] = be, e.addEventListener(t, a ? Se : xe, a)) : e.removeEventListener(t, a ? Se : xe, a);
else {
if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
e[t] = n ?? "";
break n;
} catch {}
typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
}
}
function Ve(e) {
return function(t) {
if (this.l) {
var n = this.l[t.type + e];
if (t[_e] == null) t[_e] = be++;
else if (t[_e] < n[ve]) return;
return n(I.event ? I.event(t) : t);
}
};
}
function He(e, t, n, r, i, a, o, s, c, l) {
var u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T = t.type;
if (t.constructor !== void 0) return null;
128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = I.__b) && u(t);
n: if (typeof T == "function") try {
if (_ = t.props, v = T.prototype && T.prototype.render, y = (u = T.contextType) && r[u.__c], b = u ? y ? y.props.value : u.__ : r, n.__c ? g = (d = t.__c = n.__c).__ = d.__E : (v ? t.__c = d = new T(_, b) : (t.__c = d = new R(_, b), d.constructor = T, d.render = Je), y && y.sub(d), d.state ||= {}, d.__n = r, f = d.__d = !0, d.__h = [], d._sb = []), v && d.__s == null && (d.__s = d.state), v && T.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = De({}, d.__s)), De(d.__s, T.getDerivedStateFromProps(_, d.__s))), p = d.props, m = d.state, d.__v = t, f) v && T.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), v && d.componentDidMount != null && d.__h.push(d.componentDidMount);
else {
if (v && T.getDerivedStateFromProps == null && _ !== p && d.componentWillReceiveProps != null && d.componentWillReceiveProps(_, b), t.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && !1 === d.shouldComponentUpdate(_, d.__s, b)) {
t.__v != n.__v && (d.props = _, d.state = d.__s, d.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
e && (e.__ = t);
}), we.push.apply(d.__h, d._sb), d._sb = [], d.__h.length && o.push(d);
break n;
}
d.componentWillUpdate != null && d.componentWillUpdate(_, d.__s, b), v && d.componentDidUpdate != null && d.__h.push(function() {
d.componentDidUpdate(p, m, h);
});
}
if (d.context = b, d.props = _, d.__P = e, d.__e = !1, x = I.__r, S = 0, v) d.state = d.__s, d.__d = !1, x && x(t), u = d.render(d.props, d.state, d.context), we.push.apply(d.__h, d._sb), d._sb = [];
else do
d.__d = !1, x && x(t), u = d.render(d.props, d.state, d.context), d.state = d.__s;
while (d.__d && ++S < 25);
d.state = d.__s, d.getChildContext != null && (r = De(De({}, r), d.getChildContext())), v && !f && d.getSnapshotBeforeUpdate != null && (h = d.getSnapshotBeforeUpdate(p, m)), C = u != null && u.type === L && u.key == null ? We(u.props.children) : u, s = Ie(e, Ee(C) ? C : [C], t, n, r, i, a, o, s, c, l), d.base = t.__e, t.__u &= -161, d.__h.length && o.push(d), g && (d.__E = d.__ = null);
} catch (e) {
if (t.__v = null, c || a != null) if (e.then) {
for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;
a[a.indexOf(s)] = null, t.__e = s;
} else {
for (w = a.length; w--;) Oe(a[w]);
H(t);
}
else t.__e = n.__e, t.__k = n.__k, e.then || H(t);
I.__e(e, t, n);
}
else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Ge(n.__e, t, n, r, i, a, o, c, l);
return (u = I.diffed) && u(t), 128 & t.__u ? void 0 : s;
}
function H(e) {
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(H));
}
function Ue(e, t, n) {
for (var r = 0; r < n.length; r++) Ke(n[r], n[++r], n[++r]);
I.__c && I.__c(t, e), e.some(function(t) {
try {
e = t.__h, t.__h = [], e.some(function(e) {
e.call(t);
});
} catch (e) {
I.__e(e, t.__v);
}
});
}
function We(e) {
return typeof e != "object" || !e || e.__b > 0 ? e : Ee(e) ? e.map(We) : De({}, e);
}
function Ge(e, t, n, r, i, a, o, s, c) {
var l, u, d, f, p, m, h, g = n.props || Ce, _ = t.props, v = t.type;
if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {
for (l = 0; l < a.length; l++) if ((p = a[l]) && "setAttribute" in p == !!v && (v ? p.localName == v : p.nodeType == 3)) {
e = p, a[l] = null;
break;
}
}
if (e == null) {
if (v == null) return document.createTextNode(_);
e = document.createElementNS(i, v, _.is && _), s &&= (I.__m && I.__m(t, a), !1), a = null;
}
if (v == null) g === _ || s && e.data == _ || (e.data = _);
else {
if (a &&= ue.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;
for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || Be(e, l, null, p, i);
for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || Be(e, l, p, g[l], i);
if (u) s || d && (u.__html == d.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
else if (d && (e.innerHTML = ""), Ie(t.type == "template" ? e.content : e, Ee(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && Me(n, 0), s, c), a != null) for (l = a.length; l--;) Oe(a[l]);
s || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && Be(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && Be(e, l, h, g[l], i));
}
return e;
}
function Ke(e, t, n) {
try {
if (typeof e == "function") {
var r = typeof e.__u == "function";
r && e.__u(), r && t == null || (e.__u = e(t));
} else e.current = t;
} catch (e) {
I.__e(e, n);
}
}
function qe(e, t, n) {
var r, i;
if (I.unmount && I.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Ke(r, null, t)), (r = e.__c) != null) {
if (r.componentWillUnmount) try {
r.componentWillUnmount();
} catch (e) {
I.__e(e, t);
}
r.base = r.__P = null;
}
if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && qe(r[i], t, n || typeof e.type != "function");
n || Oe(e.__e), e.__c = e.__ = e.__e = void 0;
}
function Je(e, t, n) {
return this.constructor(e, n);
}
function Ye(e, t, n) {
var r, i, a, o;
t == document && (t = document.documentElement), I.__ && I.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], He(t, e = (!r && n || t).__k = ke(L, null, [e]), i || Ce, Ce, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? ue.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), Ue(a, e, o);
}
function Xe(e, t, n) {
var r, i, a, o, s = De({}, e.props);
for (a in e.type && e.type.defaultProps && (o = e.type.defaultProps), t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : s[a] = t[a] === void 0 && o != null ? o[a] : t[a];
return arguments.length > 2 && (s.children = arguments.length > 3 ? ue.call(arguments, 2) : n), Ae(e.type, s, r || e.key, i || e.ref, null);
}
ue = we.slice, I = { __e: function(e, t, n, r) {
for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;
} catch (t) {
e = t;
}
throw e;
} }, de = 0, R.prototype.setState = function(e, t) {
var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = De({}, this.state);
typeof e == "function" && (e = e(De({}, n), this.props)), e && De(n, e), e != null && this.__v && (t && this._sb.push(t), Fe(this));
}, R.prototype.forceUpdate = function(e) {
this.__v && (this.__e = !0, e && this.__h.push(e), Fe(this));
}, R.prototype.render = L, fe = [], me = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, he = function(e, t) {
return e.__v.__b - t.__v.__b;
}, z.__r = 0, ge = Math.random().toString(8), _e = "__d" + ge, ve = "__a" + ge, ye = /(PointerCapture)$|Capture$/i, be = 0, xe = Ve(!1), Se = Ve(!0);
//#endregion
//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
var Ze = 0;
Array.isArray;
function U(e, t, n, r, i, a) {
t ||= {};
var o, s, c = t;
if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
var l = {
type: e,
props: c,
key: n,
ref: o,
__k: null,
__: null,
__b: 0,
__e: null,
__c: null,
constructor: void 0,
__v: --Ze,
__i: -1,
__u: 0,
__source: i,
__self: a
};
if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);
return I.vnode && I.vnode(l), l;
}
//#endregion
//#region node_modules/preact/hooks/dist/hooks.module.js
var W, G, Qe, $e, et = 0, tt = [], K = I, nt = K.__b, rt = K.__r, it = K.diffed, at = K.__c, ot = K.unmount, st = K.__;
function ct(e, t) {
K.__h && K.__h(G, e, et || t), et = 0;
var n = G.__H ||= {
__: [],
__h: []
};
return e >= n.__.length && n.__.push({}), n.__[e];
}
function lt(e) {
return et = 1, ut(xt, e);
}
function ut(e, t, n) {
var r = ct(W++, 2);
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : xt(void 0, t), function(e) {
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
}], r.__c = G, !G.__f)) {
var i = function(e, t, n) {
if (!r.__c.__H) return !0;
var i = r.__c.__H.__.filter(function(e) {
return e.__c;
});
if (i.every(function(e) {
return !e.__N;
})) return !a || a.call(this, e, t, n);
var o = r.__c.props !== e;
return i.some(function(e) {
if (e.__N) {
var t = e.__[0];
e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (o = !0);
}
}), a && a.call(this, e, t, n) || o;
};
G.__f = !0;
var a = G.shouldComponentUpdate, o = G.componentWillUpdate;
G.componentWillUpdate = function(e, t, n) {
if (this.__e) {
var r = a;
a = void 0, i(e, t, n), a = r;
}
o && o.call(this, e, t, n);
}, G.shouldComponentUpdate = i;
}
return r.__N || r.__;
}
function dt(e, t) {
var n = ct(W++, 3);
!K.__s && bt(n.__H, t) && (n.__ = e, n.u = t, G.__H.__h.push(n));
}
function ft(e) {
return et = 5, pt(function() {
return { current: e };
}, []);
}
function pt(e, t) {
var n = ct(W++, 7);
return bt(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
}
function mt(e, t) {
return et = 8, pt(function() {
return e;
}, t);
}
function ht() {
for (var e; e = tt.shift();) {
var t = e.__H;
if (e.__P && t) try {
t.__h.some(vt), t.__h.some(yt), t.__h = [];
} catch (n) {
t.__h = [], K.__e(n, e.__v);
}
}
}
K.__b = function(e) {
G = null, nt && nt(e);
}, K.__ = function(e, t) {
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), st && st(e, t);
}, K.__r = function(e) {
rt && rt(e), W = 0;
var t = (G = e.__c).__H;
t && (Qe === G ? (t.__h = [], G.__h = [], t.__.some(function(e) {
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
})) : (t.__h.some(vt), t.__h.some(yt), t.__h = [], W = 0)), Qe = G;
}, K.diffed = function(e) {
it && it(e);
var t = e.__c;
t && t.__H && (t.__H.__h.length && (tt.push(t) !== 1 && $e === K.requestAnimationFrame || (($e = K.requestAnimationFrame) || _t)(ht)), t.__H.__.some(function(e) {
e.u && (e.__H = e.u), e.u = void 0;
})), Qe = G = null;
}, K.__c = function(e, t) {
t.some(function(e) {
try {
e.__h.some(vt), e.__h = e.__h.filter(function(e) {
return !e.__ || yt(e);
});
} catch (n) {
t.some(function(e) {
e.__h &&= [];
}), t = [], K.__e(n, e.__v);
}
}), at && at(e, t);
}, K.unmount = function(e) {
ot && ot(e);
var t, n = e.__c;
n && n.__H && (n.__H.__.some(function(e) {
try {
vt(e);
} catch (e) {
t = e;
}
}), n.__H = void 0, t && K.__e(t, n.__v));
};
var gt = typeof requestAnimationFrame == "function";
function _t(e) {
var t, n = function() {
clearTimeout(r), gt && cancelAnimationFrame(t), setTimeout(e);
}, r = setTimeout(n, 35);
gt && (t = requestAnimationFrame(n));
}
function vt(e) {
var t = G, n = e.__c;
typeof n == "function" && (e.__c = void 0, n()), G = t;
}
function yt(e) {
var t = G;
e.__c = e.__(), G = t;
}
function bt(e, t) {
return !e || e.length !== t.length || t.some(function(t, n) {
return t !== e[n];
});
}
function xt(e, t) {
return typeof t == "function" ? t(e) : t;
}
//#endregion
//#region node_modules/@uppy/utils/lib/VirtualList.js
var St = {
position: "relative",
width: "100%",
minHeight: "100%"
}, Ct = {
position: "absolute",
top: 0,
left: 0,
width: "100%",
overflow: "visible"
};
function wt({ data: e, rowHeight: t, renderRow: n, overscanCount: r = 10, padding: i = 4, ...a }) {
let o = ft(null), [s, c] = lt(0), [l, u] = lt(0);
dt(() => {
function e() {
o.current != null && l !== o.current.offsetHeight && u(o.current.offsetHeight);
}
return e(), window.addEventListener("resize", e), () => {
window.removeEventListener("resize", e);
};
}, [l]);
let d = mt(() => {
o.current && c(o.current.scrollTop);
}, []), f = Math.floor(s / t), p = Math.floor(l / t);
r && (f = Math.max(0, f - f % r), p += r);
let m = f + p + i, h = e.slice(f, m), g = {
...St,
height: e.length * t
}, _ = {
...Ct,
top: f * t
};
return U("div", {
onScroll: d,
ref: o,
...a,
children: U("div", {
role: "presentation",
style: g,
children: U("div", {
role: "presentation",
style: _,
children: h.map(n)
})
})
});
}
//#endregion
//#region node_modules/@uppy/core/lib/BasePlugin.js
var Tt = class {
uppy;
opts;
id;
defaultLocale;
i18n;
i18nArray;
type;
VERSION;
constructor(e, t) {
this.uppy = e, this.opts = t ?? {};
}
getPluginState() {
let { plugins: e } = this.uppy.getState();
return e?.[this.id] || {};
}
setPluginState(e) {
let { plugins: t } = this.uppy.getState();
this.uppy.setState({ plugins: {
...t,
[this.id]: {
...t[this.id],
...e
}
} });
}
setOptions(e) {
this.opts = {
...this.opts,
...e
}, this.setPluginState(void 0), this.i18nInit();
}
i18nInit() {
let e = new se([
this.defaultLocale,
this.uppy.locale,
this.opts.locale
]);
this.i18n = e.translate.bind(e), this.i18nArray = e.translateArray.bind(e), this.setPluginState(void 0);
}
addTarget(e) {
throw Error("Extend the addTarget method to add your plugin to another plugin's target");
}
install() {}
uninstall() {}
update(e) {}
afterUpdate() {}
}, Et = {
debug: () => {},
warn: () => {},
error: (...e) => console.error(`[Uppy] [${A()}]`, ...e)
}, Dt = {
debug: (...e) => console.debug(`[Uppy] [${A()}]`, ...e),
warn: (...e) => console.warn(`[Uppy] [${A()}]`, ...e),
error: (...e) => console.error(`[Uppy] [${A()}]`, ...e)
}, Ot = /* @__PURE__ */ t(((e, t) => {
t.exports = function(e) {
if (typeof e != "number" || Number.isNaN(e)) throw TypeError(`Expected a number, got ${typeof e}`);
let t = e < 0, n = Math.abs(e);
if (t && (n = -n), n === 0) return "0 B";
let r = [
"B",
"KB",
"MB",
"GB",
"TB",
"PB",
"EB",
"ZB",
"YB"
], i = Math.min(Math.floor(Math.log(n) / Math.log(1024)), r.length - 1), a = Number(n / 1024 ** i), o = r[i];
return `${a >= 10 || a % 1 == 0 ? Math.round(a) : a.toFixed(1)} ${o}`;
};
})), kt = /* @__PURE__ */ t(((e, t) => {
function n(e, t) {
this.text = e ||= "", this.hasWild = ~e.indexOf("*"), this.separator = t, this.parts = e.split(t);
}
n.prototype.match = function(e) {
var t = !0, n = this.parts, r, i = n.length, a;
if (typeof e == "string" || e instanceof String) if (!this.hasWild && this.text != e) t = !1;
else {
for (a = (e || "").split(this.separator), r = 0; t && r < i; r++) if (n[r] === "*") continue;
else t = r < a.length ? n[r] === a[r] : !1;
t &&= a;
}
else if (typeof e.splice == "function") for (t = [], r = e.length; r--;) this.match(e[r]) && (t[t.length] = e[r]);
else if (typeof e == "object") for (var o in t = {}, e) this.match(o) && (t[o] = e[o]);
return t;
}, t.exports = function(e, t, r) {
var i = new n(e, r || /[\/\.]/);
return t === void 0 ? i : i.match(t);
};
})), At = /* @__PURE__ */ t(((e, t) => {
var n = kt(), r = /[\/\+\.]/;
t.exports = function(e, t) {
function i(t) {
var i = n(t, e, r);
return i && i.length >= 2;
}
return t ? i(t.split(";")[0]) : i;
};
})), jt = /* @__PURE__ */ e(Ot(), 1), Mt = /* @__PURE__ */ e(At(), 1), Nt = {
maxFileSize: null,
minFileSize: null,
maxTotalFileSize: null,
maxNumberOfFiles: null,
minNumberOfFiles: null,
allowedFileTypes: null,
requiredMetaFields: []
}, Pt = class extends Error {
isUserFacing;
file;
constructor(e, t) {
super(e), this.isUserFacing = t?.isUserFacing ?? !0, t?.file && (this.file = t.file);
}
isRestriction = !0;
}, Ft = class {
getI18n;
getOpts;
constructor(e, t) {
this.getI18n = t, this.getOpts = () => {
let t = e();
if (t.restrictions?.allowedFileTypes != null && !Array.isArray(t.restrictions.allowedFileTypes)) throw TypeError("`restrictions.allowedFileTypes` must be an array");
return t;
};
}
validateAggregateRestrictions(e, t) {
let { maxTotalFileSize: n, maxNumberOfFiles: r } = this.getOpts().restrictions;
if (r && e.filter((e) => !e.isGhost).length + t.length > r) throw new Pt(`${this.getI18n()("youCanOnlyUploadX", { smart_count: r })}`);
if (n) {
let r = [...e, ...t].reduce((e, t) => e + (t.size ?? 0), 0);
if (r > n) throw new Pt(this.getI18n()("aggregateExceedsSize", {
sizeAllowed: (0, jt.default)(n),
size: (0, jt.default)(r)
}));
}
}
validateSingleFile(e) {
let { maxFileSize: t, minFileSize: n, allowedFileTypes: r } = this.getOpts().restrictions;
if (r && !r.some((t) => t.includes("/") ? e.type ? (0, Mt.default)(e.type.replace(/;.*?$/, ""), t) : !1 : t[0] === "." && e.extension ? e.extension.toLowerCase() === t.slice(1).toLowerCase() : !1)) {
let t = r.join(", ");
throw new Pt(this.getI18n()("youCanOnlyUploadFileTypes", { types: t }), { file: e });
}
if (t && e.size != null && e.size > t) throw new Pt(this.getI18n()("exceedsSize", {
size: (0, jt.default)(t),
file: e.name ?? this.getI18n()("unnamed")
}), { file: e });
if (n && e.size != null && e.size < n) throw new Pt(this.getI18n()("inferiorSize", { size: (0, jt.default)(n) }), { file: e });
}
validate(e, t) {
t.forEach((e) => {
this.validateSingleFile(e);
}), this.validateAggregateRestrictions(e, t);
}
validateMinNumberOfFiles(e) {
let { minNumberOfFiles: t } = this.getOpts().restrictions;
if (t && Object.keys(e).length < t) throw new Pt(this.getI18n()("youHaveToAtLeastSelectX", { smart_count: t }));
}
getMissingRequiredMetaFields(e) {
let t = new Pt(this.getI18n()("missingRequiredMetaFieldOnFile", { fileName: e.name ?? this.getI18n()("unnamed") })), { requiredMetaFields: n } = this.getOpts().restrictions, r = [];
for (let t of n) (!Object.hasOwn(e.meta, t) || e.meta[t] === "") && r.push(t);
return {
missingFields: r,
error: t
};
}
};
//#endregion
//#region node_modules/@uppy/core/lib/UIPlugin.js
function It(e) {
let t = null, n;
return (...r) => (n = r, t ||= Promise.resolve().then(() => (t = null, e(...n))), t);
}
var Lt = class e extends Tt {
#e;
isTargetDOMEl;
el;
parent;
title;
getTargetPlugin(t) {
let n;
if (typeof t?.addTarget == "function") n = t, n instanceof e || console.warn(Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.", { cause: {
targetPlugin: n,
UIPlugin: e
} }));
else if (typeof t == "function") {
let e = t;
this.uppy.iteratePlugins((t) => {
t instanceof e && (n = t);
});
}
return n;
}
mount(e, t) {
let n = t.id, r = f(e);
if (r) {
this.isTargetDOMEl = !0;
let t = document.createElement("div");
return t.classList.add("uppy-Root"), this.#e = It((e) => {
this.uppy.getPlugin(this.id) && (Ye(this.render(e, t), t), this.afterUpdate());
}), this.uppy.log(`Installing ${n} to a DOM element '${e}'`), this.opts.replaceTargetContent && (r.innerHTML = ""), Ye(this.render(this.uppy.getState(), t), t), this.el = t, r.appendChild(t), t.dir = this.opts.direction || O(t) || "ltr", this.onMount(), this.el;
}
let i = this.getTargetPlugin(e);
if (i) return this.uppy.log(`Installing ${n} to ${i.id}`), this.parent = i, this.el = i.addTarget(t), this.onMount(), this.el;
this.uppy.log(`Not installing ${n}`);
let a = `Invalid target option given to ${n}.`;
throw typeof e == "function" ? a += " The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly." : a += "If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.", Error(a);
}
render(e, t) {
throw Error("Extend the render method to add your plugin to a DOM element");
}
update(e) {
this.el != null && this.#e?.(e);
}
unmount() {
this.isTargetDOMEl && this.el?.remove(), this.onUnmount();
}
onMount() {}
onUnmount() {}
}, Rt = {
name: "@uppy/store-default",
description: "The default simple object-based store for Uppy.",
version: "5.0.0",
license: "MIT",
main: "lib/index.js",
type: "module",
sideEffects: !1,
scripts: {
build: "tsc --build tsconfig.build.json",
typecheck: "tsc --build",
test: "vitest run --environment=jsdom --silent='passed-only'"
},
keywords: [
"file uploader",
"uppy",
"uppy-store"
],
homepage: "https://uppy.io",
bugs: { url: "https://github.com/transloadit/uppy/issues" },
devDependencies: {
jsdom: "^26.1.0",
typescript: "^5.8.3",
vitest: "^3.2.4"
},
repository: {
type: "git",
url: "git+https://github.com/transloadit/uppy.git"
},
exports: {
".": "./lib/index.js",
"./package.json": "./package.json"
},
files: [
"src",
"lib",
"dist",
"CHANGELOG.md"
]
}, zt = class {
static VERSION = Rt.version;
state = {};
#e = /* @__PURE__ */ new Set();
getState() {
return this.state;
}
setState(e) {
let t = { ...this.state }, n = {
...this.state,
...e
};
this.state = n, this.#t(t, n, e);
}
subscribe(e) {
return this.#e.add(e), () => {
this.#e.delete(e);
};
}
#t(...e) {
this.#e.forEach((t) => {
t(...e);
});
}
}, Bt = /* @__PURE__ */ t(((e, t) => {
function n(e) {
var t = typeof e;
return e != null && (t == "object" || t == "function");
}
t.exports = n;
})), Vt = /* @__PURE__ */ t(((e, t) => {
t.exports = typeof global == "object" && global && global.Object === Object && global;
})), Ht = /* @__PURE__ */ t(((e, t) => {
var n = Vt(), r = typeof self == "object" && self && self.Object === Object && self;
t.exports = n || r || Function("return this")();
})), Ut = /* @__PURE__ */ t(((e, t) => {
var n = Ht();
t.exports = function() {
return n.Date.now();
};
})), Wt = /* @__PURE__ */ t(((e, t) => {
var n = /\s/;
function r(e) {
for (var t = e.length; t-- && n.test(e.charAt(t)););
return t;
}
t.exports = r;
})), Gt = /* @__PURE__ */ t(((e, t) => {
var n = Wt(), r = /^\s+/;
function i(e) {
return e && e.slice(0, n(e) + 1).replace(r, "");
}
t.exports = i;
})), Kt = /* @__PURE__ */ t(((e, t) => {
t.exports = Ht().Symbol;
})), qt = /* @__PURE__ */ t(((e, t) => {
var n = Kt(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
function s(e) {
var t = i.call(e, o), n = e[o];
try {
e[o] = void 0;
var r = !0;
} catch {}
var s = a.call(e);
return r && (t ? e[o] = n : delete e[o]), s;
}
t.exports = s;
})), Jt = /* @__PURE__ */ t(((e, t) => {
var n = Object.prototype.toString;
function r(e) {
return n.call(e);
}
t.exports = r;
})), Yt = /* @__PURE__ */ t(((e, t) => {
var n = Kt(), r = qt(), i = Jt(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
function c(e) {
return e == null ? e === void 0 ? o : a : s && s in Object(e) ? r(e) : i(e);
}
t.exports = c;
})), Xt = /* @__PURE__ */ t(((e, t) => {
function n(e) {
return typeof e == "object" && !!e;
}
t.exports = n;
})), Zt = /* @__PURE__ */ t(((e, t) => {
var n = Yt(), r = Xt(), i = "[object Symbol]";
function a(e) {
return typeof e == "symbol" || r(e) && n(e) == i;
}
t.exports = a;
})), Qt = /* @__PURE__ */ t(((e, t) => {
var n = Gt(), r = Bt(), i = Zt(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
function u(e) {
if (typeof e == "number") return e;
if (i(e)) return a;
if (r(e)) {
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
e = r(t) ? t + "" : t;
}
if (typeof e != "string") return e === 0 ? e : +e;
e = n(e);
var u = s.test(e);
return u || c.test(e) ? l(e.slice(2), u ? 2 : 8) : o.test(e) ? a : +e;
}
t.exports = u;
})), $t = /* @__PURE__ */ t(((e, t) => {
var n = Bt(), r = Ut(), i = Qt(), a = "Expected a function", o = Math.max, s = Math.min;
function c(e, t, c) {
var l, u, d, f, p, m, h = 0, g = !1, _ = !1, v = !0;
if (typeof e != "function") throw TypeError(a);
t = i(t) || 0, n(c) && (g = !!c.leading, _ = "maxWait" in c, d = _ ? o(i(c.maxWait) || 0, t) : d, v = "trailing" in c ? !!c.trailing : v);
function y(t) {
var n = l, r = u;
return l = u = void 0, h = t, f = e.apply(r, n), f;
}
function b(e) {
return h = e, p = setTimeout(C, t), g ? y(e) : f;
}
function x(e) {
var n = e - m, r = e - h, i = t - n;
return _ ? s(i, d - r) : i;
}
function S(e) {
var n = e - m, r = e - h;
return m === void 0 || n >= t || n < 0 || _ && r >= d;
}
function C() {
var e = r();
if (S(e)) return w(e);
p = setTimeout(C, x(e));
}
function w(e) {
return p = void 0, v && l ? y(e) : (l = u = void 0, f);
}
function T() {
p !== void 0 && clearTimeout(p), h = 0, l = m = u = p = void 0;
}
function E() {
return p === void 0 ? f : w(r());
}
function D() {
var e = r(), n = S(e);
if (l = arguments, u = this, m = e, n) {
if (p === void 0) return b(m);
if (_) return clearTimeout(p), p = setTimeout(C, t), y(m);
}
return p === void 0 && (p = setTimeout(C, t)), f;
}
return D.cancel = T, D.flush = E, D;
}
t.exports = c;
})), en = /* @__PURE__ */ t(((e, t) => {
var n = $t(), r = Bt(), i = "Expected a function";
function a(e, t, a) {
var o = !0, s = !0;
if (typeof e != "function") throw TypeError(i);
return r(a) && (o = "leading" in a ? !!a.leading : o, s = "trailing" in a ? !!a.trailing : s), n(e, t, {
leading: o,
maxWait: t,
trailing: s
});
}
t.exports = a;
})), tn = /* @__PURE__ */ t(((e, t) => {
t.exports = function() {
var e = {}, t = e._fns = {};
e.emit = function(e, t, i, a, o, s, c) {
var l = n(e);
l.length && r(e, l, [
t,
i,
a,
o,
s,
c
]);
}, e.on = function(e, n) {
t[e] || (t[e] = []), t[e].push(n);
}, e.once = function(t, n) {
function r() {
n.apply(this, arguments), e.off(t, r);
}
this.on(t, r);
}, e.off = function(e, t) {
var n = [];
if (e && t) for (var r = this._fns[e], i = 0, a = r ? r.length : 0; i < a; i++) r[i] !== t && n.push(r[i]);
n.length ? this._fns[e] = n : delete this._fns[e];
};
function n(e) {
for (var n = t[e] ? t[e] : [], r = e.indexOf(":"), i = r === -1 ? [e] : [e.substring(0, r), e.substring(r + 1)], a = Object.keys(t), o = 0, s = a.length; o < s; o++) {
var c = a[o];
if (c === "*" && (n = n.concat(t[c])), i.length === 2 && i[0] === c) {
n = n.concat(t[c]);
break;
}
}
return n;
}
function r(e, t, n) {
for (var r = 0, i = t.length; r < i && t[r]; r++) t[r].event = e, t[r].apply(t[r], n);
}
return e;
};
})), nn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", rn = (e = 21) => {
let t = "", n = e | 0;
for (; n--;) t += nn[Math.random() * 64 | 0];
return t;
}, an = {
name: "@uppy/core",
description: "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:",
version: "5.2.0",
license: "MIT",
style: "dist/style.min.css",
type: "module",
sideEffects: ["*.css"],
scripts: {
build: "tsc --build tsconfig.build.json",
"build:css": "sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css",
typecheck: "tsc --build",
test: "vitest run --environment=jsdom --silent='passed-only'"
},
keywords: [
"file uploader",
"uppy",
"uppy-plugin"
],
homepage: "https://uppy.io",
bugs: { url: "https://github.com/transloadit/uppy/issues" },
repository: {
type: "git",
url: "git+https://github.com/transloadit/uppy.git"
},
files: [
"src",
"lib",
"dist",
"CHANGELOG.md"
],
exports: {
".": "./lib/index.js",
"./css/style.min.css": "./dist/style.min.css",
"./css/style.css": "./dist/style.css",
"./css/style.scss": "./src/style.scss",
"./package.json": "./package.json"
},
dependencies: {
"@transloadit/prettier-bytes": "^0.3.4",
"@uppy/store-default": "^5.0.0",
"@uppy/utils": "^7.1.4",
lodash: "^4.17.21",
"mime-match": "^1.0.2",
"namespace-emitter": "^2.0.1",
nanoid: "^5.0.9",
preact: "^10.5.13"
},
devDependencies: {
"@types/deep-freeze": "^0",
cssnano: "^7.0.7",
"deep-freeze": "^0.0.1",
jsdom: "^26.1.0",
postcss: "^8.5.6",
"postcss-cli": "^11.0.1",
sass: "^1.89.2",
typescript: "^5.8.3",
vitest: "^3.2.4"
}
};
//#endregion
//#region node_modules/@uppy