UNPKG

@getopenpay/openpay-js

Version:

Accept payments through OpenPay, right on your site

1,374 lines (1,373 loc) 350 kB
import { R as qe } from "./index-DC5j54sB.js"; function xt(j) { return j === void 0 && (j = {}), typeof j.addEventListener == "function" && typeof j.removeEventListener == "function"; } var Et = "OT_ZONE_CONTEXT", zt = ( /** @class */ (function() { function j() { this._enabled = !1, this._zoneCounter = 0; } return j.prototype._activeContextFromZone = function(S) { return S && S.get(Et) || qe; }, j.prototype._bindFunction = function(S, B) { var z = this, ee = function() { for (var te = this, ie = [], fe = 0; fe < arguments.length; fe++) ie[fe] = arguments[fe]; return z.with(S, function() { return B.apply(te, ie); }); }; return Object.defineProperty(ee, "length", { enumerable: !1, configurable: !0, writable: !1, value: B.length }), ee; }, j.prototype._bindListener = function(S, B) { var z = B; return z.__ot_listeners !== void 0 || (z.__ot_listeners = {}, typeof z.addEventListener == "function" && (z.addEventListener = this._patchAddEventListener(z, z.addEventListener, S)), typeof z.removeEventListener == "function" && (z.removeEventListener = this._patchRemoveEventListener(z, z.removeEventListener))), B; }, j.prototype._createZoneName = function() { this._zoneCounter++; var S = Math.random(); return this._zoneCounter + "-" + S; }, j.prototype._createZone = function(S, B) { var z; return Zone.current.fork({ name: S, properties: (z = {}, z[Et] = B, z) }); }, j.prototype._getActiveZone = function() { return Zone.current; }, j.prototype._patchAddEventListener = function(S, B, z) { var ee = this; return function(te, ie, fe) { S.__ot_listeners === void 0 && (S.__ot_listeners = {}); var ke = S.__ot_listeners[te]; ke === void 0 && (ke = /* @__PURE__ */ new WeakMap(), S.__ot_listeners[te] = ke); var ve = ee.bind(z, ie); return ke.set(ie, ve), B.call(this, te, ve, fe); }; }, j.prototype._patchRemoveEventListener = function(S, B) { return function(z, ee) { if (S.__ot_listeners === void 0 || S.__ot_listeners[z] === void 0) return B.call(this, z, ee); var te = S.__ot_listeners[z], ie = te.get(ee); return te.delete(ee), B.call(this, z, ie || ee); }; }, j.prototype.active = function() { if (!this._enabled) return qe; var S = this._getActiveZone(), B = this._activeContextFromZone(S); return B || qe; }, j.prototype.bind = function(S, B) { return S === void 0 && (S = this.active()), typeof B == "function" ? this._bindFunction(S, B) : (xt(B) && this._bindListener(S, B), B); }, j.prototype.disable = function() { return this._enabled = !1, this; }, j.prototype.enable = function() { return this._enabled = !0, this; }, j.prototype.with = function(S, B, z) { for (var ee = [], te = 3; te < arguments.length; te++) ee[te - 3] = arguments[te]; var ie = this._createZoneName(), fe = this._createZone(ie, S); return fe.run(B, z, ee); }, j; })() ), pt = {}, gt; function Ft() { if (gt) return pt; gt = 1; /** * @license Angular v<unknown> * (c) 2010-2025 Google LLC. https://angular.io/ * License: MIT */ const j = globalThis; function S(t) { return (j.__Zone_symbol_prefix || "__zone_symbol__") + t; } function B() { const t = j.performance; function n(I) { t && t.mark && t.mark(I); } function a(I, s) { t && t.measure && t.measure(I, s); } n("Zone"); class e { static __symbol__ = S; static assertZonePatched() { if (j.Promise !== O.ZoneAwarePromise) throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)"); } static get root() { let s = e.current; for (; s.parent; ) s = s.parent; return s; } static get current() { return b.zone; } static get currentTask() { return D; } static __load_patch(s, i, r = !1) { if (O.hasOwnProperty(s)) { const E = j[S("forceDuplicateZoneCheck")] === !0; if (!r && E) throw Error("Already loaded patch: " + s); } else if (!j["__Zone_disable_" + s]) { const E = "Zone:" + s; n(E), O[s] = i(j, e, P), a(E, E); } } get parent() { return this._parent; } get name() { return this._name; } _parent; _name; _properties; _zoneDelegate; constructor(s, i) { this._parent = s, this._name = i ? i.name || "unnamed" : "<root>", this._properties = i && i.properties || {}, this._zoneDelegate = new f(this, this._parent && this._parent._zoneDelegate, i); } get(s) { const i = this.getZoneWith(s); if (i) return i._properties[s]; } getZoneWith(s) { let i = this; for (; i; ) { if (i._properties.hasOwnProperty(s)) return i; i = i._parent; } return null; } fork(s) { if (!s) throw new Error("ZoneSpec required!"); return this._zoneDelegate.fork(this, s); } wrap(s, i) { if (typeof s != "function") throw new Error("Expecting function got: " + s); const r = this._zoneDelegate.intercept(this, s, i), E = this; return function() { return E.runGuarded(r, this, arguments, i); }; } run(s, i, r, E) { b = { parent: b, zone: this }; try { return this._zoneDelegate.invoke(this, s, i, r, E); } finally { b = b.parent; } } runGuarded(s, i = null, r, E) { b = { parent: b, zone: this }; try { try { return this._zoneDelegate.invoke(this, s, i, r, E); } catch (G) { if (this._zoneDelegate.handleError(this, G)) throw G; } } finally { b = b.parent; } } runTask(s, i, r) { if (s.zone != this) throw new Error("A task can only be run in the zone of creation! (Creation: " + (s.zone || re).name + "; Execution: " + this.name + ")"); const E = s, { type: G, data: { isPeriodic: ce = !1, isRefreshable: A = !1 } = {} } = s; if (s.state === J && (G === Y || G === g)) return; const ge = s.state != x; ge && E._transitionTo(x, d); const ye = D; D = E, b = { parent: b, zone: this }; try { G == g && s.data && !ce && !A && (s.cancelFn = void 0); try { return this._zoneDelegate.invokeTask(this, E, i, r); } catch (se) { if (this._zoneDelegate.handleError(this, se)) throw se; } } finally { const se = s.state; if (se !== J && se !== K) if (G == Y || ce || A && se === k) ge && E._transitionTo(d, x, k); else { const Ce = E._zoneDelegates; this._updateTaskCount(E, -1), ge && E._transitionTo(J, x, J), A && (E._zoneDelegates = Ce); } b = b.parent, D = ye; } } scheduleTask(s) { if (s.zone && s.zone !== this) { let r = this; for (; r; ) { if (r === s.zone) throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${s.zone.name}`); r = r.parent; } } s._transitionTo(k, J); const i = []; s._zoneDelegates = i, s._zone = this; try { s = this._zoneDelegate.scheduleTask(this, s); } catch (r) { throw s._transitionTo(K, k, J), this._zoneDelegate.handleError(this, r), r; } return s._zoneDelegates === i && this._updateTaskCount(s, 1), s.state == k && s._transitionTo(d, k), s; } scheduleMicroTask(s, i, r, E) { return this.scheduleTask(new p(U, s, i, r, E, void 0)); } scheduleMacroTask(s, i, r, E, G) { return this.scheduleTask(new p(g, s, i, r, E, G)); } scheduleEventTask(s, i, r, E, G) { return this.scheduleTask(new p(Y, s, i, r, E, G)); } cancelTask(s) { if (s.zone != this) throw new Error("A task can only be cancelled in the zone of creation! (Creation: " + (s.zone || re).name + "; Execution: " + this.name + ")"); if (!(s.state !== d && s.state !== x)) { s._transitionTo(V, d, x); try { this._zoneDelegate.cancelTask(this, s); } catch (i) { throw s._transitionTo(K, V), this._zoneDelegate.handleError(this, i), i; } return this._updateTaskCount(s, -1), s._transitionTo(J, V), s.runCount = -1, s; } } _updateTaskCount(s, i) { const r = s._zoneDelegates; i == -1 && (s._zoneDelegates = null); for (let E = 0; E < r.length; E++) r[E]._updateTaskCount(s.type, i); } } const c = { name: "", onHasTask: (I, s, i, r) => I.hasTask(i, r), onScheduleTask: (I, s, i, r) => I.scheduleTask(i, r), onInvokeTask: (I, s, i, r, E, G) => I.invokeTask(i, r, E, G), onCancelTask: (I, s, i, r) => I.cancelTask(i, r) }; class f { get zone() { return this._zone; } _zone; _taskCounts = { microTask: 0, macroTask: 0, eventTask: 0 }; _parentDelegate; _forkDlgt; _forkZS; _forkCurrZone; _interceptDlgt; _interceptZS; _interceptCurrZone; _invokeDlgt; _invokeZS; _invokeCurrZone; _handleErrorDlgt; _handleErrorZS; _handleErrorCurrZone; _scheduleTaskDlgt; _scheduleTaskZS; _scheduleTaskCurrZone; _invokeTaskDlgt; _invokeTaskZS; _invokeTaskCurrZone; _cancelTaskDlgt; _cancelTaskZS; _cancelTaskCurrZone; _hasTaskDlgt; _hasTaskDlgtOwner; _hasTaskZS; _hasTaskCurrZone; constructor(s, i, r) { this._zone = s, this._parentDelegate = i, this._forkZS = r && (r && r.onFork ? r : i._forkZS), this._forkDlgt = r && (r.onFork ? i : i._forkDlgt), this._forkCurrZone = r && (r.onFork ? this._zone : i._forkCurrZone), this._interceptZS = r && (r.onIntercept ? r : i._interceptZS), this._interceptDlgt = r && (r.onIntercept ? i : i._interceptDlgt), this._interceptCurrZone = r && (r.onIntercept ? this._zone : i._interceptCurrZone), this._invokeZS = r && (r.onInvoke ? r : i._invokeZS), this._invokeDlgt = r && (r.onInvoke ? i : i._invokeDlgt), this._invokeCurrZone = r && (r.onInvoke ? this._zone : i._invokeCurrZone), this._handleErrorZS = r && (r.onHandleError ? r : i._handleErrorZS), this._handleErrorDlgt = r && (r.onHandleError ? i : i._handleErrorDlgt), this._handleErrorCurrZone = r && (r.onHandleError ? this._zone : i._handleErrorCurrZone), this._scheduleTaskZS = r && (r.onScheduleTask ? r : i._scheduleTaskZS), this._scheduleTaskDlgt = r && (r.onScheduleTask ? i : i._scheduleTaskDlgt), this._scheduleTaskCurrZone = r && (r.onScheduleTask ? this._zone : i._scheduleTaskCurrZone), this._invokeTaskZS = r && (r.onInvokeTask ? r : i._invokeTaskZS), this._invokeTaskDlgt = r && (r.onInvokeTask ? i : i._invokeTaskDlgt), this._invokeTaskCurrZone = r && (r.onInvokeTask ? this._zone : i._invokeTaskCurrZone), this._cancelTaskZS = r && (r.onCancelTask ? r : i._cancelTaskZS), this._cancelTaskDlgt = r && (r.onCancelTask ? i : i._cancelTaskDlgt), this._cancelTaskCurrZone = r && (r.onCancelTask ? this._zone : i._cancelTaskCurrZone), this._hasTaskZS = null, this._hasTaskDlgt = null, this._hasTaskDlgtOwner = null, this._hasTaskCurrZone = null; const E = r && r.onHasTask, G = i && i._hasTaskZS; (E || G) && (this._hasTaskZS = E ? r : c, this._hasTaskDlgt = i, this._hasTaskDlgtOwner = this, this._hasTaskCurrZone = this._zone, r.onScheduleTask || (this._scheduleTaskZS = c, this._scheduleTaskDlgt = i, this._scheduleTaskCurrZone = this._zone), r.onInvokeTask || (this._invokeTaskZS = c, this._invokeTaskDlgt = i, this._invokeTaskCurrZone = this._zone), r.onCancelTask || (this._cancelTaskZS = c, this._cancelTaskDlgt = i, this._cancelTaskCurrZone = this._zone)); } fork(s, i) { return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, s, i) : new e(s, i); } intercept(s, i, r) { return this._interceptZS ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, s, i, r) : i; } invoke(s, i, r, E, G) { return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, s, i, r, E, G) : i.apply(r, E); } handleError(s, i) { return this._handleErrorZS ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, s, i) : !0; } scheduleTask(s, i) { let r = i; if (this._scheduleTaskZS) this._hasTaskZS && r._zoneDelegates.push(this._hasTaskDlgtOwner), r = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, s, i), r || (r = i); else if (i.scheduleFn) i.scheduleFn(i); else if (i.type == U) X(i); else throw new Error("Task is missing scheduleFn."); return r; } invokeTask(s, i, r, E) { return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, s, i, r, E) : i.callback.apply(r, E); } cancelTask(s, i) { let r; if (this._cancelTaskZS) r = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, s, i); else { if (!i.cancelFn) throw Error("Task is not cancelable"); r = i.cancelFn(i); } return r; } hasTask(s, i) { try { this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, s, i); } catch (r) { this.handleError(s, r); } } _updateTaskCount(s, i) { const r = this._taskCounts, E = r[s], G = r[s] = E + i; if (G < 0) throw new Error("More tasks executed then were scheduled."); if (E == 0 || G == 0) { const ce = { microTask: r.microTask > 0, macroTask: r.macroTask > 0, eventTask: r.eventTask > 0, change: s }; this.hasTask(this._zone, ce); } } } class p { type; source; invoke; callback; data; scheduleFn; cancelFn; _zone = null; runCount = 0; _zoneDelegates = null; _state = "notScheduled"; constructor(s, i, r, E, G, ce) { if (this.type = s, this.source = i, this.data = E, this.scheduleFn = G, this.cancelFn = ce, !r) throw new Error("callback is not defined"); this.callback = r; const A = this; s === Y && E && E.useG ? this.invoke = p.invokeTask : this.invoke = function() { return p.invokeTask.call(j, A, this, arguments); }; } static invokeTask(s, i, r) { s || (s = this), oe++; try { return s.runCount++, s.zone.runTask(s, i, r); } finally { oe == 1 && ne(), oe--; } } get zone() { return this._zone; } get state() { return this._state; } cancelScheduleRequest() { this._transitionTo(J, k); } _transitionTo(s, i, r) { if (this._state === i || this._state === r) this._state = s, s == J && (this._zoneDelegates = null); else throw new Error(`${this.type} '${this.source}': can not transition to '${s}', expecting state '${i}'${r ? " or '" + r + "'" : ""}, was '${this._state}'.`); } toString() { return this.data && typeof this.data.handleId < "u" ? this.data.handleId.toString() : Object.prototype.toString.call(this); } // add toJSON method to prevent cyclic error when // call JSON.stringify(zoneTask) toJSON() { return { type: this.type, state: this.state, source: this.source, zone: this.zone.name, runCount: this.runCount }; } } const T = S("setTimeout"), y = S("Promise"), w = S("then"); let _ = [], C = !1, M; function F(I) { if (M || j[y] && (M = j[y].resolve(0)), M) { let s = M[w]; s || (s = M.then), s.call(M, I); } else j[T](I, 0); } function X(I) { oe === 0 && _.length === 0 && F(ne), I && _.push(I); } function ne() { if (!C) { for (C = !0; _.length; ) { const I = _; _ = []; for (let s = 0; s < I.length; s++) { const i = I[s]; try { i.zone.runTask(i, null, null); } catch (r) { P.onUnhandledError(r); } } } P.microtaskDrainDone(), C = !1; } } const re = { name: "NO ZONE" }, J = "notScheduled", k = "scheduling", d = "scheduled", x = "running", V = "canceling", K = "unknown", U = "microTask", g = "macroTask", Y = "eventTask", O = {}, P = { symbol: S, currentZoneFrame: () => b, onUnhandledError: $, microtaskDrainDone: $, scheduleMicroTask: X, showUncaughtError: () => !e[S("ignoreConsoleErrorUncaughtError")], patchEventTarget: () => [], patchOnProperties: $, patchMethod: () => $, bindArguments: () => [], patchThen: () => $, patchMacroTask: () => $, patchEventPrototype: () => $, isIEOrEdge: () => !1, getGlobalObjects: () => { }, ObjectDefineProperty: () => $, ObjectGetOwnPropertyDescriptor: () => { }, ObjectCreate: () => { }, ArraySlice: () => [], patchClass: () => $, wrapWithCurrentZone: () => $, filterProperties: () => [], attachOriginToPatched: () => $, _redefineProperty: () => $, patchCallbacks: () => $, nativeScheduleMicroTask: F }; let b = { parent: null, zone: new e(null, null) }, D = null, oe = 0; function $() { } return a("Zone", "Zone"), e; } function z() { const t = globalThis, n = t[S("forceDuplicateZoneCheck")] === !0; if (t.Zone && (n || typeof t.Zone.__symbol__ != "function")) throw new Error("Zone already loaded."); return t.Zone ??= B(), t.Zone; } const ee = Object.getOwnPropertyDescriptor, te = Object.defineProperty, ie = Object.getPrototypeOf, fe = Object.create, ke = Array.prototype.slice, ve = "addEventListener", Ae = "removeEventListener", je = S(ve), He = S(Ae), _e = "true", Te = "false", we = S(""); function xe(t, n) { return Zone.current.wrap(t, n); } function Fe(t, n, a, e, c) { return Zone.current.scheduleMacroTask(t, n, a, e, c); } const H = S, Ne = typeof window < "u", De = Ne ? window : void 0, Q = Ne && De || globalThis, mt = "removeAttribute"; function Ve(t, n) { for (let a = t.length - 1; a >= 0; a--) typeof t[a] == "function" && (t[a] = xe(t[a], n + "_" + a)); return t; } function yt(t, n) { const a = t.constructor.name; for (let e = 0; e < n.length; e++) { const c = n[e], f = t[c]; if (f) { const p = ee(t, c); if (!Xe(p)) continue; t[c] = ((T) => { const y = function() { return T.apply(this, Ve(arguments, a + "." + c)); }; return pe(y, T), y; })(f); } } } function Xe(t) { return t ? t.writable === !1 ? !1 : !(typeof t.get == "function" && typeof t.set > "u") : !0; } const Ye = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, Ze = !("nw" in Q) && typeof Q.process < "u" && Q.process.toString() === "[object process]", ze = !Ze && !Ye && !!(Ne && De.HTMLElement), $e = typeof Q.process < "u" && Q.process.toString() === "[object process]" && !Ye && !!(Ne && De.HTMLElement), Le = {}, kt = H("enable_beforeunload"), Je = function(t) { if (t = t || Q.event, !t) return; let n = Le[t.type]; n || (n = Le[t.type] = H("ON_PROPERTY" + t.type)); const a = this || t.target || Q, e = a[n]; let c; if (ze && a === De && t.type === "error") { const f = t; c = e && e.call(this, f.message, f.filename, f.lineno, f.colno, f.error), c === !0 && t.preventDefault(); } else c = e && e.apply(this, arguments), // https://github.com/angular/angular/issues/47579 // https://www.w3.org/TR/2011/WD-html5-20110525/history.html#beforeunloadevent // This is the only specific case we should check for. The spec defines that the // `returnValue` attribute represents the message to show the user. When the event // is created, this attribute must be set to the empty string. t.type === "beforeunload" && // To prevent any breaking changes resulting from this change, given that // it was already causing a significant number of failures in G3, we have hidden // that behavior behind a global configuration flag. Consumers can enable this // flag explicitly if they want the `beforeunload` event to be handled as defined // in the specification. Q[kt] && // The IDL event definition is `attribute DOMString returnValue`, so we check whether // `typeof result` is a string. typeof c == "string" ? t.returnValue = c : c != null && !c && t.preventDefault(); return c; }; function Ke(t, n, a) { let e = ee(t, n); if (!e && a && ee(a, n) && (e = { enumerable: !0, configurable: !0 }), !e || !e.configurable) return; const c = H("on" + n + "patched"); if (t.hasOwnProperty(c) && t[c]) return; delete e.writable, delete e.value; const f = e.get, p = e.set, T = n.slice(2); let y = Le[T]; y || (y = Le[T] = H("ON_PROPERTY" + T)), e.set = function(w) { let _ = this; if (!_ && t === Q && (_ = Q), !_) return; typeof _[y] == "function" && _.removeEventListener(T, Je), p?.call(_, null), _[y] = w, typeof w == "function" && _.addEventListener(T, Je, !1); }, e.get = function() { let w = this; if (!w && t === Q && (w = Q), !w) return null; const _ = w[y]; if (_) return _; if (f) { let C = f.call(this); if (C) return e.set.call(this, C), typeof w[mt] == "function" && w.removeAttribute(n), C; } return null; }, te(t, n, e), t[c] = !0; } function Qe(t, n, a) { if (n) for (let e = 0; e < n.length; e++) Ke(t, "on" + n[e], a); else { const e = []; for (const c in t) c.slice(0, 2) == "on" && e.push(c); for (let c = 0; c < e.length; c++) Ke(t, e[c], a); } } const le = H("originalInstance"); function Se(t) { const n = Q[t]; if (!n) return; Q[H(t)] = n, Q[t] = function() { const c = Ve(arguments, t); switch (c.length) { case 0: this[le] = new n(); break; case 1: this[le] = new n(c[0]); break; case 2: this[le] = new n(c[0], c[1]); break; case 3: this[le] = new n(c[0], c[1], c[2]); break; case 4: this[le] = new n(c[0], c[1], c[2], c[3]); break; default: throw new Error("Arg list too long."); } }, pe(Q[t], n); const a = new n(function() { }); let e; for (e in a) t === "XMLHttpRequest" && e === "responseBlob" || (function(c) { typeof a[c] == "function" ? Q[t].prototype[c] = function() { return this[le][c].apply(this[le], arguments); } : te(Q[t].prototype, c, { set: function(f) { typeof f == "function" ? (this[le][c] = xe(f, t + "." + c), pe(this[le][c], f)) : this[le][c] = f; }, get: function() { return this[le][c]; } }); })(e); for (e in n) e !== "prototype" && n.hasOwnProperty(e) && (Q[t][e] = n[e]); } function Ee(t, n, a) { let e = t; for (; e && !e.hasOwnProperty(n); ) e = ie(e); !e && t[n] && (e = t); const c = H(n); let f = null; if (e && (!(f = e[c]) || !e.hasOwnProperty(c))) { f = e[c] = e[n]; const p = e && ee(e, n); if (Xe(p)) { const T = a(f, c, n); e[n] = function() { return T(this, arguments); }, pe(e[n], f); } } return f; } function vt(t, n, a) { let e = null; function c(f) { const p = f.data; return p.args[p.cbIdx] = function() { f.invoke.apply(this, arguments); }, e.apply(p.target, p.args), f; } e = Ee(t, n, (f) => function(p, T) { const y = a(p, T); return y.cbIdx >= 0 && typeof T[y.cbIdx] == "function" ? Fe(y.name, T[y.cbIdx], y, c) : f.apply(p, T); }); } function pe(t, n) { t[H("OriginalDelegate")] = n; } let et = !1, Ge = !1; function bt() { if (et) return Ge; et = !0; try { const t = De.navigator.userAgent; (t.indexOf("MSIE ") !== -1 || t.indexOf("Trident/") !== -1 || t.indexOf("Edge/") !== -1) && (Ge = !0); } catch { } return Ge; } function tt(t) { return typeof t == "function"; } function nt(t) { return typeof t == "number"; } const Ct = { useG: !0 }, ae = {}, rt = {}, ot = new RegExp("^" + we + "(\\w+)(true|false)$"), st = H("propagationStopped"); function it(t, n) { const a = (n ? n(t) : t) + Te, e = (n ? n(t) : t) + _e, c = we + a, f = we + e; ae[t] = {}, ae[t][Te] = c, ae[t][_e] = f; } function Pt(t, n, a, e) { const c = e && e.add || ve, f = e && e.rm || Ae, p = e && e.listeners || "eventListeners", T = e && e.rmAll || "removeAllListeners", y = H(c), w = "." + c + ":", _ = "prependListener", C = "." + _ + ":", M = function(k, d, x) { if (k.isRemoved) return; const V = k.callback; typeof V == "object" && V.handleEvent && (k.callback = (g) => V.handleEvent(g), k.originalDelegate = V); let K; try { k.invoke(k, d, [x]); } catch (g) { K = g; } const U = k.options; if (U && typeof U == "object" && U.once) { const g = k.originalDelegate ? k.originalDelegate : k.callback; d[f].call(d, x.type, g, U); } return K; }; function F(k, d, x) { if (d = d || t.event, !d) return; const V = k || d.target || t, K = V[ae[d.type][x ? _e : Te]]; if (K) { const U = []; if (K.length === 1) { const g = M(K[0], V, d); g && U.push(g); } else { const g = K.slice(); for (let Y = 0; Y < g.length && !(d && d[st] === !0); Y++) { const O = M(g[Y], V, d); O && U.push(O); } } if (U.length === 1) throw U[0]; for (let g = 0; g < U.length; g++) { const Y = U[g]; n.nativeScheduleMicroTask(() => { throw Y; }); } } } const X = function(k) { return F(this, k, !1); }, ne = function(k) { return F(this, k, !0); }; function re(k, d) { if (!k) return !1; let x = !0; d && d.useG !== void 0 && (x = d.useG); const V = d && d.vh; let K = !0; d && d.chkDup !== void 0 && (K = d.chkDup); let U = !1; d && d.rt !== void 0 && (U = d.rt); let g = k; for (; g && !g.hasOwnProperty(c); ) g = ie(g); if (!g && k[c] && (g = k), !g || g[y]) return !1; const Y = d && d.eventNameToString, O = {}, P = g[y] = g[c], b = g[H(f)] = g[f], D = g[H(p)] = g[p], oe = g[H(T)] = g[T]; let $; d && d.prepend && ($ = g[H(d.prepend)] = g[d.prepend]); function I(o, u) { return u ? typeof o == "boolean" ? { capture: o, passive: !0 } : o ? typeof o == "object" && o.passive !== !1 ? { ...o, passive: !0 } : o : { passive: !0 } : o; } const s = function(o) { if (!O.isExisting) return P.call(O.target, O.eventName, O.capture ? ne : X, O.options); }, i = function(o) { if (!o.isRemoved) { const u = ae[o.eventName]; let v; u && (v = u[o.capture ? _e : Te]); const R = v && o.target[v]; if (R) { for (let m = 0; m < R.length; m++) if (R[m] === o) { R.splice(m, 1), o.isRemoved = !0, o.removeAbortListener && (o.removeAbortListener(), o.removeAbortListener = null), R.length === 0 && (o.allRemoved = !0, o.target[v] = null); break; } } } if (o.allRemoved) return b.call(o.target, o.eventName, o.capture ? ne : X, o.options); }, r = function(o) { return P.call(O.target, O.eventName, o.invoke, O.options); }, E = function(o) { return $.call(O.target, O.eventName, o.invoke, O.options); }, G = function(o) { return b.call(o.target, o.eventName, o.invoke, o.options); }, ce = x ? s : r, A = x ? i : G, ge = function(o, u) { const v = typeof u; return v === "function" && o.callback === u || v === "object" && o.originalDelegate === u; }, ye = d?.diff || ge, se = Zone[H("UNPATCHED_EVENTS")], Ce = t[H("PASSIVE_EVENTS")]; function h(o) { if (typeof o == "object" && o !== null) { const u = { ...o }; return o.signal && (u.signal = o.signal), u; } return o; } const l = function(o, u, v, R, m = !1, N = !1) { return function() { const Z = this || t; let L = arguments[0]; d && d.transferEventName && (L = d.transferEventName(L)); let W = arguments[1]; if (!W) return o.apply(this, arguments); if (Ze && L === "uncaughtException") return o.apply(this, arguments); let q = !1; if (typeof W != "function") { if (!W.handleEvent) return o.apply(this, arguments); q = !0; } if (V && !V(o, W, Z, arguments)) return; const me = !!Ce && Ce.indexOf(L) !== -1, he = h(I(arguments[2], me)), Pe = he?.signal; if (Pe?.aborted) return; if (se) { for (let de = 0; de < se.length; de++) if (L === se[de]) return me ? o.call(Z, L, W, he) : o.apply(this, arguments); } const Ue = he ? typeof he == "boolean" ? !0 : he.capture : !1, ft = he && typeof he == "object" ? he.once : !1, Ht = Zone.current; let We = ae[L]; We || (it(L, Y), We = ae[L]); const ht = We[Ue ? _e : Te]; let Re = Z[ht], dt = !1; if (Re) { if (dt = !0, K) { for (let de = 0; de < Re.length; de++) if (ye(Re[de], W)) return; } } else Re = Z[ht] = []; let Ie; const _t = Z.constructor.name, Tt = rt[_t]; Tt && (Ie = Tt[L]), Ie || (Ie = _t + u + (Y ? Y(L) : L)), O.options = he, ft && (O.options.once = !1), O.target = Z, O.capture = Ue, O.eventName = L, O.isExisting = dt; const Oe = x ? Ct : void 0; Oe && (Oe.taskData = O), Pe && (O.options.signal = void 0); const ue = Ht.scheduleEventTask(Ie, W, Oe, v, R); if (Pe) { O.options.signal = Pe; const de = () => ue.zone.cancelTask(ue); o.call(Pe, "abort", de, { once: !0 }), ue.removeAbortListener = () => Pe.removeEventListener("abort", de); } if (O.target = null, Oe && (Oe.taskData = null), ft && (O.options.once = !0), typeof ue.options != "boolean" && (ue.options = he), ue.target = Z, ue.capture = Ue, ue.eventName = L, q && (ue.originalDelegate = W), N ? Re.unshift(ue) : Re.push(ue), m) return Z; }; }; return g[c] = l(P, w, ce, A, U), $ && (g[_] = l($, C, E, A, U, !0)), g[f] = function() { const o = this || t; let u = arguments[0]; d && d.transferEventName && (u = d.transferEventName(u)); const v = arguments[2], R = v ? typeof v == "boolean" ? !0 : v.capture : !1, m = arguments[1]; if (!m) return b.apply(this, arguments); if (V && !V(b, m, o, arguments)) return; const N = ae[u]; let Z; N && (Z = N[R ? _e : Te]); const L = Z && o[Z]; if (L) for (let W = 0; W < L.length; W++) { const q = L[W]; if (ye(q, m)) { if (L.splice(W, 1), q.isRemoved = !0, L.length === 0 && (q.allRemoved = !0, o[Z] = null, !R && typeof u == "string")) { const me = we + "ON_PROPERTY" + u; o[me] = null; } return q.zone.cancelTask(q), U ? o : void 0; } } return b.apply(this, arguments); }, g[p] = function() { const o = this || t; let u = arguments[0]; d && d.transferEventName && (u = d.transferEventName(u)); const v = [], R = ct(o, Y ? Y(u) : u); for (let m = 0; m < R.length; m++) { const N = R[m]; let Z = N.originalDelegate ? N.originalDelegate : N.callback; v.push(Z); } return v; }, g[T] = function() { const o = this || t; let u = arguments[0]; if (u) { d && d.transferEventName && (u = d.transferEventName(u)); const v = ae[u]; if (v) { const R = v[Te], m = v[_e], N = o[R], Z = o[m]; if (N) { const L = N.slice(); for (let W = 0; W < L.length; W++) { const q = L[W]; let me = q.originalDelegate ? q.originalDelegate : q.callback; this[f].call(this, u, me, q.options); } } if (Z) { const L = Z.slice(); for (let W = 0; W < L.length; W++) { const q = L[W]; let me = q.originalDelegate ? q.originalDelegate : q.callback; this[f].call(this, u, me, q.options); } } } } else { const v = Object.keys(o); for (let R = 0; R < v.length; R++) { const m = v[R], N = ot.exec(m); let Z = N && N[1]; Z && Z !== "removeListener" && this[T].call(this, Z); } this[T].call(this, "removeListener"); } if (U) return this; }, pe(g[c], P), pe(g[f], b), oe && pe(g[T], oe), D && pe(g[p], D), !0; } let J = []; for (let k = 0; k < a.length; k++) J[k] = re(a[k], e); return J; } function ct(t, n) { if (!n) { const f = []; for (let p in t) { const T = ot.exec(p); let y = T && T[1]; if (y && (!n || y === n)) { const w = t[p]; if (w) for (let _ = 0; _ < w.length; _++) f.push(w[_]); } } return f; } let a = ae[n]; a || (it(n), a = ae[n]); const e = t[a[Te]], c = t[a[_e]]; return e ? c ? e.concat(c) : e.slice() : c ? c.slice() : []; } function Rt(t, n) { const a = t.Event; a && a.prototype && n.patchMethod(a.prototype, "stopImmediatePropagation", (e) => function(c, f) { c[st] = !0, e && e.apply(c, f); }); } function wt(t, n) { n.patchMethod(t, "queueMicrotask", (a) => function(e, c) { Zone.current.scheduleMicroTask("queueMicrotask", c[0]); }); } const Me = H("zoneTask"); function be(t, n, a, e) { let c = null, f = null; n += e, a += e; const p = {}; function T(w) { const _ = w.data; _.args[0] = function() { return w.invoke.apply(this, arguments); }; const C = c.apply(t, _.args); return nt(C) ? _.handleId = C : (_.handle = C, _.isRefreshable = tt(C.refresh)), w; } function y(w) { const { handle: _, handleId: C } = w.data; return f.call(t, _ ?? C); } c = Ee(t, n, (w) => function(_, C) { if (tt(C[0])) { const M = { isRefreshable: !1, isPeriodic: e === "Interval", delay: e === "Timeout" || e === "Interval" ? C[1] || 0 : void 0, args: C }, F = C[0]; C[0] = function() { try { return F.apply(this, arguments); } finally { const { handle: x, handleId: V, isPeriodic: K, isRefreshable: U } = M; !K && !U && (V ? delete p[V] : x && (x[Me] = null)); } }; const X = Fe(n, C[0], M, T, y); if (!X) return X; const { handleId: ne, handle: re, isRefreshable: J, isPeriodic: k } = X.data; if (ne) p[ne] = X; else if (re && (re[Me] = X, J && !k)) { const d = re.refresh; re.refresh = function() { const { zone: x, state: V } = X; return V === "notScheduled" ? (X._state = "scheduled", x._updateTaskCount(X, 1)) : V === "running" && (X._state = "scheduling"), d.call(this); }; } return re ?? ne ?? X; } else return w.apply(t, C); }), f = Ee(t, a, (w) => function(_, C) { const M = C[0]; let F; nt(M) ? (F = p[M], delete p[M]) : (F = M?.[Me], F ? M[Me] = null : F = M), F?.type ? F.cancelFn && F.zone.cancelTask(F) : w.apply(t, C); }); } function Dt(t, n) { const { isBrowser: a, isMix: e } = n.getGlobalObjects(); if (!a && !e || !t.customElements || !("customElements" in t)) return; const c = [ "connectedCallback", "disconnectedCallback", "adoptedCallback", "attributeChangedCallback", "formAssociatedCallback", "formDisabledCallback", "formResetCallback", "formStateRestoreCallback" ]; n.patchCallbacks(n, t.customElements, "customElements", "define", c); } function St(t, n) { if (Zone[n.symbol("patchEventTarget")]) return; const { eventNames: a, zoneSymbolEventNames: e, TRUE_STR: c, FALSE_STR: f, ZONE_SYMBOL_PREFIX: p } = n.getGlobalObjects(); for (let y = 0; y < a.length; y++) { const w = a[y], _ = w + f, C = w + c, M = p + _, F = p + C; e[w] = {}, e[w][f] = M, e[w][c] = F; } const T = t.EventTarget; if (!(!T || !T.prototype)) return n.patchEventTarget(t, n, [T && T.prototype]), !0; } function Ot(t, n) { n.patchEventPrototype(t, n); } function at(t, n, a) { if (!a || a.length === 0) return n; const e = a.filter((f) => f.target === t); if (e.length === 0) return n; const c = e[0].ignoreProperties; return n.filter((f) => c.indexOf(f) === -1); } function lt(t, n, a, e) { if (!t) return; const c = at(t, n, a); Qe(t, c, e); } function Be(t) { return Object.getOwnPropertyNames(t).filter((n) => n.startsWith("on") && n.length > 2).map((n) => n.substring(2)); } function Nt(t, n) { if (Ze && !$e || Zone[t.symbol("patchEvents")]) return; const a = n.__Zone_ignore_on_properties; let e = []; if (ze) { const c = window; e = e.concat([ "Document", "SVGElement", "Element", "HTMLElement", "HTMLBodyElement", "HTMLMediaElement", "HTMLFrameSetElement", "HTMLFrameElement", "HTMLIFrameElement", "HTMLMarqueeElement", "Worker" ]); const f = []; lt(c, Be(c), a && a.concat(f), ie(c)); } e = e.concat([ "XMLHttpRequest", "XMLHttpRequestEventTarget", "IDBIndex", "IDBRequest", "IDBOpenDBRequest", "IDBDatabase", "IDBTransaction", "IDBCursor", "WebSocket" ]); for (let c = 0; c < e.length; c++) { const f = n[e[c]]; f?.prototype && lt(f.prototype, Be(f.prototype), a); } } function Zt(t) { t.__load_patch("legacy", (n) => { const a = n[t.__symbol__("legacyPatch")]; a && a(); }), t.__load_patch("timers", (n) => { const e = "clear"; be(n, "set", e, "Timeout"), be(n, "set", e, "Interval"), be(n, "set", e, "Immediate"); }), t.__load_patch("requestAnimationFrame", (n) => { be(n, "request", "cancel", "AnimationFrame"), be(n, "mozRequest", "mozCancel", "AnimationFrame"), be(n, "webkitRequest", "webkitCancel", "AnimationFrame"); }), t.__load_patch("blocking", (n, a) => { const e = ["alert", "prompt", "confirm"]; for (let c = 0; c < e.length; c++) { const f = e[c]; Ee(n, f, (p, T, y) => function(w, _) { return a.current.run(p, n, _, y); }); } }), t.__load_patch("EventTarget", (n, a, e) => { Ot(n, e), St(n, e); const c = n.XMLHttpRequestEventTarget; c && c.prototype && e.patchEventTarget(n, e, [c.prototype]); }), t.__load_patch("MutationObserver", (n, a, e) => { Se("MutationObserver"), Se("WebKitMutationObserver"); }), t.__load_patch("IntersectionObserver", (n, a, e) => { Se("IntersectionObserver"); }), t.__load_patch("FileReader", (n, a, e) => { Se("FileReader"); }), t.__load_patch("on_property", (n, a, e) => { Nt(e, n); }), t.__load_patch("customElements", (n, a, e) => { Dt(n, e); }), t.__load_patch("XHR", (n, a) => { w(n); const e = H("xhrTask"), c = H("xhrSync"), f = H("xhrListener"), p = H("xhrScheduled"), T = H("xhrURL"), y = H("xhrErrorBeforeScheduled"); function w(_) { const C = _.XMLHttpRequest; if (!C) return; const M = C.prototype; function F(P) { return P[e]; } let X = M[je], ne = M[He]; if (!X) { const P = _.XMLHttpRequestEventTarget; if (P) { const b = P.prototype; X = b[je], ne = b[He]; } } const re = "readystatechange", J = "scheduled"; function k(P) { const b = P.data, D = b.target; D[p] = !1, D[y] = !1; const oe = D[f]; X || (X = D[je], ne = D[He]), oe && ne.call(D, re, oe); const $ = D[f] = () => { if (D.readyState === D.DONE) if (!b.aborted && D[p] && P.state === J) { const s = D[a.__symbol__("loadfalse")]; if (D.status !== 0 && s && s.length > 0) { const i = P.invoke; P.invoke = function() { const r = D[a.__symbol__("loadfalse")]; for (let E = 0; E < r.length; E++) r[E] === P && r.splice(E, 1); !b.aborted && P.state === J && i.call(P); }, s.push(P); } else P.invoke(); } else !b.aborted && D[p] === !1 && (D[y] = !0); }; return X.call(D, re, $), D[e] || (D[e] = P), Y.apply(D, b.args), D[p] = !0, P; } function d() { } function x(P) { const b = P.data; return b.aborted = !0, O.apply(b.target, b.args); } const V = Ee(M, "open", () => function(P, b) { return P[c] = b[2] == !1, P[T] = b[1], V.apply(P, b); }), K = "XMLHttpRequest.send", U = H("fetchTaskAborting"), g = H("fetchTaskScheduling"), Y = Ee(M, "send", () => function(P, b) { if (a.current[g] === !0 || P[c]) return Y.apply(P, b); { const D = { target: P, url: P[T], isPeriodic: !1, args: b, aborted: !1 }, oe = Fe(K, d, D, k, x); P && P[y] === !0 && !D.aborted && oe.state === J && oe.invoke(); } }), O = Ee(M, "abort", () => function(P, b) { const D = F(P); if (D && typeof D.type == "string") { if (D.cancelFn == null || D.data && D.data.aborted) return; D.zone.cancelTask(D); } else if (a.current[U] === !0) return O.apply(P, b); }); } }), t.__load_patch("geolocation", (n) => { n.navigator && n.navigator.geolocation && yt(n.navigator.geolocation, ["getCurrentPosition", "watchPosition"]); }), t.__load_patch("PromiseRejectionEvent", (n, a) => { function e(c) { return function(f) { ct(n, c).forEach((T) => { const y = n.PromiseRejectionEvent; if (y) { const w = new y(c, { promise: f.promise, reason: f.rejection }); T.invoke(w); } }); }; } n.PromiseRejectionEvent && (a[H("unhandledPromiseRejectionHandler")] = e("unhandledrejection"), a[H("rejectionHandledHandler")] = e("rejectionhandled")); }), t.__load_patch("queueMicrotask", (n, a, e) => { wt(n, e); }); } function Lt(t) { t.__load_patch("ZoneAwarePromise", (n, a, e) => { const c = Object.getOwnPropertyDescriptor, f = Object.defineProperty; function p(h) { if (h && h.toString === Object.prototype.toString) { const l = h.constructor && h.constructor.name; return (l || "") + ": " + JSON.stringify(h); } return h ? h.toString() : Object.prototype.toString.call(h); } const T = e.symbol, y = [], w = n[T("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")] !== !1, _ = T("Promise"), C = T("then"), M = "__creationTrace__"; e.onUnhandledError = (h) => { if (e.showUncaughtError()) { const l = h && h.rejection; l ? console.error("Unhandled Promise rejection:", l instanceof Error ? l.message : l, "; Zone:", h.zone.name, "; Task:", h.task && h.task.source, "; Value:", l, l instanceof Error ? l.stack : void 0) : console.error(h); } }, e.microtaskDrainDone = () => { for (; y.length; ) { const h = y.shift(); try { h.zone.runGuarded(() => { throw h.throwOriginal ? h.rejection : h; }); } catch (l) { X(l); } } }; const F = T("unhandledPromiseRejectionHandler"); function X(h) { e.onUnhandledError(h); try { const l = a[F]; typeof l == "function" && l.call(this, h); } catch { } } function ne(h) { return h && typeof h.then == "function"; } function re(h) { return h; } function J(h) { return A.reject(h); } const k = T("state"), d = T("value"), x = T("finally"), V = T("parentPromiseValue"), K = T("parentPromiseState"), U = "Promise.then", g = null, Y = !0, O = !1, P = 0; function b(h, l) { return (o) => { try { I(h, l, o); } catch (u) { I(h, !1, u); } }; } const D = function() { let h = !1; return function(o) { return function() { h || (h = !0, o.apply(null, arguments)); }; }; }, oe = "Promise resolved with itself", $ = T("currentTaskTrace"); function I(h, l, o) { const u = D(); if (h === o) throw new TypeError(oe); if (h[k] === g) { let v = null; try { (typeof o == "object" || typeof o == "function") && (v = o && o.then); } catch (R) { return u(() => { I(h, !1, R); })(), h; } if (l !== O && o instanceof A && o.hasOwnProperty(k) && o.hasOwnProperty(d) && o[k] !== g) i(o), I(h, o[k], o[d]); else if (l !== O && typeof v == "function") try { v.call(o, u(b(h, l)), u(b(h, !1))); } catch (R) { u(() => { I(h, !1, R); })(); } else { h[k] = l; const R = h[d]; if (h[d] = o, h[x] === x && l === Y && (h[k] = h[K], h[d] = h[V]), l === O && o instanceof Error) { const m = a.currentTask && a.currentTask.data && a.currentTask.data[M]; m && f(o, $, { configurable: !0, enumerable: !1, writable: !0, value: m }); } for (let m = 0; m < R.length; ) r(h, R[m++], R[m++], R[m++], R[m++]); if (R.length == 0 && l == O) { h[k] = P; let m = o; try { throw new Error("Uncaught (in promise): " + p(o) + (o && o.stack ? ` ` + o.stack : "")); } catch (N) { m = N; } w && (m.throwOriginal = !0), m.rejection = o, m.promise = h, m.zone = a.current, m.task = a.currentTask, y.push(m), e.scheduleMicroTask(); } } } return h; } const s = T("rejectionHandledHandler"); function i(h) { if (h[k] === P) { try { const l = a[s]; l && typeof l == "function" && l.call(this, { rejection: h[d], promise: h }); } catch {