@acrool/react-table
Version:
Table library based for Reactjs
1,796 lines (1,793 loc) • 125 kB
JavaScript
import * as mn from "react";
import se, { useLayoutEffect as ur, useEffect as Y, useRef as H, useMemo as W, useCallback as ee, useState as Re, createContext as yt, memo as dr, useReducer as sn, useContext as Ze } from "react";
import { unstable_batchedUpdates as lt, createPortal as fr } from "react-dom";
var S = {}, gr = {
get exports() {
return S;
},
set exports(e) {
S = e;
}
}, ut = {};
/**
* @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 yn;
function hr() {
if (yn)
return ut;
yn = 1;
var e = se, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
function s(c, l, f) {
var d, u = {}, h = null, g = null;
f !== void 0 && (h = "" + f), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (g = l.ref);
for (d in l)
r.call(l, d) && !o.hasOwnProperty(d) && (u[d] = l[d]);
if (c && c.defaultProps)
for (d in l = c.defaultProps, l)
u[d] === void 0 && (u[d] = l[d]);
return { $$typeof: t, type: c, key: h, ref: g, props: u, _owner: i.current };
}
return ut.Fragment = n, ut.jsx = s, ut.jsxs = s, ut;
}
var dt = {};
/**
* @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 wn;
function vr() {
return wn || (wn = 1, process.env.NODE_ENV !== "production" && function() {
var e = se, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), b = Symbol.iterator, v = "@@iterator";
function x(a) {
if (a === null || typeof a != "object")
return null;
var p = b && a[b] || a[v];
return typeof p == "function" ? p : null;
}
var m = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function y(a) {
{
for (var p = arguments.length, w = new Array(p > 1 ? p - 1 : 0), k = 1; k < p; k++)
w[k - 1] = arguments[k];
C("error", a, w);
}
}
function C(a, p, w) {
{
var k = m.ReactDebugCurrentFrame, M = k.getStackAddendum();
M !== "" && (p += "%s", w = w.concat([M]));
var B = w.map(function(L) {
return String(L);
});
B.unshift("Warning: " + p), Function.prototype.apply.call(console[a], console, B);
}
}
var _ = !1, R = !1, E = !1, D = !1, T = !1, I;
I = Symbol.for("react.module.reference");
function $(a) {
return !!(typeof a == "string" || typeof a == "function" || a === r || a === o || T || a === i || a === f || a === d || D || a === g || _ || R || E || typeof a == "object" && a !== null && (a.$$typeof === h || a.$$typeof === u || a.$$typeof === s || a.$$typeof === c || a.$$typeof === l || // 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.
a.$$typeof === I || a.getModuleId !== void 0));
}
function P(a, p, w) {
var k = a.displayName;
if (k)
return k;
var M = p.displayName || p.name || "";
return M !== "" ? w + "(" + M + ")" : w;
}
function N(a) {
return a.displayName || "Context";
}
function O(a) {
if (a == null)
return null;
if (typeof a.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function")
return a.displayName || a.name || null;
if (typeof a == "string")
return a;
switch (a) {
case r:
return "Fragment";
case n:
return "Portal";
case o:
return "Profiler";
case i:
return "StrictMode";
case f:
return "Suspense";
case d:
return "SuspenseList";
}
if (typeof a == "object")
switch (a.$$typeof) {
case c:
var p = a;
return N(p) + ".Consumer";
case s:
var w = a;
return N(w._context) + ".Provider";
case l:
return P(a, a.render, "ForwardRef");
case u:
var k = a.displayName || null;
return k !== null ? k : O(a.type) || "Memo";
case h: {
var M = a, B = M._payload, L = M._init;
try {
return O(L(B));
} catch {
return null;
}
}
}
return null;
}
var z = Object.assign, le = 0, Se, q, re, ue, pe, de, X;
function oe() {
}
oe.__reactDisabledLog = !0;
function be() {
{
if (le === 0) {
Se = console.log, q = console.info, re = console.warn, ue = console.error, pe = console.group, de = console.groupCollapsed, X = console.groupEnd;
var a = {
configurable: !0,
enumerable: !0,
value: oe,
writable: !0
};
Object.defineProperties(console, {
info: a,
log: a,
warn: a,
error: a,
group: a,
groupCollapsed: a,
groupEnd: a
});
}
le++;
}
}
function De() {
{
if (le--, le === 0) {
var a = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: z({}, a, {
value: Se
}),
info: z({}, a, {
value: q
}),
warn: z({}, a, {
value: re
}),
error: z({}, a, {
value: ue
}),
group: z({}, a, {
value: pe
}),
groupCollapsed: z({}, a, {
value: de
}),
groupEnd: z({}, a, {
value: X
})
});
}
le < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var G = m.ReactCurrentDispatcher, Le;
function fe(a, p, w) {
{
if (Le === void 0)
try {
throw Error();
} catch (M) {
var k = M.stack.trim().match(/\n( *(at )?)/);
Le = k && k[1] || "";
}
return `
` + Le + a;
}
}
var ge = !1, A;
{
var Me = typeof WeakMap == "function" ? WeakMap : Map;
A = new Me();
}
function he(a, p) {
if (!a || ge)
return "";
{
var w = A.get(a);
if (w !== void 0)
return w;
}
var k;
ge = !0;
var M = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var B;
B = G.current, G.current = null, be();
try {
if (p) {
var L = function() {
throw Error();
};
if (Object.defineProperty(L.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(L, []);
} catch (ze) {
k = ze;
}
Reflect.construct(a, [], L);
} else {
try {
L.call();
} catch (ze) {
k = ze;
}
a.call(L.prototype);
}
} else {
try {
throw Error();
} catch (ze) {
k = ze;
}
a();
}
} catch (ze) {
if (ze && k && typeof ze.stack == "string") {
for (var j = ze.stack.split(`
`), ve = k.stack.split(`
`), J = j.length - 1, Z = ve.length - 1; J >= 1 && Z >= 0 && j[J] !== ve[Z]; )
Z--;
for (; J >= 1 && Z >= 0; J--, Z--)
if (j[J] !== ve[Z]) {
if (J !== 1 || Z !== 1)
do
if (J--, Z--, Z < 0 || j[J] !== ve[Z]) {
var ke = `
` + j[J].replace(" at new ", " at ");
return a.displayName && ke.includes("<anonymous>") && (ke = ke.replace("<anonymous>", a.displayName)), typeof a == "function" && A.set(a, ke), ke;
}
while (J >= 1 && Z >= 0);
break;
}
}
} finally {
ge = !1, G.current = B, De(), Error.prepareStackTrace = M;
}
var et = a ? a.displayName || a.name : "", bn = et ? fe(et) : "";
return typeof a == "function" && A.set(a, bn), bn;
}
function Q(a, p, w) {
return he(a, !1);
}
function ce(a) {
var p = a.prototype;
return !!(p && p.isReactComponent);
}
function Ce(a, p, w) {
if (a == null)
return "";
if (typeof a == "function")
return he(a, ce(a));
if (typeof a == "string")
return fe(a);
switch (a) {
case f:
return fe("Suspense");
case d:
return fe("SuspenseList");
}
if (typeof a == "object")
switch (a.$$typeof) {
case l:
return Q(a.render);
case u:
return Ce(a.type, p, w);
case h: {
var k = a, M = k._payload, B = k._init;
try {
return Ce(B(M), p, w);
} catch {
}
}
}
return "";
}
var Oe = Object.prototype.hasOwnProperty, it = {}, at = m.ReactDebugCurrentFrame;
function Be(a) {
if (a) {
var p = a._owner, w = Ce(a.type, a._source, p ? p.type : null);
at.setExtraStackFrame(w);
} else
at.setExtraStackFrame(null);
}
function Fe(a, p, w, k, M) {
{
var B = Function.call.bind(Oe);
for (var L in a)
if (B(a, L)) {
var j = void 0;
try {
if (typeof a[L] != "function") {
var ve = Error((k || "React class") + ": " + w + " type `" + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[L] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw ve.name = "Invariant Violation", ve;
}
j = a[L](p, L, k, w, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (J) {
j = J;
}
j && !(j instanceof Error) && (Be(M), y("%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).", k || "React class", w, L, typeof j), Be(null)), j instanceof Error && !(j.message in it) && (it[j.message] = !0, Be(M), y("Failed %s type: %s", w, j.message), Be(null));
}
}
}
var Qe = Array.isArray;
function We(a) {
return Qe(a);
}
function Ct(a) {
{
var p = typeof Symbol == "function" && Symbol.toStringTag, w = p && a[Symbol.toStringTag] || a.constructor.name || "Object";
return w;
}
}
function Rt(a) {
try {
return Dt(a), !1;
} catch {
return !0;
}
}
function Dt(a) {
return "" + a;
}
function Et(a) {
if (Rt(a))
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ct(a)), Dt(a);
}
var Ee = m.ReactCurrentOwner, Ye = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, He, st, _e;
_e = {};
function _t(a) {
if (Oe.call(a, "ref")) {
var p = Object.getOwnPropertyDescriptor(a, "ref").get;
if (p && p.isReactWarning)
return !1;
}
return a.ref !== void 0;
}
function Ut(a) {
if (Oe.call(a, "key")) {
var p = Object.getOwnPropertyDescriptor(a, "key").get;
if (p && p.isReactWarning)
return !1;
}
return a.key !== void 0;
}
function Vt(a, p) {
if (typeof a.ref == "string" && Ee.current && p && Ee.current.stateNode !== p) {
var w = O(Ee.current.type);
_e[w] || (y('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', O(Ee.current.type), a.ref), _e[w] = !0);
}
}
function Tt(a, p) {
{
var w = function() {
He || (He = !0, y("%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)", p));
};
w.isReactWarning = !0, Object.defineProperty(a, "key", {
get: w,
configurable: !0
});
}
}
function Xt(a, p) {
{
var w = function() {
st || (st = !0, y("%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)", p));
};
w.isReactWarning = !0, Object.defineProperty(a, "ref", {
get: w,
configurable: !0
});
}
}
var kt = function(a, p, w, k, M, B, L) {
var j = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: a,
key: p,
ref: w,
props: L,
// Record the component responsible for creating this element.
_owner: B
};
return j._store = {}, Object.defineProperty(j._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(j, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: k
}), Object.defineProperty(j, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: M
}), Object.freeze && (Object.freeze(j.props), Object.freeze(j)), j;
};
function qt(a, p, w, k, M) {
{
var B, L = {}, j = null, ve = null;
w !== void 0 && (Et(w), j = "" + w), Ut(p) && (Et(p.key), j = "" + p.key), _t(p) && (ve = p.ref, Vt(p, M));
for (B in p)
Oe.call(p, B) && !Ye.hasOwnProperty(B) && (L[B] = p[B]);
if (a && a.defaultProps) {
var J = a.defaultProps;
for (B in J)
L[B] === void 0 && (L[B] = J[B]);
}
if (j || ve) {
var Z = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
j && Tt(L, Z), ve && Xt(L, Z);
}
return kt(a, j, ve, M, k, Ee.current, L);
}
}
var ct = m.ReactCurrentOwner, It = m.ReactDebugCurrentFrame;
function V(a) {
if (a) {
var p = a._owner, w = Ce(a.type, a._source, p ? p.type : null);
It.setExtraStackFrame(w);
} else
It.setExtraStackFrame(null);
}
var ie;
ie = !1;
function ae(a) {
return typeof a == "object" && a !== null && a.$$typeof === t;
}
function Pe() {
{
if (ct.current) {
var a = O(ct.current.type);
if (a)
return `
Check the render method of \`` + a + "`.";
}
return "";
}
}
function me(a) {
{
if (a !== void 0) {
var p = a.fileName.replace(/^.*[\\\/]/, ""), w = a.lineNumber;
return `
Check your code at ` + p + ":" + w + ".";
}
return "";
}
}
var ye = {};
function Te(a) {
{
var p = Pe();
if (!p) {
var w = typeof a == "string" ? a : a.displayName || a.name;
w && (p = `
Check the top-level render call using <` + w + ">.");
}
return p;
}
}
function $e(a, p) {
{
if (!a._store || a._store.validated || a.key != null)
return;
a._store.validated = !0;
var w = Te(p);
if (ye[w])
return;
ye[w] = !0;
var k = "";
a && a._owner && a._owner !== ct.current && (k = " It was passed a child from " + O(a._owner.type) + "."), V(a), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', w, k), V(null);
}
}
function we(a, p) {
{
if (typeof a != "object")
return;
if (We(a))
for (var w = 0; w < a.length; w++) {
var k = a[w];
ae(k) && $e(k, p);
}
else if (ae(a))
a._store && (a._store.validated = !0);
else if (a) {
var M = x(a);
if (typeof M == "function" && M !== a.entries)
for (var B = M.call(a), L; !(L = B.next()).done; )
ae(L.value) && $e(L.value, p);
}
}
}
function Ve(a) {
{
var p = a.type;
if (p == null || typeof p == "string")
return;
var w;
if (typeof p == "function")
w = p.propTypes;
else if (typeof p == "object" && (p.$$typeof === l || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
p.$$typeof === u))
w = p.propTypes;
else
return;
if (w) {
var k = O(p);
Fe(w, a.props, "prop", k, a);
} else if (p.PropTypes !== void 0 && !ie) {
ie = !0;
var M = O(p);
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
}
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Xe(a) {
{
for (var p = Object.keys(a.props), w = 0; w < p.length; w++) {
var k = p[w];
if (k !== "children" && k !== "key") {
V(a), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", k), V(null);
break;
}
}
a.ref !== null && (V(a), y("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
}
}
function qe(a, p, w, k, M, B) {
{
var L = $(a);
if (!L) {
var j = "";
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (j += " 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 ve = me(M);
ve ? j += ve : j += Pe();
var J;
a === null ? J = "null" : We(a) ? J = "array" : a !== void 0 && a.$$typeof === t ? (J = "<" + (O(a.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : J = typeof a, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", J, j);
}
var Z = qt(a, p, w, M, B);
if (Z == null)
return Z;
if (L) {
var ke = p.children;
if (ke !== void 0)
if (k)
if (We(ke)) {
for (var et = 0; et < ke.length; et++)
we(ke[et], a);
Object.freeze && Object.freeze(ke);
} else
y("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
we(ke, a);
}
return a === r ? Xe(Z) : Ve(Z), Z;
}
}
function Ke(a, p, w) {
return qe(a, p, w, !0);
}
function Ot(a, p, w) {
return qe(a, p, w, !1);
}
var Ge = Ot, Je = Ke;
dt.Fragment = r, dt.jsx = Ge, dt.jsxs = Je;
}()), dt;
}
(function(e) {
process.env.NODE_ENV === "production" ? e.exports = hr() : e.exports = vr();
})(gr);
var je = /* @__PURE__ */ ((e) => (e.table = "table", e.cell = "cell", e))(je || {});
function te(e) {
return Object.keys(e);
}
const pr = "acrool-react-table__paginate", br = "acrool-react-table__paginate-info", mr = "acrool-react-table__paginate-limit", yr = "acrool-react-table__limit", wr = "acrool-react-table__paginate-page-ul", xr = "acrool-react-table__paginate-page-li", Sr = "acrool-react-table__paginate-page-picker", Cr = "acrool-react-table__paginate-page-nav", Rr = "acrool-react-table__root", Dr = "acrool-react-table__footer-container", Er = "acrool-react-table__title-sort", _r = "acrool-react-table__sort-column", Tr = "acrool-react-table__cellDetailTr", kr = "acrool-react-table__cellTd", Ir = "acrool-react-table__dragHandle", Or = "acrool-react-table__loading-mask-wrapper", Pr = "acrool-react-table__not-data", jr = "acrool-react-table__not-data-desc", Ar = "acrool-react-table__not-data-title", U = {
paginate: pr,
"paginate-info": "acrool-react-table__paginate-info",
paginateInfo: br,
"paginate-limit": "acrool-react-table__paginate-limit",
paginateLimit: mr,
limit: yr,
"paginate-page-ul": "acrool-react-table__paginate-page-ul",
paginatePageUl: wr,
"paginate-page-li": "acrool-react-table__paginate-page-li",
paginatePageLi: xr,
"paginate-page-picker": "acrool-react-table__paginate-page-picker",
paginatePagePicker: Sr,
"paginate-page-nav": "acrool-react-table__paginate-page-nav",
paginatePageNav: Cr,
root: Rr,
"footer-container": "acrool-react-table__footer-container",
footerContainer: Dr,
"title-sort": "acrool-react-table__title-sort",
titleSort: Er,
"sort-column": "acrool-react-table__sort-column",
sortColumn: _r,
cellDetailTr: Tr,
cellTd: kr,
dragHandle: Ir,
"loading-mask-wrapper": "acrool-react-table__loading-mask-wrapper",
loadingMaskWrapper: Or,
"not-data": "acrool-react-table__not-data",
notData: Pr,
"not-data-desc": "acrool-react-table__not-data-desc",
notDataDesc: jr,
"not-data-title": "acrool-react-table__not-data-title",
notDataTitle: Ar
};
function Nr() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return W(
() => (r) => {
t.forEach((i) => i(r));
},
// eslint-disable-next-line react-hooks/exhaustive-deps
t
);
}
const zt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
function nt(e) {
const t = Object.prototype.toString.call(e);
return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
t === "[object global]";
}
function cn(e) {
return "nodeType" in e;
}
function xe(e) {
var t, n;
return e ? nt(e) ? e : cn(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
}
function ln(e) {
const {
Document: t
} = xe(e);
return e instanceof t;
}
function wt(e) {
return nt(e) ? !1 : e instanceof xe(e).HTMLElement;
}
function Nn(e) {
return e instanceof xe(e).SVGElement;
}
function rt(e) {
return e ? nt(e) ? e.document : cn(e) ? ln(e) ? e : wt(e) || Nn(e) ? e.ownerDocument : document : document : document;
}
const Ae = zt ? ur : Y;
function un(e) {
const t = H(e);
return Ae(() => {
t.current = e;
}), ee(function() {
for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++)
r[i] = arguments[i];
return t.current == null ? void 0 : t.current(...r);
}, []);
}
function Lr() {
const e = H(null), t = ee((r, i) => {
e.current = setInterval(r, i);
}, []), n = ee(() => {
e.current !== null && (clearInterval(e.current), e.current = null);
}, []);
return [t, n];
}
function vt(e, t) {
t === void 0 && (t = [e]);
const n = H(e);
return Ae(() => {
n.current !== e && (n.current = e);
}, t), n;
}
function xt(e, t) {
const n = H();
return W(
() => {
const r = e(n.current);
return n.current = r, r;
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[...t]
);
}
function Lt(e) {
const t = un(e), n = H(null), r = ee(
(i) => {
i !== n.current && (t == null || t(i, n.current)), n.current = i;
},
//eslint-disable-next-line
[]
);
return [n, r];
}
function tn(e) {
const t = H();
return Y(() => {
t.current = e;
}, [e]), t.current;
}
let Gt = {};
function St(e, t) {
return W(() => {
if (t)
return t;
const n = Gt[e] == null ? 0 : Gt[e] + 1;
return Gt[e] = n, e + "-" + n;
}, [e, t]);
}
function Ln(e) {
return function(t) {
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
r[i - 1] = arguments[i];
return r.reduce((o, s) => {
const c = Object.entries(s);
for (const [l, f] of c) {
const d = o[l];
d != null && (o[l] = d + e * f);
}
return o;
}, {
...t
});
};
}
const tt = /* @__PURE__ */ Ln(1), pt = /* @__PURE__ */ Ln(-1);
function Fr(e) {
return "clientX" in e && "clientY" in e;
}
function dn(e) {
if (!e)
return !1;
const {
KeyboardEvent: t
} = xe(e.target);
return t && e instanceof t;
}
function Mr(e) {
if (!e)
return !1;
const {
TouchEvent: t
} = xe(e.target);
return t && e instanceof t;
}
function nn(e) {
if (Mr(e)) {
if (e.touches && e.touches.length) {
const {
clientX: t,
clientY: n
} = e.touches[0];
return {
x: t,
y: n
};
} else if (e.changedTouches && e.changedTouches.length) {
const {
clientX: t,
clientY: n
} = e.changedTouches[0];
return {
x: t,
y: n
};
}
}
return Fr(e) ? {
x: e.clientX,
y: e.clientY
} : null;
}
const bt = /* @__PURE__ */ Object.freeze({
Translate: {
toString(e) {
if (!e)
return;
const {
x: t,
y: n
} = e;
return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
}
},
Scale: {
toString(e) {
if (!e)
return;
const {
scaleX: t,
scaleY: n
} = e;
return "scaleX(" + t + ") scaleY(" + n + ")";
}
},
Transform: {
toString(e) {
if (e)
return [bt.Translate.toString(e), bt.Scale.toString(e)].join(" ");
}
},
Transition: {
toString(e) {
let {
property: t,
duration: n,
easing: r
} = e;
return t + " " + n + "ms " + r;
}
}
}), xn = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
function $r(e) {
return e.matches(xn) ? e : e.querySelector(xn);
}
const zr = {
display: "none"
};
function Br(e) {
let {
id: t,
value: n
} = e;
return se.createElement("div", {
id: t,
style: zr
}, n);
}
function Wr(e) {
let {
id: t,
announcement: n,
ariaLiveType: r = "assertive"
} = e;
const i = {
position: "fixed",
width: 1,
height: 1,
margin: -1,
border: 0,
padding: 0,
overflow: "hidden",
clip: "rect(0 0 0 0)",
clipPath: "inset(100%)",
whiteSpace: "nowrap"
};
return se.createElement("div", {
id: t,
style: i,
role: "status",
"aria-live": r,
"aria-atomic": !0
}, n);
}
function Yr() {
const [e, t] = Re("");
return {
announce: ee((r) => {
r != null && t(r);
}, []),
announcement: e
};
}
const Fn = /* @__PURE__ */ yt(null);
function Hr(e) {
const t = Ze(Fn);
Y(() => {
if (!t)
throw new Error("useDndMonitor must be used within a children of <DndContext>");
return t(e);
}, [e, t]);
}
function Ur() {
const [e] = Re(() => /* @__PURE__ */ new Set()), t = ee((r) => (e.add(r), () => e.delete(r)), [e]);
return [ee((r) => {
let {
type: i,
event: o
} = r;
e.forEach((s) => {
var c;
return (c = s[i]) == null ? void 0 : c.call(s, o);
});
}, [e]), t];
}
const Vr = {
draggable: `
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`
}, Xr = {
onDragStart(e) {
let {
active: t
} = e;
return "Picked up draggable item " + t.id + ".";
},
onDragOver(e) {
let {
active: t,
over: n
} = e;
return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
},
onDragEnd(e) {
let {
active: t,
over: n
} = e;
return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
},
onDragCancel(e) {
let {
active: t
} = e;
return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
}
};
function qr(e) {
let {
announcements: t = Xr,
container: n,
hiddenTextDescribedById: r,
screenReaderInstructions: i = Vr
} = e;
const {
announce: o,
announcement: s
} = Yr(), c = St("DndLiveRegion"), [l, f] = Re(!1);
if (Y(() => {
f(!0);
}, []), Hr(W(() => ({
onDragStart(u) {
let {
active: h
} = u;
o(t.onDragStart({
active: h
}));
},
onDragMove(u) {
let {
active: h,
over: g
} = u;
t.onDragMove && o(t.onDragMove({
active: h,
over: g
}));
},
onDragOver(u) {
let {
active: h,
over: g
} = u;
o(t.onDragOver({
active: h,
over: g
}));
},
onDragEnd(u) {
let {
active: h,
over: g
} = u;
o(t.onDragEnd({
active: h,
over: g
}));
},
onDragCancel(u) {
let {
active: h,
over: g
} = u;
o(t.onDragCancel({
active: h,
over: g
}));
}
}), [o, t])), !l)
return null;
const d = se.createElement(se.Fragment, null, se.createElement(Br, {
id: r,
value: i.draggable
}), se.createElement(Wr, {
id: c,
announcement: s
}));
return n ? fr(d, n) : d;
}
var K;
(function(e) {
e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
})(K || (K = {}));
function Ft() {
}
function Sn(e, t) {
return W(
() => ({
sensor: e,
options: t ?? {}
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[e, t]
);
}
function Gr() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return W(
() => [...t].filter((r) => r != null),
// eslint-disable-next-line react-hooks/exhaustive-deps
[...t]
);
}
const Ne = /* @__PURE__ */ Object.freeze({
x: 0,
y: 0
});
function Mn(e, t) {
return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
}
function $n(e, t) {
let {
data: {
value: n
}
} = e, {
data: {
value: r
}
} = t;
return n - r;
}
function Jr(e, t) {
let {
data: {
value: n
}
} = e, {
data: {
value: r
}
} = t;
return r - n;
}
function Cn(e) {
let {
left: t,
top: n,
height: r,
width: i
} = e;
return [{
x: t,
y: n
}, {
x: t + i,
y: n
}, {
x: t,
y: n + r
}, {
x: t + i,
y: n + r
}];
}
function zn(e, t) {
if (!e || e.length === 0)
return null;
const [n] = e;
return t ? n[t] : n;
}
function Rn(e, t, n) {
return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
x: t + e.width * 0.5,
y: n + e.height * 0.5
};
}
const Zr = (e) => {
let {
collisionRect: t,
droppableRects: n,
droppableContainers: r
} = e;
const i = Rn(t, t.left, t.top), o = [];
for (const s of r) {
const {
id: c
} = s, l = n.get(c);
if (l) {
const f = Mn(Rn(l), i);
o.push({
id: c,
data: {
droppableContainer: s,
value: f
}
});
}
}
return o.sort($n);
}, Qr = (e) => {
let {
collisionRect: t,
droppableRects: n,
droppableContainers: r
} = e;
const i = Cn(t), o = [];
for (const s of r) {
const {
id: c
} = s, l = n.get(c);
if (l) {
const f = Cn(l), d = i.reduce((h, g, b) => h + Mn(f[b], g), 0), u = Number((d / 4).toFixed(4));
o.push({
id: c,
data: {
droppableContainer: s,
value: u
}
});
}
}
return o.sort($n);
};
function Kr(e, t) {
const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), i = Math.min(t.left + t.width, e.left + e.width), o = Math.min(t.top + t.height, e.top + e.height), s = i - r, c = o - n;
if (r < i && n < o) {
const l = t.width * t.height, f = e.width * e.height, d = s * c, u = d / (l + f - d);
return Number(u.toFixed(4));
}
return 0;
}
const eo = (e) => {
let {
collisionRect: t,
droppableRects: n,
droppableContainers: r
} = e;
const i = [];
for (const o of r) {
const {
id: s
} = o, c = n.get(s);
if (c) {
const l = Kr(c, t);
l > 0 && i.push({
id: s,
data: {
droppableContainer: o,
value: l
}
});
}
}
return i.sort(Jr);
};
function to(e, t, n) {
return {
...e,
scaleX: t && n ? t.width / n.width : 1,
scaleY: t && n ? t.height / n.height : 1
};
}
function Bn(e, t) {
return e && t ? {
x: e.left - t.left,
y: e.top - t.top
} : Ne;
}
function no(e) {
return function(n) {
for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
i[o - 1] = arguments[o];
return i.reduce((s, c) => ({
...s,
top: s.top + e * c.y,
bottom: s.bottom + e * c.y,
left: s.left + e * c.x,
right: s.right + e * c.x
}), {
...n
});
};
}
const ro = /* @__PURE__ */ no(1);
function oo(e) {
if (e.startsWith("matrix3d(")) {
const t = e.slice(9, -1).split(/, /);
return {
x: +t[12],
y: +t[13],
scaleX: +t[0],
scaleY: +t[5]
};
} else if (e.startsWith("matrix(")) {
const t = e.slice(7, -1).split(/, /);
return {
x: +t[4],
y: +t[5],
scaleX: +t[0],
scaleY: +t[3]
};
}
return null;
}
function io(e, t, n) {
const r = oo(t);
if (!r)
return e;
const {
scaleX: i,
scaleY: o,
x: s,
y: c
} = r, l = e.left - s - (1 - i) * parseFloat(n), f = e.top - c - (1 - o) * parseFloat(n.slice(n.indexOf(" ") + 1)), d = i ? e.width / i : e.width, u = o ? e.height / o : e.height;
return {
width: d,
height: u,
top: f,
right: l + d,
bottom: f + u,
left: l
};
}
const ao = {
ignoreTransform: !1
};
function ot(e, t) {
t === void 0 && (t = ao);
let n = e.getBoundingClientRect();
if (t.ignoreTransform) {
const {
transform: f,
transformOrigin: d
} = xe(e).getComputedStyle(e);
f && (n = io(n, f, d));
}
const {
top: r,
left: i,
width: o,
height: s,
bottom: c,
right: l
} = n;
return {
top: r,
left: i,
width: o,
height: s,
bottom: c,
right: l
};
}
function Dn(e) {
return ot(e, {
ignoreTransform: !0
});
}
function so(e) {
const t = e.innerWidth, n = e.innerHeight;
return {
top: 0,
left: 0,
right: t,
bottom: n,
width: t,
height: n
};
}
function co(e, t) {
return t === void 0 && (t = xe(e).getComputedStyle(e)), t.position === "fixed";
}
function lo(e, t) {
t === void 0 && (t = xe(e).getComputedStyle(e));
const n = /(auto|scroll|overlay)/;
return ["overflow", "overflowX", "overflowY"].some((i) => {
const o = t[i];
return typeof o == "string" ? n.test(o) : !1;
});
}
function Bt(e, t) {
const n = [];
function r(i) {
if (t != null && n.length >= t || !i)
return n;
if (ln(i) && i.scrollingElement != null && !n.includes(i.scrollingElement))
return n.push(i.scrollingElement), n;
if (!wt(i) || Nn(i) || n.includes(i))
return n;
const o = xe(e).getComputedStyle(i);
return i !== e && lo(i, o) && n.push(i), co(i, o) ? n : r(i.parentNode);
}
return e ? r(e) : n;
}
function Wn(e) {
const [t] = Bt(e, 1);
return t ?? null;
}
function Jt(e) {
return !zt || !e ? null : nt(e) ? e : cn(e) ? ln(e) || e === rt(e).scrollingElement ? window : wt(e) ? e : null : null;
}
function Yn(e) {
return nt(e) ? e.scrollX : e.scrollLeft;
}
function Hn(e) {
return nt(e) ? e.scrollY : e.scrollTop;
}
function rn(e) {
return {
x: Yn(e),
y: Hn(e)
};
}
var ne;
(function(e) {
e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
})(ne || (ne = {}));
function Un(e) {
return !zt || !e ? !1 : e === document.scrollingElement;
}
function Vn(e) {
const t = {
x: 0,
y: 0
}, n = Un(e) ? {
height: window.innerHeight,
width: window.innerWidth
} : {
height: e.clientHeight,
width: e.clientWidth
}, r = {
x: e.scrollWidth - n.width,
y: e.scrollHeight - n.height
}, i = e.scrollTop <= t.y, o = e.scrollLeft <= t.x, s = e.scrollTop >= r.y, c = e.scrollLeft >= r.x;
return {
isTop: i,
isLeft: o,
isBottom: s,
isRight: c,
maxScroll: r,
minScroll: t
};
}
const uo = {
x: 0.2,
y: 0.2
};
function fo(e, t, n, r, i) {
let {
top: o,
left: s,
right: c,
bottom: l
} = n;
r === void 0 && (r = 10), i === void 0 && (i = uo);
const {
isTop: f,
isBottom: d,
isLeft: u,
isRight: h
} = Vn(e), g = {
x: 0,
y: 0
}, b = {
x: 0,
y: 0
}, v = {
height: t.height * i.y,
width: t.width * i.x
};
return !f && o <= t.top + v.height ? (g.y = ne.Backward, b.y = r * Math.abs((t.top + v.height - o) / v.height)) : !d && l >= t.bottom - v.height && (g.y = ne.Forward, b.y = r * Math.abs((t.bottom - v.height - l) / v.height)), !h && c >= t.right - v.width ? (g.x = ne.Forward, b.x = r * Math.abs((t.right - v.width - c) / v.width)) : !u && s <= t.left + v.width && (g.x = ne.Backward, b.x = r * Math.abs((t.left + v.width - s) / v.width)), {
direction: g,
speed: b
};
}
function go(e) {
if (e === document.scrollingElement) {
const {
innerWidth: o,
innerHeight: s
} = window;
return {
top: 0,
left: 0,
right: o,
bottom: s,
width: o,
height: s
};
}
const {
top: t,
left: n,
right: r,
bottom: i
} = e.getBoundingClientRect();
return {
top: t,
left: n,
right: r,
bottom: i,
width: e.clientWidth,
height: e.clientHeight
};
}
function Xn(e) {
return e.reduce((t, n) => tt(t, rn(n)), Ne);
}
function ho(e) {
return e.reduce((t, n) => t + Yn(n), 0);
}
function vo(e) {
return e.reduce((t, n) => t + Hn(n), 0);
}
function po(e, t) {
if (t === void 0 && (t = ot), !e)
return;
const {
top: n,
left: r,
bottom: i,
right: o
} = t(e);
Wn(e) && (i <= 0 || o <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
block: "center",
inline: "center"
});
}
const bo = [["x", ["left", "right"], ho], ["y", ["top", "bottom"], vo]];
class fn {
constructor(t, n) {
this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
const r = Bt(n), i = Xn(r);
this.rect = {
...t
}, this.width = t.width, this.height = t.height;
for (const [o, s, c] of bo)
for (const l of s)
Object.defineProperty(this, l, {
get: () => {
const f = c(r), d = i[o] - f;
return this.rect[l] + d;
},
enumerable: !0
});
Object.defineProperty(this, "rect", {
enumerable: !1
});
}
}
class ft {
constructor(t) {
this.target = void 0, this.listeners = [], this.removeAll = () => {
this.listeners.forEach((n) => {
var r;
return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
});
}, this.target = t;
}
add(t, n, r) {
var i;
(i = this.target) == null || i.addEventListener(t, n, r), this.listeners.push([t, n, r]);
}
}
function mo(e) {
const {
EventTarget: t
} = xe(e);
return e instanceof t ? e : rt(e);
}
function Zt(e, t) {
const n = Math.abs(e.x), r = Math.abs(e.y);
return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
}
var Ie;
(function(e) {
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
})(Ie || (Ie = {}));
function En(e) {
e.preventDefault();
}
function yo(e) {
e.stopPropagation();
}
var F;
(function(e) {
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter";
})(F || (F = {}));
const qn = {
start: [F.Space, F.Enter],
cancel: [F.Esc],
end: [F.Space, F.Enter]
}, wo = (e, t) => {
let {
currentCoordinates: n
} = t;
switch (e.code) {
case F.Right:
return {
...n,
x: n.x + 25
};
case F.Left:
return {
...n,
x: n.x - 25
};
case F.Down:
return {
...n,
y: n.y + 25
};
case F.Up:
return {
...n,
y: n.y - 25
};
}
};
class gn {
constructor(t) {
this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
const {
event: {
target: n
}
} = t;
this.props = t, this.listeners = new ft(rt(n)), this.windowListeners = new ft(xe(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
}
attach() {
this.handleStart(), this.windowListeners.add(Ie.Resize, this.handleCancel), this.windowListeners.add(Ie.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Ie.Keydown, this.handleKeyDown));
}
handleStart() {
const {
activeNode: t,
onStart: n
} = this.props, r = t.node.current;
r && po(r), n(Ne);
}
handleKeyDown(t) {
if (dn(t)) {
const {
active: n,
context: r,
options: i
} = this.props, {
keyboardCodes: o = qn,
coordinateGetter: s = wo,
scrollBehavior: c = "smooth"
} = i, {
code: l
} = t;
if (o.end.includes(l)) {
this.handleEnd(t);
return;
}
if (o.cancel.includes(l)) {
this.handleCancel(t);
return;
}
const {
collisionRect: f
} = r.current, d = f ? {
x: f.left,
y: f.top
} : Ne;
this.referenceCoordinates || (this.referenceCoordinates = d);
const u = s(t, {
active: n,
context: r.current,
currentCoordinates: d
});
if (u) {
const h = pt(u, d), g = {
x: 0,
y: 0
}, {
scrollableAncestors: b
} = r.current;
for (const v of b) {
const x = t.code, {
isTop: m,
isRight: y,
isLeft: C,
isBottom: _,
maxScroll: R,
minScroll: E
} = Vn(v), D = go(v), T = {
x: Math.min(x === F.Right ? D.right - D.width / 2 : D.right, Math.max(x === F.Right ? D.left : D.left + D.width / 2, u.x)),
y: Math.min(x === F.Down ? D.bottom - D.height / 2 : D.bottom, Math.max(x === F.Down ? D.top : D.top + D.height / 2, u.y))
}, I = x === F.Right && !y || x === F.Left && !C, $ = x === F.Down && !_ || x === F.Up && !m;
if (I && T.x !== u.x) {
const P = v.scrollLeft + h.x, N = x === F.Right && P <= R.x || x === F.Left && P >= E.x;
if (N && !h.y) {
v.scrollTo({
left: P,
behavior: c
});
return;
}
N ? g.x = v.scrollLeft - P : g.x = x === F.Right ? v.scrollLeft - R.x : v.scrollLeft - E.x, g.x && v.scrollBy({
left: -g.x,
behavior: c
});
break;
} else if ($ && T.y !== u.y) {
const P = v.scrollTop + h.y, N = x === F.Down && P <= R.y || x === F.Up && P >= E.y;
if (N && !h.x) {
v.scrollTo({
top: P,
behavior: c
});
return;
}
N ? g.y = v.scrollTop - P : g.y = x === F.Down ? v.scrollTop - R.y : v.scrollTop - E.y, g.y && v.scrollBy({
top: -g.y,
behavior: c
});
break;
}
}
this.handleMove(t, tt(pt(u, this.referenceCoordinates), g));
}
}
}
handleMove(t, n) {
const {
onMove: r
} = this.props;
t.preventDefault(), r(n);
}
handleEnd(t) {
const {
onEnd: n
} = this.props;
t.preventDefault(), this.detach(), n();
}
handleCancel(t) {
const {
onCancel: n
} = this.props;
t.preventDefault(), this.detach(), n();
}
detach() {
this.listeners.removeAll(), this.windowListeners.removeAll();
}
}
gn.activators = [{
eventName: "onKeyDown",
handler: (e, t, n) => {
let {
keyboardCodes: r = qn,
onActivation: i
} = t, {
active: o
} = n;
const {
code: s
} = e.nativeEvent;
if (r.start.includes(s)) {
const c = o.activatorNode.current;
return c && e.target !== c ? !1 : (e.preventDefault(), i == null || i({
event: e.nativeEvent
}), !0);
}
return !1;
}
}];
function _n(e) {
return !!(e && "distance" in e);
}
function Tn(e) {
return !!(e && "delay" in e);
}
class hn {
constructor(t, n, r) {
var i;
r === void 0 && (r = mo(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
const {
event: o
} = t, {
target: s
} = o;
this.props = t, this.events = n, this.document = rt(s), this.documentListeners = new ft(this.document), this.listeners = new ft(r), this.windowListeners = new ft(xe(s)), this.initialCoordinates = (i = nn(o)) != null ? i : Ne, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
}
attach() {
const {
events: t,
props: {
options: {
activationConstraint: n,
bypassActivationConstraint: r
}
}
} = this;
if (this.listeners.add(t.move.name, this.handleMove, {
passive: !1
}), this.listeners.add(t.end.name, this.handleEnd), this.windowListeners.add(Ie.Resize, this.handleCancel), this.windowListeners.add(Ie.DragStart, En), this.windowListeners.add(Ie.VisibilityChange, this.handleCancel), this.windowListeners.add(Ie.ContextMenu, En), this.documentListeners.add(Ie.Keydown, this.handleKeydown), n) {
if (r != null && r({
event: this.props.event,
activeNode: this.props.activeNode,
options: this.props.options
}))
return this.handleStart();
if (Tn(n)) {
this.timeoutId = setTimeout(this.handleStart, n.delay);
return;
}
if (_n(n))
return;
}
this.handleStart();
}
detach() {
this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
}
handleStart() {
const {
initialCoordinates: t
} = this, {
onStart: n
} = this.props;
t && (this.activated =