@eternaljs/styles
Version:
A comprehensive design system and styling package for Eternals JS applications. Features complete color palettes, typography system, spacing utilities, theming capabilities, and modern CSS custom properties.
1,446 lines • 212 kB
JavaScript
import * as S from "react";
import we, { useContext as ar, useEffect as St, useState as je, useRef as Ke } from "react";
import vt from "moment-timezone";
import Be from "react-dom";
function Hr(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var it = { exports: {} }, We = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var wn;
function Ur() {
if (wn) return We;
wn = 1;
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
function e(r, a, o) {
var s = null;
if (o !== void 0 && (s = "" + o), a.key !== void 0 && (s = "" + a.key), "key" in a) {
o = {};
for (var i in a)
i !== "key" && (o[i] = a[i]);
} else o = a;
return a = o.ref, {
$$typeof: t,
type: r,
key: s,
ref: a !== void 0 ? a : null,
props: o
};
}
return We.Fragment = n, We.jsx = e, We.jsxs = e, We;
}
var He = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Pn;
function Br() {
return Pn || (Pn = 1, process.env.NODE_ENV !== "production" && (function() {
function t(f) {
if (f == null) return null;
if (typeof f == "function")
return f.$$typeof === ie ? null : f.displayName || f.name || null;
if (typeof f == "string") return f;
switch (f) {
case w:
return "Fragment";
case P:
return "Profiler";
case b:
return "StrictMode";
case G:
return "Suspense";
case te:
return "SuspenseList";
case re:
return "Activity";
}
if (typeof f == "object")
switch (typeof f.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), f.$$typeof) {
case g:
return "Portal";
case N:
return f.displayName || "Context";
case O:
return (f._context.displayName || "Context") + ".Consumer";
case h:
var T = f.render;
return f = f.displayName, f || (f = T.displayName || T.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
case z:
return T = f.displayName || null, T !== null ? T : t(f.type) || "Memo";
case Y:
T = f._payload, f = f._init;
try {
return t(f(T));
} catch {
}
}
return null;
}
function n(f) {
return "" + f;
}
function e(f) {
try {
n(f);
var T = !1;
} catch {
T = !0;
}
if (T) {
T = console;
var _ = T.error, A = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
return _.call(
T,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
A
), n(f);
}
}
function r(f) {
if (f === w) return "<>";
if (typeof f == "object" && f !== null && f.$$typeof === Y)
return "<...>";
try {
var T = t(f);
return T ? "<" + T + ">" : "<...>";
} catch {
return "<...>";
}
}
function a() {
var f = ce.A;
return f === null ? null : f.getOwner();
}
function o() {
return Error("react-stack-top-frame");
}
function s(f) {
if (M.call(f, "key")) {
var T = Object.getOwnPropertyDescriptor(f, "key").get;
if (T && T.isReactWarning) return !1;
}
return f.key !== void 0;
}
function i(f, T) {
function _() {
X || (X = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
T
));
}
_.isReactWarning = !0, Object.defineProperty(f, "key", {
get: _,
configurable: !0
});
}
function u() {
var f = t(this.type);
return se[f] || (se[f] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), f = this.props.ref, f !== void 0 ? f : null;
}
function l(f, T, _, A, U, R) {
var x = _.ref;
return f = {
$$typeof: y,
type: f,
key: T,
props: _,
_owner: A
}, (x !== void 0 ? x : null) !== null ? Object.defineProperty(f, "ref", {
enumerable: !1,
get: u
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(f, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.defineProperty(f, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: U
}), Object.defineProperty(f, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: R
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
}
function c(f, T, _, A, U, R) {
var x = T.children;
if (x !== void 0)
if (A)
if (ne(x)) {
for (A = 0; A < x.length; A++)
p(x[A]);
Object.freeze && Object.freeze(x);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else p(x);
if (M.call(T, "key")) {
x = t(f);
var k = Object.keys(T).filter(function(F) {
return F !== "key";
});
A = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", E[x + A] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
A,
x,
k,
x
), E[x + A] = !0);
}
if (x = null, _ !== void 0 && (e(_), x = "" + _), s(T) && (e(T.key), x = "" + T.key), "key" in T) {
_ = {};
for (var D in T)
D !== "key" && (_[D] = T[D]);
} else _ = T;
return x && i(
_,
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
), l(
f,
x,
_,
a(),
U,
R
);
}
function p(f) {
d(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === Y && (f._payload.status === "fulfilled" ? d(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
}
function d(f) {
return typeof f == "object" && f !== null && f.$$typeof === y;
}
var v = we, y = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), O = Symbol.for("react.consumer"), N = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), te = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), re = Symbol.for("react.activity"), ie = Symbol.for("react.client.reference"), ce = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, ne = Array.isArray, j = console.createTask ? console.createTask : function() {
return null;
};
v = {
react_stack_bottom_frame: function(f) {
return f();
}
};
var X, se = {}, q = v.react_stack_bottom_frame.bind(
v,
o
)(), ve = j(r(o)), E = {};
He.Fragment = w, He.jsx = function(f, T, _) {
var A = 1e4 > ce.recentlyCreatedOwnerStacks++;
return c(
f,
T,
_,
!1,
A ? Error("react-stack-top-frame") : q,
A ? j(r(f)) : ve
);
}, He.jsxs = function(f, T, _) {
var A = 1e4 > ce.recentlyCreatedOwnerStacks++;
return c(
f,
T,
_,
!0,
A ? Error("react-stack-top-frame") : q,
A ? j(r(f)) : ve
);
};
})()), He;
}
var On;
function Yr() {
return On || (On = 1, process.env.NODE_ENV === "production" ? it.exports = Ur() : it.exports = Br()), it.exports;
}
var $ = Yr();
function qr(t) {
if (Array.isArray(t)) return t;
}
function Kr(t, n) {
var e = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (e != null) {
var r, a, o, s, i = [], u = !0, l = !1;
try {
if (o = (e = e.call(t)).next, n !== 0) for (; !(u = (r = o.call(e)).done) && (i.push(r.value), i.length !== n); u = !0) ;
} catch (c) {
l = !0, a = c;
} finally {
try {
if (!u && e.return != null && (s = e.return(), Object(s) !== s)) return;
} finally {
if (l) throw a;
}
}
return i;
}
}
function Ht(t, n) {
(n == null || n > t.length) && (n = t.length);
for (var e = 0, r = Array(n); e < n; e++) r[e] = t[e];
return r;
}
function or(t, n) {
if (t) {
if (typeof t == "string") return Ht(t, n);
var e = {}.toString.call(t).slice(8, -1);
return e === "Object" && t.constructor && (e = t.constructor.name), e === "Map" || e === "Set" ? Array.from(t) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Ht(t, n) : void 0;
}
}
function Vr() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function dt(t, n) {
return qr(t) || Kr(t, n) || or(t, n) || Vr();
}
function ee(t) {
"@babel/helpers - typeof";
return ee = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
return typeof n;
} : function(n) {
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
}, ee(t);
}
function me() {
for (var t = arguments.length, n = new Array(t), e = 0; e < t; e++)
n[e] = arguments[e];
if (n) {
for (var r = [], a = 0; a < n.length; a++) {
var o = n[a];
if (o) {
var s = ee(o);
if (s === "string" || s === "number")
r.push(o);
else if (s === "object") {
var i = Array.isArray(o) ? o : Object.entries(o).map(function(u) {
var l = dt(u, 2), c = l[0], p = l[1];
return p ? c : null;
});
r = i.length ? r.concat(i.filter(function(u) {
return !!u;
})) : r;
}
}
}
return r.join(" ").trim();
}
}
function zr(t) {
if (Array.isArray(t)) return Ht(t);
}
function Gr(t) {
if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
}
function Xr() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function yt(t) {
return zr(t) || Gr(t) || or(t) || Xr();
}
function tn(t, n) {
if (!(t instanceof n)) throw new TypeError("Cannot call a class as a function");
}
function Zr(t, n) {
if (ee(t) != "object" || !t) return t;
var e = t[Symbol.toPrimitive];
if (e !== void 0) {
var r = e.call(t, n);
if (ee(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return String(t);
}
function ir(t) {
var n = Zr(t, "string");
return ee(n) == "symbol" ? n : n + "";
}
function Jr(t, n) {
for (var e = 0; e < n.length; e++) {
var r = n[e];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, ir(r.key), r);
}
}
function nn(t, n, e) {
return e && Jr(t, e), Object.defineProperty(t, "prototype", {
writable: !1
}), t;
}
function wt(t, n, e) {
return (n = ir(n)) in t ? Object.defineProperty(t, n, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[n] = e, t;
}
function Nt(t, n) {
var e = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (!e) {
if (Array.isArray(t) || (e = Qr(t)) || n) {
e && (t = e);
var r = 0, a = function() {
};
return { s: a, n: function() {
return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] };
}, e: function(l) {
throw l;
}, f: a };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var o, s = !0, i = !1;
return { s: function() {
e = e.call(t);
}, n: function() {
var l = e.next();
return s = l.done, l;
}, e: function(l) {
i = !0, o = l;
}, f: function() {
try {
s || e.return == null || e.return();
} finally {
if (i) throw o;
}
} };
}
function Qr(t, n) {
if (t) {
if (typeof t == "string") return Tn(t, n);
var e = {}.toString.call(t).slice(8, -1);
return e === "Object" && t.constructor && (e = t.constructor.name), e === "Map" || e === "Set" ? Array.from(t) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Tn(t, n) : void 0;
}
}
function Tn(t, n) {
(n == null || n > t.length) && (n = t.length);
for (var e = 0, r = Array(n); e < n; e++) r[e] = t[e];
return r;
}
var L = /* @__PURE__ */ (function() {
function t() {
tn(this, t);
}
return nn(t, null, [{
key: "innerWidth",
value: function(e) {
if (e) {
var r = e.offsetWidth, a = getComputedStyle(e);
return r = r + (parseFloat(a.paddingLeft) + parseFloat(a.paddingRight)), r;
}
return 0;
}
}, {
key: "width",
value: function(e) {
if (e) {
var r = e.offsetWidth, a = getComputedStyle(e);
return r = r - (parseFloat(a.paddingLeft) + parseFloat(a.paddingRight)), r;
}
return 0;
}
}, {
key: "getBrowserLanguage",
value: function() {
return navigator.userLanguage || navigator.languages && navigator.languages.length && navigator.languages[0] || navigator.language || navigator.browserLanguage || navigator.systemLanguage || "en";
}
}, {
key: "getWindowScrollTop",
value: function() {
var e = document.documentElement;
return (window.pageYOffset || e.scrollTop) - (e.clientTop || 0);
}
}, {
key: "getWindowScrollLeft",
value: function() {
var e = document.documentElement;
return (window.pageXOffset || e.scrollLeft) - (e.clientLeft || 0);
}
}, {
key: "getOuterWidth",
value: function(e, r) {
if (e) {
var a = e.getBoundingClientRect().width || e.offsetWidth;
if (r) {
var o = getComputedStyle(e);
a = a + (parseFloat(o.marginLeft) + parseFloat(o.marginRight));
}
return a;
}
return 0;
}
}, {
key: "getOuterHeight",
value: function(e, r) {
if (e) {
var a = e.getBoundingClientRect().height || e.offsetHeight;
if (r) {
var o = getComputedStyle(e);
a = a + (parseFloat(o.marginTop) + parseFloat(o.marginBottom));
}
return a;
}
return 0;
}
}, {
key: "getClientHeight",
value: function(e, r) {
if (e) {
var a = e.clientHeight;
if (r) {
var o = getComputedStyle(e);
a = a + (parseFloat(o.marginTop) + parseFloat(o.marginBottom));
}
return a;
}
return 0;
}
}, {
key: "getClientWidth",
value: function(e, r) {
if (e) {
var a = e.clientWidth;
if (r) {
var o = getComputedStyle(e);
a = a + (parseFloat(o.marginLeft) + parseFloat(o.marginRight));
}
return a;
}
return 0;
}
}, {
key: "getViewport",
value: function() {
var e = window, r = document, a = r.documentElement, o = r.getElementsByTagName("body")[0], s = e.innerWidth || a.clientWidth || o.clientWidth, i = e.innerHeight || a.clientHeight || o.clientHeight;
return {
width: s,
height: i
};
}
}, {
key: "getOffset",
value: function(e) {
if (e) {
var r = e.getBoundingClientRect();
return {
top: r.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
left: r.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
};
}
return {
top: "auto",
left: "auto"
};
}
}, {
key: "index",
value: function(e) {
if (e)
for (var r = e.parentNode.childNodes, a = 0, o = 0; o < r.length; o++) {
if (r[o] === e)
return a;
r[o].nodeType === 1 && a++;
}
return -1;
}
}, {
key: "addMultipleClasses",
value: function(e, r) {
if (e && r)
if (e.classList)
for (var a = r.split(" "), o = 0; o < a.length; o++)
e.classList.add(a[o]);
else
for (var s = r.split(" "), i = 0; i < s.length; i++)
e.className = e.className + (" " + s[i]);
}
}, {
key: "removeMultipleClasses",
value: function(e, r) {
if (e && r)
if (e.classList)
for (var a = r.split(" "), o = 0; o < a.length; o++)
e.classList.remove(a[o]);
else
for (var s = r.split(" "), i = 0; i < s.length; i++)
e.className = e.className.replace(new RegExp("(^|\\b)" + s[i].split(" ").join("|") + "(\\b|$)", "gi"), " ");
}
}, {
key: "addClass",
value: function(e, r) {
e && r && (e.classList ? e.classList.add(r) : e.className = e.className + (" " + r));
}
}, {
key: "removeClass",
value: function(e, r) {
e && r && (e.classList ? e.classList.remove(r) : e.className = e.className.replace(new RegExp("(^|\\b)" + r.split(" ").join("|") + "(\\b|$)", "gi"), " "));
}
}, {
key: "hasClass",
value: function(e, r) {
return e ? e.classList ? e.classList.contains(r) : new RegExp("(^| )" + r + "( |$)", "gi").test(e.className) : !1;
}
}, {
key: "addStyles",
value: function(e) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
e && Object.entries(r).forEach(function(a) {
var o = dt(a, 2), s = o[0], i = o[1];
return e.style[s] = i;
});
}
}, {
key: "find",
value: function(e, r) {
return e ? Array.from(e.querySelectorAll(r)) : [];
}
}, {
key: "findSingle",
value: function(e, r) {
return e ? e.querySelector(r) : null;
}
}, {
key: "setAttributes",
value: function(e) {
var r = this, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (e) {
var o = function(i, u) {
var l, c, p = e != null && (l = e.$attrs) !== null && l !== void 0 && l[i] ? [e == null || (c = e.$attrs) === null || c === void 0 ? void 0 : c[i]] : [];
return [u].flat().reduce(function(d, v) {
if (v != null) {
var y = ee(v);
if (y === "string" || y === "number")
d.push(v);
else if (y === "object") {
var g = Array.isArray(v) ? o(i, v) : Object.entries(v).map(function(w) {
var b = dt(w, 2), P = b[0], O = b[1];
return i === "style" && (O || O === 0) ? "".concat(P.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), ":").concat(O) : O ? P : void 0;
});
d = g.length ? d.concat(g.filter(function(w) {
return !!w;
})) : d;
}
}
return d;
}, p);
};
Object.entries(a).forEach(function(s) {
var i = dt(s, 2), u = i[0], l = i[1];
if (l != null) {
var c = u.match(/^on(.+)/);
c ? e.addEventListener(c[1].toLowerCase(), l) : u === "p-bind" ? r.setAttributes(e, l) : (l = u === "class" ? yt(new Set(o("class", l))).join(" ").trim() : u === "style" ? o("style", l).join(";").trim() : l, (e.$attrs = e.$attrs || {}) && (e.$attrs[u] = l), e.setAttribute(u, l));
}
});
}
}
}, {
key: "getAttribute",
value: function(e, r) {
if (e) {
var a = e.getAttribute(r);
return isNaN(a) ? a === "true" || a === "false" ? a === "true" : a : +a;
}
}
}, {
key: "isAttributeEquals",
value: function(e, r, a) {
return e ? this.getAttribute(e, r) === a : !1;
}
}, {
key: "isAttributeNotEquals",
value: function(e, r, a) {
return !this.isAttributeEquals(e, r, a);
}
}, {
key: "getHeight",
value: function(e) {
if (e) {
var r = e.offsetHeight, a = getComputedStyle(e);
return r = r - (parseFloat(a.paddingTop) + parseFloat(a.paddingBottom) + parseFloat(a.borderTopWidth) + parseFloat(a.borderBottomWidth)), r;
}
return 0;
}
}, {
key: "getWidth",
value: function(e) {
if (e) {
var r = e.offsetWidth, a = getComputedStyle(e);
return r = r - (parseFloat(a.paddingLeft) + parseFloat(a.paddingRight) + parseFloat(a.borderLeftWidth) + parseFloat(a.borderRightWidth)), r;
}
return 0;
}
}, {
key: "alignOverlay",
value: function(e, r, a) {
var o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0;
e && r && (a === "self" ? this.relativePosition(e, r) : (o && (e.style.minWidth = t.getOuterWidth(r) + "px"), this.absolutePosition(e, r)));
}
}, {
key: "absolutePosition",
value: function(e, r) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "left";
if (e && r) {
var o = e.offsetParent ? {
width: e.offsetWidth,
height: e.offsetHeight
} : this.getHiddenElementDimensions(e), s = o.height, i = o.width, u = r.offsetHeight, l = r.offsetWidth, c = r.getBoundingClientRect(), p = this.getWindowScrollTop(), d = this.getWindowScrollLeft(), v = this.getViewport(), y, g;
c.top + u + s > v.height ? (y = c.top + p - s, y < 0 && (y = p), e.style.transformOrigin = "bottom") : (y = u + c.top + p, e.style.transformOrigin = "top");
var w = c.left;
a === "left" ? w + i > v.width ? g = Math.max(0, w + d + l - i) : g = w + d : w + l - i < 0 ? g = d : g = w + l - i + d, e.style.top = y + "px", e.style.left = g + "px";
}
}
}, {
key: "relativePosition",
value: function(e, r) {
if (e && r) {
var a = e.offsetParent ? {
width: e.offsetWidth,
height: e.offsetHeight
} : this.getHiddenElementDimensions(e), o = r.offsetHeight, s = r.getBoundingClientRect(), i = this.getViewport(), u, l;
s.top + o + a.height > i.height ? (u = -1 * a.height, s.top + u < 0 && (u = -1 * s.top), e.style.transformOrigin = "bottom") : (u = o, e.style.transformOrigin = "top"), a.width > i.width ? l = s.left * -1 : s.left + a.width > i.width ? l = (s.left + a.width - i.width) * -1 : l = 0, e.style.top = u + "px", e.style.left = l + "px";
}
}
}, {
key: "flipfitCollision",
value: function(e, r) {
var a = this, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "left top", s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "left bottom", i = arguments.length > 4 ? arguments[4] : void 0;
if (e && r) {
var u = r.getBoundingClientRect(), l = this.getViewport(), c = o.split(" "), p = s.split(" "), d = function(b, P) {
return P ? +b.substring(b.search(/(\+|-)/g)) || 0 : b.substring(0, b.search(/(\+|-)/g)) || b;
}, v = {
my: {
x: d(c[0]),
y: d(c[1] || c[0]),
offsetX: d(c[0], !0),
offsetY: d(c[1] || c[0], !0)
},
at: {
x: d(p[0]),
y: d(p[1] || p[0]),
offsetX: d(p[0], !0),
offsetY: d(p[1] || p[0], !0)
}
}, y = {
left: function() {
var b = v.my.offsetX + v.at.offsetX;
return b + u.left + (v.my.x === "left" ? 0 : -1 * (v.my.x === "center" ? a.getOuterWidth(e) / 2 : a.getOuterWidth(e)));
},
top: function() {
var b = v.my.offsetY + v.at.offsetY;
return b + u.top + (v.my.y === "top" ? 0 : -1 * (v.my.y === "center" ? a.getOuterHeight(e) / 2 : a.getOuterHeight(e)));
}
}, g = {
count: {
x: 0,
y: 0
},
left: function() {
var b = y.left(), P = t.getWindowScrollLeft();
e.style.left = b + P + "px", this.count.x === 2 ? (e.style.left = P + "px", this.count.x = 0) : b < 0 && (this.count.x++, v.my.x = "left", v.at.x = "right", v.my.offsetX *= -1, v.at.offsetX *= -1, this.right());
},
right: function() {
var b = y.left() + t.getOuterWidth(r), P = t.getWindowScrollLeft();
e.style.left = b + P + "px", this.count.x === 2 ? (e.style.left = l.width - t.getOuterWidth(e) + P + "px", this.count.x = 0) : b + t.getOuterWidth(e) > l.width && (this.count.x++, v.my.x = "right", v.at.x = "left", v.my.offsetX *= -1, v.at.offsetX *= -1, this.left());
},
top: function() {
var b = y.top(), P = t.getWindowScrollTop();
e.style.top = b + P + "px", this.count.y === 2 ? (e.style.left = P + "px", this.count.y = 0) : b < 0 && (this.count.y++, v.my.y = "top", v.at.y = "bottom", v.my.offsetY *= -1, v.at.offsetY *= -1, this.bottom());
},
bottom: function() {
var b = y.top() + t.getOuterHeight(r), P = t.getWindowScrollTop();
e.style.top = b + P + "px", this.count.y === 2 ? (e.style.left = l.height - t.getOuterHeight(e) + P + "px", this.count.y = 0) : b + t.getOuterHeight(r) > l.height && (this.count.y++, v.my.y = "bottom", v.at.y = "top", v.my.offsetY *= -1, v.at.offsetY *= -1, this.top());
},
center: function(b) {
if (b === "y") {
var P = y.top() + t.getOuterHeight(r) / 2;
e.style.top = P + t.getWindowScrollTop() + "px", P < 0 ? this.bottom() : P + t.getOuterHeight(r) > l.height && this.top();
} else {
var O = y.left() + t.getOuterWidth(r) / 2;
e.style.left = O + t.getWindowScrollLeft() + "px", O < 0 ? this.left() : O + t.getOuterWidth(e) > l.width && this.right();
}
}
};
g[v.at.x]("x"), g[v.at.y]("y"), this.isFunction(i) && i(v);
}
}
}, {
key: "findCollisionPosition",
value: function(e) {
if (e) {
var r = e === "top" || e === "bottom", a = e === "left" ? "right" : "left", o = e === "top" ? "bottom" : "top";
return r ? {
axis: "y",
my: "center ".concat(o),
at: "center ".concat(e)
} : {
axis: "x",
my: "".concat(a, " center"),
at: "".concat(e, " center")
};
}
}
}, {
key: "getParents",
value: function(e) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
return e.parentNode === null ? r : this.getParents(e.parentNode, r.concat([e.parentNode]));
}
/**
* Gets all scrollable parent elements of a given element
* @param {HTMLElement} element - The element to find scrollable parents for
* @returns {Array} Array of scrollable parent elements
*/
}, {
key: "getScrollableParents",
value: function(e) {
var r = this, a = [];
if (e) {
var o = this.getParents(e), s = /(auto|scroll)/, i = function(N) {
var h = N ? getComputedStyle(N) : null;
return h && (s.test(h.getPropertyValue("overflow")) || s.test(h.getPropertyValue("overflow-x")) || s.test(h.getPropertyValue("overflow-y")));
}, u = function(N) {
a.push(N.nodeName === "BODY" || N.nodeName === "HTML" || r.isDocument(N) ? window : N);
}, l = Nt(o), c;
try {
for (l.s(); !(c = l.n()).done; ) {
var p, d = c.value, v = d.nodeType === 1 && ((p = d.dataset) === null || p === void 0 ? void 0 : p.scrollselectors);
if (v) {
var y = v.split(","), g = Nt(y), w;
try {
for (g.s(); !(w = g.n()).done; ) {
var b = w.value, P = this.findSingle(d, b);
P && i(P) && u(P);
}
} catch (O) {
g.e(O);
} finally {
g.f();
}
}
d.nodeType === 1 && i(d) && u(d);
}
} catch (O) {
l.e(O);
} finally {
l.f();
}
}
return a;
}
}, {
key: "getHiddenElementOuterHeight",
value: function(e) {
if (e) {
e.style.visibility = "hidden", e.style.display = "block";
var r = e.offsetHeight;
return e.style.display = "none", e.style.visibility = "visible", r;
}
return 0;
}
}, {
key: "getHiddenElementOuterWidth",
value: function(e) {
if (e) {
e.style.visibility = "hidden", e.style.display = "block";
var r = e.offsetWidth;
return e.style.display = "none", e.style.visibility = "visible", r;
}
return 0;
}
}, {
key: "getHiddenElementDimensions",
value: function(e) {
var r = {};
return e && (e.style.visibility = "hidden", e.style.display = "block", r.width = e.offsetWidth, r.height = e.offsetHeight, e.style.display = "none", e.style.visibility = "visible"), r;
}
}, {
key: "fadeIn",
value: function(e, r) {
if (e) {
e.style.opacity = 0;
var a = +/* @__PURE__ */ new Date(), o = 0, s = function() {
o = +e.style.opacity + ((/* @__PURE__ */ new Date()).getTime() - a) / r, e.style.opacity = o, a = +/* @__PURE__ */ new Date(), +o < 1 && (window.requestAnimationFrame && requestAnimationFrame(s) || setTimeout(s, 16));
};
s();
}
}
}, {
key: "fadeOut",
value: function(e, r) {
if (e)
var a = 1, o = 50, s = o / r, i = setInterval(function() {
a = a - s, a <= 0 && (a = 0, clearInterval(i)), e.style.opacity = a;
}, o);
}
}, {
key: "getUserAgent",
value: function() {
return navigator.userAgent;
}
}, {
key: "isIOS",
value: function() {
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
}
}, {
key: "isAndroid",
value: function() {
return /(android)/i.test(navigator.userAgent);
}
}, {
key: "isChrome",
value: function() {
return /(chrome)/i.test(navigator.userAgent);
}
}, {
key: "isClient",
value: function() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
}, {
key: "isTouchDevice",
value: function() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
}
}, {
key: "isFunction",
value: function(e) {
return !!(e && e.constructor && e.call && e.apply);
}
}, {
key: "appendChild",
value: function(e, r) {
if (this.isElement(r))
r.appendChild(e);
else if (r.el && r.el.nativeElement)
r.el.nativeElement.appendChild(e);
else
throw new Error("Cannot append " + r + " to " + e);
}
}, {
key: "removeChild",
value: function(e, r) {
if (this.isElement(r))
r.removeChild(e);
else if (r.el && r.el.nativeElement)
r.el.nativeElement.removeChild(e);
else
throw new Error("Cannot remove " + e + " from " + r);
}
}, {
key: "isElement",
value: function(e) {
return (typeof HTMLElement > "u" ? "undefined" : ee(HTMLElement)) === "object" ? e instanceof HTMLElement : e && ee(e) === "object" && e !== null && e.nodeType === 1 && typeof e.nodeName == "string";
}
}, {
key: "isDocument",
value: function(e) {
return (typeof Document > "u" ? "undefined" : ee(Document)) === "object" ? e instanceof Document : e && ee(e) === "object" && e !== null && e.nodeType === 9;
}
}, {
key: "scrollInView",
value: function(e, r) {
var a = getComputedStyle(e).getPropertyValue("border-top-width"), o = a ? parseFloat(a) : 0, s = getComputedStyle(e).getPropertyValue("padding-top"), i = s ? parseFloat(s) : 0, u = e.getBoundingClientRect(), l = r.getBoundingClientRect(), c = l.top + document.body.scrollTop - (u.top + document.body.scrollTop) - o - i, p = e.scrollTop, d = e.clientHeight, v = this.getOuterHeight(r);
c < 0 ? e.scrollTop = p + c : c + v > d && (e.scrollTop = p + c - d + v);
}
}, {
key: "clearSelection",
value: function() {
if (window.getSelection)
window.getSelection().empty ? window.getSelection().empty() : window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0 && window.getSelection().removeAllRanges();
else if (document.selection && document.selection.empty)
try {
document.selection.empty();
} catch {
}
}
}, {
key: "calculateScrollbarWidth",
value: function(e) {
if (e) {
var r = getComputedStyle(e);
return e.offsetWidth - e.clientWidth - parseFloat(r.borderLeftWidth) - parseFloat(r.borderRightWidth);
}
if (this.calculatedScrollbarWidth != null)
return this.calculatedScrollbarWidth;
var a = document.createElement("div");
a.className = "p-scrollbar-measure", document.body.appendChild(a);
var o = a.offsetWidth - a.clientWidth;
return document.body.removeChild(a), this.calculatedScrollbarWidth = o, o;
}
}, {
key: "calculateBodyScrollbarWidth",
value: function() {
return window.innerWidth - document.documentElement.offsetWidth;
}
}, {
key: "getBrowser",
value: function() {
if (!this.browser) {
var e = this.resolveUserAgent();
this.browser = {}, e.browser && (this.browser[e.browser] = !0, this.browser.version = e.version), this.browser.chrome ? this.browser.webkit = !0 : this.browser.webkit && (this.browser.safari = !0);
}
return this.browser;
}
}, {
key: "resolveUserAgent",
value: function() {
var e = navigator.userAgent.toLowerCase(), r = /(chrome)[ ]([\w.]+)/.exec(e) || /(webkit)[ ]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || [];
return {
browser: r[1] || "",
version: r[2] || "0"
};
}
}, {
key: "blockBodyScroll",
value: function() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden", r = !!document.body.style.getPropertyValue("--scrollbar-width");
!r && document.body.style.setProperty("--scrollbar-width", this.calculateBodyScrollbarWidth() + "px"), this.addClass(document.body, e);
}
}, {
key: "unblockBodyScroll",
value: function() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden";
document.body.style.removeProperty("--scrollbar-width"), this.removeClass(document.body, e);
}
}, {
key: "isVisible",
value: function(e) {
return e && (e.clientHeight !== 0 || e.getClientRects().length !== 0 || getComputedStyle(e).display !== "none");
}
}, {
key: "isExist",
value: function(e) {
return !!(e !== null && typeof e < "u" && e.nodeName && e.parentNode);
}
}, {
key: "getFocusableElements",
value: function(e) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", a = t.find(e, 'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(r, `,
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r, `,
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r, `,
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r, `,
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r, `,
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r, `,
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r)), o = [], s = Nt(a), i;
try {
for (s.s(); !(i = s.n()).done; ) {
var u = i.value;
getComputedStyle(u).display !== "none" && getComputedStyle(u).visibility !== "hidden" && o.push(u);
}
} catch (l) {
s.e(l);
} finally {
s.f();
}
return o;
}
}, {
key: "getFirstFocusableElement",
value: function(e, r) {
var a = t.getFocusableElements(e, r);
return a.length > 0 ? a[0] : null;
}
}, {
key: "getLastFocusableElement",
value: function(e, r) {
var a = t.getFocusableElements(e, r);
return a.length > 0 ? a[a.length - 1] : null;
}
/**
* Focus an input element if it does not already have focus.
*
* @param {HTMLElement} el a HTML element
* @param {boolean} scrollTo flag to control whether to scroll to the element, false by default
*/
}, {
key: "focus",
value: function(e, r) {
var a = r === void 0 ? !0 : !r;
e && document.activeElement !== e && e.focus({
preventScroll: a
});
}
/**
* Focus the first focusable element if it does not already have focus.
*
* @param {HTMLElement} el a HTML element
* @param {boolean} scrollTo flag to control whether to scroll to the element, false by default
* @return {HTMLElement | undefined} the first focusable HTML element found
*/
}, {
key: "focusFirstElement",
value: function(e, r) {
if (e) {
var a = t.getFirstFocusableElement(e);
return a && t.focus(a, r), a;
}
}
}, {
key: "getCursorOffset",
value: function(e, r, a, o) {
if (e) {
var s = getComputedStyle(e), i = document.createElement("div");
i.style.position = "absolute", i.style.top = "0px", i.style.left = "0px", i.style.visibility = "hidden", i.style.pointerEvents = "none", i.style.overflow = s.overflow, i.style.width = s.width, i.style.height = s.height, i.style.padding = s.padding, i.style.border = s.border, i.style.overflowWrap = s.overflowWrap, i.style.whiteSpace = s.whiteSpace, i.style.lineHeight = s.lineHeight, i.innerHTML = r.replace(/\r\n|\r|\n/g, "<br />");
var u = document.createElement("span");
u.textContent = o, i.appendChild(u);
var l = document.createTextNode(a);
i.appendChild(l), document.body.appendChild(i);
var c = u.offsetLeft, p = u.offsetTop, d = u.clientHeight;
return document.body.removeChild(i), {
left: Math.abs(c - e.scrollLeft),
top: Math.abs(p - e.scrollTop) + d
};
}
return {
top: "auto",
left: "auto"
};
}
}, {
key: "invokeElementMethod",
value: function(e, r, a) {
e[r].apply(e, a);
}
}, {
key: "isClickable",
value: function(e) {
var r = e.nodeName, a = e.parentElement && e.parentElement.nodeName;
return r === "INPUT" || r === "TEXTAREA" || r === "BUTTON" || r === "A" || a === "INPUT" || a === "TEXTAREA" || a === "BUTTON" || a === "A" || this.hasClass(e, "p-button") || this.hasClass(e.parentElement, "p-button") || this.hasClass(e.parentElement, "p-checkbox") || this.hasClass(e.parentElement, "p-radiobutton");
}
}, {
key: "applyStyle",
value: function(e, r) {
if (typeof r == "string")
e.style.cssText = r;
else
for (var a in r)
e.style[a] = r[a];
}
}, {
key: "exportCSV",
value: function(e, r) {
var a = new Blob([e], {
type: "application/csv;charset=utf-8;"
});
if (window.navigator.msSaveOrOpenBlob)
navigator.msSaveOrOpenBlob(a, r + ".csv");
else {
var o = t.saveAs({
name: r + ".csv",
src: URL.createObjectURL(a)
});
o || (e = "data:text/csv;charset=utf-8," + e, window.open(encodeURI(e)));
}
}
}, {
key: "saveAs",
value: function(e) {
if (e) {
var r = document.createElement("a");
if (r.download !== void 0) {
var a = e.name, o = e.src;
return r.setAttribute("href", o), r.setAttribute("download", a), r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), !0;
}
}
return !1;
}
}, {
key: "createInlineStyle",
value: function(e, r) {
var a = document.createElement("style");
return t.addNonce(a, e), r || (r = document.head), r.appendChild(a), a;
}
}, {
key: "removeInlineStyle",
value: function(e) {
if (this.isExist(e)) {
try {
e.parentNode.removeChild(e);
} catch {
}
e = null;
}
return e;
}
}, {
key: "addNonce",
value: function(e, r) {
try {
r || (r = process.env.REACT_APP_CSS_NONCE);
} catch {
}
r && e.setAttribute("nonce", r);
}
}, {
key: "getTargetElement",
value: function(e) {
if (!e)
return null;
if (e === "document")
return document;
if (e === "window")
return window;
if (ee(e) === "object" && e.hasOwnProperty("current"))
return this.isExist(e.current) ? e.current : null;
var r = function(s) {
return !!(s && s.constructor && s.call && s.apply);
}, a = r(e) ? e() : e;
return this.isDocument(a) || this.isExist(a) ? a : null;
}
/**
* Get the attribute names for an element and sorts them alpha for comparison
*/
}, {
key: "getAttributeNames",
value: function(e) {
var r, a, o;
for (a = [], o = e.attributes, r = 0; r < o.length; ++r)
a.push(o[r].nodeName);
return a.sort(), a;
}
/**
* Compare two elements for equality. Even will compare if the style element
* is out of order for example:
*
* elem1 = style="color: red; font-size: 28px"
* elem2 = style="font-size: 28px; color: red"
*/
}, {
key: "isEqualElement",
value: function(e, r) {
var a, o, s, i, u;
if (a = t.getAttributeNames(e), o = t.getAttributeNames(r), a.join(",") !== o.join(","))
return !1;
for (var l = 0; l < a.length; ++l)
if (s = a[l], s === "style")
for (var c = e.style, p = r.style, d = /^\d+$/, v = 0, y = Object.keys(c); v < y.length; v++) {
var g = y[v];
if (!d.test(g) && c[g] !== p[g])
return !1;
}
else if (e.getAttribute(s) !== r.getAttribute(s))
return !1;
for (i = e.firstChild, u = r.firstChild; i && u; i = i.nextSibling, u = u.nextSibling) {
if (i.nodeType !== u.nodeType)
return !1;
if (i.nodeType === 1) {
if (!t.isEqualElement(i, u))
return !1;
} else if (i.nodeValue !== u.nodeValue)
return !1;
}
return !(i || u);
}
}, {
key: "hasCSSAnimation",
value: function(e) {
if (e) {
var r = getComputedStyle(e), a = parseFloat(r.getPropertyValue("animation-duration") || "0");
return a > 0;
}
return !1;
}
}, {
key: "hasCSSTransition",
value: function(e) {
if (e) {
var r = getComputedStyle(e), a = parseFloat(r.getPropertyValue("transition-duration") || "0");
return a > 0;
}
return !1;
}
}]);
})();
wt(L, "DATA_PROPS", ["data-"]);
wt(L, "ARIA_PROPS", ["aria", "focus-target"]);
function ea() {
var t = /* @__PURE__ */ new Map();
return {
on: function(e, r) {
var a = t.get(e);
a ? a.push(r) : a = [r], t.set(e, a);
},
off: function(e, r) {
var a = t.get(e);
a && a.splice(a.indexOf(r) >>> 0, 1);
},
emit: function(e, r) {
var a = t.get(e);
a && a.slice().forEach(function(o) {
return o(r);
});
}
};
}
function Ut() {
return Ut = Object.assign ? Object.assign.bind() : function(t) {
for (var n = 1; n < arguments.length; n++) {
var e = arguments[n];
for (var r in e) ({}).hasOwnProperty.call(e, r) && (t[r] = e[r]);
}
return t;
}, Ut.apply(null, arguments);
}
function Cn(t, n) {
var e = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (!e) {
if (Array.isArray(t) || (e = ta(t)) || n) {
e && (t = e);
var r = 0, a = function() {
};
return { s: a, n: function() {
return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] };
}, e: function(l) {
throw l;
}, f: a };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var o, s = !0, i = !1;
return { s: function() {
e = e.call(t);
}, n: function() {
var l = e.next();
return s = l.done, l;
}, e: function(l) {
i = !0, o = l;
}, f: function() {
try {
s || e.return == null || e.return();
} finally {
if (i) throw o;
}
} };
}
function ta(t, n) {
if (t) {
if (typeof t == "string") return An(t, n);
var e = {}.toString.call(t).slice(8, -1);
return e === "Object" && t.constructor && (e = t.constructor.name), e === "Map" || e === "Set" ? Array.from(t) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? An(t, n) : void 0;
}
}
function An(t, n) {
(n == null || n > t.length) && (n = t.length);
for (var e = 0, r = Array(n); e < n; e++) r[e] = t[e];
return r;
}
var H = /* @__PURE__ */ (function() {
function t() {
tn(this, t);
}
return nn(t, null, [{
key: "equals",
value: function(e, r, a) {
return a && e && ee(e) === "object" && r && ee(r) === "object" ? this.deepEquals(this.resolveFieldData(e, a), this.resolveFieldData(r, a)) : this.deepEquals(e, r);
}
/**
* Compares two JSON objects for deep equality recursively comparing both objects.
* @param {*} a the first JSON object
* @param {*} b the second JSON object
* @returns true if equals, false it not
*/
}, {
key: "deepEquals",
value: function(e, r) {
if (e === r)
return !0;
if (e && r && ee(e) === "object" && ee(r) === "object") {
var a = Array.isArray(e), o = Array.isArray(r), s, i, u;
if (a && o) {
if (i = e.length, i !== r.length)
return !1;
for (s = i; s-- !== 0; )
if (!this.deepEquals(e[s], r[s]))
return !1;
return !0;
}
if (a !== o)
return !1;
var l = e instanceof Date, c = r instanceof Date;
if (l !== c)
return !1;
if (l && c)
return e.getTime() === r.getTime();
var p = e instanceof RegExp, d = r instanceof RegExp;
if (p !== d)
return !1;
if (p && d)
return e.toString() === r.toString();
var v = Object.keys(e);
if (i = v.length, i !== Object.keys(r).length)
return !1;
for (s = i; s-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(r, v[s]))
return !1;
for (s = i; s-- !== 0; )
if (u = v[s], !this.deepEquals(e[u], r[u]))
return !1;
return !0;
}
return e !== e && r !== r;
}
}, {
key: "resolveFieldData",
value: function(e, r) {
if (!e || !r)
return null;
try {
var a = e[r];
if (this.isNotEmpty(a))
return a;
} catch {
}
if (Object.keys(e).length) {
if (this.isFunction(r))
return r(e);
if (this.isNotEmpty(e[r]))
return e[r];
if (r.indexOf(".") === -1)
return e[r];
for (var o = r.split("."), s = e, i = 0, u = o.length; i < u; ++i) {
if (s == null)
return null;
s = s[o[i]];
}
return s;
}
return null;
}
}, {
key: "findDiffKeys",
value: function(e, r) {
return !e || !r ? {} : Object.keys(e).filter(function(a) {
return !r.hasOw