121 lines
3.5 KiB
JavaScript
121 lines
3.5 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: ab2e1927315c9199.b865cfe6f4.js
|
|
* Module id: 819752
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t = e.i(54168),
|
|
r = e.i(490210);
|
|
function n(e, t) {
|
|
if (!e) return !1;
|
|
if (e.contains) return e.contains(t);
|
|
for (var r = t; r; ) {
|
|
if (r === e) return !0;
|
|
r = r.parentNode;
|
|
}
|
|
return !1;
|
|
}
|
|
e.s(["default", () => n], 819752);
|
|
var i = "data-rc-order",
|
|
o = "data-rc-priority",
|
|
a = new Map();
|
|
function l() {
|
|
var e =
|
|
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
|
|
t = e.mark;
|
|
return t
|
|
? t.startsWith("data-")
|
|
? t
|
|
: "data-".concat(t)
|
|
: "rc-util-key";
|
|
}
|
|
function u(e) {
|
|
return e.attachTo
|
|
? e.attachTo
|
|
: document.querySelector("head") || document.body;
|
|
}
|
|
function c(e) {
|
|
return Array.from((a.get(e) || e).children).filter(function (e) {
|
|
return "STYLE" === e.tagName;
|
|
});
|
|
}
|
|
function s(e) {
|
|
var t =
|
|
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
if (!(0, r.default)()) return null;
|
|
var n = t.csp,
|
|
a = t.prepend,
|
|
l = t.priority,
|
|
s = void 0 === l ? 0 : l,
|
|
f = "queue" === a ? "prependQueue" : a ? "prepend" : "append",
|
|
d = "prependQueue" === f,
|
|
h = document.createElement("style");
|
|
h.setAttribute(i, f),
|
|
d && s && h.setAttribute(o, "".concat(s)),
|
|
null != n && n.nonce && (h.nonce = null == n ? void 0 : n.nonce),
|
|
(h.innerHTML = e);
|
|
var v = u(t),
|
|
p = v.firstChild;
|
|
if (a) {
|
|
if (d) {
|
|
var g = (t.styles || c(v)).filter(function (e) {
|
|
return (
|
|
!!["prepend", "prependQueue"].includes(e.getAttribute(i)) &&
|
|
s >= Number(e.getAttribute(o) || 0)
|
|
);
|
|
});
|
|
if (g.length)
|
|
return v.insertBefore(h, g[g.length - 1].nextSibling), h;
|
|
}
|
|
v.insertBefore(h, p);
|
|
} else v.appendChild(h);
|
|
return h;
|
|
}
|
|
function f(e) {
|
|
var t =
|
|
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
|
|
r = u(t);
|
|
return (t.styles || c(r)).find(function (r) {
|
|
return r.getAttribute(l(t)) === e;
|
|
});
|
|
}
|
|
function d(e) {
|
|
var t =
|
|
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
|
|
r = f(e, t);
|
|
r && u(t).removeChild(r);
|
|
}
|
|
function h(e, r) {
|
|
var i,
|
|
o,
|
|
d,
|
|
h = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
|
|
v = u(h),
|
|
p = c(v),
|
|
g = (0, t.default)((0, t.default)({}, h), {}, { styles: p }),
|
|
m = a.get(v);
|
|
if (!m || !n(document, m)) {
|
|
var b = s("", g),
|
|
y = b.parentNode;
|
|
a.set(v, y), v.removeChild(b);
|
|
}
|
|
var S = f(r, g);
|
|
if (S)
|
|
return (
|
|
null != (i = g.csp) &&
|
|
i.nonce &&
|
|
S.nonce !== (null == (o = g.csp) ? void 0 : o.nonce) &&
|
|
(S.nonce = null == (d = g.csp) ? void 0 : d.nonce),
|
|
S.innerHTML !== e && (S.innerHTML = e),
|
|
S
|
|
);
|
|
var x = s(e, g);
|
|
return x.setAttribute(l(g), r), x;
|
|
}
|
|
e.s(["removeCSS", () => d, "updateCSS", () => h], 470360);
|
|
};
|
|
|
|
export default moduleFactory;
|