highlight.run
Version:
Open source, fullstack monitoring. Capture frontend errors, record server side logs, and visualize what broke with session replay.
1,691 lines (1,690 loc) • 476 kB
JavaScript
var Zc = Object.defineProperty, Gc = Object.defineProperties;
var Ic = Object.getOwnPropertyDescriptors;
var ii = Object.getOwnPropertySymbols;
var Gn = Object.prototype.hasOwnProperty, In = Object.prototype.propertyIsEnumerable;
var Ss = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Sc = (s) => {
throw TypeError(s);
};
var Vs = (s, e, t) => e in s ? Zc(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, S = (s, e) => {
for (var t in e || (e = {}))
Gn.call(e, t) && Vs(s, t, e[t]);
if (ii)
for (var t of ii(e))
In.call(e, t) && Vs(s, t, e[t]);
return s;
}, $ = (s, e) => Gc(s, Ic(e));
var pe = (s, e) => {
var t = {};
for (var i in s)
Gn.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]);
if (s != null && ii)
for (var i of ii(s))
e.indexOf(i) < 0 && In.call(s, i) && (t[i] = s[i]);
return t;
};
var x = (s, e, t) => Vs(s, typeof e != "symbol" ? e + "" : e, t);
var re = (s, e, t) => new Promise((i, r) => {
var n = (l) => {
try {
a(t.next(l));
} catch (c) {
r(c);
}
}, o = (l) => {
try {
a(t.throw(l));
} catch (c) {
r(c);
}
}, a = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(n, o);
a((t = t.apply(s, e)).next());
}), Vc = function(s, e) {
this[0] = s, this[1] = e;
};
var Xs = (s) => {
var e = s[Ss("asyncIterator")], t = !1, i, r = {};
return e == null ? (e = s[Ss("iterator")](), i = (n) => r[n] = (o) => e[n](o)) : (e = e.call(s), i = (n) => r[n] = (o) => {
if (t) {
if (t = !1, n === "throw") throw o;
return o;
}
return t = !0, {
done: !1,
value: new Vc(new Promise((a) => {
var l = e[n](o);
l instanceof Object || Sc("Object expected"), a(l);
}), 1)
};
}), r[Ss("iterator")] = () => r, i("next"), "throw" in e ? i("throw") : r.throw = (n) => {
throw n;
}, "return" in e && i("return"), r;
};
import { Q as Xc, K as Wc, i as Sn, d as Rc, a as wc, p as Cc, b as qo, g as vc, c as xc, C as Lc, m as Yc, e as xe, S as Ye, s as Be, G as Ws, f as Vn, r as Xn, F as _e, h as kc, j as Nc, k as Rs, l as gt, n as Wn, M as We, o as $e, V as Tc, q as Ue, H as Rn, t as Jc, u as Uc, v as ws, L as Fc, w as Kc, x as wn, y as Hc, z as Mc } from "./index-BB3ZMf2W.js";
import { A as Hy, B as My } from "./index-BB3ZMf2W.js";
function zc(s, e) {
for (var t = 0; t < e.length; t++) {
const i = e[t];
if (typeof i != "string" && !Array.isArray(i)) {
for (const r in i)
if (r !== "default" && !(r in s)) {
const n = Object.getOwnPropertyDescriptor(i, r);
n && Object.defineProperty(s, r, n.get ? n : {
enumerable: !0,
get: () => i[r]
});
}
}
}
return Object.freeze(Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }));
}
function Oc(s) {
return `"${s.replace(Pc, Ec)}"`;
}
const Pc = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
function Ec(s) {
return Bc[s.charCodeAt(0)];
}
const Bc = [
"\\u0000",
"\\u0001",
"\\u0002",
"\\u0003",
"\\u0004",
"\\u0005",
"\\u0006",
"\\u0007",
"\\b",
"\\t",
"\\n",
"\\u000B",
"\\f",
"\\r",
"\\u000E",
"\\u000F",
"\\u0010",
"\\u0011",
"\\u0012",
"\\u0013",
"\\u0014",
"\\u0015",
"\\u0016",
"\\u0017",
"\\u0018",
"\\u0019",
"\\u001A",
"\\u001B",
"\\u001C",
"\\u001D",
"\\u001E",
"\\u001F",
"",
"",
'\\"',
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
// 2F
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
// 3F
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
// 4F
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\\\\",
"",
"",
"",
// 5F
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
// 6F
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\\u007F",
"\\u0080",
"\\u0081",
"\\u0082",
"\\u0083",
"\\u0084",
"\\u0085",
"\\u0086",
"\\u0087",
"\\u0088",
"\\u0089",
"\\u008A",
"\\u008B",
"\\u008C",
"\\u008D",
"\\u008E",
"\\u008F",
"\\u0090",
"\\u0091",
"\\u0092",
"\\u0093",
"\\u0094",
"\\u0095",
"\\u0096",
"\\u0097",
"\\u0098",
"\\u0099",
"\\u009A",
"\\u009B",
"\\u009C",
"\\u009D",
"\\u009E",
"\\u009F"
], Dc = Object.freeze({});
function jc(s, e, t = Xc) {
const i = /* @__PURE__ */ new Map();
for (const X of Object.values(Wc))
i.set(X, Ac(e, X));
let r, n = Array.isArray(s), o = [s], a = -1, l = [], c = s, u, d;
const h = [], p = [];
do {
a++;
const X = a === o.length, R = X && l.length !== 0;
if (X) {
if (u = p.length === 0 ? void 0 : h[h.length - 1], c = d, d = p.pop(), R)
if (n) {
c = c.slice();
let W = 0;
for (const [G, v] of l) {
const k = G - W;
v === null ? (c.splice(k, 1), W++) : c[k] = v;
}
} else {
c = Object.defineProperties(
{},
Object.getOwnPropertyDescriptors(c)
);
for (const [W, G] of l)
c[W] = G;
}
a = r.index, o = r.keys, l = r.edits, n = r.inArray, r = r.prev;
} else if (d) {
if (u = n ? a : o[a], c = d[u], c == null)
continue;
h.push(u);
}
let Z;
if (!Array.isArray(c)) {
var b, f;
Sn(c) || Rc(!1, `Invalid AST Node: ${wc(c)}.`);
const W = X ? (b = i.get(c.kind)) === null || b === void 0 ? void 0 : b.leave : (f = i.get(c.kind)) === null || f === void 0 ? void 0 : f.enter;
if (Z = W == null ? void 0 : W.call(e, c, u, d, h, p), Z === Dc)
break;
if (Z === !1) {
if (!X) {
h.pop();
continue;
}
} else if (Z !== void 0 && (l.push([u, Z]), !X))
if (Sn(Z))
c = Z;
else {
h.pop();
continue;
}
}
if (Z === void 0 && R && l.push([u, c]), X)
h.pop();
else {
var m;
r = {
inArray: n,
index: a,
keys: o,
edits: l,
prev: r
}, n = Array.isArray(c), o = n ? c : (m = t[c.kind]) !== null && m !== void 0 ? m : [], a = -1, l = [], d && p.push(d), d = c;
}
} while (r !== void 0);
return l.length !== 0 ? l[l.length - 1][1] : s;
}
function Ac(s, e) {
const t = s[e];
return typeof t == "object" ? t : typeof t == "function" ? {
enter: t,
leave: void 0
} : {
enter: s.enter,
leave: s.leave
};
}
function el(s) {
return jc(s, _c);
}
const Qc = 80, _c = {
Name: {
leave: (s) => s.value
},
Variable: {
leave: (s) => "$" + s.name
},
// Document
Document: {
leave: (s) => w(s.definitions, `
`)
},
OperationDefinition: {
leave(s) {
const e = F("(", w(s.variableDefinitions, ", "), ")"), t = w(
[
s.operation,
w([s.name, e]),
w(s.directives, " ")
],
" "
);
return (t === "query" ? "" : t + " ") + s.selectionSet;
}
},
VariableDefinition: {
leave: ({ variable: s, type: e, defaultValue: t, directives: i }) => s + ": " + e + F(" = ", t) + F(" ", w(i, " "))
},
SelectionSet: {
leave: ({ selections: s }) => Ge(s)
},
Field: {
leave({ alias: s, name: e, arguments: t, directives: i, selectionSet: r }) {
const n = F("", s, ": ") + e;
let o = n + F("(", w(t, ", "), ")");
return o.length > Qc && (o = n + F(`(
`, wi(w(t, `
`)), `
)`)), w([o, w(i, " "), r], " ");
}
},
Argument: {
leave: ({ name: s, value: e }) => s + ": " + e
},
// Fragments
FragmentSpread: {
leave: ({ name: s, directives: e }) => "..." + s + F(" ", w(e, " "))
},
InlineFragment: {
leave: ({ typeCondition: s, directives: e, selectionSet: t }) => w(
[
"...",
F("on ", s),
w(e, " "),
t
],
" "
)
},
FragmentDefinition: {
leave: ({ name: s, typeCondition: e, variableDefinitions: t, directives: i, selectionSet: r }) => (
// or removed in the future.
`fragment ${s}${F("(", w(t, ", "), ")")} on ${e} ${F("", w(i, " "), " ")}` + r
)
},
// Value
IntValue: {
leave: ({ value: s }) => s
},
FloatValue: {
leave: ({ value: s }) => s
},
StringValue: {
leave: ({ value: s, block: e }) => e ? Cc(s) : Oc(s)
},
BooleanValue: {
leave: ({ value: s }) => s ? "true" : "false"
},
NullValue: {
leave: () => "null"
},
EnumValue: {
leave: ({ value: s }) => s
},
ListValue: {
leave: ({ values: s }) => "[" + w(s, ", ") + "]"
},
ObjectValue: {
leave: ({ fields: s }) => "{" + w(s, ", ") + "}"
},
ObjectField: {
leave: ({ name: s, value: e }) => s + ": " + e
},
// Directive
Directive: {
leave: ({ name: s, arguments: e }) => "@" + s + F("(", w(e, ", "), ")")
},
// Type
NamedType: {
leave: ({ name: s }) => s
},
ListType: {
leave: ({ type: s }) => "[" + s + "]"
},
NonNullType: {
leave: ({ type: s }) => s + "!"
},
// Type System Definitions
SchemaDefinition: {
leave: ({ description: s, directives: e, operationTypes: t }) => F("", s, `
`) + w(["schema", w(e, " "), Ge(t)], " ")
},
OperationTypeDefinition: {
leave: ({ operation: s, type: e }) => s + ": " + e
},
ScalarTypeDefinition: {
leave: ({ description: s, name: e, directives: t }) => F("", s, `
`) + w(["scalar", e, w(t, " ")], " ")
},
ObjectTypeDefinition: {
leave: ({ description: s, name: e, interfaces: t, directives: i, fields: r }) => F("", s, `
`) + w(
[
"type",
e,
F("implements ", w(t, " & ")),
w(i, " "),
Ge(r)
],
" "
)
},
FieldDefinition: {
leave: ({ description: s, name: e, arguments: t, type: i, directives: r }) => F("", s, `
`) + e + (Cn(t) ? F(`(
`, wi(w(t, `
`)), `
)`) : F("(", w(t, ", "), ")")) + ": " + i + F(" ", w(r, " "))
},
InputValueDefinition: {
leave: ({ description: s, name: e, type: t, defaultValue: i, directives: r }) => F("", s, `
`) + w(
[e + ": " + t, F("= ", i), w(r, " ")],
" "
)
},
InterfaceTypeDefinition: {
leave: ({ description: s, name: e, interfaces: t, directives: i, fields: r }) => F("", s, `
`) + w(
[
"interface",
e,
F("implements ", w(t, " & ")),
w(i, " "),
Ge(r)
],
" "
)
},
UnionTypeDefinition: {
leave: ({ description: s, name: e, directives: t, types: i }) => F("", s, `
`) + w(
["union", e, w(t, " "), F("= ", w(i, " | "))],
" "
)
},
EnumTypeDefinition: {
leave: ({ description: s, name: e, directives: t, values: i }) => F("", s, `
`) + w(["enum", e, w(t, " "), Ge(i)], " ")
},
EnumValueDefinition: {
leave: ({ description: s, name: e, directives: t }) => F("", s, `
`) + w([e, w(t, " ")], " ")
},
InputObjectTypeDefinition: {
leave: ({ description: s, name: e, directives: t, fields: i }) => F("", s, `
`) + w(["input", e, w(t, " "), Ge(i)], " ")
},
DirectiveDefinition: {
leave: ({ description: s, name: e, arguments: t, repeatable: i, locations: r }) => F("", s, `
`) + "directive @" + e + (Cn(t) ? F(`(
`, wi(w(t, `
`)), `
)`) : F("(", w(t, ", "), ")")) + (i ? " repeatable" : "") + " on " + w(r, " | ")
},
SchemaExtension: {
leave: ({ directives: s, operationTypes: e }) => w(
["extend schema", w(s, " "), Ge(e)],
" "
)
},
ScalarTypeExtension: {
leave: ({ name: s, directives: e }) => w(["extend scalar", s, w(e, " ")], " ")
},
ObjectTypeExtension: {
leave: ({ name: s, interfaces: e, directives: t, fields: i }) => w(
[
"extend type",
s,
F("implements ", w(e, " & ")),
w(t, " "),
Ge(i)
],
" "
)
},
InterfaceTypeExtension: {
leave: ({ name: s, interfaces: e, directives: t, fields: i }) => w(
[
"extend interface",
s,
F("implements ", w(e, " & ")),
w(t, " "),
Ge(i)
],
" "
)
},
UnionTypeExtension: {
leave: ({ name: s, directives: e, types: t }) => w(
[
"extend union",
s,
w(e, " "),
F("= ", w(t, " | "))
],
" "
)
},
EnumTypeExtension: {
leave: ({ name: s, directives: e, values: t }) => w(["extend enum", s, w(e, " "), Ge(t)], " ")
},
InputObjectTypeExtension: {
leave: ({ name: s, directives: e, fields: t }) => w(["extend input", s, w(e, " "), Ge(t)], " ")
}
};
function w(s, e = "") {
var t;
return (t = s == null ? void 0 : s.filter((i) => i).join(e)) !== null && t !== void 0 ? t : "";
}
function Ge(s) {
return F(`{
`, wi(w(s, `
`)), `
}`);
}
function F(s, e, t = "") {
return e != null && e !== "" ? s + e + t : "";
}
function wi(s) {
return F(" ", s.replace(/\n/g, `
`));
}
function Cn(s) {
var e;
return (e = s == null ? void 0 : s.some((t) => t.includes(`
`))) !== null && e !== void 0 ? e : !1;
}
const Fr = JSON, $c = (s) => s.toUpperCase(), qc = (s) => {
const e = {};
return s.forEach((t, i) => {
e[i] = t;
}), e;
}, eu = (s, e, t) => s.document ? s : {
document: s,
variables: e,
requestHeaders: t,
signal: void 0
}, tu = (s, e, t) => s.query ? s : {
query: s,
variables: e,
requestHeaders: t,
signal: void 0
}, iu = (s, e) => s.documents ? s : {
documents: s,
requestHeaders: e,
signal: void 0
}, vn = (s) => {
var i, r;
let e;
const t = s.definitions.filter((n) => n.kind === "OperationDefinition");
return t.length === 1 && (e = (r = (i = t[0]) == null ? void 0 : i.name) == null ? void 0 : r.value), e;
}, Cs = (s) => {
if (typeof s == "string") {
let t;
try {
const i = qo(s);
t = vn(i);
} catch (i) {
}
return { query: s, operationName: t };
}
const e = vn(s);
return { query: el(s), operationName: e };
};
var qs = { exports: {} };
(function(s, e) {
var t = typeof self != "undefined" ? self : xc, i = function() {
function n() {
this.fetch = !1, this.DOMException = t.DOMException;
}
return n.prototype = t, new n();
}();
(function(n) {
(function(o) {
var a = {
searchParams: "URLSearchParams" in n,
iterable: "Symbol" in n && "iterator" in Symbol,
blob: "FileReader" in n && "Blob" in n && function() {
try {
return new Blob(), !0;
} catch (y) {
return !1;
}
}(),
formData: "FormData" in n,
arrayBuffer: "ArrayBuffer" in n
};
function l(y) {
return y && DataView.prototype.isPrototypeOf(y);
}
if (a.arrayBuffer)
var c = [
"[object Int8Array]",
"[object Uint8Array]",
"[object Uint8ClampedArray]",
"[object Int16Array]",
"[object Uint16Array]",
"[object Int32Array]",
"[object Uint32Array]",
"[object Float32Array]",
"[object Float64Array]"
], u = ArrayBuffer.isView || function(y) {
return y && c.indexOf(Object.prototype.toString.call(y)) > -1;
};
function d(y) {
if (typeof y != "string" && (y = String(y)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(y))
throw new TypeError("Invalid character in header field name");
return y.toLowerCase();
}
function h(y) {
return typeof y != "string" && (y = String(y)), y;
}
function p(y) {
var g = {
next: function() {
var Y = y.shift();
return { done: Y === void 0, value: Y };
}
};
return a.iterable && (g[Symbol.iterator] = function() {
return g;
}), g;
}
function b(y) {
this.map = {}, y instanceof b ? y.forEach(function(g, Y) {
this.append(Y, g);
}, this) : Array.isArray(y) ? y.forEach(function(g) {
this.append(g[0], g[1]);
}, this) : y && Object.getOwnPropertyNames(y).forEach(function(g) {
this.append(g, y[g]);
}, this);
}
b.prototype.append = function(y, g) {
y = d(y), g = h(g);
var Y = this.map[y];
this.map[y] = Y ? Y + ", " + g : g;
}, b.prototype.delete = function(y) {
delete this.map[d(y)];
}, b.prototype.get = function(y) {
return y = d(y), this.has(y) ? this.map[y] : null;
}, b.prototype.has = function(y) {
return this.map.hasOwnProperty(d(y));
}, b.prototype.set = function(y, g) {
this.map[d(y)] = h(g);
}, b.prototype.forEach = function(y, g) {
for (var Y in this.map)
this.map.hasOwnProperty(Y) && y.call(g, this.map[Y], Y, this);
}, b.prototype.keys = function() {
var y = [];
return this.forEach(function(g, Y) {
y.push(Y);
}), p(y);
}, b.prototype.values = function() {
var y = [];
return this.forEach(function(g) {
y.push(g);
}), p(y);
}, b.prototype.entries = function() {
var y = [];
return this.forEach(function(g, Y) {
y.push([Y, g]);
}), p(y);
}, a.iterable && (b.prototype[Symbol.iterator] = b.prototype.entries);
function f(y) {
if (y.bodyUsed)
return Promise.reject(new TypeError("Already read"));
y.bodyUsed = !0;
}
function m(y) {
return new Promise(function(g, Y) {
y.onload = function() {
g(y.result);
}, y.onerror = function() {
Y(y.error);
};
});
}
function X(y) {
var g = new FileReader(), Y = m(g);
return g.readAsArrayBuffer(y), Y;
}
function R(y) {
var g = new FileReader(), Y = m(g);
return g.readAsText(y), Y;
}
function Z(y) {
for (var g = new Uint8Array(y), Y = new Array(g.length), Q = 0; Q < g.length; Q++)
Y[Q] = String.fromCharCode(g[Q]);
return Y.join("");
}
function W(y) {
if (y.slice)
return y.slice(0);
var g = new Uint8Array(y.byteLength);
return g.set(new Uint8Array(y)), g.buffer;
}
function G() {
return this.bodyUsed = !1, this._initBody = function(y) {
this._bodyInit = y, y ? typeof y == "string" ? this._bodyText = y : a.blob && Blob.prototype.isPrototypeOf(y) ? this._bodyBlob = y : a.formData && FormData.prototype.isPrototypeOf(y) ? this._bodyFormData = y : a.searchParams && URLSearchParams.prototype.isPrototypeOf(y) ? this._bodyText = y.toString() : a.arrayBuffer && a.blob && l(y) ? (this._bodyArrayBuffer = W(y.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(y) || u(y)) ? this._bodyArrayBuffer = W(y) : this._bodyText = y = Object.prototype.toString.call(y) : this._bodyText = "", this.headers.get("content-type") || (typeof y == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(y) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
}, a.blob && (this.blob = function() {
var y = f(this);
if (y)
return y;
if (this._bodyBlob)
return Promise.resolve(this._bodyBlob);
if (this._bodyArrayBuffer)
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
if (this._bodyFormData)
throw new Error("could not read FormData body as blob");
return Promise.resolve(new Blob([this._bodyText]));
}, this.arrayBuffer = function() {
return this._bodyArrayBuffer ? f(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(X);
}), this.text = function() {
var y = f(this);
if (y)
return y;
if (this._bodyBlob)
return R(this._bodyBlob);
if (this._bodyArrayBuffer)
return Promise.resolve(Z(this._bodyArrayBuffer));
if (this._bodyFormData)
throw new Error("could not read FormData body as text");
return Promise.resolve(this._bodyText);
}, a.formData && (this.formData = function() {
return this.text().then(V);
}), this.json = function() {
return this.text().then(JSON.parse);
}, this;
}
var v = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
function k(y) {
var g = y.toUpperCase();
return v.indexOf(g) > -1 ? g : y;
}
function L(y, g) {
g = g || {};
var Y = g.body;
if (y instanceof L) {
if (y.bodyUsed)
throw new TypeError("Already read");
this.url = y.url, this.credentials = y.credentials, g.headers || (this.headers = new b(y.headers)), this.method = y.method, this.mode = y.mode, this.signal = y.signal, !Y && y._bodyInit != null && (Y = y._bodyInit, y.bodyUsed = !0);
} else
this.url = String(y);
if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new b(g.headers)), this.method = k(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && Y)
throw new TypeError("Body not allowed for GET or HEAD requests");
this._initBody(Y);
}
L.prototype.clone = function() {
return new L(this, { body: this._bodyInit });
};
function V(y) {
var g = new FormData();
return y.trim().split("&").forEach(function(Y) {
if (Y) {
var Q = Y.split("="), O = Q.shift().replace(/\+/g, " "), U = Q.join("=").replace(/\+/g, " ");
g.append(decodeURIComponent(O), decodeURIComponent(U));
}
}), g;
}
function C(y) {
var g = new b(), Y = y.replace(/\r?\n[\t ]+/g, " ");
return Y.split(/\r?\n/).forEach(function(Q) {
var O = Q.split(":"), U = O.shift().trim();
if (U) {
var j = O.join(":").trim();
g.append(U, j);
}
}), g;
}
G.call(L.prototype);
function N(y, g) {
g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in g ? g.statusText : "OK", this.headers = new b(g.headers), this.url = g.url || "", this._initBody(y);
}
G.call(N.prototype), N.prototype.clone = function() {
return new N(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new b(this.headers),
url: this.url
});
}, N.error = function() {
var y = new N(null, { status: 0, statusText: "" });
return y.type = "error", y;
};
var D = [301, 302, 303, 307, 308];
N.redirect = function(y, g) {
if (D.indexOf(g) === -1)
throw new RangeError("Invalid status code");
return new N(null, { status: g, headers: { location: y } });
}, o.DOMException = n.DOMException;
try {
new o.DOMException();
} catch (y) {
o.DOMException = function(g, Y) {
this.message = g, this.name = Y;
var Q = Error(g);
this.stack = Q.stack;
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
}
function q(y, g) {
return new Promise(function(Y, Q) {
var O = new L(y, g);
if (O.signal && O.signal.aborted)
return Q(new o.DOMException("Aborted", "AbortError"));
var U = new XMLHttpRequest();
function j() {
U.abort();
}
U.onload = function() {
var ee = {
status: U.status,
statusText: U.statusText,
headers: C(U.getAllResponseHeaders() || "")
};
ee.url = "responseURL" in U ? U.responseURL : ee.headers.get("X-Request-URL");
var ge = "response" in U ? U.response : U.responseText;
Y(new N(ge, ee));
}, U.onerror = function() {
Q(new TypeError("Network request failed"));
}, U.ontimeout = function() {
Q(new TypeError("Network request failed"));
}, U.onabort = function() {
Q(new o.DOMException("Aborted", "AbortError"));
}, U.open(O.method, O.url, !0), O.credentials === "include" ? U.withCredentials = !0 : O.credentials === "omit" && (U.withCredentials = !1), "responseType" in U && a.blob && (U.responseType = "blob"), O.headers.forEach(function(ee, ge) {
U.setRequestHeader(ge, ee);
}), O.signal && (O.signal.addEventListener("abort", j), U.onreadystatechange = function() {
U.readyState === 4 && O.signal.removeEventListener("abort", j);
}), U.send(typeof O._bodyInit == "undefined" ? null : O._bodyInit);
});
}
return q.polyfill = !0, n.fetch || (n.fetch = q, n.Headers = b, n.Request = L, n.Response = N), o.Headers = b, o.Request = L, o.Response = N, o.fetch = q, Object.defineProperty(o, "__esModule", { value: !0 }), o;
})({});
})(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
var r = i;
e = r.fetch, e.default = r.fetch, e.fetch = r.fetch, e.Headers = r.Headers, e.Request = r.Request, e.Response = r.Response, s.exports = e;
})(qs, qs.exports);
var Ji = qs.exports;
const Ci = /* @__PURE__ */ vc(Ji), su = /* @__PURE__ */ zc({
__proto__: null,
default: Ci
}, [Ji]), qe = (s) => {
let e = {};
return s && (typeof Headers != "undefined" && s instanceof Headers || su && Ji.Headers && s instanceof Ji.Headers ? e = qc(s) : Array.isArray(s) ? s.forEach(([t, i]) => {
t && i !== void 0 && (e[t] = i);
}) : e = s), e;
}, xn = (s) => s.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), ru = (s) => {
if (!Array.isArray(s.query)) {
const i = s, r = [`query=${encodeURIComponent(xn(i.query))}`];
return s.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
}
if (typeof s.variables != "undefined" && !Array.isArray(s.variables))
throw new Error("Cannot create query with given variable type, array expected");
const e = s, t = s.query.reduce((i, r, n) => (i.push({
query: xn(r),
variables: e.variables ? e.jsonSerializer.stringify(e.variables[n]) : void 0
}), i), []);
return `query=${encodeURIComponent(e.jsonSerializer.stringify(t))}`;
}, nu = (s) => (e) => re(void 0, null, function* () {
var f;
const { url: t, query: i, variables: r, operationName: n, fetch: o, fetchOptions: a, middleware: l } = e, c = S({}, e.headers);
let u = "", d;
s === "POST" ? (d = lu(i, r, n, a.jsonSerializer), typeof d == "string" && (c["Content-Type"] = "application/json")) : u = ru({
query: i,
variables: r,
operationName: n,
jsonSerializer: (f = a.jsonSerializer) != null ? f : Fr
});
const h = S({
method: s,
headers: c,
body: d
}, a);
let p = t, b = h;
if (l) {
const m = yield Promise.resolve(l($(S({}, h), { url: t, operationName: n, variables: r }))), { url: R } = m, Z = pe(m, ["url"]);
p = R, b = Z;
}
return u && (p = `${p}?${u}`), yield o(p, b);
});
class ou {
constructor(e, t = {}) {
this.url = e, this.requestConfig = t, this.rawRequest = (...i) => re(this, null, function* () {
const [r, n, o] = i, a = tu(r, n, o), m = this.requestConfig, { headers: l, fetch: c = Ci, method: u = "POST", requestMiddleware: d, responseMiddleware: h } = m, p = pe(m, ["headers", "fetch", "method", "requestMiddleware", "responseMiddleware"]), { url: b } = this;
a.signal !== void 0 && (p.signal = a.signal);
const { operationName: f } = Cs(a.query);
return vs({
url: b,
query: a.query,
variables: a.variables,
headers: S(S({}, qe(xs(l))), qe(a.requestHeaders)),
operationName: f,
fetch: c,
method: u,
fetchOptions: p,
middleware: d
}).then((X) => (h && h(X), X)).catch((X) => {
throw h && h(X), X;
});
});
}
request(e, ...t) {
return re(this, null, function* () {
const [i, r] = t, n = eu(e, i, r), f = this.requestConfig, { headers: o, fetch: a = Ci, method: l = "POST", requestMiddleware: c, responseMiddleware: u } = f, d = pe(f, ["headers", "fetch", "method", "requestMiddleware", "responseMiddleware"]), { url: h } = this;
n.signal !== void 0 && (d.signal = n.signal);
const { query: p, operationName: b } = Cs(n.document);
return vs({
url: h,
query: p,
variables: n.variables,
headers: S(S({}, qe(xs(o))), qe(n.requestHeaders)),
operationName: b,
fetch: a,
method: l,
fetchOptions: d,
middleware: c
}).then((m) => (u && u(m), m.data)).catch((m) => {
throw u && u(m), m;
});
});
}
// prettier-ignore
batchRequests(e, t) {
var c;
const i = iu(e, t), l = this.requestConfig, { headers: r } = l, n = pe(l, ["headers"]);
i.signal !== void 0 && (n.signal = i.signal);
const o = i.documents.map(({ document: u }) => Cs(u).query), a = i.documents.map(({ variables: u }) => u);
return vs({
url: this.url,
query: o,
// @ts-expect-error TODO reconcile batch variables into system.
variables: a,
headers: S(S({}, qe(xs(r))), qe(i.requestHeaders)),
operationName: void 0,
fetch: (c = this.requestConfig.fetch) != null ? c : Ci,
method: this.requestConfig.method || "POST",
fetchOptions: n,
middleware: this.requestConfig.requestMiddleware
}).then((u) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(u), u.data)).catch((u) => {
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(u), u;
});
}
setHeaders(e) {
return this.requestConfig.headers = e, this;
}
/**
* Attach a header to the client. All subsequent requests will have this header.
*/
setHeader(e, t) {
const { headers: i } = this.requestConfig;
return i ? i[e] = t : this.requestConfig.headers = { [e]: t }, this;
}
/**
* Change the client endpoint. All subsequent requests will send to this endpoint.
*/
setEndpoint(e) {
return this.url = e, this;
}
}
const vs = (s) => re(void 0, null, function* () {
var u, d;
const { query: e, variables: t, fetchOptions: i } = s, r = nu($c((u = s.method) != null ? u : "post")), n = Array.isArray(s.query), o = yield r(s), a = yield au(o, (d = i.jsonSerializer) != null ? d : Fr), l = Array.isArray(a) ? !a.some(({ data: p }) => !p) : !!a.data, c = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
if (o.ok && c && l) {
const h = (Array.isArray(a), a), { errors: p } = h, b = pe(h, ["errors"]), f = i.errorPolicy === "ignore" ? b : a;
return $(S({}, n ? { data: f } : f), {
headers: o.headers,
status: o.status
});
} else {
const p = typeof a == "string" ? {
error: a
} : a;
throw new Lc(
// @ts-expect-error TODO
$(S({}, p), { status: o.status, headers: o.headers }),
{ query: e, variables: t }
);
}
}), lu = (s, e, t, i) => {
const r = i != null ? i : Fr;
if (!Array.isArray(s))
return r.stringify({ query: s, variables: e, operationName: t });
if (typeof e != "undefined" && !Array.isArray(e))
throw new Error("Cannot create request body with given variable type, array expected");
const n = s.reduce((o, a, l) => (o.push({ query: a, variables: e ? e[l] : void 0 }), o), []);
return r.stringify(n);
}, au = (s, e) => re(void 0, null, function* () {
let t;
return s.headers.forEach((i, r) => {
r.toLowerCase() === "content-type" && (t = i);
}), t && (t.toLowerCase().startsWith("application/json") || t.toLowerCase().startsWith("application/graphql+json") || t.toLowerCase().startsWith("application/graphql-response+json")) ? e.parse(yield s.text()) : s.text();
}), xs = (s) => typeof s == "function" ? s() : s, cu = {
key: "_sid"
}, uu = "rrweb/sequential-id@1", du = (s) => {
const e = cu;
let t = 0;
return {
name: uu,
eventProcessor(i) {
return Object.assign(i, {
[e.key]: ++t
}), i;
},
options: e
};
};
var hu = Object.defineProperty, pu = (s, e, t) => e in s ? hu(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, I = (s, e, t) => pu(s, typeof e != "symbol" ? e + "" : e, t), Ln, mu = Object.defineProperty, fu = (s, e, t) => e in s ? mu(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, Yn = (s, e, t) => fu(s, typeof e != "symbol" ? e + "" : e, t), ne = /* @__PURE__ */ ((s) => (s[s.Document = 0] = "Document", s[s.DocumentType = 1] = "DocumentType", s[s.Element = 2] = "Element", s[s.Text = 3] = "Text", s[s.CDATA = 4] = "CDATA", s[s.Comment = 5] = "Comment", s))(ne || {});
const kn = {
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
ShadowRoot: ["host", "styleSheets"],
Element: ["shadowRoot", "querySelector", "querySelectorAll"],
MutationObserver: []
}, Nn = {
Node: ["contains", "getRootNode"],
ShadowRoot: ["getSelection"],
Element: [],
MutationObserver: ["constructor"]
}, si = {}, bu = () => !!globalThis.Zone;
function Kr(s) {
if (si[s])
return si[s];
const e = globalThis[s], t = e.prototype, i = s in kn ? kn[s] : void 0, r = !!(i && // @ts-expect-error 2345
i.every(
(a) => {
var l, c;
return !!((c = (l = Object.getOwnPropertyDescriptor(t, a)) == null ? void 0 : l.get) != null && c.toString().includes("[native code]"));
}
)), n = s in Nn ? Nn[s] : void 0, o = !!(n && n.every(
// @ts-expect-error 2345
(a) => {
var l;
return typeof t[a] == "function" && ((l = t[a]) == null ? void 0 : l.toString().includes("[native code]"));
}
));
if (r && o && !bu())
return si[s] = e.prototype, e.prototype;
try {
const a = document.createElement("iframe");
document.body.appendChild(a);
const l = a.contentWindow;
if (!l) return e.prototype;
const c = l[s].prototype;
return document.body.removeChild(a), c ? si[s] = c : t;
} catch (a) {
return t;
}
}
const Ls = {};
function Me(s, e, t) {
var i;
const r = `${s}.${String(t)}`;
if (Ls[r])
return Ls[r].call(
e
);
const n = Kr(s), o = (i = Object.getOwnPropertyDescriptor(
n,
t
)) == null ? void 0 : i.get;
return o ? (Ls[r] = o, o.call(e)) : e[t];
}
const Ys = {};
function tl(s, e, t) {
const i = `${s}.${String(t)}`;
if (Ys[i])
return Ys[i].bind(
e
);
const n = Kr(s)[t];
return typeof n != "function" ? e[t] : (Ys[i] = n, n.bind(e));
}
function yu(s) {
return Me("Node", s, "childNodes");
}
function gu(s) {
return Me("Node", s, "parentNode");
}
function Zu(s) {
return Me("Node", s, "parentElement");
}
function Gu(s) {
return Me("Node", s, "textContent");
}
function Iu(s, e) {
return tl("Node", s, "contains")(e);
}
function Su(s) {
return tl("Node", s, "getRootNode")();
}
function Vu(s) {
return !s || !("host" in s) ? null : Me("ShadowRoot", s, "host");
}
function Xu(s) {
return s.styleSheets;
}
function Wu(s) {
return !s || !("shadowRoot" in s) ? null : Me("Element", s, "shadowRoot");
}
function Ru(s, e) {
return Me("Element", s, "querySelector")(e);
}
function wu(s, e) {
return Me("Element", s, "querySelectorAll")(e);
}
function Cu() {
return Kr("MutationObserver").constructor;
}
function vu(s, e, t) {
try {
if (!(e in s))
return () => {
};
const i = s[e], r = t(i);
return typeof r == "function" && (r.prototype = r.prototype || {}, Object.defineProperties(r, {
__rrweb_original__: {
enumerable: !1,
value: i
}
})), s[e] = r, () => {
s[e] = i;
};
} catch (i) {
return () => {
};
}
}
const oe = {
childNodes: yu,
parentNode: gu,
parentElement: Zu,
textContent: Gu,
contains: Iu,
getRootNode: Su,
host: Vu,
styleSheets: Xu,
shadowRoot: Wu,
querySelector: Ru,
querySelectorAll: wu,
mutationObserver: Cu,
patch: vu
};
function il(s) {
return s.nodeType === s.ELEMENT_NODE;
}
function xt(s) {
const e = (
// anchor and textarea elements also have a `host` property
// but only shadow roots have a `mode` property
s && "host" in s && "mode" in s && oe.host(s) || null
);
return !!(e && "shadowRoot" in e && oe.shadowRoot(e) === s);
}
function Lt(s) {
return Object.prototype.toString.call(s) === "[object ShadowRoot]";
}
function xu(s) {
return s.includes(" background-clip: text;") && !s.includes(" -webkit-background-clip: text;") && (s = s.replace(
/\sbackground-clip:\s*text;/g,
" -webkit-background-clip: text; background-clip: text;"
)), s;
}
function Lu(s) {
const { cssText: e } = s;
if (e.split('"').length < 3) return e;
const t = ["@import", `url(${JSON.stringify(s.href)})`];
return s.layerName === "" ? t.push("layer") : s.layerName && t.push(`layer(${s.layerName})`), s.supportsText && t.push(`supports(${s.supportsText})`), s.media.length && t.push(s.media.mediaText), t.join(" ") + ";";
}
function er(s) {
try {
const e = s.rules || s.cssRules;
if (!e)
return null;
let t = s.href;
!t && s.ownerNode && s.ownerNode.ownerDocument && (t = s.ownerNode.ownerDocument.location.href);
const i = Array.from(
e,
(r) => sl(r, t)
).join("");
return xu(i);
} catch (e) {
return null;
}
}
function sl(s, e) {
if (ku(s)) {
let t;
try {
t = // for same-origin stylesheets,
// we can access the imported stylesheet rules directly
er(s.styleSheet) || // work around browser issues with the raw string `@import url(...)` statement
Lu(s);
} catch (i) {
t = s.cssText;
}
return s.styleSheet.href ? Ki(t, s.styleSheet.href) : t;
} else {
let t = s.cssText;
return Nu(s) && s.selectorText.includes(":") && (t = Yu(t)), e ? Ki(t, e) : t;
}
}
function Yu(s) {
const e = /(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;
return s.replace(e, "$1\\$2");
}
function ku(s) {
return "styleSheet" in s;
}
function Nu(s) {
return "selectorText" in s;
}
class rl {
constructor() {
Yn(this, "idNodeMap", /* @__PURE__ */ new Map()), Yn(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
}
getId(e) {
var t;
if (!e) return -1;
const i = (t = this.getMeta(e)) == null ? void 0 : t.id;
return i != null ? i : -1;
}
getNode(e) {
return this.idNodeMap.get(e) || null;
}
getIds() {
return Array.from(this.idNodeMap.keys());
}
getMeta(e) {
return this.nodeMetaMap.get(e) || null;
}
// removes the node from idNodeMap
// doesn't remove the node from nodeMetaMap
removeNodeFromMap(e) {
const t = this.getId(e);
this.idNodeMap.delete(t), e.childNodes && e.childNodes.forEach(
(i) => this.removeNodeFromMap(i)
);
}
has(e) {
return this.idNodeMap.has(e);
}
hasNode(e) {
return this.nodeMetaMap.has(e);
}
add(e, t) {
const i = t.id;
this.idNodeMap.set(i, e), this.nodeMetaMap.set(e, t);
}
replace(e, t) {
const i = this.getNode(e);
if (i) {
const r = this.nodeMetaMap.get(i);
r && this.nodeMetaMap.set(t, r);
}
this.idNodeMap.set(e, t);
}
reset() {
this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
}
}
function Tu() {
return new rl();
}
function Ui({
element: s,
maskInputOptions: e,
tagName: t,
type: i,
value: r,
overwriteRecord: n,
maskInputFn: o
}) {
let a = r || "";
return ll({
maskInputOptions: e,
tagName: t,
type: i,
overwriteRecord: n
}) && (o ? a = o(a, s) : a = "*".repeat(a.length)), a;
}
function at(s) {
return s.toLowerCase();
}
const Tn = "__rrweb_original__";
function Ju(s) {
const e = s.getContext("2d");
if (!e) return !0;
const t = 50;
for (let i = 0; i < s.width; i += t)
for (let r = 0; r < s.height; r += t) {
const n = e.getImageData, o = Tn in n ? n[Tn] : n;
if (new Uint32Array(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
o.call(
e,
i,
r,
Math.min(t, s.width - i),
Math.min(t, s.height - r)
).data.buffer
).some((l) => l !== 0)) return !1;
}
return !0;
}
function Fi(s) {
const e = s.type;
return s.hasAttribute("data-rr-is-password") ? "password" : e ? (
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
at(e)
) : null;
}
function nl(s, e) {
var n;
let t;
try {
t = new URL(s, window.location.href);
} catch (o) {
return null;
}
const i = /\.([0-9a-z]+)(?:$)/i, r = t.pathname.match(i);
return (n = r == null ? void 0 : r[1]) != null ? n : null;
}
function Uu(s) {
let e = "";
return s.indexOf("//") > -1 ? e = s.split("/").slice(0, 3).join("/") : e = s.split("/")[0], e = e.split("?")[0], e;
}
const Fu = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, Ku = /^(?:[a-z+]+:)?\/\//i, Hu = /^www\..*/i, Mu = /^(data:)([^,]*),(.*)/i;
function Ki(s, e) {
return (s || "").replace(
Fu,
(t, i, r, n, o, a) => {
const l = r || o || a, c = i || n || "";
if (!l)
return t;
if (Ku.test(l) || Hu.test(l))
return `url(${c}${l}${c})`;
if (Mu.test(l))
return `url(${c}${l}${c})`;
if (l[0] === "/")
return `url(${c}${Uu(e) + l}${c})`;
const u = e.split("/"), d = l.split("/");
u.pop();
for (const h of d)
h !== "." && (h === ".." ? u.pop() : u.push(h));
return `url(${c}${u.join("/")}${c})`;
}
);
}
function ri(s, e = !1) {
return e ? s.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "") : s.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0");
}
function zu(s, e, t = !1) {
const i = Array.from(e.childNodes), r = [];
let n = 0;
if (i.length > 1 && s && typeof s == "string") {
let o = ri(s, t);
const a = o.length / s.length;
for (let l = 1; l < i.length; l++)
if (i[l].textContent && typeof i[l].textContent == "string") {
const c = ri(
i[l].textContent,
t
), u = 100;
let d = 3;
for (; d < c.length && // keep consuming css identifiers (to get a decent chunk more quickly)
(c[d].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section
c.indexOf(c.substring(0, d), 1) !== -1); d++)
;
for (; d < c.length; d++) {
let h = c.substring(0, d), p = o.split(h), b = -1;
if (p.length === 2)
b = p[0].length;
else if (p.length > 2 && p[0] === "" && i[l - 1].textContent !== "")
b = o.indexOf(h, 1);
else if (p.length === 1) {
if (h = h.substring(
0,
h.length - 1
), p = o.split(h), p.length <= 1)
return r.push(s), r;
d = u + 1;
} else d === c.length - 1 && (b = o.indexOf(h));
if (p.length >= 2 && d > u) {
const f = i[l - 1].textContent;
if (f && typeof f == "string") {
const m = ri(f).length;
b = o.indexOf(h, m);
}
b === -1 && (b = p[0].length);
}
if (b !== -1) {
let f = Math.floor(b / a);
for (; f > 0 && f < s.length; ) {
if (n += 1, n > 50 * i.length)
return r.push(s), r;
const m = ri(
s.substring(0, f),
t
);
if (m.length === b) {
r.push(s.substring(0, f)), s = s.substring(f), o = o.substring(b);
break;
} else m.length < b ? f += Math.max(
1,
Math.floor((b - m.length) / a)
) : f -= Math.max(
1,
Math.floor((m.length - b) * a)
);
}
break;
}
}
}
}
return r.push(s), r;
}
function Ou(s, e) {
return zu(s, e).join("/* rr_split */");
}
function Hr(s) {
return s = s.replace(/[^ -~]+/g, ""), s = (s == null ? void 0 : s.split(" ").map((e) => Math.random().toString(20).substring(2, e.length)).join(" ")) || "", s;
}
function tr(s) {
return s === "img" || s === "video" || s === "audio" || s === "source";
}
const Pu = new RegExp(
/[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/
), Eu = new RegExp(/[0-9]{9,16}/), Bu = new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/), Du = new RegExp(
/[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}/
), ju = new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/), Au = new RegExp(
/[0-9]{1,5}.?[0-9]{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}/
), Qu = new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/), _u = [
Pu,
Eu,
Bu,
Du,
ju,
Au,
Qu
];
function ol(s) {
return s ? _u.some((e) => e.test(s)) : !1;
}
const ll = ({
maskInputOptions: s,
tagName: e,
type: t,
overwriteRecord: i
}) => {
const r = t && t.toLowerCase();
return i !== "true" && (!!s[e.toLowerCase()] || !!(r && s[r]));
};
let $u = 1;
const qu = new RegExp("[^a-z0-9-_:]"), Tt = -2;
function al() {
return $u++;
}
function ed(s) {
if (s instanceof HTMLFormElement)
return "form";
const e = at(s.tagName);
return qu.test(e) ? "div" : e;
}
let et, Jn;
const td = /^[^ \t\n\r\u000c]+/, id = /^[, \t\n\r\u000c]+/;
function sd(s, e) {
if (e.trim() === "")
return e;
let t = 0;
function i(n) {
let o;
const a = n.exec(e.substring(t));
return a ? (o = a[0], t += o.length, o) : "";
}
const r = [];
for (; i(id), !(t >= e.length); ) {
let n = i(td);
if (n.slice(-1) === ",")
n = rt(s, n.substring(0, n.length - 1)), r.push(n);
else {
let o = "";
n = rt(s, n);
let a = !1;
for (; ; ) {
const l = e.charAt(t);
if (l === "") {
r.push((n + o).trim());
break;
} else if (a)
l === ")" && (a = !1);
else if (l === ",") {
t += 1, r.push((n + o).trim());
break;
} else l === "(" && (a = !0);
o += l, t += 1;
}
}
}
return r.join(", ");
}
const Un = /* @__PURE__ */ new WeakMap();
function rt(s, e) {
return !e || e.trim() === "" ? e : Mr(s, e);
}
function rd(s) {
return !!(s.tagName === "svg" || s.ownerSVGElement);
}
function Mr(s, e) {
let t = Un.get(s);
if (t || (t = s.createElement("a"), Un.set(s, t)), !e)
e = "";
else if (e.startsWith("blob:") || e.startsWith("data:"))
return e;
return t.setAttribute("href", e), t.href;
}
function cl(s, e, t, i) {
return i && (t === "src" || t === "href" && !(e === "use" && i[0] === "#") || t === "xlink:href" && i[0] !== "#" || t === "background" && (e === "table" || e === "td" || e === "th") ? rt(s, i) : t === "srcset" ? sd(s, i) : t === "style" ? Ki(i, Mr(s)) : e === "object" && t === "data" ? rt(s, i) : i);
}
function ul(s, e, t) {
return (s === "video" || s === "audio") && e === "autoplay";
}
function Fn(s, e, t) {
try {
if (typeof e == "string") {
if (s.classList.contains(e))
return !0;
} else
for (let i = s.classList.length; i--; ) {
const r = s.classList[i];
if (e.test(r))
return !0;
}
if (t)
return s.matches(t);
} catch (i) {
}
return !1;
}
function Hi(s, e, t) {
if (!s) return !1;
if (s.nodeType !== s.ELEMENT_NODE)
return t ? Hi(oe.parentNode(s), e, t) : !1;
for (let i = s.classList.length; i--; ) {
const r = s.classList[i];
if (e.test(r))
return !0;
}
return t ? Hi(oe.parentNode(s), e, t) : !1;
}
function dl(s, e, t, i) {
let r;
if (il(s)) {
if (r = s, !oe.childNodes(r).length)
return !1;
} else {
if (oe.parentElement(s) === null)
return !1;
r = oe.parentElement(s);
}
try {
if (typeof e == "string") {
if (i) {
if (r.closest(`.${e}`)) return !0;
} else if (r.classList.contains(e)) return !0;
} else if (Hi(r, e, i)) return !0;
if (t) {
if (i) {
if (r.closest(t)) return !0;
} else if (r.matches(t)) return !0;
}
} catch (n) {
}
return !1;
}
function nd(s, e, t) {
const i = s.contentWindow;
if (!i)
return;
let r = !1, n;
try {
n = i.document.readyState;
} catch (a) {
return;
}
if (n !== "complete") {
const a = setTimeout(() => {
r || (e(), r = !0);
}, t);
s.addEventListener("load", () => {
clearTimeout(a), r = !0, e();
});
return;
}
const o = "about:blank";
if (i.location.href !== o || s.src === o || s.src === "")
return setTimeout(e, 0), s.addEventListener("load", e);
s.addEventListener("load", e);
}
function od(s, e, t) {
let i = !1, r;
try {
r = s.sheet;
} catch (o) {
return;
}
if (r) return;
const n = setTimeout(() => {
i || (e(), i = !0);
}, t);
s.addEventListener("load", () => {
clearTimeout(n), i = !0, e();
});
}
function ld(s, e) {
const {
doc: t,
mirror: i,
blockClass: r,
blockSelector: n,
needsMask: o,
inlineStylesheet: a,
maskInputOptions: l = {},
maskTextClass: c,
maskTextFn: u,
maskInputFn: d,
dataURLOptions: h = {},
inli