UNPKG

@suprsend/web-components

Version:

This SuprSend library enables the use of features like inbox and preference drop-in components in non-React frameworks such as Vanilla JavaScript, Angular, and Vue

1,379 lines 821 kB
var Lr, me, vp, Ln, Vu, yp, Ap, Cp, Bl, gl, Tl, Sp, Rr = {}, bp = [], O5 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Li = Array.isArray; function mn(t, e) { for (var n in e) t[n] = e[n]; return t; } function Ul(t) { t && t.parentNode && t.parentNode.removeChild(t); } function et(t, e, n) { var r, i, a, o = {}; for (a in e) a == "key" ? r = e[a] : a == "ref" ? i = e[a] : o[a] = e[a]; if (arguments.length > 2 && (o.children = arguments.length > 3 ? Lr.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) o[a] === void 0 && (o[a] = t.defaultProps[a]); return Ar(t, o, r, i, null); } function Ar(t, e, n, r, i) { var a = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++vp, __i: -1, __u: 0 }; return i == null && me.vnode != null && me.vnode(a), a; } function Rp() { return { current: null }; } function wt(t) { return t.children; } function Vt(t, e) { this.props = t, this.context = e; } function jn(t, e) { if (e == null) return t.__ ? jn(t.__, t.__i + 1) : null; for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e; return typeof t.type == "function" ? jn(t) : null; } function xp(t) { var e, n; if ((t = t.__) != null && t.__c != null) { for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) { t.__e = t.__c.base = n.__e; break; } return xp(t); } } function _l(t) { (!t.__d && (t.__d = !0) && Ln.push(t) && !Ri.__r++ || Vu !== me.debounceRendering) && ((Vu = me.debounceRendering) || yp)(Ri); } function Ri() { for (var t, e, n, r, i, a, o, s = 1; Ln.length; ) Ln.length > s && Ln.sort(Ap), t = Ln.shift(), s = Ln.length, t.__d && (n = void 0, i = (r = (e = t).__v).__e, a = [], o = [], e.__P && ((n = mn({}, r)).__v = r.__v + 1, me.vnode && me.vnode(n), ql(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, a, i ?? jn(r), !!(32 & r.__u), o), n.__v = r.__v, n.__.__k[n.__i] = n, Np(a, n, o), n.__e != i && xp(n))); Ri.__r = 0; } function Op(t, e, n, r, i, a, o, s, u, c, d) { var f, T, l, p, _, y, C = r && r.__k || bp, v = e.length; for (u = k5(n, e, C, u, v), f = 0; f < v; f++) (l = n.__k[f]) != null && (T = l.__i === -1 ? Rr : C[l.__i] || Rr, l.__i = f, y = ql(t, l, T, i, a, o, s, u, c, d), p = l.__e, l.ref && T.ref != l.ref && (T.ref && $l(T.ref, null, l), d.push(l.ref, l.__c || p, l)), _ == null && p != null && (_ = p), 4 & l.__u || T.__k === l.__k ? u = kp(l, u, t) : typeof l.type == "function" && y !== void 0 ? u = y : p && (u = p.nextSibling), l.__u &= -7); return n.__e = _, u; } function k5(t, e, n, r, i) { var a, o, s, u, c, d = n.length, f = d, T = 0; for (t.__k = new Array(i), a = 0; a < i; a++) (o = e[a]) != null && typeof o != "boolean" && typeof o != "function" ? (u = a + T, (o = t.__k[a] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ar(null, o, null, null, null) : Li(o) ? Ar(wt, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? Ar(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = t, o.__b = t.__b + 1, s = null, (c = o.__i = N5(o, n, u, f)) !== -1 && (f--, (s = n[c]) && (s.__u |= 2)), s == null || s.__v === null ? (c == -1 && T--, typeof o.type != "function" && (o.__u |= 4)) : c != u && (c == u - 1 ? T-- : c == u + 1 ? T++ : (c > u ? T-- : T++, o.__u |= 4))) : t.__k[a] = null; if (f) for (a = 0; a < d; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = jn(s)), Ip(s, s)); return r; } function kp(t, e, n) { var r, i; if (typeof t.type == "function") { for (r = t.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = t, e = kp(r[i], e, n)); return e; } t.__e != e && (e && t.type && !n.contains(e) && (e = jn(t)), n.insertBefore(t.__e, e || null), e = t.__e); do e = e && e.nextSibling; while (e != null && e.nodeType == 8); return e; } function gn(t, e) { return e = e || [], t == null || typeof t == "boolean" || (Li(t) ? t.some(function(n) { gn(n, e); }) : e.push(t)), e; } function N5(t, e, n, r) { var i, a, o = t.key, s = t.type, u = e[n]; if (u === null || u && o == u.key && s === u.type && !(2 & u.__u)) return n; if (r > (u != null && !(2 & u.__u) ? 1 : 0)) for (i = n - 1, a = n + 1; i >= 0 || a < e.length; ) { if (i >= 0) { if ((u = e[i]) && !(2 & u.__u) && o == u.key && s === u.type) return i; i--; } if (a < e.length) { if ((u = e[a]) && !(2 & u.__u) && o == u.key && s === u.type) return a; a++; } } return -1; } function Yu(t, e, n) { e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || O5.test(e) ? n : n + "px"; } function Xr(t, e, n, r, i) { var a; e: if (e == "style") if (typeof n == "string") t.style.cssText = n; else { if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || Yu(t.style, e, ""); if (n) for (e in n) r && n[e] === r[e] || Yu(t.style, e, n[e]); } else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(Cp, "$1")), e = e.toLowerCase() in t || e == "onFocusOut" || e == "onFocusIn" ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? r ? n.u = r.u : (n.u = Bl, t.addEventListener(e, a ? Tl : gl, a)) : t.removeEventListener(e, a ? Tl : gl, a); else { if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try { t[e] = n ?? ""; break e; } catch { } typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n)); } } function Qu(t) { return function(e) { if (this.l) { var n = this.l[e.type + t]; if (e.t == null) e.t = Bl++; else if (e.t < n.u) return; return n(me.event ? me.event(e) : e); } }; } function ql(t, e, n, r, i, a, o, s, u, c) { var d, f, T, l, p, _, y, C, v, R, E, S, b, x, N, O, M, P, B = e.type; if (e.constructor !== void 0) return null; 128 & n.__u && (u = !!(32 & n.__u), a = [s = e.__e = n.__e]), (d = me.__b) && d(e); e: if (typeof B == "function") try { if (C = e.props, v = "prototype" in B && B.prototype.render, R = (d = B.contextType) && r[d.__c], E = d ? R ? R.props.value : d.__ : r, n.__c ? y = (f = e.__c = n.__c).__ = f.__E : (v ? e.__c = f = new B(C, E) : (e.__c = f = new Vt(C, E), f.constructor = B, f.render = w5), R && R.sub(f), f.props = C, f.state || (f.state = {}), f.context = E, f.__n = r, T = f.__d = !0, f.__h = [], f._sb = []), v && f.__s == null && (f.__s = f.state), v && B.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = mn({}, f.__s)), mn(f.__s, B.getDerivedStateFromProps(C, f.__s))), l = f.props, p = f.state, f.__v = e, T) v && B.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), v && f.componentDidMount != null && f.__h.push(f.componentDidMount); else { if (v && B.getDerivedStateFromProps == null && C !== l && f.componentWillReceiveProps != null && f.componentWillReceiveProps(C, E), !f.__e && (f.shouldComponentUpdate != null && f.shouldComponentUpdate(C, f.__s, E) === !1 || e.__v == n.__v)) { for (e.__v != n.__v && (f.props = C, f.state = f.__s, f.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(w) { w && (w.__ = e); }), S = 0; S < f._sb.length; S++) f.__h.push(f._sb[S]); f._sb = [], f.__h.length && o.push(f); break e; } f.componentWillUpdate != null && f.componentWillUpdate(C, f.__s, E), v && f.componentDidUpdate != null && f.__h.push(function() { f.componentDidUpdate(l, p, _); }); } if (f.context = E, f.props = C, f.__P = t, f.__e = !1, b = me.__r, x = 0, v) { for (f.state = f.__s, f.__d = !1, b && b(e), d = f.render(f.props, f.state, f.context), N = 0; N < f._sb.length; N++) f.__h.push(f._sb[N]); f._sb = []; } else do f.__d = !1, b && b(e), d = f.render(f.props, f.state, f.context), f.state = f.__s; while (f.__d && ++x < 25); f.state = f.__s, f.getChildContext != null && (r = mn(mn({}, r), f.getChildContext())), v && !T && f.getSnapshotBeforeUpdate != null && (_ = f.getSnapshotBeforeUpdate(l, p)), M = (O = d != null && d.type === wt && d.key == null) ? d.props.children : d, O && (d.props.children = null), s = Op(t, Li(M) ? M : [M], e, n, r, i, a, o, s, u, c), f.base = e.__e, e.__u &= -161, f.__h.length && o.push(f), y && (f.__E = f.__ = null); } catch (w) { if (e.__v = null, u || a != null) if (w.then) { for (e.__u |= u ? 160 : 128; s && s.nodeType == 8 && s.nextSibling; ) s = s.nextSibling; a[a.indexOf(s)] = null, e.__e = s; } else for (P = a.length; P--; ) Ul(a[P]); else e.__e = n.__e, e.__k = n.__k; me.__e(w, e, n); } else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : s = e.__e = I5(n.__e, e, n, r, i, a, o, u, c); return (d = me.diffed) && d(e), 128 & e.__u ? void 0 : s; } function Np(t, e, n) { for (var r = 0; r < n.length; r++) $l(n[r], n[++r], n[++r]); me.__c && me.__c(e, t), t.some(function(i) { try { t = i.__h, i.__h = [], t.some(function(a) { a.call(i); }); } catch (a) { me.__e(a, i.__v); } }); } function I5(t, e, n, r, i, a, o, s, u) { var c, d, f, T, l, p, _, y = n.props, C = e.props, v = e.type; if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), a != null) { for (c = 0; c < a.length; c++) if ((l = a[c]) && "setAttribute" in l == !!v && (v ? l.localName == v : l.nodeType == 3)) { t = l, a[c] = null; break; } } if (t == null) { if (v == null) return document.createTextNode(C); t = document.createElementNS(i, v, C.is && C), s && (me.__m && me.__m(e, a), s = !1), a = null; } if (v === null) y === C || s && t.data === C || (t.data = C); else { if (a = a && Lr.call(t.childNodes), y = n.props || Rr, !s && a != null) for (y = {}, c = 0; c < t.attributes.length; c++) y[(l = t.attributes[c]).name] = l.value; for (c in y) if (l = y[c], c != "children") { if (c == "dangerouslySetInnerHTML") f = l; else if (!(c in C)) { if (c == "value" && "defaultValue" in C || c == "checked" && "defaultChecked" in C) continue; Xr(t, c, null, l, i); } } for (c in C) l = C[c], c == "children" ? T = l : c == "dangerouslySetInnerHTML" ? d = l : c == "value" ? p = l : c == "checked" ? _ = l : s && typeof l != "function" || y[c] === l || Xr(t, c, l, y[c], i); if (d) s || f && (d.__html === f.__html || d.__html === t.innerHTML) || (t.innerHTML = d.__html), e.__k = []; else if (f && (t.innerHTML = ""), Op(e.type === "template" ? t.content : t, Li(T) ? T : [T], e, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && jn(n, 0), s, u), a != null) for (c = a.length; c--; ) Ul(a[c]); s || (c = "value", v == "progress" && p == null ? t.removeAttribute("value") : p !== void 0 && (p !== t[c] || v == "progress" && !p || v == "option" && p !== y[c]) && Xr(t, c, p, y[c], i), c = "checked", _ !== void 0 && _ !== t[c] && Xr(t, c, _, y[c], i)); } return t; } function $l(t, e, n) { try { if (typeof t == "function") { var r = typeof t.__u == "function"; r && t.__u(), r && e == null || (t.__u = t(e)); } else t.current = e; } catch (i) { me.__e(i, n); } } function Ip(t, e, n) { var r, i; if (me.unmount && me.unmount(t), (r = t.ref) && (r.current && r.current !== t.__e || $l(r, null, e)), (r = t.__c) != null) { if (r.componentWillUnmount) try { r.componentWillUnmount(); } catch (a) { me.__e(a, e); } r.base = r.__P = null; } if (r = t.__k) for (i = 0; i < r.length; i++) r[i] && Ip(r[i], e, n || typeof t.type != "function"); n || Ul(t.__e), t.__c = t.__ = t.__e = void 0; } function w5(t, e, n) { return this.constructor(t, n); } function xr(t, e, n) { var r, i, a, o; e == document && (e = document.documentElement), me.__ && me.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, a = [], o = [], ql(e, t = (!r && n || e).__k = et(wt, null, [t]), i || Rr, Rr, e.namespaceURI, !r && n ? [n] : i ? null : e.firstChild ? Lr.call(e.childNodes) : null, a, !r && n ? n : i ? i.__e : e.firstChild, r, o), Np(a, t, o); } function wp(t, e) { xr(t, e, wp); } function L5(t, e, n) { var r, i, a, o, s = mn({}, t.props); for (a in t.type && t.type.defaultProps && (o = t.type.defaultProps), e) a == "key" ? r = e[a] : a == "ref" ? i = e[a] : s[a] = e[a] === void 0 && o !== void 0 ? o[a] : e[a]; return arguments.length > 2 && (s.children = arguments.length > 3 ? Lr.call(arguments, 2) : n), Ar(t.type, s, r || t.key, i || t.ref, null); } function Fn(t) { function e(n) { var r, i; return this.getChildContext || (r = /* @__PURE__ */ new Set(), (i = {})[e.__c] = this, this.getChildContext = function() { return i; }, this.componentWillUnmount = function() { r = null; }, this.shouldComponentUpdate = function(a) { this.props.value !== a.value && r.forEach(function(o) { o.__e = !0, _l(o); }); }, this.sub = function(a) { r.add(a); var o = a.componentWillUnmount; a.componentWillUnmount = function() { r && r.delete(a), o && o.call(a); }; }), n.children; } return e.__c = "__cC" + Sp++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, r) { return n.children(r); }).contextType = e, e; } Lr = bp.slice, me = { __e: function(t, e, n, r) { for (var i, a, o; e = e.__; ) if ((i = e.__c) && !i.__) try { if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(t)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, r || {}), o = i.__d), o) return i.__E = i; } catch (s) { t = s; } throw t; } }, vp = 0, Vt.prototype.setState = function(t, e) { var n; n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = mn({}, this.state), typeof t == "function" && (t = t(mn({}, n), this.props)), t && mn(n, t), t != null && this.__v && (e && this._sb.push(e), _l(this)); }, Vt.prototype.forceUpdate = function(t) { this.__v && (this.__e = !0, t && this.__h.push(t), _l(this)); }, Vt.prototype.render = wt, Ln = [], yp = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ap = function(t, e) { return t.__v.__b - e.__v.__b; }, Ri.__r = 0, Cp = /(PointerCapture)$|Capture$/i, Bl = 0, gl = Qu(!1), Tl = Qu(!0), Sp = 0; var P5 = 0; function Ze(t, e, n, r, i, a) { e || (e = {}); var o, s, u = e; if ("ref" in u) for (s in u = {}, e) s == "ref" ? o = e[s] : u[s] = e[s]; var c = { type: t, props: u, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --P5, __i: -1, __u: 0, __source: i, __self: a }; if (typeof t == "function" && (o = t.defaultProps)) for (s in o) u[s] === void 0 && (u[s] = o[s]); return me.vnode && me.vnode(c), c; } var Tn, Ue, s1, Xu, Wn = 0, Lp = [], Ke = me, Ju = Ke.__b, Zu = Ke.__r, ec = Ke.diffed, tc = Ke.__c, nc = Ke.unmount, rc = Ke.__; function Hn(t, e) { Ke.__h && Ke.__h(Ue, t, Wn || e), Wn = 0; var n = Ue.__H || (Ue.__H = { __: [], __h: [] }); return t >= n.__.length && n.__.push({}), n.__[t]; } function qe(t) { return Wn = 1, Pi(Pp, t); } function Pi(t, e, n) { var r = Hn(Tn++, 2); if (r.t = t, !r.__c && (r.__ = [n ? n(e) : Pp(void 0, e), function(s) { var u = r.__N ? r.__N[0] : r.__[0], c = r.t(u, s); u !== c && (r.__N = [c, r.__[1]], r.__c.setState({})); }], r.__c = Ue, !Ue.__f)) { var i = function(s, u, c) { if (!r.__c.__H) return !0; var d = r.__c.__H.__.filter(function(T) { return !!T.__c; }); if (d.every(function(T) { return !T.__N; })) return !a || a.call(this, s, u, c); var f = r.__c.props !== s; return d.forEach(function(T) { if (T.__N) { var l = T.__[0]; T.__ = T.__N, T.__N = void 0, l !== T.__[0] && (f = !0); } }), a && a.call(this, s, u, c) || f; }; Ue.__f = !0; var a = Ue.shouldComponentUpdate, o = Ue.componentWillUpdate; Ue.componentWillUpdate = function(s, u, c) { if (this.__e) { var d = a; a = void 0, i(s, u, c), a = d; } o && o.call(this, s, u, c); }, Ue.shouldComponentUpdate = i; } return r.__N || r.__; } function tt(t, e) { var n = Hn(Tn++, 3); !Ke.__s && jl(n.__H, e) && (n.__ = t, n.u = e, Ue.__H.__h.push(n)); } function Bn(t, e) { var n = Hn(Tn++, 4); !Ke.__s && jl(n.__H, e) && (n.__ = t, n.u = e, Ue.__h.push(n)); } function _n(t) { return Wn = 5, Yt(function() { return { current: t }; }, []); } function Gl(t, e, n) { Wn = 6, Bn(function() { if (typeof t == "function") { var r = t(e()); return function() { t(null), r && typeof r == "function" && r(); }; } if (t) return t.current = e(), function() { return t.current = null; }; }, n == null ? n : n.concat(t)); } function Yt(t, e) { var n = Hn(Tn++, 7); return jl(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__; } function Mn(t, e) { return Wn = 8, Yt(function() { return t; }, e); } function Pt(t) { var e = Ue.context[t.__c], n = Hn(Tn++, 9); return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(Ue)), e.props.value) : t.__; } function zl(t, e) { Ke.useDebugValue && Ke.useDebugValue(e ? e(t) : t); } function M5(t) { var e = Hn(Tn++, 10), n = qe(); return e.__ = t, Ue.componentDidCatch || (Ue.componentDidCatch = function(r, i) { e.__ && e.__(r, i), n[1](r); }), [n[0], function() { n[1](void 0); }]; } function Kl() { var t = Hn(Tn++, 11); if (!t.__) { for (var e = Ue.__v; e !== null && !e.__m && e.__ !== null; ) e = e.__; var n = e.__m || (e.__m = [0, 0]); t.__ = "P" + n[0] + "-" + n[1]++; } return t.__; } function D5() { for (var t; t = Lp.shift(); ) if (t.__P && t.__H) try { t.__H.__h.forEach(mi), t.__H.__h.forEach(El), t.__H.__h = []; } catch (e) { t.__H.__h = [], Ke.__e(e, t.__v); } } Ke.__b = function(t) { Ue = null, Ju && Ju(t); }, Ke.__ = function(t, e) { t && e.__k && e.__k.__m && (t.__m = e.__k.__m), rc && rc(t, e); }, Ke.__r = function(t) { Zu && Zu(t), Tn = 0; var e = (Ue = t.__c).__H; e && (s1 === Ue ? (e.__h = [], Ue.__h = [], e.__.forEach(function(n) { n.__N && (n.__ = n.__N), n.u = n.__N = void 0; })) : (e.__h.forEach(mi), e.__h.forEach(El), e.__h = [], Tn = 0)), s1 = Ue; }, Ke.diffed = function(t) { ec && ec(t); var e = t.__c; e && e.__H && (e.__H.__h.length && (Lp.push(e) !== 1 && Xu === Ke.requestAnimationFrame || ((Xu = Ke.requestAnimationFrame) || F5)(D5)), e.__H.__.forEach(function(n) { n.u && (n.__H = n.u), n.u = void 0; })), s1 = Ue = null; }, Ke.__c = function(t, e) { e.some(function(n) { try { n.__h.forEach(mi), n.__h = n.__h.filter(function(r) { return !r.__ || El(r); }); } catch (r) { e.some(function(i) { i.__h && (i.__h = []); }), e = [], Ke.__e(r, n.__v); } }), tc && tc(t, e); }, Ke.unmount = function(t) { nc && nc(t); var e, n = t.__c; n && n.__H && (n.__H.__.forEach(function(r) { try { mi(r); } catch (i) { e = i; } }), n.__H = void 0, e && Ke.__e(e, n.__v)); }; var ic = typeof requestAnimationFrame == "function"; function F5(t) { var e, n = function() { clearTimeout(r), ic && cancelAnimationFrame(e), setTimeout(t); }, r = setTimeout(n, 100); ic && (e = requestAnimationFrame(n)); } function mi(t) { var e = Ue, n = t.__c; typeof n == "function" && (t.__c = void 0, n()), Ue = e; } function El(t) { var e = Ue; t.__c = t.__(), Ue = e; } function jl(t, e) { return !t || t.length !== e.length || e.some(function(n, r) { return n !== t[r]; }); } function Pp(t, e) { return typeof e == "function" ? e(t) : e; } function Mp(t, e) { for (var n in e) t[n] = e[n]; return t; } function vl(t, e) { for (var n in t) if (n !== "__source" && !(n in e)) return !0; for (var r in e) if (r !== "__source" && t[r] !== e[r]) return !0; return !1; } function Wl(t, e) { var n = e(), r = qe({ t: { __: n, u: e } }), i = r[0].t, a = r[1]; return Bn(function() { i.__ = n, i.u = e, o1(i) && a({ t: i }); }, [t, n, e]), tt(function() { return o1(i) && a({ t: i }), t(function() { o1(i) && a({ t: i }); }); }, [t]), n; } function o1(t) { var e, n, r = t.u, i = t.__; try { var a = r(); return !((e = i) === (n = a) && (e !== 0 || 1 / e == 1 / n) || e != e && n != n); } catch { return !0; } } function Vl(t) { t(); } function Yl(t) { return t; } function Ql() { return [!1, Vl]; } var Xl = Bn; function xi(t, e) { this.props = t, this.context = e; } function Dp(t, e) { function n(i) { var a = this.props.ref, o = a == i.ref; return !o && a && (a.call ? a(null) : a.current = null), e ? !e(this.props, i) || !o : vl(this.props, i); } function r(i) { return this.shouldComponentUpdate = n, et(t, i); } return r.displayName = "Memo(" + (t.displayName || t.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r; } (xi.prototype = new Vt()).isPureReactComponent = !0, xi.prototype.shouldComponentUpdate = function(t, e) { return vl(this.props, t) || vl(this.state, e); }; var ac = me.__b; me.__b = function(t) { t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), ac && ac(t); }; var H5 = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; function Jl(t) { function e(n) { var r = Mp({}, n); return delete r.ref, t(r, n.ref || null); } return e.$$typeof = H5, e.render = e, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e; } var sc = function(t, e) { return t == null ? null : gn(gn(t).map(e)); }, Fp = { map: sc, forEach: sc, count: function(t) { return t ? gn(t).length : 0; }, only: function(t) { var e = gn(t); if (e.length !== 1) throw "Children.only"; return e[0]; }, toArray: gn }, B5 = me.__e; me.__e = function(t, e, n, r) { if (t.then) { for (var i, a = e; a = a.__; ) if ((i = a.__c) && i.__c) return e.__e == null && (e.__e = n.__e, e.__k = n.__k), i.__c(t, e); } B5(t, e, n, r); }; var oc = me.unmount; function Hp(t, e, n) { return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(r) { typeof r.__c == "function" && r.__c(); }), t.__c.__H = null), (t = Mp({}, t)).__c != null && (t.__c.__P === n && (t.__c.__P = e), t.__c = null), t.__k = t.__k && t.__k.map(function(r) { return Hp(r, e, n); })), t; } function Bp(t, e, n) { return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(r) { return Bp(r, e, n); }), t.__c && t.__c.__P === e && (t.__e && n.appendChild(t.__e), t.__c.__e = !0, t.__c.__P = n)), t; } function Cr() { this.__u = 0, this.o = null, this.__b = null; } function Up(t) { var e = t.__.__c; return e && e.__a && e.__a(t); } function qp(t) { var e, n, r; function i(a) { if (e || (e = t()).then(function(o) { n = o.default || o; }, function(o) { r = o; }), r) throw r; if (!n) throw e; return et(n, a); } return i.displayName = "Lazy", i.__f = !0, i; } function Gn() { this.i = null, this.l = null; } me.unmount = function(t) { var e = t.__c; e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), oc && oc(t); }, (Cr.prototype = new Vt()).__c = function(t, e) { var n = e.__c, r = this; r.o == null && (r.o = []), r.o.push(n); var i = Up(r.__v), a = !1, o = function() { a || (a = !0, n.__R = null, i ? i(s) : s()); }; n.__R = o; var s = function() { if (!--r.__u) { if (r.state.__a) { var u = r.state.__a; r.__v.__k[0] = Bp(u, u.__c.__P, u.__c.__O); } var c; for (r.setState({ __a: r.__b = null }); c = r.o.pop(); ) c.forceUpdate(); } }; r.__u++ || 32 & e.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), t.then(o, o); }, Cr.prototype.componentWillUnmount = function() { this.o = []; }, Cr.prototype.render = function(t, e) { if (this.__b) { if (this.__v.__k) { var n = document.createElement("div"), r = this.__v.__k[0].__c; this.__v.__k[0] = Hp(this.__b, n, r.__O = r.__P); } this.__b = null; } var i = e.__a && et(wt, null, t.fallback); return i && (i.__u &= -33), [et(wt, null, e.__a ? null : t.children), i]; }; var lc = function(t, e, n) { if (++n[1] === n[0] && t.l.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.l.size)) for (n = t.i; n; ) { for (; n.length > 3; ) n.pop()(); if (n[1] < n[0]) break; t.i = n = n[2]; } }; function U5(t) { return this.getChildContext = function() { return t.context; }, t.children; } function q5(t) { var e = this, n = t.h; e.componentWillUnmount = function() { xr(null, e.v), e.v = null, e.h = null; }, e.h && e.h !== n && e.componentWillUnmount(), e.v || (e.h = n, e.v = { nodeType: 1, parentNode: n, childNodes: [], contains: function() { return !0; }, appendChild: function(r) { this.childNodes.push(r), e.h.appendChild(r); }, insertBefore: function(r, i) { this.childNodes.push(r), e.h.insertBefore(r, i); }, removeChild: function(r) { this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), e.h.removeChild(r); } }), xr(et(U5, { context: e.context }, t.__v), e.v); } function Oi(t, e) { var n = et(q5, { __v: t, h: e }); return n.containerInfo = e, n; } (Gn.prototype = new Vt()).__a = function(t) { var e = this, n = Up(e.__v), r = e.l.get(t); return r[0]++, function(i) { var a = function() { e.props.revealOrder ? (r.push(i), lc(e, t, r)) : i(); }; n ? n(a) : a(); }; }, Gn.prototype.render = function(t) { this.i = null, this.l = /* @__PURE__ */ new Map(); var e = gn(t.children); t.revealOrder && t.revealOrder[0] === "b" && e.reverse(); for (var n = e.length; n--; ) this.l.set(e[n], this.i = [1, 0, this.i]); return t.children; }, Gn.prototype.componentDidUpdate = Gn.prototype.componentDidMount = function() { var t = this; this.l.forEach(function(e, n) { lc(t, n, e); }); }; var $p = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, $5 = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, G5 = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, z5 = /[A-Z0-9]/g, K5 = typeof document < "u", j5 = function(t) { return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t); }; function Zl(t, e, n) { return e.__k == null && (e.textContent = ""), xr(t, e), typeof n == "function" && n(), t ? t.__c : null; } function Gp(t, e, n) { return wp(t, e), typeof n == "function" && n(), t ? t.__c : null; } Vt.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) { Object.defineProperty(Vt.prototype, t, { configurable: !0, get: function() { return this["UNSAFE_" + t]; }, set: function(e) { Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e }); } }); }); var uc = me.event; function W5() { } function V5() { return this.cancelBubble; } function Y5() { return this.defaultPrevented; } me.event = function(t) { return uc && (t = uc(t)), t.persist = W5, t.isPropagationStopped = V5, t.isDefaultPrevented = Y5, t.nativeEvent = t; }; var eu, Q5 = { enumerable: !1, configurable: !0, get: function() { return this.class; } }, cc = me.vnode; me.vnode = function(t) { typeof t.type == "string" && function(e) { var n = e.props, r = e.type, i = {}, a = r.indexOf("-") === -1; for (var o in n) { var s = n[o]; if (!(o === "value" && "defaultValue" in n && s == null || K5 && o === "children" && r === "noscript" || o === "class" || o === "className")) { var u = o.toLowerCase(); o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && s === !0 ? s = "" : u === "translate" && s === "no" ? s = !1 : u[0] === "o" && u[1] === "n" ? u === "ondoubleclick" ? o = "ondblclick" : u !== "onchange" || r !== "input" && r !== "textarea" || j5(n.type) ? u === "onfocus" ? o = "onfocusin" : u === "onblur" ? o = "onfocusout" : G5.test(o) && (o = u) : u = o = "oninput" : a && $5.test(o) ? o = o.replace(z5, "-$&").toLowerCase() : s === null && (s = void 0), u === "oninput" && i[o = u] && (o = "oninputCapture"), i[o] = s; } } r == "select" && i.multiple && Array.isArray(i.value) && (i.value = gn(n.children).forEach(function(c) { c.props.selected = i.value.indexOf(c.props.value) != -1; })), r == "select" && i.defaultValue != null && (i.value = gn(n.children).forEach(function(c) { c.props.selected = i.multiple ? i.defaultValue.indexOf(c.props.value) != -1 : i.defaultValue == c.props.value; })), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className", Q5)) : (n.className && !n.class || n.class && n.className) && (i.class = i.className = n.className), e.props = i; }(t), t.$$typeof = $p, cc && cc(t); }; var fc = me.__r; me.__r = function(t) { fc && fc(t), eu = t.__c; }; var dc = me.diffed; me.diffed = function(t) { dc && dc(t); var e = t.props, n = t.__e; n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value), eu = null; }; var zp = { ReactCurrentDispatcher: { current: { readContext: function(t) { return eu.__n[t.__c].props.value; }, useCallback: Mn, useContext: Pt, useDebugValue: zl, useDeferredValue: Yl, useEffect: tt, useId: Kl, useImperativeHandle: Gl, useInsertionEffect: Xl, useLayoutEffect: Bn, useMemo: Yt, useReducer: Pi, useRef: _n, useState: qe, useSyncExternalStore: Wl, useTransition: Ql } } }, X5 = "18.3.1"; function Kp(t) { return et.bind(null, t); } function Pr(t) { return !!t && t.$$typeof === $p; } function jp(t) { return Pr(t) && t.type === wt; } function Wp(t) { return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo("); } function Vp(t) { return Pr(t) ? L5.apply(null, arguments) : t; } function Mi(t) { return !!t.__k && (xr(null, t), !0); } function Yp(t) { return t && (t.base || t.nodeType === 1 && t) || null; } var Qp = function(t, e) { return t(e); }, tu = function(t, e) { return t(e); }, Xp = wt, Jp = Pr, L = { useState: qe, useId: Kl, useReducer: Pi, useEffect: tt, useLayoutEffect: Bn, useInsertionEffect: Xl, useTransition: Ql, useDeferredValue: Yl, useSyncExternalStore: Wl, startTransition: Vl, useRef: _n, useImperativeHandle: Gl, useMemo: Yt, useCallback: Mn, useContext: Pt, useDebugValue: zl, version: "18.3.1", Children: Fp, render: Zl, hydrate: Gp, unmountComponentAtNode: Mi, createPortal: Oi, createElement: et, createContext: Fn, createFactory: Kp, cloneElement: Vp, createRef: Rp, Fragment: wt, isValidElement: Pr, isElement: Jp, isFragment: jp, isMemo: Wp, findDOMNode: Yp, Component: Vt, PureComponent: xi, memo: Dp, forwardRef: Jl, flushSync: tu, unstable_batchedUpdates: Qp, StrictMode: Xp, Suspense: Cr, SuspenseList: Gn, lazy: qp, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: zp }; const yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Children: Fp, Component: Vt, Fragment: wt, PureComponent: xi, StrictMode: Xp, Suspense: Cr, SuspenseList: Gn, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: zp, cloneElement: Vp, createContext: Fn, createElement: et, createFactory: Kp, createPortal: Oi, createRef: Rp, default: L, findDOMNode: Yp, flushSync: tu, forwardRef: Jl, hydrate: Gp, isElement: Jp, isFragment: jp, isMemo: Wp, isValidElement: Pr, lazy: qp, memo: Dp, render: Zl, startTransition: Vl, unmountComponentAtNode: Mi, unstable_batchedUpdates: Qp, useCallback: Mn, useContext: Pt, useDebugValue: zl, useDeferredValue: Yl, useEffect: tt, useErrorBoundary: M5, useId: Kl, useImperativeHandle: Gl, useInsertionEffect: Xl, useLayoutEffect: Bn, useMemo: Yt, useReducer: Pi, useRef: _n, useState: qe, useSyncExternalStore: Wl, useTransition: Ql, version: X5 }, Symbol.toStringTag, { value: "Module" })); function Zp(t) { return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, n) { var r = t.get(e); r ? r.push(n) : t.set(e, [n]); }, off: function(e, n) { var r = t.get(e); r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : t.set(e, [])); }, emit: function(e, n) { var r = t.get(e); r && r.slice().map(function(i) { i(n); }), (r = t.get("*")) && r.slice().map(function(i) { i(e, n); }); } }; } function Al(t) { this.message = t; } Al.prototype = new Error(), Al.prototype.name = "InvalidCharacterError"; var hc = typeof window < "u" && window.atob && window.atob.bind(window) || function(t) { var e = String(t).replace(/=+$/, ""); if (e.length % 4 == 1) throw new Al("'atob' failed: The string to be decoded is not correctly encoded."); for (var n, r, i = 0, a = 0, o = ""; r = e.charAt(a++); ~r && (n = i % 4 ? 64 * n + r : r, i++ % 4) ? o += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0) r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r); return o; }; function J5(t) { var e = t.replace(/-/g, "+").replace(/_/g, "/"); switch (e.length % 4) { case 0: break; case 2: e += "=="; break; case 3: e += "="; break; default: throw "Illegal base64url string!"; } try { return function(n) { return decodeURIComponent(hc(n).replace(/(.)/g, function(r, i) { var a = i.charCodeAt(0).toString(16).toUpperCase(); return a.length < 2 && (a = "0" + a), "%" + a; })); }(e); } catch { return hc(e); } } function ki(t) { this.message = t; } function nu(t, e) { if (typeof t != "string") throw new ki("Invalid token specified"); var n = (e = e || {}).header === !0 ? 0 : 1; try { return JSON.parse(J5(t.split(".")[n])); } catch (r) { throw new ki("Invalid token specified: " + r.message); } } ki.prototype = new Error(), ki.prototype.name = "InvalidTokenError"; const pc = (t) => { let e; const n = /* @__PURE__ */ new Set(), r = (c, d) => { const f = typeof c == "function" ? c(e) : c; if (!Object.is(f, e)) { const T = e; e = d ?? (typeof f != "object" || f === null) ? f : Object.assign({}, e, f), n.forEach((l) => l(e, T)); } }, i = () => e, s = { setState: r, getState: i, getInitialState: () => u, subscribe: (c) => (n.add(c), () => n.delete(c)) }, u = e = t(r, i, s); return s; }, Z5 = (t) => t ? pc(t) : pc, sn = /* @__PURE__ */ Object.create(null); sn.open = "0"; sn.close = "1"; sn.ping = "2"; sn.pong = "3"; sn.message = "4"; sn.upgrade = "5"; sn.noop = "6"; const gi = /* @__PURE__ */ Object.create(null); Object.keys(sn).forEach((t) => { gi[sn[t]] = t; }); const Cl = { type: "error", data: "parser error" }, e9 = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", t9 = typeof ArrayBuffer == "function", n9 = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t && t.buffer instanceof ArrayBuffer, ru = ({ type: t, data: e }, n, r) => e9 && e instanceof Blob ? n ? r(e) : mc(e, r) : t9 && (e instanceof ArrayBuffer || n9(e)) ? n ? r(e) : mc(new Blob([e]), r) : r(sn[t] + (e || "")), mc = (t, e) => { const n = new FileReader(); return n.onload = function() { const r = n.result.split(",")[1]; e("b" + (r || "")); }, n.readAsDataURL(t); }; function gc(t) { return t instanceof Uint8Array ? t : t instanceof ArrayBuffer ? new Uint8Array(t) : new Uint8Array(t.buffer, t.byteOffset, t.byteLength); } let l1; function e4(t, e) { if (e9 && t.data instanceof Blob) return t.data.arrayBuffer().then(gc).then(e); if (t9 && (t.data instanceof ArrayBuffer || n9(t.data))) return e(gc(t.data)); ru(t, !1, (n) => { l1 || (l1 = new TextEncoder()), e(l1.encode(n)); }); } const Tc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Er = typeof Uint8Array > "u" ? [] : new Uint8Array(256); for (let t = 0; t < Tc.length; t++) Er[Tc.charCodeAt(t)] = t; const t4 = (t) => { let e = t.length * 0.75, n = t.length, r, i = 0, a, o, s, u; t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--); const c = new ArrayBuffer(e), d = new Uint8Array(c); for (r = 0; r < n; r += 4) a = Er[t.charCodeAt(r)], o = Er[t.charCodeAt(r + 1)], s = Er[t.charCodeAt(r + 2)], u = Er[t.charCodeAt(r + 3)], d[i++] = a << 2 | o >> 4, d[i++] = (o & 15) << 4 | s >> 2, d[i++] = (s & 3) << 6 | u & 63; return c; }, n4 = typeof ArrayBuffer == "function", iu = (t, e) => { if (typeof t != "string") return { type: "message", data: r9(t, e) }; const n = t.charAt(0); return n === "b" ? { type: "message", data: r4(t.substring(1), e) } : gi[n] ? t.length > 1 ? { type: gi[n], data: t.substring(1) } : { type: gi[n] } : Cl; }, r4 = (t, e) => { if (n4) { const n = t4(t); return r9(n, e); } else return { base64: !0, data: t }; }, r9 = (t, e) => { switch (e) { case "blob": return t instanceof Blob ? t : new Blob([t]); case "arraybuffer": default: return t instanceof ArrayBuffer ? t : t.buffer; } }, i9 = "", i4 = (t, e) => { const n = t.length, r = new Array(n); let i = 0; t.forEach((a, o) => { ru(a, !1, (s) => { r[o] = s, ++i === n && e(r.join(i9)); }); }); }, a4 = (t, e) => { const n = t.split(i9), r = []; for (let i = 0; i < n.length; i++) { const a = iu(n[i], e); if (r.push(a), a.type === "error") break; } return r; }; function s4() { return new TransformStream({ transform(t, e) { e4(t, (n) => { const r = n.length; let i; if (r < 126) i = new Uint8Array(1), new DataView(i.buffer).setUint8(0, r); else if (r < 65536) { i = new Uint8Array(3); const a = new DataView(i.buffer); a.setUint8(0, 126), a.setUint16(1, r); } else { i = new Uint8Array(9); const a = new DataView(i.buffer); a.setUint8(0, 127), a.setBigUint64(1, BigInt(r)); } t.data && typeof t.data != "string" && (i[0] |= 128), e.enqueue(i), e.enqueue(n); }); } }); } let u1; function Jr(t) { return t.reduce((e, n) => e + n.length, 0); } function Zr(t, e) { if (t[0].length === e) return t.shift(); const n = new Uint8Array(e); let r = 0; for (let i = 0; i < e; i++) n[i] = t[0][r++], r === t[0].length && (t.shift(), r = 0); return t.length && r < t[0].length && (t[0] = t[0].slice(r)), n; } function o4(t, e) { u1 || (u1 = new TextDecoder()); const n = []; let r = 0, i = -1, a = !1; return new TransformStream({ transform(o, s) { for (n.push(o); ; ) { if (r === 0) { if (Jr(n) < 1) break; const u = Zr(n, 1); a = (u[0] & 128) === 128, i = u[0] & 127, i < 126 ? r = 3 : i === 126 ? r = 1 : r = 2; } else if (r === 1) { if (Jr(n) < 2) break; const u = Zr(n, 2); i = new DataView(u.buffer, u.byteOffset, u.length).getUint16(0), r = 3; } else if (r === 2) { if (Jr(n) < 8) break; const u = Zr(n, 8), c = new DataView(u.buffer, u.byteOffset, u.length), d = c.getUint32(0); if (d > Math.pow(2, 21) - 1) { s.enqueue(Cl); break; } i = d * Math.pow(2, 32) + c.getUint32(4), r = 3; } else { if (Jr(n) < i) break; const u = Zr(n, i); s.enqueue(iu(a ? u : u1.decode(u), e)), r = 0; } if (i === 0 || i > t) { s.enqueue(Cl); break; } } } }); } const a9 = 4; function Xe(t) { if (t) return l4(t); } function l4(t) { for (var e in Xe.prototype) t[e] = Xe.prototype[e]; return t; } Xe.prototype.on = Xe.prototype.addEventListener = function(t, e) { return this._callbacks = this._callbacks || {}, (this._callbacks["$" + t] = this._callbacks["$" + t] || []).push(e), this; }; Xe.prototype.once = function(t, e) { function n() { this.off(t, n), e.apply(this, arguments); } return n.fn = e, this.on(t, n), this; }; Xe.prototype.off = Xe.prototype.removeListener = Xe.prototype.removeAllListeners = Xe.prototype.removeEventListener = function(t, e) { if (this._callbacks = this._callbacks || {}, arguments.length == 0) return this._callbacks = {}, this; var n = this._callbacks["$" + t]; if (!n) return this; if (arguments.length == 1) return delete this._callbacks["$" + t], this; for (var r, i = 0; i < n.length; i++) if (r = n[i], r === e || r.fn === e) { n.splice(i, 1); break; } return n.length === 0 && delete this._callbacks["$" + t], this; }; Xe.prototype.emit = function(t) { this._callbacks = this._callbacks || {}; for (var e = new Array(arguments.length - 1), n = this._callbacks["$" + t], r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; if (n) { n = n.slice(0); for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, e); } return this; }; Xe.prototype.emitReserved = Xe.prototype.emit; Xe.prototype.listeners = function(t) { return this._callbacks = this._callbacks || {}, this._callbacks["$" + t] || []; }; Xe.prototype.hasListeners = function(t) { return !!this.listeners(t).length; }; const Di = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, n) => n(e, 0), Dt = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), u4 = "arraybuffer"; function s9(t, ...e) { return e.reduce((n, r) => (t.hasOwnProperty(r) && (n[r] = t[r]), n), {}); } const c4 = Dt.setTimeout, f4 = Dt.clearTimeout; function Fi(t, e) { e.useNativeTimers ? (t.setTimeoutFn = c4.bind(Dt), t.clearTimeoutFn = f4.bind(Dt)) : (t.setTimeoutFn = Dt.setTimeout.bind(Dt), t.clearTimeoutFn = Dt.clearTimeout.bind(Dt)); } const d4 = 1.33; function h4(t) { return typeof t == "string" ? p4(t) : Math.ceil((t.byteLength || t.size) * d4); } function p4(t) { let e = 0, n = 0; for (let r = 0, i = t.length; r < i; r++) e = t.charCodeAt(r), e < 128 ? n += 1 : e < 2048 ? n += 2 : e < 55296 || e >= 57344 ? n += 3 : (r++, n += 4); return n; } function o9() { return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5); } function m4(t) { let e = ""; for (let n in t) t.hasOwnProperty(n) && (e.length && (e += "&"), e += encodeURIComponent(n) + "=" + encodeURIComponent(t[n])); return e; } function g4(t) { let e = {}, n = t.split("&"); for (let r = 0, i = n.length; r < i; r++) { let a = n[r].split("="); e[decodeURIComponent(a[0])] = decodeURIComponent(a[1]); } return e; } class T4 extends Error { constructor(e, n, r) { super(e), this.description = n, this.context = r, this.type = "TransportError"; } } class au extends Xe { /** * Transport abstract constructor. * * @param {Object} opts - options * @protected */ constructor(e) { super(), this.writable = !1, Fi(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64; } /** * Emits an error. * * @param {String} reason * @param description * @param context - the error context * @return {Transport} for chaining * @protected */ onError(e, n, r) { return super.emitReserved("error", new T4(e, n, r)), this; } /** * Opens the transport. */ open() { return this.readyState = "opening", this.doOpen(), this; } /** * Closes the transport. */ close() { return (this.readyState === "opening" || this.readyState === "open") && (this.doClose(), this.onClose()), this; } /** * Sends multiple packets. * * @param {Array} packets */ send(e) { this.readyState === "open" && this.write(e); } /** * Called upon open * * @protected */ onOpen() { this.readyState = "open", this.writable = !0, super.emitReserved("open"); } /** * Called with data. * * @param {String} data * @protected */ onData(e) { const n = iu(e, this.socket.binaryType); this.onPacket(n); } /** * Called with a decoded packet. * * @protected */ onPacket(e) { super.emitReserved("packet", e); } /** * Called upon close. * * @protected */ onClose(e) { this.readyState = "closed", super.emitReserved("close", e); } /** * Pauses the transport, in order not to lose packets during an upgrade. * * @param onPause */ pause(e) { } createUri(e, n = {}) { return e + "://" + this._hostname() + this._port() + this.opts.path + this._query(n); } _hostname() { const e = this.opts.hostname; return e.indexOf(":") === -1 ? e : "[" + e + "]"; } _port() { return this.opts.port && (this.opts.secure && +(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : ""; } _query(e) { const n = m4(e); return n.length ? "?" + n : ""; } } class _4 extends au { constructor() { super(...arguments), this._polling = !1; } get name() { return "polling"; } /** * Opens the socket (triggers polling). We write a PING message to determine * when the transport is open. * * @protected */ doOpen() { this._poll(); } /** * Pauses polling. * * @param {Function} onPause - callback upon buffers are flushed and transport is paused * @package */ pause(e) { this.readyState = "pausing"; const n = () => { this.readyState = "paused", e(); }; if (this._polling || !this.writable) { let r = 0; this._polling && (r++, this.once("pollComplete", function() { --r || n(); })), this.writable || (r++, this.once("drain", function() { --r || n(); })); } else n(); } /** * Starts polling cycle. * * @private */ _poll() { this._polling = !0, this.doPoll(), this.emitReserved("poll"); } /** * Overloads onData to detect payloads. * * @protected */ onData(e) { const n = (r) => { if (this.readyState === "opening" && r.type === "open" && this.onOpen(), r.type === "close") return this.onClose({ description: "transport closed by the server" }), !1; this.onPacket(r); }; a4(e, this.socket.binaryType).forEach(n), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll()); } /** * For polling, send a close packet. * * @protected */ doClose() { const e = () => { this.write([{ type: "close" }]); }; this.readyState === "open" ? e() : this.once("open", e); } /** * Writes a packets payload. * * @param {Array} packets - data packets * @protected */ write(e) { this.writable = !1, i4(e, (n) => { this.doWrite(n, () => { this.writable = !0, this.emitReserved("drain"); }); }); } /** * Generates uri for connection. * * @private */ uri() { const e = this.opts.secure ? "https" : "http", n = this.query || {}; return this.opts.timestampRequests !== !1 && (n[this.opts.timestampParam] = o9()), !this.supportsBinary && !n.sid && (n.b64 = 1), this.createUri(e, n); } } let l9 = !1; try { l9 = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest(); } catch { } const E4 = l9; function v4() { } class y4 extends _4 { /** * XHR Polling constructor. * * @param {Object} opts * @package */ constructor(e) { if (super(e), typeof location < "u") { const n = location.protocol === "https:"; let r = location.port; r || (r = n ? "443" : "80"), this.xd = typeof location < "u" && e.hostname !== location.hostname || r !== e.port; } } /** * Sends data. * * @param {String} data to send. * @param {Function} called upon flush. * @private */ doWrite(e, n) { const r = this.request({ method: "POST", data: e }); r.on("success", n), r.on("error", (i, a) => { this.onError("xhr post error", i, a); }); } /** * Starts a poll cycle. * * @private */ doPoll() { const e = this.request(); e.on("data", this.onData.bind(this)), e.on("error", (n, r) => { this.onError("xhr poll error", n, r); }), this.pollXhr = e; } } class nn extends Xe { /** * Request constructor * * @param {Object} options * @package */ constructor(e, n, r) { super(), this.createRequest = e, Fi(this, r), this._opts = r, this._method = r.method || "GET", this._uri = n, this._data = r.data !== void 0 ? r.data : null, this._create(); } /** * Creates the XHR object and sends the request. * * @private */ _create() { var e; const n = s9(this._opts,