1
0
Fork 0
mirror of https://github.com/voltbonn/diversity.volt.link.git synced 2024-06-30 17:59:40 +00:00
diversity.volt.link/frontend/scripts/async.min.js

3 lines
26 KiB
JavaScript
Raw Normal View History

2022-11-20 12:54:10 +00:00
// source: https://cdn.jsdelivr.net/npm/async@3.1.0/dist/async.min.js
(function (e, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t(e.async = {}) })(this, function (e) { 'use strict'; function t(e, ...t) { return (...a) => e(...t, ...a) } function a(e) { return function (...t) { var a = t.pop(); return e.call(this, t, a) } } function n(e) { setTimeout(e, 0) } function i(e) { return (t, ...a) => e(() => t(...a)) } function r(e) { return u(e) ? function (...t) { const a = t.pop(), n = e.apply(this, t); return s(n, a) } : a(function (t, a) { var n; try { n = e.apply(this, t) } catch (t) { return a(t) } return n && "function" == typeof n.then ? s(n, a) : void a(null, n) }) } function s(e, t) { return e.then(e => { l(t, null, e) }, e => { l(t, e && e.message ? e : new Error(e)) }) } function l(e, t, a) { try { e(t, a) } catch (e) { Ee(t => { throw t }, e) } } function u(e) { return "AsyncFunction" === e[Symbol.toStringTag] } function c(e) { return "AsyncGenerator" === e[Symbol.toStringTag] } function d(e) { return "function" == typeof e[Symbol.asyncIterator] } function p(e) { if ("function" != typeof e) throw new Error("expected a function"); return u(e) ? r(e) : e } function o(e, t = e.length) { function a(...a) { return "function" == typeof a[t - 1] ? e.apply(this, a) : new Promise((n, i) => { a[t - 1] = (e, ...t) => e ? i(e) : void n(1 < t.length ? t : t[0]), e.apply(this, a) }) } if (!t) throw new Error("arity is undefined"); return Object.defineProperty(a, "name", { value: `awaitable(${e.name})` }), a } function h(e) { return function (t, ...a) { const n = o(function (n) { var i = this; return e(t, (e, t) => { p(e).apply(i, a.concat(t)) }, n) }); return n } } function f(e, t, a, n) { t = t || []; var i = [], r = 0, s = p(a); return e(t, (e, t, a) => { var n = r++; s(e, (e, t) => { i[n] = t, a(e) }) }, e => { n(e, i) }) } function y(e) { return e && "number" == typeof e.length && 0 <= e.length && 0 == e.length % 1 } function m(e) { function t(...t) { if (null !== e) { var a = e; e = null, a.apply(this, t) } } return Object.assign(t, e), t } function g(e) { return e[Symbol.iterator] && e[Symbol.iterator]() } function k(e) { var t = -1, a = e.length; return function () { return ++t < a ? { value: e[t], key: t } : null } } function v(e) { var t = -1; return function () { var a = e.next(); return a.done ? null : (t++, { value: a.value, key: t }) } } function S(e) { var t = e ? Object.keys(e) : [], a = -1, n = t.length; return function () { var i = t[++a]; return a < n ? { value: e[i], key: i } : null } } function L(e) { if (y(e)) return k(e); var t = g(e); return t ? v(t) : S(e) } function x(e) { return function (...t) { if (null === e) throw new Error("Callback was already called."); var a = e; e = null, a.apply(this, t) } } function E(e, t, a, n) { function i() { d >= t || c || l || (c = !0, e.next().then(({ value: e, done: t }) => { if (!(u || l)) return c = !1, t ? (l = !0, void (0 >= d && n(null))) : void (d++, a(e, p, r), p++, i()) }).catch(s)) } function r(e, t) { return d -= 1, u ? void 0 : e ? s(e) : !1 === e ? (l = !0, void (u = !0)) : t === be || l && 0 >= d ? (l = !0, n(null)) : void i() } function s(e) { u || (c = !1, l = !0, n(e)) } let l = !1, u = !1, c = !1, d = 0, p = 0; i() } function b(e, t, a) { function n(e, t) { !1 === e && (l = !0); !0 === l || (e ? a(e) : (++r === s || t === be) && a(null)) } a = m(a); var i = 0, r = 0, { length: s } = e, l = !1; for (0 === s && a(null); i < s; i++)t(e[i], i, x(n)) } function O(e, t, a) { return _e(e, 1 / 0, t, a) } function _() { function e(e, ...n) { return e ? a(e) : void t(1 < n.length ? n : n[0]) } let t, a; return e[Fe] = new Promise((e, n) => { t = e, a = n }), e } function M(e, t, a) { function n(e, t) { g.push(() => l(e, t)) } function i() { if (!h) { if (0 === g.length && 0 === o) return a(null, d); for (; g.length && o < t;) { var e = g.shift(); e() } } } function r(e, t) { var a = y[e]; a || (a = y[e] = []), a.push(t) } function s(e) { var t = y[e] || []; t.forEach(e => e()), i() } function l(e, t) { if (!f) { var n = x((t,