UNPKG

react-checker-maker

Version:

React checker maker is a lightweight package that can be used to manage privileges in [React Js](https://reactjs.org). This package utilizes [React Router Dom](https://reactrouter.com) and allows for the addition of specific privileges to routes and eleme

1,279 lines (1,276 loc) 68 kB
import ke, { createContext as Yt, useContext as Qt, useState as $, useMemo as Tt, useEffect as H, useRef as Re, useLayoutEffect as pr } from "react"; var T = {}, yr = { get exports() { return T; }, set exports(e) { T = e; } }, Xe = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Rt; function hr() { if (Rt) return Xe; Rt = 1; var e = ke, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 }; function l(s, f, m) { var c, d = {}, p = null, h = null; m !== void 0 && (p = "" + m), f.key !== void 0 && (p = "" + f.key), f.ref !== void 0 && (h = f.ref); for (c in f) o.call(f, c) && !i.hasOwnProperty(c) && (d[c] = f[c]); if (s && s.defaultProps) for (c in f = s.defaultProps, f) d[c] === void 0 && (d[c] = f[c]); return { $$typeof: r, type: s, key: p, ref: h, props: d, _owner: a.current }; } return Xe.Fragment = n, Xe.jsx = l, Xe.jsxs = l, Xe; } var qe = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var St; function gr() { return St || (St = 1, process.env.NODE_ENV !== "production" && function() { var e = ke, r = Symbol.for("react.element"), n = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), s = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), v = Symbol.iterator, b = "@@iterator"; function M(t) { if (t === null || typeof t != "object") return null; var u = v && t[v] || t[b]; return typeof u == "function" ? u : null; } var j = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function x(t) { { for (var u = arguments.length, y = new Array(u > 1 ? u - 1 : 0), _ = 1; _ < u; _++) y[_ - 1] = arguments[_]; L("error", t, y); } } function L(t, u, y) { { var _ = j.ReactDebugCurrentFrame, I = _.getStackAddendum(); I !== "" && (u += "%s", y = y.concat([I])); var C = y.map(function(R) { return String(R); }); C.unshift("Warning: " + u), Function.prototype.apply.call(console[t], console, C); } } var F = !1, P = !1, G = !1, X = !1, B = !1, q; q = Symbol.for("react.module.reference"); function Z(t) { return !!(typeof t == "string" || typeof t == "function" || t === o || t === i || B || t === a || t === m || t === c || X || t === h || F || P || G || typeof t == "object" && t !== null && (t.$$typeof === p || t.$$typeof === d || t.$$typeof === l || t.$$typeof === s || t.$$typeof === f || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. t.$$typeof === q || t.getModuleId !== void 0)); } function O(t, u, y) { var _ = t.displayName; if (_) return _; var I = u.displayName || u.name || ""; return I !== "" ? y + "(" + I + ")" : y; } function W(t) { return t.displayName || "Context"; } function D(t) { if (t == null) return null; if (typeof t.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function") return t.displayName || t.name || null; if (typeof t == "string") return t; switch (t) { case o: return "Fragment"; case n: return "Portal"; case i: return "Profiler"; case a: return "StrictMode"; case m: return "Suspense"; case c: return "SuspenseList"; } if (typeof t == "object") switch (t.$$typeof) { case s: var u = t; return W(u) + ".Consumer"; case l: var y = t; return W(y._context) + ".Provider"; case f: return O(t, t.render, "ForwardRef"); case d: var _ = t.displayName || null; return _ !== null ? _ : D(t.type) || "Memo"; case p: { var I = t, C = I._payload, R = I._init; try { return D(R(C)); } catch { return null; } } } return null; } var U = Object.assign, k = 0, z, se, ue, xe, pe, we, _e; function ee() { } ee.__reactDisabledLog = !0; function Ve() { { if (k === 0) { z = console.log, se = console.info, ue = console.warn, xe = console.error, pe = console.group, we = console.groupCollapsed, _e = console.groupEnd; var t = { configurable: !0, enumerable: !0, value: ee, writable: !0 }; Object.defineProperties(console, { info: t, log: t, warn: t, error: t, group: t, groupCollapsed: t, groupEnd: t }); } k++; } } function He() { { if (k--, k === 0) { var t = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: U({}, t, { value: z }), info: U({}, t, { value: se }), warn: U({}, t, { value: ue }), error: U({}, t, { value: xe }), group: U({}, t, { value: pe }), groupCollapsed: U({}, t, { value: we }), groupEnd: U({}, t, { value: _e }) }); } k < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var ye = j.ReactCurrentDispatcher, Se; function he(t, u, y) { { if (Se === void 0) try { throw Error(); } catch (I) { var _ = I.stack.trim().match(/\n( *(at )?)/); Se = _ && _[1] || ""; } return ` ` + Se + t; } } var De = !1, je; { var $e = typeof WeakMap == "function" ? WeakMap : Map; je = new $e(); } function de(t, u) { if (!t || De) return ""; { var y = je.get(t); if (y !== void 0) return y; } var _; De = !0; var I = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var C; C = ye.current, ye.current = null, Ve(); try { if (u) { var R = function() { throw Error(); }; if (Object.defineProperty(R.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(R, []); } catch (Te) { _ = Te; } Reflect.construct(t, [], R); } else { try { R.call(); } catch (Te) { _ = Te; } t.call(R.prototype); } } else { try { throw Error(); } catch (Te) { _ = Te; } t(); } } catch (Te) { if (Te && _ && typeof Te.stack == "string") { for (var A = Te.stack.split(` `), re = _.stack.split(` `), Q = A.length - 1, V = re.length - 1; Q >= 1 && V >= 0 && A[Q] !== re[V]; ) V--; for (; Q >= 1 && V >= 0; Q--, V--) if (A[Q] !== re[V]) { if (Q !== 1 || V !== 1) do if (Q--, V--, V < 0 || A[Q] !== re[V]) { var fe = ` ` + A[Q].replace(" at new ", " at "); return t.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", t.displayName)), typeof t == "function" && je.set(t, fe), fe; } while (Q >= 1 && V >= 0); break; } } } finally { De = !1, ye.current = C, He(), Error.prepareStackTrace = I; } var Ze = t ? t.displayName || t.name : "", At = Ze ? he(Ze) : ""; return typeof t == "function" && je.set(t, At), At; } function Fe(t, u, y) { return de(t, !1); } function Me(t) { var u = t.prototype; return !!(u && u.isReactComponent); } function te(t, u, y) { if (t == null) return ""; if (typeof t == "function") return de(t, Me(t)); if (typeof t == "string") return he(t); switch (t) { case m: return he("Suspense"); case c: return he("SuspenseList"); } if (typeof t == "object") switch (t.$$typeof) { case f: return Fe(t.render); case d: return te(t.type, u, y); case p: { var _ = t, I = _._payload, C = _._init; try { return te(C(I), u, y); } catch { } } } return ""; } var ne = Object.prototype.hasOwnProperty, Ne = {}, Ie = j.ReactDebugCurrentFrame; function ge(t) { if (t) { var u = t._owner, y = te(t.type, t._source, u ? u.type : null); Ie.setExtraStackFrame(y); } else Ie.setExtraStackFrame(null); } function Le(t, u, y, _, I) { { var C = Function.call.bind(ne); for (var R in t) if (C(t, R)) { var A = void 0; try { if (typeof t[R] != "function") { var re = Error((_ || "React class") + ": " + y + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw re.name = "Invariant Violation", re; } A = t[R](u, R, _, y, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (Q) { A = Q; } A && !(A instanceof Error) && (ge(I), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", y, R, typeof A), ge(null)), A instanceof Error && !(A.message in Ne) && (Ne[A.message] = !0, ge(I), x("Failed %s type: %s", y, A.message), ge(null)); } } } var Oe = Array.isArray; function Ce(t) { return Oe(t); } function Be(t) { { var u = typeof Symbol == "function" && Symbol.toStringTag, y = u && t[Symbol.toStringTag] || t.constructor.name || "Object"; return y; } } function J(t) { try { return K(t), !1; } catch { return !0; } } function K(t) { return "" + t; } function w(t) { if (J(t)) return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(t)), K(t); } var N = j.ReactCurrentOwner, ae = { key: !0, ref: !0, __self: !0, __source: !0 }, g, S, E; E = {}; function le(t) { if (ne.call(t, "ref")) { var u = Object.getOwnPropertyDescriptor(t, "ref").get; if (u && u.isReactWarning) return !1; } return t.ref !== void 0; } function Y(t) { if (ne.call(t, "key")) { var u = Object.getOwnPropertyDescriptor(t, "key").get; if (u && u.isReactWarning) return !1; } return t.key !== void 0; } function oe(t, u) { if (typeof t.ref == "string" && N.current && u && N.current.stateNode !== u) { var y = D(N.current.type); E[y] || (x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', D(N.current.type), t.ref), E[y] = !0); } } function ie(t, u) { { var y = function() { g || (g = !0, x("%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://reactjs.org/link/special-props)", u)); }; y.isReactWarning = !0, Object.defineProperty(t, "key", { get: y, configurable: !0 }); } } function Ee(t, u) { { var y = function() { S || (S = !0, x("%s: `ref` 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://reactjs.org/link/special-props)", u)); }; y.isReactWarning = !0, Object.defineProperty(t, "ref", { get: y, configurable: !0 }); } } var We = function(t, u, y, _, I, C, R) { var A = { // This tag allows us to uniquely identify this as a React Element $$typeof: r, // Built-in properties that belong on the element type: t, key: u, ref: y, props: R, // Record the component responsible for creating this element. _owner: C }; return A._store = {}, Object.defineProperty(A._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(A, "_self", { configurable: !1, enumerable: !1, writable: !1, value: _ }), Object.defineProperty(A, "_source", { configurable: !1, enumerable: !1, writable: !1, value: I }), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A; }; function Ge(t, u, y, _, I) { { var C, R = {}, A = null, re = null; y !== void 0 && (w(y), A = "" + y), Y(u) && (w(u.key), A = "" + u.key), le(u) && (re = u.ref, oe(u, I)); for (C in u) ne.call(u, C) && !ae.hasOwnProperty(C) && (R[C] = u[C]); if (t && t.defaultProps) { var Q = t.defaultProps; for (C in Q) R[C] === void 0 && (R[C] = Q[C]); } if (A || re) { var V = typeof t == "function" ? t.displayName || t.name || "Unknown" : t; A && ie(R, V), re && Ee(R, V); } return We(t, A, re, I, _, N.current, R); } } var Ae = j.ReactCurrentOwner, it = j.ReactDebugCurrentFrame; function ve(t) { if (t) { var u = t._owner, y = te(t.type, t._source, u ? u.type : null); it.setExtraStackFrame(y); } else it.setExtraStackFrame(null); } var dt; dt = !1; function mt(t) { return typeof t == "object" && t !== null && t.$$typeof === r; } function _t() { { if (Ae.current) { var t = D(Ae.current.type); if (t) return ` Check the render method of \`` + t + "`."; } return ""; } } function ar(t) { { if (t !== void 0) { var u = t.fileName.replace(/^.*[\\\/]/, ""), y = t.lineNumber; return ` Check your code at ` + u + ":" + y + "."; } return ""; } } var jt = {}; function lr(t) { { var u = _t(); if (!u) { var y = typeof t == "string" ? t : t.displayName || t.name; y && (u = ` Check the top-level render call using <` + y + ">."); } return u; } } function Mt(t, u) { { if (!t._store || t._store.validated || t.key != null) return; t._store.validated = !0; var y = lr(u); if (jt[y]) return; jt[y] = !0; var _ = ""; t && t._owner && t._owner !== Ae.current && (_ = " It was passed a child from " + D(t._owner.type) + "."), ve(t), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, _), ve(null); } } function Nt(t, u) { { if (typeof t != "object") return; if (Ce(t)) for (var y = 0; y < t.length; y++) { var _ = t[y]; mt(_) && Mt(_, u); } else if (mt(t)) t._store && (t._store.validated = !0); else if (t) { var I = M(t); if (typeof I == "function" && I !== t.entries) for (var C = I.call(t), R; !(R = C.next()).done; ) mt(R.value) && Mt(R.value, u); } } } function cr(t) { { var u = t.type; if (u == null || typeof u == "string") return; var y; if (typeof u == "function") y = u.propTypes; else if (typeof u == "object" && (u.$$typeof === f || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. u.$$typeof === d)) y = u.propTypes; else return; if (y) { var _ = D(u); Le(y, t.props, "prop", _, t); } else if (u.PropTypes !== void 0 && !dt) { dt = !0; var I = D(u); x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", I || "Unknown"); } typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function sr(t) { { for (var u = Object.keys(t.props), y = 0; y < u.length; y++) { var _ = u[y]; if (_ !== "children" && _ !== "key") { ve(t), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), ve(null); break; } } t.ref !== null && (ve(t), x("Invalid attribute `ref` supplied to `React.Fragment`."), ve(null)); } } function Et(t, u, y, _, I, C) { { var R = Z(t); if (!R) { var A = ""; (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var re = ar(I); re ? A += re : A += _t(); var Q; t === null ? Q = "null" : Ce(t) ? Q = "array" : t !== void 0 && t.$$typeof === r ? (Q = "<" + (D(t.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : Q = typeof t, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Q, A); } var V = Ge(t, u, y, I, C); if (V == null) return V; if (R) { var fe = u.children; if (fe !== void 0) if (_) if (Ce(fe)) { for (var Ze = 0; Ze < fe.length; Ze++) Nt(fe[Ze], t); Object.freeze && Object.freeze(fe); } else x("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 Nt(fe, t); } return t === o ? sr(V) : cr(V), V; } } function ur(t, u, y) { return Et(t, u, y, !0); } function fr(t, u, y) { return Et(t, u, y, !1); } var dr = fr, mr = ur; qe.Fragment = o, qe.jsx = dr, qe.jsxs = mr; }()), qe; } (function(e) { process.env.NODE_ENV === "production" ? e.exports = hr() : e.exports = gr(); })(yr); const Vt = (e, r) => typeof r == "number" || typeof r == "string" ? String(r) === String(e) : Array.isArray(r) ? e.some((n) => r.includes(String(n))) : !0, vr = (e, r) => typeof r == "number" || typeof r == "string" ? String(r) === String(e) : Array.isArray(r) ? r.includes(String(e)) : !0, Dt = (e, r) => typeof e == "number" || typeof e == "string" ? vr(e, r) : Array.isArray(e) ? Vt(e, r) : !0, It = (e) => { e.remove(); }; function bt(e, r) { return e.filter((n) => { const o = [(n == null ? void 0 : n.privileges) || ""].flat(); return !n.privileges || !o.length || Vt(o, r) ? (n.children && (n.children = bt(n.children, r)), !0) : !1; }); } const Ht = (e, r) => { document.querySelectorAll("[data-priv-id]").forEach((n) => { const o = n.getAttribute("data-priv-id"), a = e == null ? void 0 : e[o]; if ((typeof a == "string" || typeof a == "number" || Array.isArray(a)) && (Dt(a, r) || It(n)), typeof a == "object" && !Dt(a.key, r)) { if (a.removeEL !== !1 && It(n), a.css) for (const i in a.css) n.style[i] = a.css[i]; if (a.elementProps) for (const i in a.elementProps) n[i] = a.elementProps[i]; } }); }, br = { pathname: "", store: {}, setStore: () => "", reRenderELPrivilege: () => "", fRoutes: [], setFRoutes: () => "", reFilterRoutes: () => "" }, Bt = Yt(br), xr = () => Qt(Bt), Qr = ({ children: e, pathname: r }) => { const [n, o] = $({}), [a, i] = $([]), l = () => { Ht( n.elementPrivileges || {}, n.userPrivileges || "" ); }, s = (f) => { i(bt(f || [], n.userPrivileges || "")); }; return /* @__PURE__ */ T.jsx( Bt.Provider, { value: { pathname: r, store: n, setStore: o, reRenderELPrivilege: l, fRoutes: a, setFRoutes: i, reFilterRoutes: s }, children: e } ); }, Vr = ({ routes: e, userPrivileges: r, elementPrivileges: n, dependencies: o = [] }) => { const { setStore: a, pathname: i, fRoutes: l, setFRoutes: s } = xr(), f = Tt( () => l.length ? l : e, [e, l] ), m = Tt(() => { if (typeof r == "number" || typeof r == "string") return String(r); if (Array.isArray(r)) return r.map((c) => String(c)); }, [r]); return H(() => { n && Ht(n, m || ""); }, [i, ...o]), H(() => { s(bt(e, m || "")), a({ routes: e, userPrivileges: m, elementPrivileges: n }); }, [r, ...o]), f; }; var yt = {}, wr = { get exports() { return yt; }, set exports(e) { yt = e; } }; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ (function(e) { (function() { var r = {}.hasOwnProperty; function n() { for (var o = [], a = 0; a < arguments.length; a++) { var i = arguments[a]; if (i) { var l = typeof i; if (l === "string" || l === "number") o.push(i); else if (Array.isArray(i)) { if (i.length) { var s = n.apply(null, i); s && o.push(s); } } else if (l === "object") { if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]")) { o.push(i.toString()); continue; } for (var f in i) r.call(i, f) && i[f] && o.push(f); } } } return o.join(" "); } e.exports ? (n.default = n, e.exports = n) : window.classNames = n; })(); })(wr); const et = yt, Lt = ({ type: e = "check", checked: r, handleChange: n, id: o }) => /* @__PURE__ */ T.jsxs("div", { onClick: () => n && n(o, !r), children: [ e === "check" && /* @__PURE__ */ T.jsx("div", { className: et("cb", { selected: r }), children: r && /* @__PURE__ */ T.jsx( "img", { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTQ1IiBoZWlnaHQ9IjQwMiIgdmlld0JveD0iMCAwIDU0NSA0MDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik00Mi4wNTQyIDIxNy4yOUwxODQuNTI3IDM1OS43NTdMNTAyLjYxNyA0MS42NjY3IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjgzLjMzMzMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K", alt: "tick" } ) }), e === "box" && /* @__PURE__ */ T.jsxs("div", { className: et("cb", { selected: r }), children: [ !r && /* @__PURE__ */ T.jsx("div", { className: "cb_i_box" }), r && /* @__PURE__ */ T.jsx( "img", { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTQ1IiBoZWlnaHQ9IjQwMiIgdmlld0JveD0iMCAwIDU0NSA0MDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik00Mi4wNTQyIDIxNy4yOUwxODQuNTI3IDM1OS43NTdMNTAyLjYxNyA0MS42NjY3IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjgzLjMzMzMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K", alt: "tick" } ) ] }) ] }); function nt(e) { return e.split("-")[1]; } function xt(e) { return e === "y" ? "height" : "width"; } function Qe(e) { return e.split("-")[0]; } function ot(e) { return ["top", "bottom"].includes(Qe(e)) ? "x" : "y"; } function Ot(e, r, n) { let { reference: o, floating: a } = e; const i = o.x + o.width / 2 - a.width / 2, l = o.y + o.height / 2 - a.height / 2, s = ot(r), f = xt(s), m = o[f] / 2 - a[f] / 2, c = s === "x"; let d; switch (Qe(r)) { case "top": d = { x: i, y: o.y - a.height }; break; case "bottom": d = { x: i, y: o.y + o.height }; break; case "right": d = { x: o.x + o.width, y: l }; break; case "left": d = { x: o.x - a.width, y: l }; break; default: d = { x: o.x, y: o.y }; } switch (nt(r)) { case "start": d[s] -= m * (n && c ? -1 : 1); break; case "end": d[s] += m * (n && c ? -1 : 1); } return d; } const _r = async (e, r, n) => { const { placement: o = "bottom", strategy: a = "absolute", middleware: i = [], platform: l } = n, s = i.filter(Boolean), f = await (l.isRTL == null ? void 0 : l.isRTL(r)); let m = await l.getElementRects({ reference: e, floating: r, strategy: a }), { x: c, y: d } = Ot(m, o, f), p = o, h = {}, v = 0; for (let b = 0; b < s.length; b++) { const { name: M, fn: j } = s[b], { x, y: L, data: F, reset: P } = await j({ x: c, y: d, initialPlacement: o, placement: p, strategy: a, middlewareData: h, rects: m, platform: l, elements: { reference: e, floating: r } }); c = x ?? c, d = L ?? d, h = { ...h, [M]: { ...h[M], ...F } }, P && v <= 50 && (v++, typeof P == "object" && (P.placement && (p = P.placement), P.rects && (m = P.rects === !0 ? await l.getElementRects({ reference: e, floating: r, strategy: a }) : P.rects), { x: c, y: d } = Ot(m, p, f)), b = -1); } return { x: c, y: d, placement: p, strategy: a, middlewareData: h }; }; function Zt(e) { return typeof e != "number" ? function(r) { return { top: 0, right: 0, bottom: 0, left: 0, ...r }; }(e) : { top: e, right: e, bottom: e, left: e }; } function lt(e) { return { ...e, top: e.y, left: e.x, right: e.x + e.width, bottom: e.y + e.height }; } async function Jt(e, r) { var n; r === void 0 && (r = {}); const { x: o, y: a, platform: i, rects: l, elements: s, strategy: f } = e, { boundary: m = "clippingAncestors", rootBoundary: c = "viewport", elementContext: d = "floating", altBoundary: p = !1, padding: h = 0 } = r, v = Zt(h), b = s[p ? d === "floating" ? "reference" : "floating" : d], M = lt(await i.getClippingRect({ element: (n = await (i.isElement == null ? void 0 : i.isElement(b))) == null || n ? b : b.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(s.floating)), boundary: m, rootBoundary: c, strategy: f })), j = d === "floating" ? { ...l.floating, x: o, y: a } : l.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s.floating)), L = await (i.isElement == null ? void 0 : i.isElement(x)) && await (i.getScale == null ? void 0 : i.getScale(x)) || { x: 1, y: 1 }, F = lt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: j, offsetParent: x, strategy: f }) : j); return { top: (M.top - F.top + v.top) / L.y, bottom: (F.bottom - M.bottom + v.bottom) / L.y, left: (M.left - F.left + v.left) / L.x, right: (F.right - M.right + v.right) / L.x }; } const jr = Math.min, Mr = Math.max; function ht(e, r, n) { return Mr(e, jr(r, n)); } const Nr = (e) => ({ name: "arrow", options: e, async fn(r) { const { element: n, padding: o = 0 } = e || {}, { x: a, y: i, placement: l, rects: s, platform: f, elements: m } = r; if (n == null) return {}; const c = Zt(o), d = { x: a, y: i }, p = ot(l), h = xt(p), v = await f.getDimensions(n), b = p === "y", M = b ? "top" : "left", j = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", L = s.reference[h] + s.reference[p] - d[p] - s.floating[h], F = d[p] - s.reference[p], P = await (f.getOffsetParent == null ? void 0 : f.getOffsetParent(n)); let G = P ? P[x] : 0; G && await (f.isElement == null ? void 0 : f.isElement(P)) || (G = m.floating[x] || s.floating[h]); const X = L / 2 - F / 2, B = c[M], q = G - v[h] - c[j], Z = G / 2 - v[h] / 2 + X, O = ht(B, Z, q), W = nt(l) != null && Z != O && s.reference[h] / 2 - (Z < B ? c[M] : c[j]) - v[h] / 2 < 0; return { [p]: d[p] - (W ? Z < B ? B - Z : q - Z : 0), data: { [p]: O, centerOffset: Z - O } }; } }), Er = ["top", "right", "bottom", "left"]; Er.reduce((e, r) => e.concat(r, r + "-start", r + "-end"), []); const Ar = { left: "right", right: "left", bottom: "top", top: "bottom" }; function ct(e) { return e.replace(/left|right|bottom|top/g, (r) => Ar[r]); } function Tr(e, r, n) { n === void 0 && (n = !1); const o = nt(e), a = ot(e), i = xt(a); let l = a === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top"; return r.reference[i] > r.floating[i] && (l = ct(l)), { main: l, cross: ct(l) }; } const Rr = { start: "end", end: "start" }; function pt(e) { return e.replace(/start|end/g, (r) => Rr[r]); } const Sr = function(e) { return e === void 0 && (e = {}), { name: "flip", options: e, async fn(r) { var n; const { placement: o, middlewareData: a, rects: i, initialPlacement: l, platform: s, elements: f } = r, { mainAxis: m = !0, crossAxis: c = !0, fallbackPlacements: d, fallbackStrategy: p = "bestFit", fallbackAxisSideDirection: h = "none", flipAlignment: v = !0, ...b } = e, M = Qe(o), j = Qe(l) === l, x = await (s.isRTL == null ? void 0 : s.isRTL(f.floating)), L = d || (j || !v ? [ct(l)] : function(O) { const W = ct(O); return [pt(O), W, pt(W)]; }(l)); d || h === "none" || L.push(...function(O, W, D, U) { const k = nt(O); let z = function(se, ue, xe) { const pe = ["left", "right"], we = ["right", "left"], _e = ["top", "bottom"], ee = ["bottom", "top"]; switch (se) { case "top": case "bottom": return xe ? ue ? we : pe : ue ? pe : we; case "left": case "right": return ue ? _e : ee; default: return []; } }(Qe(O), D === "start", U); return k && (z = z.map((se) => se + "-" + k), W && (z = z.concat(z.map(pt)))), z; }(l, v, h, x)); const F = [l, ...L], P = await Jt(r, b), G = []; let X = ((n = a.flip) == null ? void 0 : n.overflows) || []; if (m && G.push(P[M]), c) { const { main: O, cross: W } = Tr(o, i, x); G.push(P[O], P[W]); } if (X = [...X, { placement: o, overflows: G }], !G.every((O) => O <= 0)) { var B, q; const O = (((B = a.flip) == null ? void 0 : B.index) || 0) + 1, W = F[O]; if (W) return { data: { index: O, overflows: X }, reset: { placement: W } }; let D = (q = X.filter((U) => U.overflows[0] <= 0).sort((U, k) => U.overflows[1] - k.overflows[1])[0]) == null ? void 0 : q.placement; if (!D) switch (p) { case "bestFit": { var Z; const U = (Z = X.map((k) => [k.placement, k.overflows.filter((z) => z > 0).reduce((z, se) => z + se, 0)]).sort((k, z) => k[1] - z[1])[0]) == null ? void 0 : Z[0]; U && (D = U); break; } case "initialPlacement": D = l; } if (o !== D) return { reset: { placement: D } }; } return {}; } }; }, Dr = function(e) { return e === void 0 && (e = 0), { name: "offset", options: e, async fn(r) { const { x: n, y: o } = r, a = await async function(i, l) { const { placement: s, platform: f, elements: m } = i, c = await (f.isRTL == null ? void 0 : f.isRTL(m.floating)), d = Qe(s), p = nt(s), h = ot(s) === "x", v = ["left", "top"].includes(d) ? -1 : 1, b = c && h ? -1 : 1, M = typeof l == "function" ? l(i) : l; let { mainAxis: j, crossAxis: x, alignmentAxis: L } = typeof M == "number" ? { mainAxis: M, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...M }; return p && typeof L == "number" && (x = p === "end" ? -1 * L : L), h ? { x: x * b, y: j * v } : { x: j * v, y: x * b }; }(r, e); return { x: n + a.x, y: o + a.y, data: a }; } }; }; function Ir(e) { return e === "x" ? "y" : "x"; } const Lr = function(e) { return e === void 0 && (e = {}), { name: "shift", options: e, async fn(r) { const { x: n, y: o, placement: a } = r, { mainAxis: i = !0, crossAxis: l = !1, limiter: s = { fn: (M) => { let { x: j, y: x } = M; return { x: j, y: x }; } }, ...f } = e, m = { x: n, y: o }, c = await Jt(r, f), d = ot(Qe(a)), p = Ir(d); let h = m[d], v = m[p]; if (i) { const M = d === "y" ? "bottom" : "right"; h = ht(h + c[d === "y" ? "top" : "left"], h, h - c[M]); } if (l) { const M = p === "y" ? "bottom" : "right"; v = ht(v + c[p === "y" ? "top" : "left"], v, v - c[M]); } const b = s.fn({ ...r, [d]: h, [p]: v }); return { ...b, data: { x: b.x - n, y: b.y - o } }; } }; }; function ce(e) { var r; return ((r = e.ownerDocument) == null ? void 0 : r.defaultView) || window; } function be(e) { return ce(e).getComputedStyle(e); } function Gt(e) { return e instanceof ce(e).Node; } function Pe(e) { return Gt(e) ? (e.nodeName || "").toLowerCase() : ""; } let at; function Xt() { if (at) return at; const e = navigator.userAgentData; return e && Array.isArray(e.brands) ? (at = e.brands.map((r) => r.brand + "/" + r.version).join(" "), at) : navigator.userAgent; } function me(e) { return e instanceof ce(e).HTMLElement; } function ze(e) { return e instanceof ce(e).Element; } function Ct(e) { return typeof ShadowRoot > "u" ? !1 : e instanceof ce(e).ShadowRoot || e instanceof ShadowRoot; } function ut(e) { const { overflow: r, overflowX: n, overflowY: o, display: a } = be(e); return /auto|scroll|overlay|hidden|clip/.test(r + o + n) && !["inline", "contents"].includes(a); } function Or(e) { return ["table", "td", "th"].includes(Pe(e)); } function gt(e) { const r = /firefox/i.test(Xt()), n = be(e), o = n.backdropFilter || n.WebkitBackdropFilter; return n.transform !== "none" || n.perspective !== "none" || !!o && o !== "none" || r && n.willChange === "filter" || r && !!n.filter && n.filter !== "none" || ["transform", "perspective"].some((a) => n.willChange.includes(a)) || ["paint", "layout", "strict", "content"].some((a) => { const i = n.contain; return i != null && i.includes(a); }); } function vt() { return /^((?!chrome|android).)*safari/i.test(Xt()); } function wt(e) { return ["html", "body", "#document"].includes(Pe(e)); } const kt = Math.min, Ke = Math.max, st = Math.round; function qt(e) { const r = be(e); let n = parseFloat(r.width), o = parseFloat(r.height); const a = me(e), i = a ? e.offsetWidth : n, l = a ? e.offsetHeight : o, s = st(n) !== i || st(o) !== l; return s && (n = i, o = l), { width: n, height: o, fallback: s }; } function Kt(e) { return ze(e) ? e : e.contextElement; } const er = { x: 1, y: 1 }; function Je(e) { const r = Kt(e); if (!me(r)) return er; const n = r.getBoundingClientRect(), { width: o, height: a, fallback: i } = qt(r); let l = (i ? st(n.width) : n.width) / o, s = (i ? st(n.height) : n.height) / a; return l && Number.isFinite(l) || (l = 1), s && Number.isFinite(s) || (s = 1), { x: l, y: s }; } function tt(e, r, n, o) { var a, i; r === void 0 && (r = !1), n === void 0 && (n = !1); const l = e.getBoundingClientRect(), s = Kt(e); let f = er; r && (o ? ze(o) && (f = Je(o)) : f = Je(e)); const m = s ? ce(s) : window, c = vt() && n; let d = (l.left + (c && ((a = m.visualViewport) == null ? void 0 : a.offsetLeft) || 0)) / f.x, p = (l.top + (c && ((i = m.visualViewport) == null ? void 0 : i.offsetTop) || 0)) / f.y, h = l.width / f.x, v = l.height / f.y; if (s) { const b = ce(s), M = o && ze(o) ? ce(o) : o; let j = b.frameElement; for (; j && o && M !== b; ) { const x = Je(j), L = j.getBoundingClientRect(), F = getComputedStyle(j); L.x += (j.clientLeft + parseFloat(F.paddingLeft)) * x.x, L.y += (j.clientTop + parseFloat(F.paddingTop)) * x.y, d *= x.x, p *= x.y, h *= x.x, v *= x.y, d += L.x, p += L.y, j = ce(j).frameElement; } } return lt({ width: h, height: v, x: d, y: p }); } function Ue(e) { return ((Gt(e) ? e.ownerDocument : e.document) || window.document).documentElement; } function ft(e) { return ze(e) ? { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop } : { scrollLeft: e.pageXOffset, scrollTop: e.pageYOffset }; } function tr(e) { return tt(Ue(e)).left + ft(e).scrollLeft; } function rt(e) { if (Pe(e) === "html") return e; const r = e.assignedSlot || e.parentNode || Ct(e) && e.host || Ue(e); return Ct(r) ? r.host : r; } function rr(e) { const r = rt(e); return wt(r) ? r.ownerDocument.body : me(r) && ut(r) ? r : rr(r); } function nr(e, r) { var n; r === void 0 && (r = []); const o = rr(e), a = o === ((n = e.ownerDocument) == null ? void 0 : n.body), i = ce(o); return a ? r.concat(i, i.visualViewport || [], ut(o) ? o : []) : r.concat(o, nr(o)); } function zt(e, r, n) { let o; if (r === "viewport") o = function(l, s) { const f = ce(l), m = Ue(l), c = f.visualViewport; let d = m.clientWidth, p = m.clientHeight, h = 0, v = 0; if (c) { d = c.width, p = c.height; const b = vt(); (!b || b && s === "fixed") && (h = c.offsetLeft, v = c.offsetTop); } return { width: d, height: p, x: h, y: v }; }(e, n); else if (r === "document") o = function(l) { const s = Ue(l), f = ft(l), m = l.ownerDocument.body, c = Ke(s.scrollWidth, s.clientWidth, m.scrollWidth, m.clientWidth), d = Ke(s.scrollHeight, s.clientHeight, m.scrollHeight, m.clientHeight); let p = -f.scrollLeft + tr(l); const h = -f.scrollTop; return be(m).direction === "rtl" && (p += Ke(s.clientWidth, m.clientWidth) - c), { width: c, height: d, x: p, y: h }; }(Ue(e)); else if (ze(r)) o = function(l, s) { const f = tt(l, !0, s === "fixed"), m = f.top + l.clientTop, c = f.left + l.clientLeft, d = me(l) ? Je(l) : { x: 1, y: 1 }; return { width: l.clientWidth * d.x, height: l.clientHeight * d.y, x: c * d.x, y: m * d.y }; }(r, n); else { const l = { ...r }; if (vt()) { var a, i; const s = ce(e); l.x -= ((a = s.visualViewport) == null ? void 0 : a.offsetLeft) || 0, l.y -= ((i = s.visualViewport) == null ? void 0 : i.offsetTop) || 0; } o = l; } return lt(o); } function Ut(e, r) { return me(e) && be(e).position !== "fixed" ? r ? r(e) : e.offsetParent : null; } function Pt(e, r) { const n = ce(e); if (!me(e)) return n; let o = Ut(e, r); for (; o && Or(o) && be(o).position === "static"; ) o = Ut(o, r); return o && (Pe(o) === "html" || Pe(o) === "body" && be(o).position === "static" && !gt(o)) ? n : o || function(a) { let i = rt(a); for (; me(i) && !wt(i); ) { if (gt(i)) return i; i = rt(i); } return null; }(e) || n; } function Cr(e, r, n) { const o = me(r), a = Ue(r), i = tt(e, !0, n === "fixed", r); let l = { scrollLeft: 0, scrollTop: 0 }; const s = { x: 0, y: 0 }; if (o || !o && n !== "fixed") if ((Pe(r) !== "body" || ut(a)) && (l = ft(r)), me(r)) { const f = tt(r, !0); s.x = f.x + r.clientLeft, s.y = f.y + r.clientTop; } else a && (s.x = tr(a)); return { x: i.left + l.scrollLeft - s.x, y: i.top + l.scrollTop - s.y, width: i.width, height: i.height }; } const kr = { getClippingRect: function(e) { let { element: r, boundary: n, rootBoundary: o, strategy: a } = e; const i = n === "clippingAncestors" ? function(m, c) { const d = c.get(m); if (d) return d; let p = nr(m).filter((M) => ze(M) && Pe(M) !== "body"), h = null; const v = be(m).position === "fixed"; let b = v ? rt(m) : m; for (; ze(b) && !wt(b); ) { const M = be(b), j = gt(b); M.position === "fixed" && (h = null), (v ? j || h : j || M.position !== "static" || !h || !["absolute", "fixed"].includes(h.position)) ? h = M : p = p.filter((x) => x !== b), b = rt(b); } return c.set(m, p), p; }(r, this._c) : [].concat(n), l = [...i, o], s = l[0], f = l.reduce((m, c) => { const d = zt(r, c, a); return m.top = Ke(d.top, m.top), m.right = kt(d.right, m.right), m.bottom = kt(d.bottom, m.bottom), m.left = Ke(d.left, m.left), m; }, zt(r, s, a)); return { width: f.right - f.left, height: f.bottom - f.top, x: f.left, y: f.top }; }, convertOffsetParentRelativeRectToViewportRelativeRect: function(e) { let { rect: r, offsetParent: n, strategy: o } = e; const a = me(n), i = Ue(n); if (n === i) return r; let l = { scrollLeft: 0, scrollTop: 0 }, s = { x: 1, y: 1 }; const f = { x: 0, y: 0 }; if ((a || !a && o !== "fixed") && ((Pe(n) !== "body" || ut(i)) && (l = ft(n)), me(n))) { const m = tt(n); s = Je(n), f.x = m.x + n.clientLeft, f.y = m.y + n.clientTop; } return { width: r.width * s.x, height: r.height * s.y, x: r.x * s.x - l.scrollLeft * s.x + f.x, y: r.y * s.y - l.scrollTop * s.y + f.y }; }, isElement: ze, getDimensions: function(e) { return qt(e); }, getOffsetParent: Pt, getDocumentElement: Ue, getScale: Je, async getElementRects(e) { let { reference: r, floating: n, strategy: o } = e; const a = this.getOffsetParent || Pt, i = this.getDimensions; return { reference: Cr(r, await a(n), o), floating: { x: 0, y: 0, ...await i(n) } }; }, getClientRects: (e) => Array.from(e.getClientRects()), isRTL: (e) => be(e).direction === "rtl" }, $t = (e, r, n) => { const o = /* @__PURE__ */ new Map(), a = { platform: kr, ...n }, i = { ...a.platform, _c: o }; return _r(e, r, { ...a, platform: i }); }, Ft = (e, r, n) => { let o = null; return function(...a) { const i = () => { o = null, n || e.apply(this, a); }; n && !o && (e.apply(this, a), o = setTimeout(i, r)), n || (o && clearTimeout(o), o = setTimeout(i, r)); }; }, zr = { anchorRefs: /* @__PURE__ */ new Set(), activeAnchor: { current: null }, attach: () => { }, detach: () => { }, setActiveAnchor: () => { } }, Ur = Yt({ getTooltipData: () => zr }); function or(e = "DEFAULT_TOOLTIP_ID") { return Qt(Ur).getTooltipData(e); } const Pr = typeof window < "u" ? pr : H, Wt = async ({ elementReference: e = null, tooltipReference: r = null, tooltipArrowReference: n = null, place: o = "top", offset: a = 10, strategy: i = "absolute", middlewares: l = [Dr(Number(a)), Sr(), Lr({ padding: 5 })] }) => { if (!e) return { tooltipStyles: {}, tooltipArrowStyles: {}, place: o }; if (r === null) return { tooltipStyles: {}, tooltipArrowStyles: {}, place: o }; const s = l; return n ? (s.push(Nr({ element: n, padding: 5 })), $t(e, r, { placement: o, strategy: i, middleware: s }).then(({ x: f, y: m, placement: c, middlewareData: d }) => { var p, h; const v = { left: `${f}px`, top: `${m}px` }, { x: b, y: M } = (p = d.arrow) !== null && p !== void 0 ? p : { x: 0, y: 0 }; return { tooltipStyles: v, tooltipArrowStyles: { left: b != null ? `${b}px` : "", top: M != null ? `${M}px` : "", right: "", bottom: "", [(h = { top: "bottom", right: "left", bottom: "top", left: "right" }[c.split("-")[0]]) !== null && h !== void 0 ? h : "bottom"]: "-4px" }, place: c }; })) : $t(e, r, { placement: "bottom", strategy: i, middleware: s }).then(({ x: f, y: m, placement: c }) => ({ tooltipStyles: { left: `${f}px`, top: `${m}px` }, tooltipArrowStyles: {}, place: c })); }; var Ye = { tooltip: "styles-module_tooltip__mnnfp", fixed: "styles-module_fixed__7ciUi", arrow: "styles-module_arrow__K0L3T", noArrow: "styles-module_noArrow__T8y2L", clickable: "styles-module_clickable__Bv9o7", show: "styles-module_show__2NboJ", dark: "styles-module_dark__xNqje", light: "styles-module_light__Z6W-X", success: "styles-module_success__A2AKt", warning: "styles-module_warning__SCK0X", error: "styles-module_error__JvumD", info: "styles-module_info__BWdHW" }; const $r = ({ id: e, className: r, classNameArrow: n, variant: o = "dark", anchorId: a, anchorSelect: i, place: l = "top", offset: s = 10, events: f = ["hover"], openOnClick: m = !1, positionStrategy: c = "absolute", middlewares: d, wrapper: p, delayShow: h = 0, delayHide: v = 0, float: b = !1, noArrow: M = !1, clickable: j = !1, closeOnEsc: x = !1, style: L, position: F, afterShow: P, afterHide: G, content: X, contentWrapperRef: B, isOpen: q, setIsOpen: Z, activeAnchor: O, setActiveAnchor: W }) => { const D = Re(null), U = Re(null), k = Re(null), z = Re(null), [se, ue] = $(l), [xe, pe] = $({}), [we, _e] = $({}), [ee, Ve] = $(!1), [He, ye] = $(!1), Se = Re(!1), he = Re(null), { anchorRefs: De, setActiveAnchor: je } = or(e), $e = Re(!1), [de, Fe] = $([]), Me = Re(!1), te = m || f.includes("click"); Pr(() => (Me.current = !0, () => { Me.current = !1; }), []), H(() => { if (!ee) { const g = setTimeout(() => { ye(!1); }, 150); return () => { clearTimeout(g); }; } return () => null; }, [ee]); const ne = (g) => { Me.current && (g && ye(!0), setTimeout(() => { Me.current && (Z == null || Z(g), q === void 0 && Ve(g)); }, 10)); }; H(() => { if (q === void 0) return () => null; q && ye(!0); const g = setTimeout(() => { Ve(q); }, 10); return () => { clearTimeout(g); }; }, [q]), H(() => { ee !== Se.current && (Se.current = ee, ee ? P == null || P() : G == null || G()); }, [ee]); const Ne = (g = v) => { z.current && clearTimeout(z.current), z.current = setTimeout(() => { $e.current || ne(!1); }, g); }, Ie = (g) => { var S; if (!g) return; const E = (S = g.currentTarget) !== null && S !== void 0 ? S : g.target; if (!(E != null && E.isConnected)) return W(null), void je({ current: null }); h ? (k.current && clearTimeout(k.current), k.current = setTimeout(() => { ne(!0); }, h)) : ne(!0), W(E), je({ current: E }), z.current && clearTimeout(z.current); }, ge = () => { j ? Ne(v || 100) : v ? Ne() : ne(!1), k.current && clearTimeout(k.current); }, Le = ({ x: g, y: S }) => { Wt({ place: l, offset: s, elementReference: { getBoundingClientRect: () => ({ x: g, y: S, width: 0, height: 0, top: S, left: g, right: g, bottom: S }) }, tooltipReference: D.current, tooltipArrowReference: U.current, strategy: c, middlewares: d }).then((E) => { Object.keys(E.tooltipStyles).length && pe(E.tooltipStyles), Object.keys(E.tooltipArrowStyles).length && _e(E.tooltipArrowStyles), ue(E.place); }); }, Oe = (g) => { if (!g) return; const S = g, E = { x: S.clientX, y: S.clientY }; Le(E), he.current = E; }, Ce = (g) => { Ie(g), v && Ne(); }, Be = (g) => { var S; [document.querySelector(`[id='${a}']`), ...de].some((E) => E == null ? void 0 : E.contains(g.target)) || !((S = D.current) === null || S === void 0) && S.contains(g.target) || ne(!1); }, J = (g) => { g.key === "Escape" && ne(!1); }, K = Ft(Ie, 50, !0), w = Ft(ge, 50, !0); H(() => { var g, S; const E = new Set(De); de.forEach((Ee) => { E.add({ current: Ee }); }); const le = document.querySelector(`[id='${a}']`); le && E.add({ current: le }), x && window.addEventListener("keydown", J); const Y = []; te ? (window.addEventListener("click", Be), Y.push({ event: "click", listener: Ce })) : (Y.push({ event: "mouseenter", listener: K }, { event: "mouseleave", listener: w }, { event: "focus", listener: K }, { event: "blur", listener: w }), b &&