jira-task-management
Version:
Reusable Jira-like task management UI components built with React, including Mytasks, TeamMembers, and more.
11,247 lines • 408 kB
JavaScript
var xo = Object.defineProperty;
var jo = (e, n, t) => n in e ? xo(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
var Da = (e, n, t) => jo(e, typeof n != "symbol" ? n + "" : n, t);
import * as V from "react";
import be, { useState as Z, useEffect as xe, useRef as Ue, useMemo as ct, isValidElement as On, cloneElement as Nn, Children as wo, useContext as yn, useCallback as Qe, useLayoutEffect as Co, forwardRef as Kr, Component as Eo, createContext as To } from "react";
import { Link as sr, BrowserRouter as So, useLocation as Po, Routes as Oo, Route as Ot, Navigate as No, useParams as ko, useNavigate as _o } from "react-router-dom";
import { Image as Ma, ListGroup as At, Nav as or, Row as Me, Col as ye, Dropdown as Ze, Form as O, Badge as Wi, Modal as me, Button as Te, Container as ht, OverlayTrigger as Ao, Tooltip as Ro, Card as Fe, Table as Ui, Alert as Fa } from "react-bootstrap";
import { Droppable as Io, Draggable as Do, DragDropContext as qi } from "react-beautiful-dnd";
import { useReactTable as Mo, getCoreRowModel as Fo, flexRender as La } from "@tanstack/react-table";
import Lo from "@fullcalendar/react";
import $o from "@fullcalendar/daygrid";
import Vo from "@fullcalendar/interaction";
import { AnimatePresence as Yi, motion as Se } from "framer-motion";
import Yt, { unstable_batchedUpdates as Bo } from "react-dom";
import zo from "react-quill";
function Ho(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Cn = { exports: {} }, Bt = {};
/**
* @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 $a;
function Wo() {
if ($a) return Bt;
$a = 1;
var e = be, n = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
function o(l, c, u) {
var d, f = {}, p = null, m = null;
u !== void 0 && (p = "" + u), c.key !== void 0 && (p = "" + c.key), c.ref !== void 0 && (m = c.ref);
for (d in c) r.call(c, d) && !s.hasOwnProperty(d) && (f[d] = c[d]);
if (l && l.defaultProps) for (d in c = l.defaultProps, c) f[d] === void 0 && (f[d] = c[d]);
return { $$typeof: n, type: l, key: p, ref: m, props: f, _owner: a.current };
}
return Bt.Fragment = t, Bt.jsx = o, Bt.jsxs = o, Bt;
}
var zt = {};
/**
* @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 Va;
function Uo() {
return Va || (Va = 1, process.env.NODE_ENV !== "production" && function() {
var e = be, n = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), g = Symbol.iterator, y = "@@iterator";
function x(h) {
if (h === null || typeof h != "object")
return null;
var R = g && h[g] || h[y];
return typeof R == "function" ? R : null;
}
var j = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function C(h) {
{
for (var R = arguments.length, G = new Array(R > 1 ? R - 1 : 0), ae = 1; ae < R; ae++)
G[ae - 1] = arguments[ae];
E("error", h, G);
}
}
function E(h, R, G) {
{
var ae = j.ReactDebugCurrentFrame, he = ae.getStackAddendum();
he !== "" && (R += "%s", G = G.concat([he]));
var je = G.map(function(pe) {
return String(pe);
});
je.unshift("Warning: " + R), Function.prototype.apply.call(console[h], console, je);
}
}
var I = !1, b = !1, $ = !1, k = !1, L = !1, z;
z = Symbol.for("react.module.reference");
function A(h) {
return !!(typeof h == "string" || typeof h == "function" || h === r || h === s || L || h === a || h === u || h === d || k || h === m || I || b || $ || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === f || h.$$typeof === o || h.$$typeof === l || h.$$typeof === c || // 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.
h.$$typeof === z || h.getModuleId !== void 0));
}
function W(h, R, G) {
var ae = h.displayName;
if (ae)
return ae;
var he = R.displayName || R.name || "";
return he !== "" ? G + "(" + he + ")" : G;
}
function te(h) {
return h.displayName || "Context";
}
function ne(h) {
if (h == null)
return null;
if (typeof h.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function")
return h.displayName || h.name || null;
if (typeof h == "string")
return h;
switch (h) {
case r:
return "Fragment";
case t:
return "Portal";
case s:
return "Profiler";
case a:
return "StrictMode";
case u:
return "Suspense";
case d:
return "SuspenseList";
}
if (typeof h == "object")
switch (h.$$typeof) {
case l:
var R = h;
return te(R) + ".Consumer";
case o:
var G = h;
return te(G._context) + ".Provider";
case c:
return W(h, h.render, "ForwardRef");
case f:
var ae = h.displayName || null;
return ae !== null ? ae : ne(h.type) || "Memo";
case p: {
var he = h, je = he._payload, pe = he._init;
try {
return ne(pe(je));
} catch {
return null;
}
}
}
return null;
}
var H = Object.assign, X = 0, re, oe, q, le, S, B, ee;
function D() {
}
D.__reactDisabledLog = !0;
function N() {
{
if (X === 0) {
re = console.log, oe = console.info, q = console.warn, le = console.error, S = console.group, B = console.groupCollapsed, ee = console.groupEnd;
var h = {
configurable: !0,
enumerable: !0,
value: D,
writable: !0
};
Object.defineProperties(console, {
info: h,
log: h,
warn: h,
error: h,
group: h,
groupCollapsed: h,
groupEnd: h
});
}
X++;
}
}
function v() {
{
if (X--, X === 0) {
var h = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: H({}, h, {
value: re
}),
info: H({}, h, {
value: oe
}),
warn: H({}, h, {
value: q
}),
error: H({}, h, {
value: le
}),
group: H({}, h, {
value: S
}),
groupCollapsed: H({}, h, {
value: B
}),
groupEnd: H({}, h, {
value: ee
})
});
}
X < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var T = j.ReactCurrentDispatcher, P;
function M(h, R, G) {
{
if (P === void 0)
try {
throw Error();
} catch (he) {
var ae = he.stack.trim().match(/\n( *(at )?)/);
P = ae && ae[1] || "";
}
return `
` + P + h;
}
}
var J = !1, _;
{
var K = typeof WeakMap == "function" ? WeakMap : Map;
_ = new K();
}
function w(h, R) {
if (!h || J)
return "";
{
var G = _.get(h);
if (G !== void 0)
return G;
}
var ae;
J = !0;
var he = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var je;
je = T.current, T.current = null, N();
try {
if (R) {
var pe = function() {
throw Error();
};
if (Object.defineProperty(pe.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(pe, []);
} catch (ze) {
ae = ze;
}
Reflect.construct(h, [], pe);
} else {
try {
pe.call();
} catch (ze) {
ae = ze;
}
h.call(pe.prototype);
}
} else {
try {
throw Error();
} catch (ze) {
ae = ze;
}
h();
}
} catch (ze) {
if (ze && ae && typeof ze.stack == "string") {
for (var de = ze.stack.split(`
`), Ve = ae.stack.split(`
`), Pe = de.length - 1, ke = Ve.length - 1; Pe >= 1 && ke >= 0 && de[Pe] !== Ve[ke]; )
ke--;
for (; Pe >= 1 && ke >= 0; Pe--, ke--)
if (de[Pe] !== Ve[ke]) {
if (Pe !== 1 || ke !== 1)
do
if (Pe--, ke--, ke < 0 || de[Pe] !== Ve[ke]) {
var Ge = `
` + de[Pe].replace(" at new ", " at ");
return h.displayName && Ge.includes("<anonymous>") && (Ge = Ge.replace("<anonymous>", h.displayName)), typeof h == "function" && _.set(h, Ge), Ge;
}
while (Pe >= 1 && ke >= 0);
break;
}
}
} finally {
J = !1, T.current = je, v(), Error.prepareStackTrace = he;
}
var Pt = h ? h.displayName || h.name : "", bt = Pt ? M(Pt) : "";
return typeof h == "function" && _.set(h, bt), bt;
}
function ie(h, R, G) {
return w(h, !1);
}
function _e(h) {
var R = h.prototype;
return !!(R && R.isReactComponent);
}
function Ee(h, R, G) {
if (h == null)
return "";
if (typeof h == "function")
return w(h, _e(h));
if (typeof h == "string")
return M(h);
switch (h) {
case u:
return M("Suspense");
case d:
return M("SuspenseList");
}
if (typeof h == "object")
switch (h.$$typeof) {
case c:
return ie(h.render);
case f:
return Ee(h.type, R, G);
case p: {
var ae = h, he = ae._payload, je = ae._init;
try {
return Ee(je(he), R, G);
} catch {
}
}
}
return "";
}
var Re = Object.prototype.hasOwnProperty, st = {}, Y = j.ReactDebugCurrentFrame;
function Q(h) {
if (h) {
var R = h._owner, G = Ee(h.type, h._source, R ? R.type : null);
Y.setExtraStackFrame(G);
} else
Y.setExtraStackFrame(null);
}
function fe(h, R, G, ae, he) {
{
var je = Function.call.bind(Re);
for (var pe in h)
if (je(h, pe)) {
var de = void 0;
try {
if (typeof h[pe] != "function") {
var Ve = Error((ae || "React class") + ": " + G + " type `" + pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw Ve.name = "Invariant Violation", Ve;
}
de = h[pe](R, pe, ae, G, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (Pe) {
de = Pe;
}
de && !(de instanceof Error) && (Q(he), C("%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).", ae || "React class", G, pe, typeof de), Q(null)), de instanceof Error && !(de.message in st) && (st[de.message] = !0, Q(he), C("Failed %s type: %s", G, de.message), Q(null));
}
}
}
var Ie = Array.isArray;
function yt(h) {
return Ie(h);
}
function dt(h) {
{
var R = typeof Symbol == "function" && Symbol.toStringTag, G = R && h[Symbol.toStringTag] || h.constructor.name || "Object";
return G;
}
}
function tr(h) {
try {
return Tt(h), !1;
} catch {
return !0;
}
}
function Tt(h) {
return "" + h;
}
function Ea(h) {
if (tr(h))
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", dt(h)), Tt(h);
}
var Ta = j.ReactCurrentOwner, to = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Sa, Pa;
function no(h) {
if (Re.call(h, "ref")) {
var R = Object.getOwnPropertyDescriptor(h, "ref").get;
if (R && R.isReactWarning)
return !1;
}
return h.ref !== void 0;
}
function ro(h) {
if (Re.call(h, "key")) {
var R = Object.getOwnPropertyDescriptor(h, "key").get;
if (R && R.isReactWarning)
return !1;
}
return h.key !== void 0;
}
function ao(h, R) {
typeof h.ref == "string" && Ta.current;
}
function io(h, R) {
{
var G = function() {
Sa || (Sa = !0, C("%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)", R));
};
G.isReactWarning = !0, Object.defineProperty(h, "key", {
get: G,
configurable: !0
});
}
}
function so(h, R) {
{
var G = function() {
Pa || (Pa = !0, C("%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)", R));
};
G.isReactWarning = !0, Object.defineProperty(h, "ref", {
get: G,
configurable: !0
});
}
}
var oo = function(h, R, G, ae, he, je, pe) {
var de = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: n,
// Built-in properties that belong on the element
type: h,
key: R,
ref: G,
props: pe,
// Record the component responsible for creating this element.
_owner: je
};
return de._store = {}, Object.defineProperty(de._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(de, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: ae
}), Object.defineProperty(de, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: he
}), Object.freeze && (Object.freeze(de.props), Object.freeze(de)), de;
};
function lo(h, R, G, ae, he) {
{
var je, pe = {}, de = null, Ve = null;
G !== void 0 && (Ea(G), de = "" + G), ro(R) && (Ea(R.key), de = "" + R.key), no(R) && (Ve = R.ref, ao(R, he));
for (je in R)
Re.call(R, je) && !to.hasOwnProperty(je) && (pe[je] = R[je]);
if (h && h.defaultProps) {
var Pe = h.defaultProps;
for (je in Pe)
pe[je] === void 0 && (pe[je] = Pe[je]);
}
if (de || Ve) {
var ke = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
de && io(pe, ke), Ve && so(pe, ke);
}
return oo(h, de, Ve, he, ae, Ta.current, pe);
}
}
var nr = j.ReactCurrentOwner, Oa = j.ReactDebugCurrentFrame;
function St(h) {
if (h) {
var R = h._owner, G = Ee(h.type, h._source, R ? R.type : null);
Oa.setExtraStackFrame(G);
} else
Oa.setExtraStackFrame(null);
}
var rr;
rr = !1;
function ar(h) {
return typeof h == "object" && h !== null && h.$$typeof === n;
}
function Na() {
{
if (nr.current) {
var h = ne(nr.current.type);
if (h)
return `
Check the render method of \`` + h + "`.";
}
return "";
}
}
function co(h) {
return "";
}
var ka = {};
function uo(h) {
{
var R = Na();
if (!R) {
var G = typeof h == "string" ? h : h.displayName || h.name;
G && (R = `
Check the top-level render call using <` + G + ">.");
}
return R;
}
}
function _a(h, R) {
{
if (!h._store || h._store.validated || h.key != null)
return;
h._store.validated = !0;
var G = uo(R);
if (ka[G])
return;
ka[G] = !0;
var ae = "";
h && h._owner && h._owner !== nr.current && (ae = " It was passed a child from " + ne(h._owner.type) + "."), St(h), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', G, ae), St(null);
}
}
function Aa(h, R) {
{
if (typeof h != "object")
return;
if (yt(h))
for (var G = 0; G < h.length; G++) {
var ae = h[G];
ar(ae) && _a(ae, R);
}
else if (ar(h))
h._store && (h._store.validated = !0);
else if (h) {
var he = x(h);
if (typeof he == "function" && he !== h.entries)
for (var je = he.call(h), pe; !(pe = je.next()).done; )
ar(pe.value) && _a(pe.value, R);
}
}
}
function fo(h) {
{
var R = h.type;
if (R == null || typeof R == "string")
return;
var G;
if (typeof R == "function")
G = R.propTypes;
else if (typeof R == "object" && (R.$$typeof === c || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
R.$$typeof === f))
G = R.propTypes;
else
return;
if (G) {
var ae = ne(R);
fe(G, h.props, "prop", ae, h);
} else if (R.PropTypes !== void 0 && !rr) {
rr = !0;
var he = ne(R);
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", he || "Unknown");
}
typeof R.getDefaultProps == "function" && !R.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function po(h) {
{
for (var R = Object.keys(h.props), G = 0; G < R.length; G++) {
var ae = R[G];
if (ae !== "children" && ae !== "key") {
St(h), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", ae), St(null);
break;
}
}
h.ref !== null && (St(h), C("Invalid attribute `ref` supplied to `React.Fragment`."), St(null));
}
}
var Ra = {};
function Ia(h, R, G, ae, he, je) {
{
var pe = A(h);
if (!pe) {
var de = "";
(h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (de += " 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 = co();
Ve ? de += Ve : de += Na();
var Pe;
h === null ? Pe = "null" : yt(h) ? Pe = "array" : h !== void 0 && h.$$typeof === n ? (Pe = "<" + (ne(h.type) || "Unknown") + " />", de = " Did you accidentally export a JSX literal instead of a component?") : Pe = typeof h, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Pe, de);
}
var ke = lo(h, R, G, he, je);
if (ke == null)
return ke;
if (pe) {
var Ge = R.children;
if (Ge !== void 0)
if (ae)
if (yt(Ge)) {
for (var Pt = 0; Pt < Ge.length; Pt++)
Aa(Ge[Pt], h);
Object.freeze && Object.freeze(Ge);
} else
C("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
Aa(Ge, h);
}
if (Re.call(R, "key")) {
var bt = ne(h), ze = Object.keys(R).filter(function(bo) {
return bo !== "key";
}), ir = ze.length > 0 ? "{key: someKey, " + ze.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Ra[bt + ir]) {
var yo = ze.length > 0 ? "{" + ze.join(": ..., ") + ": ...}" : "{}";
C(`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} />`, ir, bt, yo, bt), Ra[bt + ir] = !0;
}
}
return h === r ? po(ke) : fo(ke), ke;
}
}
function mo(h, R, G) {
return Ia(h, R, G, !0);
}
function ho(h, R, G) {
return Ia(h, R, G, !1);
}
var vo = ho, go = mo;
zt.Fragment = r, zt.jsx = vo, zt.jsxs = go;
}()), zt;
}
var Ba;
function qo() {
return Ba || (Ba = 1, process.env.NODE_ENV === "production" ? Cn.exports = Wo() : Cn.exports = Uo()), Cn.exports;
}
var i = qo(), Gi = {
color: void 0,
size: void 0,
className: void 0,
style: void 0,
attr: void 0
}, za = be.createContext && /* @__PURE__ */ be.createContext(Gi), Yo = ["attr", "size", "title"];
function Go(e, n) {
if (e == null) return {};
var t = Zo(e, n), r, a;
if (Object.getOwnPropertySymbols) {
var s = Object.getOwnPropertySymbols(e);
for (a = 0; a < s.length; a++)
r = s[a], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
}
return t;
}
function Zo(e, n) {
if (e == null) return {};
var t = {};
for (var r in e)
if (Object.prototype.hasOwnProperty.call(e, r)) {
if (n.indexOf(r) >= 0) continue;
t[r] = e[r];
}
return t;
}
function Rn() {
return Rn = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Rn.apply(this, arguments);
}
function Ha(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function In(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? Ha(Object(t), !0).forEach(function(r) {
Jo(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Ha(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function Jo(e, n, t) {
return n = Ko(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
function Ko(e) {
var n = Xo(e, "string");
return typeof n == "symbol" ? n : n + "";
}
function Xo(e, n) {
if (typeof e != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (typeof r != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function Zi(e) {
return e && e.map((n, t) => /* @__PURE__ */ be.createElement(n.tag, In({
key: t
}, n.attr), Zi(n.child)));
}
function Ce(e) {
return (n) => /* @__PURE__ */ be.createElement(Qo, Rn({
attr: In({}, e.attr)
}, n), Zi(e.child));
}
function Qo(e) {
var n = (t) => {
var {
attr: r,
size: a,
title: s
} = e, o = Go(e, Yo), l = a || t.size || "1em", c;
return t.className && (c = t.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ be.createElement("svg", Rn({
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0"
}, t.attr, r, o, {
className: c,
style: In(In({
color: e.color || t.color
}, t.style), e.style),
height: l,
width: l,
xmlns: "http://www.w3.org/2000/svg"
}), s && /* @__PURE__ */ be.createElement("title", null, s), e.children);
};
return za !== void 0 ? /* @__PURE__ */ be.createElement(za.Consumer, null, (t) => n(t)) : n(Gi);
}
function el(e) {
return Ce({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M160 256a16 16 0 0 1 16-16h144V136c0-32-33.79-56-64-56H104a56.06 56.06 0 0 0-56 56v240a56.06 56.06 0 0 0 56 56h160a56.06 56.06 0 0 0 56-56V272H176a16 16 0 0 1-16-16zm299.31-11.31-80-80a16 16 0 0 0-22.62 22.62L409.37 240H320v32h89.37l-52.68 52.69a16 16 0 1 0 22.62 22.62l80-80a16 16 0 0 0 0-22.62z" }, child: [] }] })(e);
}
const tl = ({ projects: e, role: n, rolePermissions: t, userName: r, userAvatar: a, navLinks: s = [] }) => {
const [o, l] = Z(!1);
xe(() => {
var u;
l((u = t[n]) == null ? void 0 : u.canEditProjects), console.log("canManageProjects", o);
}, [n, t]);
const c = n === "admin" || n === "hr" ? e : e.filter((u) => u.members.includes(r));
return /* @__PURE__ */ i.jsxs("div", { className: "sidebar d-flex flex-column p-3 bg-white", children: [
/* @__PURE__ */ i.jsxs("div", { className: "logo-container d-flex justify-content-center align-items-center mb-4", children: [
/* @__PURE__ */ i.jsx(Ma, { src: "/jira.svg", alt: "Logo", className: "sidebar-logo-img" }),
/* @__PURE__ */ i.jsx("h1", { className: "sidebar-logo-text mb-0 p-2", children: "JIRAsss" })
] }),
/* @__PURE__ */ i.jsx("div", { className: "mb-2", children: /* @__PURE__ */ i.jsx(At, { className: "mb-2", children: /* @__PURE__ */ i.jsxs(At.Item, { className: "user-profile d-flex align-items-center justify-content-between active", children: [
/* @__PURE__ */ i.jsxs("span", { className: "user-avatar-name d-flex align-items-center", children: [
/* @__PURE__ */ i.jsx(Ma, { src: a, alt: "User Avatar", className: "user-avatar me-2" }),
r.toUpperCase()
] }),
/* @__PURE__ */ i.jsx(or.Link, { as: sr, to: "/", className: "d-flex align-items-center text-dark py-2", children: /* @__PURE__ */ i.jsx(el, { style: { fontWeight: "bold", fontSize: "1.5rem", color: "white" } }) })
] }) }) }),
/* @__PURE__ */ i.jsx(or, { defaultActiveKey: "/home", className: "sidebar-nav flex-column mb-4", children: s.map((u, d) => /* @__PURE__ */ i.jsxs(
or.Link,
{
as: sr,
to: u.path,
className: `sidebar-nav-link d-flex align-items-center text-dark py-2 ${u.name.toLowerCase().replace(/\s+/g, "-")}-link`,
children: [
u.icon && be.cloneElement(u.icon, {
className: `sidebar-nav-icon sidebar-nav-icon-${u.name.toLowerCase().replace(/\s+/g, "-")} me-3`
}),
u.name
]
},
d
)) }),
/* @__PURE__ */ i.jsxs("div", { className: "mt-auto", children: [
/* @__PURE__ */ i.jsx("div", { className: "projects-header d-flex justify-content-between align-items-center text-muted small mb-3", children: /* @__PURE__ */ i.jsx("span", { children: "PROJECTS" }) }),
/* @__PURE__ */ i.jsx(At, { children: c.map((u) => /* @__PURE__ */ i.jsxs(
At.Item,
{
className: "project-item d-flex align-items-center",
as: sr,
to: `/projects/${u.id}`,
children: [
/* @__PURE__ */ i.jsx(
"div",
{
className: "project-avatar rounded-circle d-flex justify-content-center align-items-center me-3",
style: { backgroundColor: u.color },
children: u.short
}
),
u.name
]
},
u.id
)) })
] })
] });
};
function nl(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2z" }, child: [] }, { tag: "path", attr: { d: "M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466" }, child: [] }] })(e);
}
function rl(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" }, child: [] }, { tag: "path", attr: { d: "m10.97 4.97-.02.022-3.473 4.425-2.093-2.094a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05" }, child: [] }] })(e);
}
function Wa(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708" }, child: [] }] })(e);
}
function al(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z" }, child: [] }, { tag: "path", attr: { d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0" }, child: [] }] })(e);
}
function il(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a2 2 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139q.323-.119.684-.12h5.396z" }, child: [] }] })(e);
}
function sl(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0" }, child: [] }, { tag: "path", attr: { d: "M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z" }, child: [] }] })(e);
}
function ol(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M2 2.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5zM3 3H2v1h1z" }, child: [] }, { tag: "path", attr: { d: "M5 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M5.5 7a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1zm0 4a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z" }, child: [] }, { tag: "path", attr: { fillRule: "evenodd", d: "M1.5 7a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5zM2 7h1v1H2zm0 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm1 .5H2v1h1z" }, child: [] }] })(e);
}
function nn(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4" }, child: [] }] })(e);
}
function ll(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0" }, child: [] }] })(e);
}
function cl(e) {
return Ce({ attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" }, child: [] }] })(e);
}
const Ji = ({
selectedProject: e,
setSelectedProject: n,
selectedAssignee: t,
setSelectedAssignee: r,
selectedStatus: a,
setSelectedStatus: s,
selectedDate: o,
setSelectedDate: l,
searchQuery: c,
setSearchQuery: u,
projectOptions: d,
assigneeOptions: f,
statusOptions: p,
isProjectView: m
}) => {
const [g, y] = Z(""), [x, j] = Z(0), [C, E] = Z(0), [I, b] = Z(!0), $ = ["Charles", "Jira", "Home Page", "In Progress"];
return xe(() => {
if (c.length > 0) {
y("");
return;
}
const k = $[x];
let L;
return I ? C < k.length ? L = setTimeout(() => {
y(k.slice(0, C + 1)), E(C + 1);
}, 200) : L = setTimeout(() => {
b(!1), E(C - 1);
}, 1e3) : C >= 0 ? L = setTimeout(() => {
y(k.slice(0, C)), E(C - 1);
}, 150) : L = setTimeout(() => {
j((x + 1) % $.length), E(0), b(!0);
}, 500), () => clearTimeout(L);
}, [c, C, I, x, $]), /* @__PURE__ */ i.jsxs(Me, { className: "mb-4", children: [
/* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsx("div", { className: "position-relative", children: /* @__PURE__ */ i.jsxs(Ze, { children: [
/* @__PURE__ */ i.jsxs(
Ze.Toggle,
{
variant: "outline-secondary",
size: "sm",
className: "d-flex align-items-center",
children: [
a,
" ",
/* @__PURE__ */ i.jsx(Wa, { className: "ms-1", size: 14 })
]
}
),
/* @__PURE__ */ i.jsx(Ze.Menu, { children: p.map((k) => /* @__PURE__ */ i.jsx(
Ze.Item,
{
onClick: () => s(k),
active: a === k,
children: k
},
k
)) })
] }) }) }),
/* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsx("div", { className: "position-relative", children: /* @__PURE__ */ i.jsxs(Ze, { children: [
/* @__PURE__ */ i.jsxs(
Ze.Toggle,
{
variant: "outline-secondary",
size: "sm",
className: "d-flex align-items-center",
children: [
t,
" ",
/* @__PURE__ */ i.jsx(Wa, { className: "ms-1", size: 14 })
]
}
),
/* @__PURE__ */ i.jsx(Ze.Menu, { children: f.map((k) => /* @__PURE__ */ i.jsx(
Ze.Item,
{
onClick: () => r(k),
active: t === k,
children: k
},
k
)) })
] }) }) }),
!m && /* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsx(
O.Select,
{
size: "sm",
value: e,
onChange: (k) => n(k.target.value),
className: "border rounded-md text-sm text-gray-700",
children: d.map((k) => /* @__PURE__ */ i.jsx("option", { value: k, children: k }, k))
}
) }),
/* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsx("div", { className: "position-relative", children: /* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
size: "sm",
value: o,
onChange: (k) => l(k.target.value),
className: "border rounded-md text-sm text-gray-700",
style: { padding: "0 0.5rem" }
}
) }) }),
/* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsxs("div", { className: "d-flex align-items-center border rounded-md px-3 py-1", children: [
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "text",
value: c,
onChange: (k) => u(k.target.value),
className: "bg-transparent border-0 shadow-none text-sm text-gray-500",
placeholder: g || "Search",
style: { padding: "0 0.5rem", boxShadow: "none" }
}
),
/* @__PURE__ */ i.jsx(ll, { className: "text-primary", size: 16 })
] }) })
] });
}, Ki = ({ kanbanTasks: e = {}, projects: n = [] }) => {
const t = {
Todo: "#B3EBF2",
"In Progress": "rgba(133, 209, 219, 0.6)",
"In Review": "#B6F2D1",
Done: "#C9FDF2"
}, r = (o) => {
const l = n.find((c) => c.name === o);
return l ? l.members : [];
}, a = (o) => {
if (!o) return "U";
const l = o.trim().split(" ");
return l.length === 1 ? l[0].charAt(0).toUpperCase() : (l[0].charAt(0) + l[1].charAt(0)).toUpperCase();
}, s = (o) => {
if (!o) return "";
const l = new Date(o);
return isNaN(l) ? o : l.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
};
return /* @__PURE__ */ i.jsx(Me, { className: "mt-2 g-3", children: ["Todo", "In Progress", "In Review", "Done"].map((o) => {
var l;
return /* @__PURE__ */ i.jsx(ye, { xs: 12, sm: 6, md: 3, children: /* @__PURE__ */ i.jsxs(
"div",
{
className: "border rounded p-3 h-100",
style: { backgroundColor: t[o] },
children: [
/* @__PURE__ */ i.jsxs("div", { className: "d-flex justify-content-between align-items-center mb-3", children: [
/* @__PURE__ */ i.jsx(
"strong",
{
className: "text-sm font-medium text-gray-600",
style: {
backgroundColor: "white",
padding: "2px 8px",
borderRadius: "4px",
color: "rgba(112, 104, 104, 0.7)"
},
children: o
}
),
/* @__PURE__ */ i.jsx(Wi, { style: { opacity: 0.9 }, bg: "light", text: "dark", className: "border", children: ((l = e[o]) == null ? void 0 : l.length) || 0 })
] }),
/* @__PURE__ */ i.jsx(Io, { droppableId: o, isDropDisabled: !1, children: (c) => /* @__PURE__ */ i.jsxs(
"div",
{
...c.droppableProps,
ref: c.innerRef,
style: { minHeight: "200px" },
children: [
(e[o] || []).map((u, d) => {
r(u.project);
const f = u.assignee && u.assignee.trim() !== "" ? u.assignee : "Unassigned", p = u.assignee && u.assignee.trim() !== "" ? a(u.assignee) : "U";
return /* @__PURE__ */ i.jsx(Do, { draggableId: u.id.toString(), index: d, children: (m) => /* @__PURE__ */ i.jsxs(
"div",
{
ref: m.innerRef,
...m.draggableProps,
...m.dragHandleProps,
className: "p-3 mb-2 border rounded bg-white shadow-sm",
children: [
/* @__PURE__ */ i.jsx("div", { className: "text-sm text-gray-900", children: u.title }),
/* @__PURE__ */ i.jsx("div", { className: "text-xs text-gray-500 mt-1", children: s(u.dueDate) }),
/* @__PURE__ */ i.jsxs("div", { className: "d-flex align-items-center mt-2", children: [
/* @__PURE__ */ i.jsx(
"div",
{
className: "me-2 d-flex justify-content-center align-items-center text-white",
style: {
width: "24px",
height: "24px",
borderRadius: "50%",
fontSize: "12px",
fontWeight: "bold",
userSelect: "none",
backgroundColor: "rgba(118, 104, 104, 0.5)"
},
title: f,
children: p
}
),
/* @__PURE__ */ i.jsx("div", { className: "text-sm text-gray-900", children: f })
] })
]
}
) }, u.id);
}),
c.placeholder
]
}
) })
]
}
) }, o);
}) });
};
function ul(e) {
return Ce({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" }, child: [] }] })(e);
}
function dl(e) {
return Ce({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M11 7h2v2h-2V7zm0 4h2v6h-2v-6zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" }, child: [] }] })(e);
}
const fl = ({ show: e, onHide: n, item: t }) => {
var l, c;
const [r, a] = Z(null), s = Ue(null), o = t == null ? void 0 : t.originalTask;
return xe(() => {
const u = s.current;
if (!u) return;
const d = u.querySelectorAll("img"), f = [];
return d.forEach((p) => {
p.style.maxWidth = "200px", p.style.cursor = "pointer";
const m = () => {
a(p.src);
};
p.addEventListener("click", m), f.push({ img: p, onClick: m });
}), () => {
f.forEach(({ img: p, onClick: m }) => {
p.removeEventListener("click", m);
});
};
}, [o == null ? void 0 : o.description]), t ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsxs(me, { show: e, onHide: n, className: "jira-modal", children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, children: /* @__PURE__ */ i.jsx(me.Title, { children: t.type === "PROJECT" ? "Project Details" : "Task Details" }) }),
/* @__PURE__ */ i.jsx(me.Body, { children: t.type === "PROJECT" ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Project Name:" }),
" ",
t.title
] }),
/* @__PURE__ */ i.jsx("p", { children: "This is a project, not a task. It does not have task-specific details like description or status." }),
t.originalProject && /* @__PURE__ */ i.jsx(i.Fragment, { children: /* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Members:" }),
" ",
((l = t.originalProject.members) == null ? void 0 : l.join(", ")) || "N/A"
] }) })
] }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Type:" }),
" ",
t.type
] }),
/* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Title:" }),
" ",
(o == null ? void 0 : o.title) || "N/A"
] }),
/* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Status:" }),
" ",
(o == null ? void 0 : o.status) || "N/A"
] }),
/* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Assignee:" }),
" ",
(o == null ? void 0 : o.assignee) || "N/A"
] }),
/* @__PURE__ */ i.jsxs("p", { children: [
/* @__PURE__ */ i.jsx("strong", { children: "Due Date:" }),
" ",
(o == null ? void 0 : o.dueDate) || "N/A"
] }),
/* @__PURE__ */ i.jsx("p", { children: /* @__PURE__ */ i.jsx("strong", { children: "Description:" }) }),
o != null && o.description ? /* @__PURE__ */ i.jsx(
"div",
{
ref: s,
style: { maxWidth: "100%" },
dangerouslySetInnerHTML: { __html: o.description }
}
) : /* @__PURE__ */ i.jsx("p", { children: "No description available." }),
((c = o == null ? void 0 : o.attachments) == null ? void 0 : c.length) > 0 && /* @__PURE__ */ i.jsxs("div", { children: [
/* @__PURE__ */ i.jsx("p", { children: /* @__PURE__ */ i.jsx("strong", { children: "Attachments:" }) }),
o.attachments.map((u, d) => /* @__PURE__ */ i.jsx("div", { children: u.url && u.name.match(/\.(jpg|jpeg|png|gif)$/i) ? /* @__PURE__ */ i.jsx(
"img",
{
src: u.url,
alt: u.name,
style: { maxWidth: "200px", margin: "5px 0", cursor: "pointer" },
onClick: () => a(u.url)
}
) : /* @__PURE__ */ i.jsx("p", { children: u.name }) }, d))
] })
] }) }),
/* @__PURE__ */ i.jsx(me.Footer, { children: /* @__PURE__ */ i.jsx(Te, { variant: "secondary", onClick: n, children: "Close" }) })
] }),
/* @__PURE__ */ i.jsxs(me, { show: !!r, onHide: () => a(null), centered: !0, children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, children: /* @__PURE__ */ i.jsx(me.Title, { children: "Image Preview" }) }),
/* @__PURE__ */ i.jsx(me.Body, { children: r && /* @__PURE__ */ i.jsx(
"img",
{
src: r,
alt: "Enlarged",
style: { width: "100%", maxHeight: "500px", objectFit: "contain" }
}
) })
] })
] }) : /* @__PURE__ */ i.jsxs(me, { show: e, onHide: n, className: "jira-modal", children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, children: /* @__PURE__ */ i.jsx(me.Title, { children: "Task Details" }) }),
/* @__PURE__ */ i.jsx(me.Body, { children: /* @__PURE__ */ i.jsx("p", { children: "No item selected." }) }),
/* @__PURE__ */ i.jsx(me.Footer, { children: /* @__PURE__ */ i.jsx(Te, { variant: "secondary", onClick: n, children: "Close" }) })
] });
}, pl = () => /* @__PURE__ */ i.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 112 112", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
/* @__PURE__ */ i.jsx("path", { d: "M96 0H16C7.16344 0 0 7.16344 0 16V96C0 104.837 7.16344 112 16 112H96C104.837 112 112 104.837 112 96V16C112 7.16344 104.837 0 96 0Z", fill: "#63BA3C" }),
/* @__PURE__ */ i.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M72 24H40C35.584 24 32 27.584 32 32V84C32 86.208 33.792 88 36 88C37.4 88 38.568 87.24 39.28 86.152L39.312 86.16L54.72 68.32C55.36 67.472 56.64 67.472 57.28 68.32L72.688 86.16L72.72 86.152C73.432 87.24 74.6 88 76 88C78.208 88 80 86.208 80 84V32C80 27.584 76.416 24 72 24Z", fill: "white" })
] }), ml = () => /* @__PURE__ */ i.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 112 112", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
/* @__PURE__ */ i.jsx("path", { d: "M96 0H16C7.16344 0 0 7.16344 0 16V96C0 104.837 7.16344 112 16 112H96C104.837 112 112 104.837 112 96V16C112 7.16344 104.837 0 96 0Z", fill: "#904EE2" }),
/* @__PURE__ */ i.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M79.3864 54.0528L79.3704 54.0208C79.7384 53.4208 80.0024 52.7568 80.0024 51.9968C80.0024 49.7888 78.2104 47.9968 76.0024 47.9968H56.0024V27.9968C56.0024 25.7888 54.2104 23.9968 52.0024 23.9968C50.6264 23.9968 49.4824 24.7328 48.7624 25.7808C48.5384 26.1088 48.3544 26.4448 48.2344 26.8208L32.6504 57.8928L32.6664 57.9168C32.2824 58.5328 32.0024 59.2208 32.0024 59.9968C32.0024 62.2128 33.7944 63.9968 36.0024 63.9968H56.0024V83.9968C56.0024 86.2128 57.7944 87.9968 60.0024 87.9968C61.4344 87.9968 62.6344 87.2048 63.3464 86.0688L63.3704 86.0768L63.4744 85.8688C63.5624 85.7008 63.6584 85.5488 63.7224 85.3728L79.3864 54.0528Z", fill: "white" })
] }), hl = () => /* @__PURE__ */ i.jsx("svg", { width: "16", height: "16", viewBox: "0 0 112 112", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i.jsx("path", { d: "M96 0H16C7.16344 0 0 7.16344 0 16V96C0 104.837 7.16344 112 16 112H96C104.837 112 112 104.837 112 96V16C112 7.16344 104.837 0 96 0Z", fill: "#4BADE8" }) }), vl = () => /* @__PURE__ */ i.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 112 112", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
/* @__PURE__ */ i.jsx("path", { d: "M96 0H16C7.16344 0 0 7.16344 0 16V96C0 104.837 7.16344 112 16 112H96C104.837 112 112 104.837 112 96V16C112 7.16344 104.837 0 96 0Z", fill: "#E5493A" }),
/* @__PURE__ */ i.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M84 56C84 71.4653 71.4653 84 56 84C40.5347 84 28 71.4653 28 56C28 40.5347 40.5347 28 56 28C71.4653 28 84 40.5347 84 56Z", fill: "white" })
] }), gl = () => /* @__PURE__ */ i.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 112 112", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
/* @__PURE__ */ i.jsx("path", { d: "M96 0H16C7.16344 0 0 7.16344 0 16V96C0 104.837 7.16344 112 16 112H96C104.837 112 112 104.837 112 96V16C112 7.16344 104.837 0 96 0Z", fill: "#FFAB00" }),
/* @__PURE__ */ i.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M36 32H76C78.2091 32 80 33.7909 80 36V76C80 78.2091 78.2091 80 76 80H36C33.7909 80 32 78.2091 32 76V36C32 33.7909 33.7909 32 36 32ZM36 36V48H56V36H36ZM56 48H76V76H56V48ZM36 76H56V60H36V76Z", fill: "white" })
] }), Xi = ({
filteredTasks: e = [],
handleEdit: n = () => {
},
handleDelete: t = () => {
},
hideProjectColumn: r = !1,
projects: a = [],
teamMembers: s = [],
deleteTask: o = () => {
},
editTask: l = () => {
},
deleteProject: c = () => {
},
removeTeamMember: u = () => {
}
}) => {
const [d, f] = Z({}), [p, m] = Z(null), [g, y] = Z(""), [x, j] = Z(!1), [C, E] = Z(null), [I, b] = Z(!1), [$, k] = Z(null), L = ct(() => (() => {
const N = /* @__PURE__ */ new Map();
if (!Array.isArray(e))
return console.warn("filteredTasks is not an array:", e), [];
e.forEach((T) => {
const P = T.project || "Unassigned Project";
N.has(P) || N.set(P, []), N.get(P).push(T);
});
const v = [];
return N.forEach((T, P) => {
const M = `project-${P}`, J = {
id: M,
title: P,
type: "PROJECT",
assignee: "",
dueDate: "",
status: "Todo",
parentId: null,
depth: 0,
originalTask: null,
originalProject: a.find((K) => K.name === P) || null
};
v.push(J), T.filter((K) => K.workType === "Epic").forEach((K) => {
var _e;
const w = (_e = K.id) == null ? void 0 : _e.toString();
v.push({
id: w,
title: K.title,
type: "EPIC",
assignee: "",
dueDate: K.dueDate,
status: K.status,
parentId: M,
depth: 1,
originalTask: K
}), T.filter(
(Ee) => {
var Re;
return ((Re = Ee.parent) == null ? void 0 : Re.toString()) === w && Ee.workType === "Story";
}
).forEach((Ee) => {
var Y;
const Re = (Y = Ee.id) == null ? void 0 : Y.toString();
v.push({
id: Re,
title: Ee.title,
type: "STORY",
assignee: Ee.assignee || "N/A",
dueDate: Ee.dueDate,
status: Ee.status,
parentId: w,
depth: 2,
originalTask: Ee
}), T.filter(
(Q) => {
var fe;
return ((fe = Q.parent) == null ? void 0 : fe.toString()) === Re && (Q.workType === "Task" || Q.workType === "Bug");
}
).forEach((Q) => {
var fe;
v.push({
id: (fe = Q.id) == null ? void 0 : fe.toString(),
title: Q.title,
type: Q.workType.toUpperCase(),
assignee: Q.assignee || "N/A",
dueDate: Q.dueDate,
status: Q.status,
parentId: Re,
depth: 3,
originalTask: Q
});
});
});
});
}), v;
})(), [e, a]), z = ct(() => {
const D = {};
L.forEach((v) => D[v.id] = v);
const N = (v) => {
if (v.depth === 0) return !0;
const T = D[v.parentId];
return T && d[T.id] && N(T);
};
return L.filter(N);
}, [L, d]), A = (D) => {
f((N) => ({ ...N, [D]: !N[D] }));
}, W = (D, N, v) => {
m({ rowId: D, columnId: N }), y(v);
}, te = () => {
m(null), y("");
}, ne = (D) => {
if (!D.original.originalTask) {
te();
return;
}
const N = { ...D.original.originalTask };
switch (p.columnId) {
case "status":
N.status = g;
break;
case "assignee":
N.assignee = g;
break;
case "dueDate":
N.dueDate = g;
break;
}
l(
(v) => v.map(
(T) => T.id === N.id ? N : T
)
), te();
}, H = (D) => {
E(D.original), j(!0);
}, X = (D) => {
k(D.original), b(!0);
}, re = () => {
if (C) {
switch (C.type) {
case "PROJECT":
C.originalProject && c(C.originalProject.id);
break;
case "EPIC":
case "STORY":
case "TASK":
case "BUG":
C.originalTask && t(C.originalTask.id);
break;
}
j(!1), E(null);
}
}, oe = ["Todo", "In Progress", "In Review", "Done", "Blocked"];
a.map((D) => D.name);
const q = ["", ...s.map((D) => D.name)], le = (D) => {
if (!D) return "0%";
const N = /* @__PURE__ */ new Date(), v = new Date(D);
if (v < N) return "0%";
const T = v - N, P = Math.ceil(T / (1e3 * 60 * 60 * 24));
return `${Math.min(Math.abs(P) / 30 * 100, 100)}%`;
}, S = (D) => {
const N = D.row, v = D.column.id, T = D.getValue();
if ((p == null ? void 0 : p.rowId) === N.id && (p == null ? void 0 : p.columnId) === v)
return /* @__PURE__ */ i.jsxs("div", { className: "d-flex align-items-center", children: [
v === "status" && /* @__PURE__ */ i.jsx(
O.Select,
{
size: "sm",
value: g,
onChange: (M) => y(M.target.value),
autoFocus: !0,
onBlur: () => ne(N),
onKeyDown: (M) => M.key === "Enter" && ne(N),
style: { fontSize: "14px", padding: "2px 8px" },
children: oe.map((M) => /* @__PURE__ */ i.jsx("option", { value: M, children: M }, M))
}
),
v === "assignee" && /* @__PURE__ */ i.jsx(
O.Select,
{
size: "sm",
value: g,
onChange: (M) => y(M.target.value),
autoFocus: !0,
onBlur: () => ne(N),
onKeyDown: (M) => M.key === "Enter" && ne(N),
style: { fontSize: "14px", padding: "2px 8px" },
children: q.map((M) => /* @__PURE__ */ i.jsx("option", { value: M, children: M || "Unassigned" }, M || "unassigned"))
}
),
v === "dueDate" && /* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
size: "sm",
value: g,
onChange: (M) => y(M.target.value),
autoFocus: !0,
onBlur: () => ne(N),
onKeyDown: (M) => M.key === "Enter" && ne(N),
style: { fontSize: "14px", padding: "2px 8px" }
}
)
] });
const P = ["TASK", "BUG", "STORY", "EPIC"].includes(N.original.type) && ["status", "assignee", "dueDate"].includes(v) && N.original.originalTask;
if (v === "status" && T) {
const M = `status-badge status-${T.toLowerCase().replace(" ", "-")}`;
return /* @__PURE__ */ i.jsx(
"div",
{
className: `editable-cell ${P ? "" : "not-editable"}`,
onClick: () => P && W(N.id, v, T),
style: { minHeight: "30px" },
children: /* @__PURE__ */ i.jsx("span", { className: M, children: T })
}
);
}
return v === "dueDate" && T ? /* @__PURE__ */ i.jsxs(
"div",
{
className: `due-date-cell editable-cell ${P ? "" : "not-editable"}`,
onClick: () => P && W(N.id, v, T),
style: { minHeight: "30px", position: "relative" },
children: [
T,
/* @__PURE__ */ i.jsx("div", { className: "due-date-bar", style: { width: le(T) } })
]
}
) : /* @__PURE__ */ i.jsx(
"div",
{
className: `editable-cell ${P ? "" : "not-editable"}`,
onClick: () => P && W(N.id, v, T),
style: { minHeight: "30px" },
children: T
}
);
}, B = ct(
() => [
{
accessorKey: "title",
header: "Hierarchy",
cell: ({ row: D, getValue: N }) => {
const v = D.original, T = L.some((M) => M.parentId === v.id), P = () => {
switch (v.type) {
case "PROJECT":
return /* @__PURE__ */ i.jsx(gl, {});
case "EPIC":
return /* @__PURE__ */ i.jsx(ml, {});
case "STORY":
return /* @__PURE__ */ i.jsx(pl, {});
case "TASK":
return /* @__PURE__ */ i.jsx(hl, {});
case "BUG":
return /* @__PURE__ */ i.jsx(vl, {});
default:
return null;
}
};
return /* @__PURE__ */ i.jsxs("div", { className: "hierarchy-cell", children: [
T && /* @__PURE__ */ i.jsx(
"button",
{
className: "expand-btn",
onClick: () => A(v.id),
children: d[v.id] ? "▼" : "▶"
}
),
/* @__PURE__ */ i.jsx("span", { className: "issue-icon", children: P() }),
/* @__PURE__ */ i.jsx("span", { className: "type-label", children: v.type }),
": ",
N()
] });
}
},
{
accessorKey: "assignee",
header: "Assignee",
cell: S
},
{
accessorKey: "dueDate",
header: "Due Date",
cell: S
},
{
accessorKey: "status",
header: "Status",
cell: S
},
{
header: "Actions",
cell: ({ row: D }) => /* @__PURE__ */ i.jsxs("div", { children: [
n && ["TASK", "BUG", "STORY", "EPIC"].includes(D.original.type) && D.original.originalTask && /* @__PURE__ */ i.jsx(
"button",
{
className: "action-btn me-2",
onClick: () => n(D.original.originalTask),
children: "✏️"
}
),
["TASK", "BUG", "STORY", "EPIC"].includes(D.original.type) && D.original.originalTask && /* @__PURE__ */ i.jsx(
"button",
{
className: "action-btn me-2",
onClick: () => X(D),
title: "More Info",
children: /* @__PURE__ */ i.jsx(dl, {})
}
),
/* @__PURE__ */ i.jsx(
"button",
{
className: "action-btn",
onClick: () => H(D),
children: /* @__PURE__ */ i.jsx(ul, {})
}
)
] })
}
],
[d, L, p, g, n]
), ee = Mo({
data: z,
columns: B,
getCoreRowModel: Fo()
});
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx("div", { className: "jira-table-container", children: /* @__PURE__ */ i.jsxs("table", { className: "jira-table", children: [
/* @__PURE__ */ i.jsx("thead", { children: ee.getHeaderGroups().map((D) => /* @__PURE__ */ i.jsx("tr", { children: D.headers.map((N) => /* @__PURE__ */ i.jsx("th", { children: La(N.column.columnDef.header, N.getContext()) }, N.id)) }, D.id)) }),
/* @__PURE__ */ i.jsx("tbody", { children: ee.getRowModel().rows.map((D) => /* @__PURE__ */ i.jsx("tr", { children: D.getVisibleCells().map((N) => /* @__PURE__ */ i.jsx("td", { children: La(N.column.columnDef.cell, N.getContext()) }, N.id)) }, D.id)) })
] }) }),
/* @__PURE__ */ i.jsxs(
me,
{
show: x,
onHide: () => j(!1),
className: "jira-modal",
children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, children: /* @__PURE__ */ i.jsx(me.Title, { children: "Confirm Delete" }) }),
/* @__PURE__ */ i.jsx(me.Body, { children: C && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsxs("p", { children: [
"Are you sure you want to delete this ",
C.type.toLowerCase(),
"?"
] }),
/* @__PURE__ */ i.jsx("p", { children: /* @__PURE__ */ i.jsx("strong", { children: C.title }) }),
C.type === "PROJECT" && /* @__PURE__ */ i.jsx("p", { className: "text-danger", children: "Warning: This will also delete all tasks and epics associated with this project!" }),
C.type === "EPIC" && /* @__PURE__ */ i.jsx("p", { className: "text-danger", children: "Warning: This will also delete all stories and tasks under this epic!" }),
C.type === "STORY" && /* @__PURE__ */ i.jsx("p", { className: "text-danger", children: "Warning: This will also delete all tasks under this story!" })
] }) }),
/* @__PURE__ */ i.jsxs(me.Footer, { children: [
/* @__PURE__ */ i.jsx(Te, { variant: "secondary", onClick: () => j(!1), children: "Cancel" }),
/* @__PURE__ */ i.jsx(Te, { variant: "danger", onClick: re, children: "Delete" })
] })
]
}
),
/* @__PURE__ */ i.jsx(
fl,
{
show: I,
onHide: () => b(!1),
item: $
}
)
] });
};
var En = { exports: {} }, Tn = { exports: {} }, ve = {};
/** @license React v16.13.1
* react-is.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 Ua;
function yl() {
if (Ua) return ve;
Ua = 1;
var e = typeof Symbol == "function" && Symbol.for, n = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, r = e ? Symbol.for("react.fragment") : 60107, a = e ? Symbol.for("react.strict_mode") : 60108, s = e ? Symbol.for("react.profiler") : 60114, o = e ? Symbol.for("react.provider") : 60109, l = e ? Symbol.for("react.context") : 60110, c = e ? Symbol.for("react.async_mode") : 60111, u = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, f = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, m = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, y = e ? Symbol.for("react.block") : 60121, x = e ? Symbol.for("react.fundamental") : 60117, j = e ? Symbol.for("react.responder") : 60118, C = e ? Symbol.for("react.scope") : 60119;
function E(b) {
if (typeof b == "object" && b !== null) {
var $ = b.$$typeof;
switch ($) {
case n:
switch (b = b.type, b) {
case c:
case u:
case r:
case s:
case a:
case f:
return b;
default:
switch (b = b && b.$$typeof, b) {
case l:
case d:
case g:
case m:
case o:
return b;
default:
return $;
}
}
case t:
return $;
}
}
}
function I(b) {
return E(b) === u;
}
return ve.AsyncMode = c, ve.ConcurrentMode = u, ve.ContextConsumer = l, ve.ContextProvider = o, ve.Element = n, ve.ForwardRef = d, ve.Fragment = r, ve.Lazy = g, ve.Memo = m, ve.Portal = t, ve.Profiler = s, ve.StrictMode = a, ve.Suspense = f, ve.isAsyncMode = function(b) {
return I(b) || E(b) === c;
}, ve.isConcurrentMode = I, ve.isContextConsumer = function(b) {
return E(b) === l;
}, ve.isContextProvider = function(b) {
return E(b) === o;
}, ve.isElement = function(b) {
return typeof b == "object" && b !== null && b.$$typeof === n;
}, ve.isForwardRef = function(b) {
return E(b) === d;
}, ve.isFragment = function(b) {
return E(b) === r;
}, ve.isLazy = function(b) {
return E(b) === g;
}, ve.isMemo = function(b) {
return E(b) === m;
}, ve.isPortal = function(b) {
return E(b) === t;
}, ve.isProfiler = function(b) {
return E(b) === s;
}, ve.isStrictMode = function(b) {
return E(b) === a;
}, ve.isSuspense = function(b) {
return E(b) === f;
}, ve.isValidElementType = function(b) {
return typeof b == "string" || typeof b == "function" || b === r || b === u || b === s || b === a || b === f || b === p || typeof b == "object" && b !== null && (b.$$typeof === g || b.$$typeof === m || b.$$typeof === o || b.$$typeof === l || b.$$typeof === d || b.$$typeof === x || b.$$typeof === j || b.$$typeof === C || b.$$typeof === y);
}, ve.typeOf = E, ve;
}
var ge = {};
/** @license React v16.13.1
* react-is.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 qa;
function bl() {
return qa || (qa = 1, process.env.NODE_ENV !== "production" && function() {
var e = typeof Symbol == "function" && Symbol.for, n = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, r = e ? Symbol.for("react.fragment") : 60107, a = e ? Symbol.for("react.strict_mode") : 60108, s = e ? Symbol.for("react.profiler") : 60114, o = e ? Symbol.for("react.provider") : 60109, l = e ? Symbol.for("react.context") : 60110, c = e ? Symbol.for("react.async_mode") : 60111, u = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, f = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, m = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, y = e ? Symbol.for("react.block") : 60121, x = e ? Symbol.for("react.fundamental") : 60117, j = e ? Symbol.for("react.responder") : 60118, C = e ? Symbol.for("react.scope") : 60119;
function E(w) {
return typeof w == "string" || typeof w == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
w === r || w === u || w === s || w === a || w === f || w === p || typeof w == "object" && w !== null && (w.$$typeof === g || w.$$typeof === m || w.$$typeof === o || w.$$typeof === l || w.$$typeof === d || w.$$typeof === x || w.$$typeof === j || w.$$typeof === C || w.$$typeof === y);
}
function I(w) {
if (typeof w == "object" && w !== null) {
var ie = w.$$typeof;
switch (ie) {
case n:
var _e = w.type;
switch (_e) {
case c:
case u:
case r:
case s:
case a:
case f:
return _e;
default:
var Ee = _e && _e.$$typeof;
switch (Ee) {
case l:
case d:
case g:
case m:
case o:
return Ee;
default:
return ie;
}
}
case t:
return ie;
}
}
}
var b = c, $ = u, k = l, L = o, z = n, A = d, W = r, te = g, ne = m, H = t, X = s, re = a, oe = f, q = !1;
function le(w) {
return q || (q = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), S(w) || I(w) === c;
}
function S(w) {
return I(w) === u;
}
function B(w) {
return I(w) === l;
}
function ee(w) {
return I(w) === o;
}
function D(w) {
return typeof w == "object" && w !== null && w.$$typeof === n;
}
function N(w) {
return I(w) === d;
}
function v(w) {
return I(w) === r;
}
function T(w) {
return I(w) === g;
}
function P(w) {
return I(w) === m;
}
function M(w) {
return I(w) === t;
}
function J(w) {
return I(w) === s;
}
function _(w) {
return I(w) === a;
}
function K(w) {
return I(w) === f;
}
ge.AsyncMode = b, ge.ConcurrentMode = $, ge.ContextConsumer = k, ge.ContextProvider = L, ge.Element = z, ge.ForwardRef = A, ge.Fragment = W, ge.Lazy = te, ge.Memo = ne, ge.Portal = H, ge.Profiler = X, ge.StrictMode = re, ge.Suspense = oe, ge.isAsyncMode = le, ge.isConcurrentMode = S, ge.isContextConsumer = B, ge.isContextProvider = ee, ge.isElement = D, ge.isForwardRef = N, ge.isFragment = v, ge.isLazy = T, ge.isMemo = P, ge.isPortal = M, ge.isProfiler = J, ge.isStrictMode = _, ge.isSuspense = K, ge.isValidElementType = E, ge.typeOf = I;
}()), ge;
}
var Ya;
function Qi() {
return Ya || (Ya = 1, process.env.NODE_ENV === "production" ? Tn.exports = yl() : Tn.exports = bl()), Tn.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var lr, Ga;
function xl() {
if (Ga) return lr;
Ga = 1;
var e = Object.getOwnPropertySymbols, n = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
function r(s) {
if (s == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(s);
}
function a() {
try {
if (!Object.assign)
return !1;
var s = new String("abc");
if (s[5] = "de", Object.getOwnPropertyNames(s)[0] === "5")
return !1;
for (var o = {}, l = 0; l < 10; l++)
o["_" + String.fromCharCode(l)] = l;
var c = Object.getOwnPropertyNames(o).map(function(d) {
return o[d];
});
if (c.join("") !== "0123456789")
return !1;
var u = {};
return "abcdefghijklmnopqrst".split("").forEach(function(d) {
u[d] = d;
}), Object.keys(Object.assign({}, u)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return lr = a() ? Object.assign : function(s, o) {
for (var l, c = r(s), u, d = 1; d < arguments.length; d++) {
l = Object(arguments[d]);
for (var f in l)
n.call(l, f) && (c[f] = l[f]);
if (e) {
u = e(l);
for (var p = 0; p < u.length; p++)
t.call(l, u[p]) && (c[u[p]] = l[u[p]]);
}
}
return c;
}, lr;
}
var cr, Za;
function Xr() {
if (Za) return cr;
Za = 1;
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return cr = e, cr;
}
var ur, Ja;
function es() {
return Ja || (Ja = 1, ur = Function.call.bind(Object.prototype.hasOwnProperty)), ur;
}
var dr, Ka;
function jl() {
if (Ka) return dr;
Ka = 1;
var e = function() {
};
if (process.env.NODE_ENV !== "production") {
var n = /* @__PURE__ */ Xr(), t = {}, r = /* @__PURE__ */ es();
e = function(s) {
var o = "Warning: " + s;
typeof console < "u" && console.error(o);
try {
throw new Error(o);
} catch {
}
};
}
function a(s, o, l, c, u) {
if (process.env.NODE_ENV !== "production") {
for (var d in s)
if (r(s, d)) {
var f;
try {
if (typeof s[d] != "function") {
var p = Error(
(c || "React class") + ": " + l + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw p.name = "Invariant Violation", p;
}
f = s[d](o, d, c, l, null, n);
} catch (g) {
f = g;
}
if (f && !(f instanceof Error) && e(
(c || "React class") + ": type specification of " + l + " `" + d + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), f instanceof Error && !(f.message in t)) {
t[f.message] = !0;
var m = u ? u() : "";
e(
"Failed " + l + " type: " + f.message + (m ?? "")
);
}
}
}
}
return a.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (t = {});
}, dr = a, dr;
}
var fr, Xa;
function wl() {
if (Xa) return fr;
Xa = 1;
var e = Qi(), n = xl(), t = /* @__PURE__ */ Xr(), r = /* @__PURE__ */ es(), a = /* @__PURE__ */ jl(), s = function() {
};
process.env.NODE_ENV !== "production" && (s = function(l) {
var c = "Warning: " + l;
typeof console < "u" && console.error(c);
try {
throw new Error(c);
} catch {
}
});
function o() {
return null;
}
return fr = function(l, c) {
var u = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
function f(S) {
var B = S && (u && S[u] || S[d]);
if (typeof B == "function")
return B;
}
var p = "<<anonymous>>", m = {
array: j("array"),
bigint: j("bigint"),
bool: j("boolean"),
func: j("function"),
number: j("number"),
object: j("object"),
string: j("string"),
symbol: j("symbol"),
any: C(),
arrayOf: E,
element: I(),
elementType: b(),
instanceOf: $,
node: A(),
objectOf: L,
oneOf: k,
oneOfType: z,
shape: te,
exact: ne
};
function g(S, B) {
return S === B ? S !== 0 || 1 / S === 1 / B : S !== S && B !== B;
}
function y(S, B) {
this.message = S, this.data = B && typeof B == "object" ? B : {}, this.stack = "";
}
y.prototype = Error.prototype;
function x(S) {
if (process.env.NODE_ENV !== "production")
var B = {}, ee = 0;
function D(v, T, P, M, J, _, K) {
if (M = M || p, _ = _ || P, K !== t) {
if (c) {
var w = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
);
throw w.name = "Invariant Violation", w;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var ie = M + ":" + P;
!B[ie] && // Avoid spamming the console because they are often not actionable except for lib authors
ee < 3 && (s(
"You are manually calling a React.PropTypes validation function for the `" + _ + "` prop on `" + M + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
), B[ie] = !0, ee++);
}
}
return T[P] == null ? v ? T[P] === null ? new y("The " + J + " `" + _ + "` is marked as required " + ("in `" + M + "`, but its value is `null`.")) : new y("The " + J + " `" + _ + "` is marked as required in " + ("`" + M + "`, but its value is `undefined`.")) : null : S(T, P, M, J, _);
}
var N = D.bind(null, !1);
return N.isRequired = D.bind(null, !0), N;
}
function j(S) {
function B(ee, D, N, v, T, P) {
var M = ee[D], J = re(M);
if (J !== S) {
var _ = oe(M);
return new y(
"Invalid " + v + " `" + T + "` of type " + ("`" + _ + "` supplied to `" + N + "`, expected ") + ("`" + S + "`."),
{ expectedType: S }
);
}
return null;
}
return x(B);
}
function C() {
return x(o);
}
function E(S) {
function B(ee, D, N, v, T) {
if (typeof S != "function")
return new y("Property `" + T + "` of component `" + N + "` has invalid PropType notation inside arrayOf.");
var P = ee[D];
if (!Array.isArray(P)) {
var M = re(P);
return new y("Invalid " + v + " `" + T + "` of type " + ("`" + M + "` supplied to `" + N + "`, expected an array."));
}
for (var J = 0; J < P.length; J++) {
var _ = S(P, J, N, v, T + "[" + J + "]", t);
if (_ instanceof Error)
return _;
}
return null;
}
return x(B);
}
function I() {
function S(B, ee, D, N, v) {
var T = B[ee];
if (!l(T)) {
var P = re(T);
return new y("Invalid " + N + " `" + v + "` of type " + ("`" + P + "` supplied to `" + D + "`, expected a single ReactElement."));
}
return null;
}
return x(S);
}
function b() {
function S(B, ee, D, N, v) {
var T = B[ee];
if (!e.isValidElementType(T)) {
var P = re(T);
return new y("Invalid " + N + " `" + v + "` of type " + ("`" + P + "` supplied to `" + D + "`, expected a single ReactElement type."));
}
return null;
}
return x(S);
}
function $(S) {
function B(ee, D, N, v, T) {
if (!(ee[D] instanceof S)) {
var P = S.name || p, M = le(ee[D]);
return new y("Invalid " + v + " `" + T + "` of type " + ("`" + M + "` supplied to `" + N + "`, expected ") + ("instance of `" + P + "`."));
}
return null;
}
return x(B);
}
function k(S) {
if (!Array.isArray(S))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s(
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
) : s("Invalid argument supplied to oneOf, expected an array.")), o;
function B(ee, D, N, v, T) {
for (var P = ee[D], M = 0; M < S.length; M++)
if (g(P, S[M]))
return null;
var J = JSON.stringify(S, function(K, w) {
var ie = oe(w);
return ie === "symbol" ? String(w) : w;
});
return new y("Invalid " + v + " `" + T + "` of value `" + String(P) + "` " + ("supplied to `" + N + "`, expected one of " + J + "."));
}
return x(B);
}
function L(S) {
function B(ee, D, N, v, T) {
if (typeof S != "function")
return new y("Property `" + T + "` of component `" + N + "` has invalid PropType notation inside objectOf.");
var P = ee[D], M = re(P);
if (M !== "object")
return new y("Invalid " + v + " `" + T + "` of type " + ("`" + M + "` supplied to `" + N + "`, expected an object."));
for (var J in P)
if (r(P, J)) {
var _ = S(P, J, N, v, T + "." + J, t);
if (_ instanceof Error)
return _;
}
return null;
}
return x(B);
}
function z(S) {
if (!Array.isArray(S))
return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), o;
for (var B = 0; B < S.length; B++) {
var ee = S[B];
if (typeof ee != "function")
return s(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + q(ee) + " at index " + B + "."
), o;
}
function D(N, v, T, P, M) {
for (var J = [], _ = 0; _ < S.length; _++) {
var K = S[_], w = K(N, v, T, P, M, t);
if (w == null)
return null;
w.data && r(w.data, "expectedType") && J.push(w.data.expectedType);
}
var ie = J.length > 0 ? ", expected one of type [" + J.join(", ") + "]" : "";
return new y("Invalid " + P + " `" + M + "` supplied to " + ("`" + T + "`" + ie + "."));
}
return x(D);
}
function A() {
function S(B, ee, D, N, v) {
return H(B[ee]) ? null : new y("Invalid " + N + " `" + v + "` supplied to " + ("`" + D + "`, expected a ReactNode."));
}
return x(S);
}
function W(S, B, ee, D, N) {
return new y(
(S || "React class") + ": " + B + " type `" + ee + "." + D + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + N + "`."
);
}
function te(S) {
function B(ee, D, N, v, T) {
var P = ee[D], M = re(P);
if (M !== "object")
return new y("Invalid " + v + " `" + T + "` of type `" + M + "` " + ("supplied to `" + N + "`, expected `object`."));
for (var J in S) {
var _ = S[J];
if (typeof _ != "function")
return W(N, v, T, J, oe(_));
var K = _(P, J, N, v, T + "." + J, t);
if (K)
return K;
}
return null;
}
return x(B);
}
function ne(S) {
function B(ee, D, N, v, T) {
var P = ee[D], M = re(P);
if (M !== "object")
return new y("Invalid " + v + " `" + T + "` of type `" + M + "` " + ("supplied to `" + N + "`, expected `object`."));
var J = n({}, ee[D], S);
for (var _ in J) {
var K = S[_];
if (r(S, _) && typeof K != "function")
return W(N, v, T, _, oe(K));
if (!K)
return new y(
"Invalid " + v + " `" + T + "` key `" + _ + "` supplied to `" + N + "`.\nBad object: " + JSON.stringify(ee[D], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(S), null, " ")
);
var w = K(P, _, N, v, T + "." + _, t);
if (w)
return w;
}
return null;
}
return x(B);
}
function H(S) {
switch (typeof S) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !S;
case "object":
if (Array.isArray(S))
return S.every(H);
if (S === null || l(S))
return !0;
var B = f(S);
if (B) {
var ee = B.call(S), D;
if (B !== S.entries) {
for (; !(D = ee.next()).done; )
if (!H(D.value))
return !1;
} else
for (; !(D = ee.next()).done; ) {
var N = D.value;
if (N && !H(N[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function X(S, B) {
return S === "symbol" ? !0 : B ? B["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && B instanceof Symbol : !1;
}
function re(S) {
var B = typeof S;
return Array.isArray(S) ? "array" : S instanceof RegExp ? "object" : X(B, S) ? "symbol" : B;
}
function oe(S) {
if (typeof S > "u" || S === null)
return "" + S;
var B = re(S);
if (B === "object") {
if (S instanceof Date)
return "date";
if (S instanceof RegExp)
return "regexp";
}
return B;
}
function q(S) {
var B = oe(S);
switch (B) {
case "array":
case "object":
return "an " + B;
case "boolean":
case "date":
case "regexp":
return "a " + B;
default:
return B;
}
}
function le(S) {
return !S.constructor || !S.constructor.name ? p : S.constructor.name;
}
return m.checkPropTypes = a, m.resetWarningCache = a.resetWarningCache, m.PropTypes = m, m;
}, fr;
}
var pr, Qa;
function Cl() {
if (Qa) return pr;
Qa = 1;
var e = /* @__PURE__ */ Xr();
function n() {
}
function t() {
}
return t.resetWarningCache = n, pr = function() {
function r(o, l, c, u, d, f) {
if (f !== e) {
var p = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
throw p.name = "Invariant Violation", p;
}
}
r.isRequired = r;
function a() {
return r;
}
var s = {
array: r,
bigint: r,
bool: r,
func: r,
number: r,
object: r,
string: r,
symbol: r,
any: r,
arrayOf: a,
element: r,
elementType: r,
instanceOf: a,
node: r,
objectOf: a,
oneOf: a,
oneOfType: a,
shape: a,
exact: a,
checkPropTypes: t,
resetWarningCache: n
};
return s.PropTypes = s, s;
}, pr;
}
var ei;
function El() {
if (ei) return En.exports;
if (ei = 1, process.env.NODE_ENV !== "production") {
var e = Qi(), n = !0;
En.exports = /* @__PURE__ */ wl()(e.isElement, n);
} else
En.exports = /* @__PURE__ */ Cl()();
return En.exports;
}
var Tl = /* @__PURE__ */ El();
const U = /* @__PURE__ */ Ho(Tl), Qr = ({ filteredTasks: e = [] }) => {
const n = {
Todo: { background: "#FFF0F0", border: "#FF6B6B", text: "#CC0000" },
"In Progress": { background: "#F0F7FF", border: "#4D96FF", text: "#003D99" },
"In Review": { background: "#FFF8F0", border: "#FFB347", text: "#CC7000" },
Done: { background: "#F0FFF4", border: "#77DD77", text: "#008000" }
}, t = e.map((s) => {
const o = n[s.status] || n.Todo;
return {
id: s.id,
title: s.title,
date: s.dueDate,
backgroundColor: o.background,
borderColor: o.border,
textColor: o.text,
extendedProps: {
assignee: s.assignee,
project: s.project,
status: s.status,
description: s.description || ""
}
};
}), r = e.length ? e.reduce(
(s, o) => !s || new Date(o.dueDate) < new Date(s.dueDate) ? o : s
).dueDate : (/* @__PURE__ */ new Date()).toISOString().split("T")[0], a = (s) => /* @__PURE__ */ i.jsx(
Ao,
{
placement: "top",
overlay: /* @__PURE__ */ i.jsxs(Ro, { className: "calendar-tooltip", children: [
/* @__PURE__ */ i.jsxs("div", { className: "tooltip-header", children: [
/* @__PURE__ */ i.jsx("strong", { children: s.event.title }),
/* @__PURE__ */ i.jsx("span", { className: `status-badge ${s.event.extendedProps.status.replace(/\s+/g, "-").toLowerCase()}`, children: s.event.extendedProps.status })
] }),
/* @__PURE__ */ i.jsxs("div", { className: "tooltip-content", children: [
s.event.extendedProps.description && /* @__PURE__ */ i.jsx("p", { className: "tooltip-description", children: s.event.extendedProps.description }),
/* @__PURE__ */ i.jsxs("div", { className: "tooltip-meta", children: [
/* @__PURE__ */ i.jsxs("span", { className: "meta-item", children: [
/* @__PURE__ */ i.jsx("i", { className: "bi bi-person-fill" }),
" ",
s.event.extendedProps.assignee || "Unassigned"
] }),
/* @__PURE__ */ i.jsxs("span", { className: "meta-item", children: [
/* @__PURE__ */ i.jsx("i", { className: "bi bi-folder-fill" }),
" ",
s.event.extendedProps.project || "No project"
] })
] })
] })
] }),
children: /* @__PURE__ */ i.jsxs("div", { className: "fc-event-content", children: [
/* @__PURE__ */ i.jsx("div", { className: "fc-event-title", children: s.event.title }),
/* @__PURE__ */ i.jsx("div", { className: "fc-event-status", children: s.event.extendedProps.status })
] })
}
);
return /* @__PURE__ */ i.jsx(ht, { fluid: !0, className: "task-calendar-view px-0", children: /* @__PURE__ */ i.jsx("div", { className: "calendar-container", children: /* @__PURE__ */ i.jsx(
Lo,
{
plugins: [$o, Vo],
initialView: "dayGridMonth",
initialDate: r,
events: t,
height: "auto",
headerToolbar: {
left: "title",
center: "",
right: "prev,next today dayGridMonth"
},
eventDisplay: "block",
eventContent: a,
dayHeaderClassNames: "calendar-day-header",
dayCellClassNames: "calendar-day-cell",
eventClassNames: "calendar-event",
buttonText: {
today: "Today",
month: "Month"
},
"aria-label": "Task calendar",
navLinks: !0,
dayMaxEvents: 3,
moreLinkContent: (s) => /* @__PURE__ */ i.jsxs("span", { className: "more-link", children: [
"+",
s.num,
" more"
] })
}
) }) });
};
Qr.propTypes = {
filteredTasks: U.arrayOf(
U.shape({
id: U.oneOfType([U.number, U.string]).isRequired,
title: U.string.isRequired,
dueDate: U.string.isRequired,
status: U.string,
assignee: U.string,
project: U.string,
description: U.string
})
).isRequired
};
const ts = ({ activeView: e, setActiveView: n, allowedViews: t }) => /* @__PURE__ */ i.jsxs("div", { children: [
t.includes("kanban") && /* @__PURE__ */ i.jsx(
Te,
{
variant: e === "kanban" ? "primary" : "outline-primary",
onClick: () => n("kanban"),
children: "Kanban"
}
),
t.includes("table") && /* @__PURE__ */ i.jsx(
Te,
{
variant: e === "table" ? "primary" : "outline-primary",
onClick: () => n("table"),
children: "Table"
}
),
t.includes("calendar") && /* @__PURE__ */ i.jsx(
Te,
{
variant: e === "calendar" ? "primary" : "outline-primary",
onClick: () => n("calendar"),
children: "Calendar"
}
)
] });
function rn() {
return rn = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, rn.apply(null, arguments);
}
function ea(e, n) {
if (e == null) return {};
var t = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
if (n.indexOf(r) !== -1) continue;
t[r] = e[r];
}
return t;
}
function Tr(e, n) {
return Tr = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
return t.__proto__ = r, t;
}, Tr(e, n);
}
function ta(e, n) {
e.prototype = Object.create(n.prototype), e.prototype.constructor = e, Tr(e, n);
}
function Sl(e, n) {
return e.classList ? !!n && e.classList.contains(n) : (" " + (e.className.baseVal || e.className) + " ").indexOf(" " + n + " ") !== -1;
}
function Pl(e, n) {
e.classList ? e.classList.add(n) : Sl(e, n) || (typeof e.className == "string" ? e.className = e.className + " " + n : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + n));
}
function ti(e, n) {
return e.replace(new RegExp("(^|\\s)" + n + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
}
function Ol(e, n) {
e.classList ? e.classList.remove(n) : typeof e.className == "string" ? e.className = ti(e.className, n) : e.setAttribute("class", ti(e.className && e.className.baseVal || "", n));
}
const ni = {
disabled: !1
};
var Nl = process.env.NODE_ENV !== "production" ? U.oneOfType([U.number, U.shape({
enter: U.number,
exit: U.number,
appear: U.number
}).isRequired]) : null, kl = process.env.NODE_ENV !== "production" ? U.oneOfType([U.string, U.shape({
enter: U.string,
exit: U.string,
active: U.string
}), U.shape({
enter: U.string,
enterDone: U.string,
enterActive: U.string,
exit: U.string,
exitDone: U.string,
exitActive: U.string
})]) : null;
const Dn = be.createContext(null);
var ns = function(n) {
return n.scrollTop;
}, Gt = "unmounted", jt = "exited", wt = "entering", _t = "entered", Sr = "exiting", it = /* @__PURE__ */ function(e) {
ta(n, e);
function n(r, a) {
var s;
s = e.call(this, r, a) || this;
var o = a, l = o && !o.isMounting ? r.enter : r.appear, c;
return s.appearStatus = null, r.in ? l ? (c = jt, s.appearStatus = wt) : c = _t : r.unmountOnExit || r.mountOnEnter ? c = Gt : c = jt, s.state = {
status: c
}, s.nextCallback = null, s;
}
n.getDerivedStateFromProps = function(a, s) {
var o = a.in;
return o && s.status === Gt ? {
status: jt
} : null;
};
var t = n.prototype;
return t.componentDidMount = function() {
this.updateStatus(!0, this.appearStatus);
}, t.componentDidUpdate = function(a) {
var s = null;
if (a !== this.props) {
var o = this.state.status;
this.props.in ? o !== wt && o !== _t && (s = wt) : (o === wt || o === _t) && (s = Sr);
}
this.updateStatus(!1, s);
}, t.componentWillUnmount = function() {
this.cancelNextCallback();
}, t.getTimeouts = function() {
var a = this.props.timeout, s, o, l;
return s = o = l = a, a != null && typeof a != "number" && (s = a.exit, o = a.enter, l = a.appear !== void 0 ? a.appear : o), {
exit: s,
enter: o,
appear: l
};
}, t.updateStatus = function(a, s) {
if (a === void 0 && (a = !1), s !== null)
if (this.cancelNextCallback(), s === wt) {
if (this.props.unmountOnExit || this.props.mountOnEnter) {
var o = this.props.nodeRef ? this.props.nodeRef.current : Yt.findDOMNode(this);
o && ns(o);
}
this.performEnter(a);
} else
this.performExit();
else this.props.unmountOnExit && this.state.status === jt && this.setState({
status: Gt
});
}, t.performEnter = function(a) {
var s = this, o = this.props.enter, l = this.context ? this.context.isMounting : a, c = this.props.nodeRef ? [l] : [Yt.findDOMNode(this), l], u = c[0], d = c[1], f = this.getTimeouts(), p = l ? f.appear : f.enter;
if (!a && !o || ni.disabled) {
this.safeSetState({
status: _t
}, function() {
s.props.onEntered(u);
});
return;
}
this.props.onEnter(u, d), this.safeSetState({
status: wt
}, function() {
s.props.onEntering(u, d), s.onTransitionEnd(p, function() {
s.safeSetState({
status: _t
}, function() {
s.props.onEntered(u, d);
});
});
});
}, t.performExit = function() {
var a = this, s = this.props.exit, o = this.getTimeouts(), l = this.props.nodeRef ? void 0 : Yt.findDOMNode(this);
if (!s || ni.disabled) {
this.safeSetState({
status: jt
}, function() {
a.props.onExited(l);
});
return;
}
this.props.onExit(l), this.safeSetState({
status: Sr
}, function() {
a.props.onExiting(l), a.onTransitionEnd(o.exit, function() {
a.safeSetState({
status: jt
}, function() {
a.props.onExited(l);
});
});
});
}, t.cancelNextCallback = function() {
this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
}, t.safeSetState = function(a, s) {
s = this.setNextCallback(s), this.setState(a, s);
}, t.setNextCallback = function(a) {
var s = this, o = !0;
return this.nextCallback = function(l) {
o && (o = !1, s.nextCallback = null, a(l));
}, this.nextCallback.cancel = function() {
o = !1;
}, this.nextCallback;
}, t.onTransitionEnd = function(a, s) {
this.setNextCallback(s);
var o = this.props.nodeRef ? this.props.nodeRef.current : Yt.findDOMNode(this), l = a == null && !this.props.addEndListener;
if (!o || l) {
setTimeout(this.nextCallback, 0);
return;
}
if (this.props.addEndListener) {
var c = this.props.nodeRef ? [this.nextCallback] : [o, this.nextCallback], u = c[0], d = c[1];
this.props.addEndListener(u, d);
}
a != null && setTimeout(this.nextCallback, a);
}, t.render = function() {
var a = this.state.status;
if (a === Gt)
return null;
var s = this.props, o = s.children;
s.in, s.mountOnEnter, s.unmountOnExit, s.appear, s.enter, s.exit, s.timeout, s.addEndListener, s.onEnter, s.onEntering, s.onEntered, s.onExit, s.onExiting, s.onExited, s.nodeRef;
var l = ea(s, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
return (
// allows for nested Transitions
/* @__PURE__ */ be.createElement(Dn.Provider, {
value: null
}, typeof o == "function" ? o(a, l) : be.cloneElement(be.Children.only(o), l))
);
}, n;
}(be.Component);
it.contextType = Dn;
it.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* A React reference to DOM element that need to transition:
* https://stackoverflow.com/a/51127130/4671932
*
* - When `nodeRef` prop is used, `node` is not passed to callback functions
* (e.g. `onEnter`) because user already has direct access to the node.
* - When changing `key` prop of `Transition` in a `TransitionGroup` a new
* `nodeRef` need to be provided to `Transition` with changed `key` prop
* (see
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
*/
nodeRef: U.shape({
current: typeof Element > "u" ? U.any : function(e, n, t, r, a, s) {
var o = e[n];
return U.instanceOf(o && "ownerDocument" in o ? o.ownerDocument.defaultView.Element : Element)(e, n, t, r, a, s);
}
}),
/**
* A `function` child can be used instead of a React element. This function is
* called with the current transition status (`'entering'`, `'entered'`,
* `'exiting'`, `'exited'`), which can be used to apply context
* specific props to a component.
*
* ```jsx
* <Transition in={this.state.in} timeout={150}>
* {state => (
* <MyComponent className={`fade fade-${state}`} />
* )}
* </Transition>
* ```
*/
children: U.oneOfType([U.func.isRequired, U.element.isRequired]).isRequired,
/**
* Show the component; triggers the enter or exit states
*/
in: U.bool,
/**
* By default the child component is mounted immediately along with
* the parent `Transition` component. If you want to "lazy mount" the component on the
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
* mounted, even on "exited", unless you also specify `unmountOnExit`.
*/
mountOnEnter: U.bool,
/**
* By default the child component stays mounted after it reaches the `'exited'` state.
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
*/
unmountOnExit: U.bool,
/**
* By default the child component does not perform the enter transition when
* it first mounts, regardless of the value of `in`. If you want this
* behavior, set both `appear` and `in` to `true`.
*
* > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
* > only adds an additional enter transition. However, in the
* > `<CSSTransition>` component that first enter transition does result in
* > additional `.appear-*` classes, that way you can choose to style it
* > differently.
*/
appear: U.bool,
/**
* Enable or disable enter transitions.
*/
enter: U.bool,
/**
* Enable or disable exit transitions.
*/
exit: U.bool,
/**
* The duration of the transition, in milliseconds.
* Required unless `addEndListener` is provided.
*
* You may specify a single timeout for all transitions:
*
* ```jsx
* timeout={500}
* ```
*
* or individually:
*
* ```jsx
* timeout={{
* appear: 500,
* enter: 300,
* exit: 500,
* }}
* ```
*
* - `appear` defaults to the value of `enter`
* - `enter` defaults to `0`
* - `exit` defaults to `0`
*
* @type {number | { enter?: number, exit?: number, appear?: number }}
*/
timeout: function(n) {
var t = Nl;
n.addEndListener || (t = t.isRequired);
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
a[s - 1] = arguments[s];
return t.apply(void 0, [n].concat(a));
},
/**
* Add a custom transition end trigger. Called with the transitioning
* DOM node and a `done` callback. Allows for more fine grained transition end
* logic. Timeouts are still used as a fallback if provided.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* ```jsx
* addEndListener={(node, done) => {
* // use the css transitionend event to mark the finish of a transition
* node.addEventListener('transitionend', done, false);
* }}
* ```
*/
addEndListener: U.func,
/**
* Callback fired before the "entering" status is applied. An extra parameter
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool) -> void
*/
onEnter: U.func,
/**
* Callback fired after the "entering" status is applied. An extra parameter
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntering: U.func,
/**
* Callback fired after the "entered" status is applied. An extra parameter
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool) -> void
*/
onEntered: U.func,
/**
* Callback fired before the "exiting" status is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement) -> void
*/
onExit: U.func,
/**
* Callback fired after the "exiting" status is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement) -> void
*/
onExiting: U.func,
/**
* Callback fired after the "exited" status is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement) -> void
*/
onExited: U.func
} : {};
function Nt() {
}
it.defaultProps = {
in: !1,
mountOnEnter: !1,
unmountOnExit: !1,
appear: !1,
enter: !0,
exit: !0,
onEnter: Nt,
onEntering: Nt,
onEntered: Nt,
onExit: Nt,
onExiting: Nt,
onExited: Nt
};
it.UNMOUNTED = Gt;
it.EXITED = jt;
it.ENTERING = wt;
it.ENTERED = _t;
it.EXITING = Sr;
var _l = function(n, t) {
return n && t && t.split(" ").forEach(function(r) {
return Pl(n, r);
});
}, mr = function(n, t) {
return n && t && t.split(" ").forEach(function(r) {
return Ol(n, r);
});
}, na = /* @__PURE__ */ function(e) {
ta(n, e);
function n() {
for (var r, a = arguments.length, s = new Array(a), o = 0; o < a; o++)
s[o] = arguments[o];
return r = e.call.apply(e, [this].concat(s)) || this, r.appliedClasses = {
appear: {},
enter: {},
exit: {}
}, r.onEnter = function(l, c) {
var u = r.resolveArguments(l, c), d = u[0], f = u[1];
r.removeClasses(d, "exit"), r.addClass(d, f ? "appear" : "enter", "base"), r.props.onEnter && r.props.onEnter(l, c);
}, r.onEntering = function(l, c) {
var u = r.resolveArguments(l, c), d = u[0], f = u[1], p = f ? "appear" : "enter";
r.addClass(d, p, "active"), r.props.onEntering && r.props.onEntering(l, c);
}, r.onEntered = function(l, c) {
var u = r.resolveArguments(l, c), d = u[0], f = u[1], p = f ? "appear" : "enter";
r.removeClasses(d, p), r.addClass(d, p, "done"), r.props.onEntered && r.props.onEntered(l, c);
}, r.onExit = function(l) {
var c = r.resolveArguments(l), u = c[0];
r.removeClasses(u, "appear"), r.removeClasses(u, "enter"), r.addClass(u, "exit", "base"), r.props.onExit && r.props.onExit(l);
}, r.onExiting = function(l) {
var c = r.resolveArguments(l), u = c[0];
r.addClass(u, "exit", "active"), r.props.onExiting && r.props.onExiting(l);
}, r.onExited = function(l) {
var c = r.resolveArguments(l), u = c[0];
r.removeClasses(u, "exit"), r.addClass(u, "exit", "done"), r.props.onExited && r.props.onExited(l);
}, r.resolveArguments = function(l, c) {
return r.props.nodeRef ? [r.props.nodeRef.current, l] : [l, c];
}, r.getClassNames = function(l) {
var c = r.props.classNames, u = typeof c == "string", d = u && c ? c + "-" : "", f = u ? "" + d + l : c[l], p = u ? f + "-active" : c[l + "Active"], m = u ? f + "-done" : c[l + "Done"];
return {
baseClassName: f,
activeClassName: p,
doneClassName: m
};
}, r;
}
var t = n.prototype;
return t.addClass = function(a, s, o) {
var l = this.getClassNames(s)[o + "ClassName"], c = this.getClassNames("enter"), u = c.doneClassName;
s === "appear" && o === "done" && u && (l += " " + u), o === "active" && a && ns(a), l && (this.appliedClasses[s][o] = l, _l(a, l));
}, t.removeClasses = function(a, s) {
var o = this.appliedClasses[s], l = o.base, c = o.active, u = o.done;
this.appliedClasses[s] = {}, l && mr(a, l), c && mr(a, c), u && mr(a, u);
}, t.render = function() {
var a = this.props;
a.classNames;
var s = ea(a, ["classNames"]);
return /* @__PURE__ */ be.createElement(it, rn({}, s, {
onEnter: this.onEnter,
onEntered: this.onEntered,
onEntering: this.onEntering,
onExit: this.onExit,
onExiting: this.onExiting,
onExited: this.onExited
}));
}, n;
}(be.Component);
na.defaultProps = {
classNames: ""
};
na.propTypes = process.env.NODE_ENV !== "production" ? rn({}, it.propTypes, {
/**
* The animation classNames applied to the component as it appears, enters,
* exits or has finished the transition. A single name can be provided, which
* will be suffixed for each stage, e.g. `classNames="fade"` applies:
*
* - `fade-appear`, `fade-appear-active`, `fade-appear-done`
* - `fade-enter`, `fade-enter-active`, `fade-enter-done`
* - `fade-exit`, `fade-exit-active`, `fade-exit-done`
*
* A few details to note about how these classes are applied:
*
* 1. They are _joined_ with the ones that are already defined on the child
* component, so if you want to add some base styles, you can use
* `className` without worrying that it will be overridden.
*
* 2. If the transition component mounts with `in={false}`, no classes are
* applied yet. You might be expecting `*-exit-done`, but if you think
* about it, a component cannot finish exiting if it hasn't entered yet.
*
* 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
* allows you to define different behavior for when appearing is done and
* when regular entering is done, using selectors like
* `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
* an epic entrance animation when element first appears in the DOM using
* [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
* simply use `fade-enter-done` for defining both cases.
*
* Each individual classNames can also be specified independently like:
*
* ```js
* classNames={{
* appear: 'my-appear',
* appearActive: 'my-active-appear',
* appearDone: 'my-done-appear',
* enter: 'my-enter',
* enterActive: 'my-active-enter',
* enterDone: 'my-done-enter',
* exit: 'my-exit',
* exitActive: 'my-active-exit',
* exitDone: 'my-done-exit',
* }}
* ```
*
* If you want to set these classes using CSS Modules:
*
* ```js
* import styles from './styles.css';
* ```
*
* you might want to use camelCase in your CSS file, that way could simply
* spread them instead of listing them one by one:
*
* ```js
* classNames={{ ...styles }}
* ```
*
* @type {string | {
* appear?: string,
* appearActive?: string,
* appearDone?: string,
* enter?: string,
* enterActive?: string,
* enterDone?: string,
* exit?: string,
* exitActive?: string,
* exitDone?: string,
* }}
*/
classNames: kl,
/**
* A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
* applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEnter: U.func,
/**
* A `<Transition>` callback fired immediately after the 'enter-active' or
* 'appear-active' class is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntering: U.func,
/**
* A `<Transition>` callback fired immediately after the 'enter' or
* 'appear' classes are **removed** and the `done` class is added to the DOM node.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntered: U.func,
/**
* A `<Transition>` callback fired immediately after the 'exit' class is
* applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExit: U.func,
/**
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExiting: U.func,
/**
* A `<Transition>` callback fired immediately after the 'exit' classes
* are **removed** and the `exit-done` class is added to the DOM node.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExited: U.func
}) : {};
function Al(e) {
if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
function ra(e, n) {
var t = function(s) {
return n && On(s) ? n(s) : s;
}, r = /* @__PURE__ */ Object.create(null);
return e && wo.map(e, function(a) {
return a;
}).forEach(function(a) {
r[a.key] = t(a);
}), r;
}
function Rl(e, n) {
e = e || {}, n = n || {};
function t(d) {
return d in n ? n[d] : e[d];
}
var r = /* @__PURE__ */ Object.create(null), a = [];
for (var s in e)
s in n ? a.length && (r[s] = a, a = []) : a.push(s);
var o, l = {};
for (var c in n) {
if (r[c])
for (o = 0; o < r[c].length; o++) {
var u = r[c][o];
l[r[c][o]] = t(u);
}
l[c] = t(c);
}
for (o = 0; o < a.length; o++)
l[a[o]] = t(a[o]);
return l;
}
function Ct(e, n, t) {
return t[n] != null ? t[n] : e.props[n];
}
function Il(e, n) {
return ra(e.children, function(t) {
return Nn(t, {
onExited: n.bind(null, t),
in: !0,
appear: Ct(t, "appear", e),
enter: Ct(t, "enter", e),
exit: Ct(t, "exit", e)
});
});
}
function Dl(e, n, t) {
var r = ra(e.children), a = Rl(n, r);
return Object.keys(a).forEach(function(s) {
var o = a[s];
if (On(o)) {
var l = s in n, c = s in r, u = n[s], d = On(u) && !u.props.in;
c && (!l || d) ? a[s] = Nn(o, {
onExited: t.bind(null, o),
in: !0,
exit: Ct(o, "exit", e),
enter: Ct(o, "enter", e)
}) : !c && l && !d ? a[s] = Nn(o, {
in: !1
}) : c && l && On(u) && (a[s] = Nn(o, {
onExited: t.bind(null, o),
in: u.props.in,
exit: Ct(o, "exit", e),
enter: Ct(o, "enter", e)
}));
}
}), a;
}
var Ml = Object.values || function(e) {
return Object.keys(e).map(function(n) {
return e[n];
});
}, Fl = {
component: "div",
childFactory: function(n) {
return n;
}
}, aa = /* @__PURE__ */ function(e) {
ta(n, e);
function n(r, a) {
var s;
s = e.call(this, r, a) || this;
var o = s.handleExited.bind(Al(s));
return s.state = {
contextValue: {
isMounting: !0
},
handleExited: o,
firstRender: !0
}, s;
}
var t = n.prototype;
return t.componentDidMount = function() {
this.mounted = !0, this.setState({
contextValue: {
isMounting: !1
}
});
}, t.componentWillUnmount = function() {
this.mounted = !1;
}, n.getDerivedStateFromProps = function(a, s) {
var o = s.children, l = s.handleExited, c = s.firstRender;
return {
children: c ? Il(a, l) : Dl(a, o, l),
firstRender: !1
};
}, t.handleExited = function(a, s) {
var o = ra(this.props.children);
a.key in o || (a.props.onExited && a.props.onExited(s), this.mounted && this.setState(function(l) {
var c = rn({}, l.children);
return delete c[a.key], {
children: c
};
}));
}, t.render = function() {
var a = this.props, s = a.component, o = a.childFactory, l = ea(a, ["component", "childFactory"]), c = this.state.contextValue, u = Ml(this.state.children).map(o);
return delete l.appear, delete l.enter, delete l.exit, s === null ? /* @__PURE__ */ be.createElement(Dn.Provider, {
value: c
}, u) : /* @__PURE__ */ be.createElement(Dn.Provider, {
value: c
}, /* @__PURE__ */ be.createElement(s, l, u));
}, n;
}(be.Component);
aa.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* `<TransitionGroup>` renders a `<div>` by default. You can change this
* behavior by providing a `component` prop.
* If you use React v16+ and would like to avoid a wrapping `<div>` element
* you can pass in `component={null}`. This is useful if the wrapping div
* borks your css styles.
*/
component: U.any,
/**
* A set of `<Transition>` components, that are toggled `in` and out as they
* leave. the `<TransitionGroup>` will inject specific transition props, so
* remember to spread them through if you are wrapping the `<Transition>` as
* with our `<Fade>` example.
*
* While this component is meant for multiple `Transition` or `CSSTransition`
* children, sometimes you may want to have a single transition child with
* content that you want to be transitioned out and in when you change it
* (e.g. routes, images etc.) In that case you can change the `key` prop of
* the transition child as you change its content, this will cause
* `TransitionGroup` to transition the child out and back in.
*/
children: U.node,
/**
* A convenience prop that enables or disables appear animations
* for all children. Note that specifying this will override any defaults set
* on individual children Transitions.
*/
appear: U.bool,
/**
* A convenience prop that enables or disables enter animations
* for all children. Note that specifying this will override any defaults set
* on individual children Transitions.
*/
enter: U.bool,
/**
* A convenience prop that enables or disables exit animations
* for all children. Note that specifying this will override any defaults set
* on individual children Transitions.
*/
exit: U.bool,
/**
* You may need to apply reactive updates to a child as it is exiting.
* This is generally done by using `cloneElement` however in the case of an exiting
* child the element has already been removed and not accessible to the consumer.
*
* If you do need to update a child as it leaves you can provide a `childFactory`
* to wrap every child, even the ones that are leaving.
*
* @type Function(child: ReactElement) -> ReactElement
*/
childFactory: U.func
} : {};
aa.defaultProps = Fl;
function Ll(e) {
if (Array.isArray(e)) return e;
}
function $l(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r, a, s, o, l = [], c = !0, u = !1;
try {
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (l.push(r.value), l.length !== n); c = !0) ;
} catch (d) {
u = !0, a = d;
} finally {
try {
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
} finally {
if (u) throw a;
}
}
return l;
}
}
function Pr(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
function rs(e, n) {
if (e) {
if (typeof e == "string") return Pr(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Pr(e, n) : void 0;
}
}
function Vl() {
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 kn(e, n) {
return Ll(e) || $l(e, n) || rs(e, n) || Vl();
}
function we(e) {
"@babel/helpers - typeof";
return we = 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;
}, we(e);
}
function ut() {
for (var e = arguments.length, n = new Array(e), t = 0; t < e; t++)
n[t] = arguments[t];
if (n) {
for (var r = [], a = 0; a < n.length; a++) {
var s = n[a];
if (s) {
var o = we(s);
if (o === "string" || o === "number")
r.push(s);
else if (o === "object") {
var l = Array.isArray(s) ? s : Object.entries(s).map(function(c) {
var u = kn(c, 2), d = u[0], f = u[1];
return f ? d : null;
});
r = l.length ? r.concat(l.filter(function(c) {
return !!c;
})) : r;
}
}
}
return r.join(" ").trim();
}
}
function Bl(e) {
if (Array.isArray(e)) return Pr(e);
}
function zl(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function Hl() {
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 Mn(e) {
return Bl(e) || zl(e) || rs(e) || Hl();
}
function ia(e, n) {
if (!(e instanceof n)) throw new TypeError("Cannot call a class as a function");
}
function Wl(e, n) {
if (we(e) != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (we(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function as(e) {
var n = Wl(e, "string");
return we(n) == "symbol" ? n : n + "";
}
function Ul(e, n) {
for (var t = 0; t < n.length; t++) {
var r = n[t];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, as(r.key), r);
}
}
function sa(e, n, t) {
return t && Ul(e, t), Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
function Hn(e, n, t) {
return (n = as(n)) in e ? Object.defineProperty(e, n, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[n] = t, e;
}
function hr(e, n) {
var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (!t) {
if (Array.isArray(e) || (t = ql(e)) || n) {
t && (e = t);
var r = 0, a = function() {
};
return { s: a, n: function() {
return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
}, e: function(u) {
throw u;
}, 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 s, o = !0, l = !1;
return { s: function() {
t = t.call(e);
}, n: function() {
var u = t.next();
return o = u.done, u;
}, e: function(u) {
l = !0, s = u;
}, f: function() {
try {
o || t.return == null || t.return();
} finally {
if (l) throw s;
}
} };
}
function ql(e, n) {
if (e) {
if (typeof e == "string") return ri(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ri(e, n) : void 0;
}
}
function ri(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
var Ae = /* @__PURE__ */ function() {
function e() {
ia(this, e);
}
return sa(e, null, [{
key: "innerWidth",
value: function(t) {
if (t) {
var r = t.offsetWidth, a = getComputedStyle(t);
return r = r + (parseFloat(a.paddingLeft) + parseFloat(a.paddingRight)), r;
}
return 0;
}
}, {
key: "width",
value: function(t) {
if (t) {
var r = t.offsetWidth, a = getComputedStyle(t);
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 t = document.documentElement;
return (window.pageYOffset || t.scrollTop) - (t.clientTop || 0);
}
}, {
key: "getWindowScrollLeft",
value: function() {
var t = document.documentElement;
return (window.pageXOffset || t.scrollLeft) - (t.clientLeft || 0);
}
}, {
key: "getOuterWidth",
value: function(t, r) {
if (t) {
var a = t.getBoundingClientRect().width || t.offsetWidth;
if (r) {
var s = getComputedStyle(t);
a = a + (parseFloat(s.marginLeft) + parseFloat(s.marginRight));
}
return a;
}
return 0;
}
}, {
key: "getOuterHeight",
value: function(t, r) {
if (t) {
var a = t.getBoundingClientRect().height || t.offsetHeight;
if (r) {
var s = getComputedStyle(t);
a = a + (parseFloat(s.marginTop) + parseFloat(s.marginBottom));
}
return a;
}
return 0;
}
}, {
key: "getClientHeight",
value: function(t, r) {
if (t) {
var a = t.clientHeight;
if (r) {
var s = getComputedStyle(t);
a = a + (parseFloat(s.marginTop) + parseFloat(s.marginBottom));
}
return a;
}
return 0;
}
}, {
key: "getClientWidth",
value: function(t, r) {
if (t) {
var a = t.clientWidth;
if (r) {
var s = getComputedStyle(t);
a = a + (parseFloat(s.marginLeft) + parseFloat(s.marginRight));
}
return a;
}
return 0;
}
}, {
key: "getViewport",
value: function() {
var t = window, r = document, a = r.documentElement, s = r.getElementsByTagName("body")[0], o = t.innerWidth || a.clientWidth || s.clientWidth, l = t.innerHeight || a.clientHeight || s.clientHeight;
return {
width: o,
height: l
};
}
}, {
key: "getOffset",
value: function(t) {
if (t) {
var r = t.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(t) {
if (t)
for (var r = t.parentNode.childNodes, a = 0, s = 0; s < r.length; s++) {
if (r[s] === t)
return a;
r[s].nodeType === 1 && a++;
}
return -1;
}
}, {
key: "addMultipleClasses",
value: function(t, r) {
if (t && r)
if (t.classList)
for (var a = r.split(" "), s = 0; s < a.length; s++)
t.classList.add(a[s]);
else
for (var o = r.split(" "), l = 0; l < o.length; l++)
t.className = t.className + (" " + o[l]);
}
}, {
key: "removeMultipleClasses",
value: function(t, r) {
if (t && r)
if (t.classList)
for (var a = r.split(" "), s = 0; s < a.length; s++)
t.classList.remove(a[s]);
else
for (var o = r.split(" "), l = 0; l < o.length; l++)
t.className = t.className.replace(new RegExp("(^|\\b)" + o[l].split(" ").join("|") + "(\\b|$)", "gi"), " ");
}
}, {
key: "addClass",
value: function(t, r) {
t && r && (t.classList ? t.classList.add(r) : t.className = t.className + (" " + r));
}
}, {
key: "removeClass",
value: function(t, r) {
t && r && (t.classList ? t.classList.remove(r) : t.className = t.className.replace(new RegExp("(^|\\b)" + r.split(" ").join("|") + "(\\b|$)", "gi"), " "));
}
}, {
key: "hasClass",
value: function(t, r) {
return t ? t.classList ? t.classList.contains(r) : new RegExp("(^| )" + r + "( |$)", "gi").test(t.className) : !1;
}
}, {
key: "addStyles",
value: function(t) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
t && Object.entries(r).forEach(function(a) {
var s = kn(a, 2), o = s[0], l = s[1];
return t.style[o] = l;
});
}
}, {
key: "find",
value: function(t, r) {
return t ? Array.from(t.querySelectorAll(r)) : [];
}
}, {
key: "findSingle",
value: function(t, r) {
return t ? t.querySelector(r) : null;
}
}, {
key: "setAttributes",
value: function(t) {
var r = this, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (t) {
var s = function(l, c) {
var u, d, f = t != null && (u = t.$attrs) !== null && u !== void 0 && u[l] ? [t == null || (d = t.$attrs) === null || d === void 0 ? void 0 : d[l]] : [];
return [c].flat().reduce(function(p, m) {
if (m != null) {
var g = we(m);
if (g === "string" || g === "number")
p.push(m);
else if (g === "object") {
var y = Array.isArray(m) ? s(l, m) : Object.entries(m).map(function(x) {
var j = kn(x, 2), C = j[0], E = j[1];
return l === "style" && (E || E === 0) ? "".concat(C.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), ":").concat(E) : E ? C : void 0;
});
p = y.length ? p.concat(y.filter(function(x) {
return !!x;
})) : p;
}
}
return p;
}, f);
};
Object.entries(a).forEach(function(o) {
var l = kn(o, 2), c = l[0], u = l[1];
if (u != null) {
var d = c.match(/^on(.+)/);
d ? t.addEventListener(d[1].toLowerCase(), u) : c === "p-bind" ? r.setAttributes(t, u) : (u = c === "class" ? Mn(new Set(s("class", u))).join(" ").trim() : c === "style" ? s("style", u).join(";").trim() : u, (t.$attrs = t.$attrs || {}) && (t.$attrs[c] = u), t.setAttribute(c, u));
}
});
}
}
}, {
key: "getAttribute",
value: function(t, r) {
if (t) {
var a = t.getAttribute(r);
return isNaN(a) ? a === "true" || a === "false" ? a === "true" : a : +a;
}
}
}, {
key: "isAttributeEquals",
value: function(t, r, a) {
return t ? this.getAttribute(t, r) === a : !1;
}
}, {
key: "isAttributeNotEquals",
value: function(t, r, a) {
return !this.isAttributeEquals(t, r, a);
}
}, {
key: "getHeight",
value: function(t) {
if (t) {
var r = t.offsetHeight, a = getComputedStyle(t);
return r = r - (parseFloat(a.paddingTop) + parseFloat(a.paddingBottom) + parseFloat(a.borderTopWidth) + parseFloat(a.borderBottomWidth)), r;
}
return 0;
}
}, {
key: "getWidth",
value: function(t) {
if (t) {
var r = t.offsetWidth, a = getComputedStyle(t);
return r = r - (parseFloat(a.paddingLeft) + parseFloat(a.paddingRight) + parseFloat(a.borderLeftWidth) + parseFloat(a.borderRightWidth)), r;
}
return 0;
}
}, {
key: "alignOverlay",
value: function(t, r, a) {
var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0;
t && r && (a === "self" ? this.relativePosition(t, r) : (s && (t.style.minWidth = e.getOuterWidth(r) + "px"), this.absolutePosition(t, r)));
}
}, {
key: "absolutePosition",
value: function(t, r) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "left";
if (t && r) {
var s = t.offsetParent ? {
width: t.offsetWidth,
height: t.offsetHeight
} : this.getHiddenElementDimensions(t), o = s.height, l = s.width, c = r.offsetHeight, u = r.offsetWidth, d = r.getBoundingClientRect(), f = this.getWindowScrollTop(), p = this.getWindowScrollLeft(), m = this.getViewport(), g, y;
d.top + c + o > m.height ? (g = d.top + f - o, g < 0 && (g = f), t.style.transformOrigin = "bottom") : (g = c + d.top + f, t.style.transformOrigin = "top");
var x = d.left;
a === "left" ? x + l > m.width ? y = Math.max(0, x + p + u - l) : y = x + p : x + u - l < 0 ? y = p : y = x + u - l + p, t.style.top = g + "px", t.style.left = y + "px";
}
}
}, {
key: "relativePosition",
value: function(t, r) {
if (t && r) {
var a = t.offsetParent ? {
width: t.offsetWidth,
height: t.offsetHeight
} : this.getHiddenElementDimensions(t), s = r.offsetHeight, o = r.getBoundingClientRect(), l = this.getViewport(), c, u;
o.top + s + a.height > l.height ? (c = -1 * a.height, o.top + c < 0 && (c = -1 * o.top), t.style.transformOrigin = "bottom") : (c = s, t.style.transformOrigin = "top"), a.width > l.width ? u = o.left * -1 : o.left + a.width > l.width ? u = (o.left + a.width - l.width) * -1 : u = 0, t.style.top = c + "px", t.style.left = u + "px";
}
}
}, {
key: "flipfitCollision",
value: function(t, r) {
var a = this, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "left top", o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "left bottom", l = arguments.length > 4 ? arguments[4] : void 0;
if (t && r) {
var c = r.getBoundingClientRect(), u = this.getViewport(), d = s.split(" "), f = o.split(" "), p = function(j, C) {
return C ? +j.substring(j.search(/(\+|-)/g)) || 0 : j.substring(0, j.search(/(\+|-)/g)) || j;
}, m = {
my: {
x: p(d[0]),
y: p(d[1] || d[0]),
offsetX: p(d[0], !0),
offsetY: p(d[1] || d[0], !0)
},
at: {
x: p(f[0]),
y: p(f[1] || f[0]),
offsetX: p(f[0], !0),
offsetY: p(f[1] || f[0], !0)
}
}, g = {
left: function() {
var j = m.my.offsetX + m.at.offsetX;
return j + c.left + (m.my.x === "left" ? 0 : -1 * (m.my.x === "center" ? a.getOuterWidth(t) / 2 : a.getOuterWidth(t)));
},
top: function() {
var j = m.my.offsetY + m.at.offsetY;
return j + c.top + (m.my.y === "top" ? 0 : -1 * (m.my.y === "center" ? a.getOuterHeight(t) / 2 : a.getOuterHeight(t)));
}
}, y = {
count: {
x: 0,
y: 0
},
left: function() {
var j = g.left(), C = e.getWindowScrollLeft();
t.style.left = j + C + "px", this.count.x === 2 ? (t.style.left = C + "px", this.count.x = 0) : j < 0 && (this.count.x++, m.my.x = "left", m.at.x = "right", m.my.offsetX *= -1, m.at.offsetX *= -1, this.right());
},
right: function() {
var j = g.left() + e.getOuterWidth(r), C = e.getWindowScrollLeft();
t.style.left = j + C + "px", this.count.x === 2 ? (t.style.left = u.width - e.getOuterWidth(t) + C + "px", this.count.x = 0) : j + e.getOuterWidth(t) > u.width && (this.count.x++, m.my.x = "right", m.at.x = "left", m.my.offsetX *= -1, m.at.offsetX *= -1, this.left());
},
top: function() {
var j = g.top(), C = e.getWindowScrollTop();
t.style.top = j + C + "px", this.count.y === 2 ? (t.style.left = C + "px", this.count.y = 0) : j < 0 && (this.count.y++, m.my.y = "top", m.at.y = "bottom", m.my.offsetY *= -1, m.at.offsetY *= -1, this.bottom());
},
bottom: function() {
var j = g.top() + e.getOuterHeight(r), C = e.getWindowScrollTop();
t.style.top = j + C + "px", this.count.y === 2 ? (t.style.left = u.height - e.getOuterHeight(t) + C + "px", this.count.y = 0) : j + e.getOuterHeight(r) > u.height && (this.count.y++, m.my.y = "bottom", m.at.y = "top", m.my.offsetY *= -1, m.at.offsetY *= -1, this.top());
},
center: function(j) {
if (j === "y") {
var C = g.top() + e.getOuterHeight(r) / 2;
t.style.top = C + e.getWindowScrollTop() + "px", C < 0 ? this.bottom() : C + e.getOuterHeight(r) > u.height && this.top();
} else {
var E = g.left() + e.getOuterWidth(r) / 2;
t.style.left = E + e.getWindowScrollLeft() + "px", E < 0 ? this.left() : E + e.getOuterWidth(t) > u.width && this.right();
}
}
};
y[m.at.x]("x"), y[m.at.y]("y"), this.isFunction(l) && l(m);
}
}
}, {
key: "findCollisionPosition",
value: function(t) {
if (t) {
var r = t === "top" || t === "bottom", a = t === "left" ? "right" : "left", s = t === "top" ? "bottom" : "top";
return r ? {
axis: "y",
my: "center ".concat(s),
at: "center ".concat(t)
} : {
axis: "x",
my: "".concat(a, " center"),
at: "".concat(t, " center")
};
}
}
}, {
key: "getParents",
value: function(t) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
return t.parentNode === null ? r : this.getParents(t.parentNode, r.concat([t.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(t) {
var r = this, a = [];
if (t) {
var s = this.getParents(t), o = /(auto|scroll)/, l = function(I) {
var b = I ? getComputedStyle(I) : null;
return b && (o.test(b.getPropertyValue("overflow")) || o.test(b.getPropertyValue("overflow-x")) || o.test(b.getPropertyValue("overflow-y")));
}, c = function(I) {
a.push(I.nodeName === "BODY" || I.nodeName === "HTML" || r.isDocument(I) ? window : I);
}, u = hr(s), d;
try {
for (u.s(); !(d = u.n()).done; ) {
var f, p = d.value, m = p.nodeType === 1 && ((f = p.dataset) === null || f === void 0 ? void 0 : f.scrollselectors);
if (m) {
var g = m.split(","), y = hr(g), x;
try {
for (y.s(); !(x = y.n()).done; ) {
var j = x.value, C = this.findSingle(p, j);
C && l(C) && c(C);
}
} catch (E) {
y.e(E);
} finally {
y.f();
}
}
p.nodeType === 1 && l(p) && c(p);
}
} catch (E) {
u.e(E);
} finally {
u.f();
}
}
return a;
}
}, {
key: "getHiddenElementOuterHeight",
value: function(t) {
if (t) {
t.style.visibility = "hidden", t.style.display = "block";
var r = t.offsetHeight;
return t.style.display = "none", t.style.visibility = "visible", r;
}
return 0;
}
}, {
key: "getHiddenElementOuterWidth",
value: function(t) {
if (t) {
t.style.visibility = "hidden", t.style.display = "block";
var r = t.offsetWidth;
return t.style.display = "none", t.style.visibility = "visible", r;
}
return 0;
}
}, {
key: "getHiddenElementDimensions",
value: function(t) {
var r = {};
return t && (t.style.visibility = "hidden", t.style.display = "block", r.width = t.offsetWidth, r.height = t.offsetHeight, t.style.display = "none", t.style.visibility = "visible"), r;
}
}, {
key: "fadeIn",
value: function(t, r) {
if (t) {
t.style.opacity = 0;
var a = +/* @__PURE__ */ new Date(), s = 0, o = function() {
s = +t.style.opacity + ((/* @__PURE__ */ new Date()).getTime() - a) / r, t.style.opacity = s, a = +/* @__PURE__ */ new Date(), +s < 1 && (window.requestAnimationFrame && requestAnimationFrame(o) || setTimeout(o, 16));
};
o();
}
}
}, {
key: "fadeOut",
value: function(t, r) {
if (t)
var a = 1, s = 50, o = s / r, l = setInterval(function() {
a = a - o, a <= 0 && (a = 0, clearInterval(l)), t.style.opacity = a;
}, s);
}
}, {
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(t) {
return !!(t && t.constructor && t.call && t.apply);
}
}, {
key: "appendChild",
value: function(t, r) {
if (this.isElement(r))
r.appendChild(t);
else if (r.el && r.el.nativeElement)
r.el.nativeElement.appendChild(t);
else
throw new Error("Cannot append " + r + " to " + t);
}
}, {
key: "removeChild",
value: function(t, r) {
if (this.isElement(r))
r.removeChild(t);
else if (r.el && r.el.nativeElement)
r.el.nativeElement.removeChild(t);
else
throw new Error("Cannot remove " + t + " from " + r);
}
}, {
key: "isElement",
value: function(t) {
return (typeof HTMLElement > "u" ? "undefined" : we(HTMLElement)) === "object" ? t instanceof HTMLElement : t && we(t) === "object" && t !== null && t.nodeType === 1 && typeof t.nodeName == "string";
}
}, {
key: "isDocument",
value: function(t) {
return (typeof Document > "u" ? "undefined" : we(Document)) === "object" ? t instanceof Document : t && we(t) === "object" && t !== null && t.nodeType === 9;
}
}, {
key: "scrollInView",
value: function(t, r) {
var a = getComputedStyle(t).getPropertyValue("border-top-width"), s = a ? parseFloat(a) : 0, o = getComputedStyle(t).getPropertyValue("padding-top"), l = o ? parseFloat(o) : 0, c = t.getBoundingClientRect(), u = r.getBoundingClientRect(), d = u.top + document.body.scrollTop - (c.top + document.body.scrollTop) - s - l, f = t.scrollTop, p = t.clientHeight, m = this.getOuterHeight(r);
d < 0 ? t.scrollTop = f + d : d + m > p && (t.scrollTop = f + d - p + m);
}
}, {
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(t) {
if (t) {
var r = getComputedStyle(t);
return t.offsetWidth - t.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 s = a.offsetWidth - a.clientWidth;
return document.body.removeChild(a), this.calculatedScrollbarWidth = s, s;
}
}, {
key: "calculateBodyScrollbarWidth",
value: function() {
return window.innerWidth - document.documentElement.offsetWidth;
}
}, {
key: "getBrowser",
value: function() {
if (!this.browser) {
var t = this.resolveUserAgent();
this.browser = {}, t.browser && (this.browser[t.browser] = !0, this.browser.version = t.version), this.browser.chrome ? this.browser.webkit = !0 : this.browser.webkit && (this.browser.safari = !0);
}
return this.browser;
}
}, {
key: "resolveUserAgent",
value: function() {
var t = navigator.userAgent.toLowerCase(), r = /(chrome)[ ]([\w.]+)/.exec(t) || /(webkit)[ ]([\w.]+)/.exec(t) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(t) || /(msie) ([\w.]+)/.exec(t) || t.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t) || [];
return {
browser: r[1] || "",
version: r[2] || "0"
};
}
}, {
key: "blockBodyScroll",
value: function() {
var t = 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, t);
}
}, {
key: "unblockBodyScroll",
value: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden";
document.body.style.removeProperty("--scrollbar-width"), this.removeClass(document.body, t);
}
}, {
key: "isVisible",
value: function(t) {
return t && (t.clientHeight !== 0 || t.getClientRects().length !== 0 || getComputedStyle(t).display !== "none");
}
}, {
key: "isExist",
value: function(t) {
return !!(t !== null && typeof t < "u" && t.nodeName && t.parentNode);
}
}, {
key: "getFocusableElements",
value: function(t) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", a = e.find(t, '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)), s = [], o = hr(a), l;
try {
for (o.s(); !(l = o.n()).done; ) {
var c = l.value;
getComputedStyle(c).display !== "none" && getComputedStyle(c).visibility !== "hidden" && s.push(c);
}
} catch (u) {
o.e(u);
} finally {
o.f();
}
return s;
}
}, {
key: "getFirstFocusableElement",
value: function(t, r) {
var a = e.getFocusableElements(t, r);
return a.length > 0 ? a[0] : null;
}
}, {
key: "getLastFocusableElement",
value: function(t, r) {
var a = e.getFocusableElements(t, 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(t, r) {
var a = r === void 0 ? !0 : !r;
t && document.activeElement !== t && t.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(t, r) {
if (t) {
var a = e.getFirstFocusableElement(t);
return a && e.focus(a, r), a;
}
}
}, {
key: "getCursorOffset",
value: function(t, r, a, s) {
if (t) {
var o = getComputedStyle(t), l = document.createElement("div");
l.style.position = "absolute", l.style.top = "0px", l.style.left = "0px", l.style.visibility = "hidden", l.style.pointerEvents = "none", l.style.overflow = o.overflow, l.style.width = o.width, l.style.height = o.height, l.style.padding = o.padding, l.style.border = o.border, l.style.overflowWrap = o.overflowWrap, l.style.whiteSpace = o.whiteSpace, l.style.lineHeight = o.lineHeight, l.innerHTML = r.replace(/\r\n|\r|\n/g, "<br />");
var c = document.createElement("span");
c.textContent = s, l.appendChild(c);
var u = document.createTextNode(a);
l.appendChild(u), document.body.appendChild(l);
var d = c.offsetLeft, f = c.offsetTop, p = c.clientHeight;
return document.body.removeChild(l), {
left: Math.abs(d - t.scrollLeft),
top: Math.abs(f - t.scrollTop) + p
};
}
return {
top: "auto",
left: "auto"
};
}
}, {
key: "invokeElementMethod",
value: function(t, r, a) {
t[r].apply(t, a);
}
}, {
key: "isClickable",
value: function(t) {
var r = t.nodeName, a = t.parentElement && t.parentElement.nodeName;
return r === "INPUT" || r === "TEXTAREA" || r === "BUTTON" || r === "A" || a === "INPUT" || a === "TEXTAREA" || a === "BUTTON" || a === "A" || this.hasClass(t, "p-button") || this.hasClass(t.parentElement, "p-button") || this.hasClass(t.parentElement, "p-checkbox") || this.hasClass(t.parentElement, "p-radiobutton");
}
}, {
key: "applyStyle",
value: function(t, r) {
if (typeof r == "string")
t.style.cssText = r;
else
for (var a in r)
t.style[a] = r[a];
}
}, {
key: "exportCSV",
value: function(t, r) {
var a = new Blob([t], {
type: "application/csv;charset=utf-8;"
});
if (window.navigator.msSaveOrOpenBlob)
navigator.msSaveOrOpenBlob(a, r + ".csv");
else {
var s = e.saveAs({
name: r + ".csv",
src: URL.createObjectURL(a)
});
s || (t = "data:text/csv;charset=utf-8," + t, window.open(encodeURI(t)));
}
}
}, {
key: "saveAs",
value: function(t) {
if (t) {
var r = document.createElement("a");
if (r.download !== void 0) {
var a = t.name, s = t.src;
return r.setAttribute("href", s), 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(t, r) {
var a = document.createElement("style");
return e.addNonce(a, t), r || (r = document.head), r.appendChild(a), a;
}
}, {
key: "removeInlineStyle",
value: function(t) {
if (this.isExist(t)) {
try {
t.parentNode.removeChild(t);
} catch {
}
t = null;
}
return t;
}
}, {
key: "addNonce",
value: function(t, r) {
try {
r || (r = process.env.REACT_APP_CSS_NONCE);
} catch {
}
r && t.setAttribute("nonce", r);
}
}, {
key: "getTargetElement",
value: function(t) {
if (!t)
return null;
if (t === "document")
return document;
if (t === "window")
return window;
if (we(t) === "object" && t.hasOwnProperty("current"))
return this.isExist(t.current) ? t.current : null;
var r = function(o) {
return !!(o && o.constructor && o.call && o.apply);
}, a = r(t) ? t() : t;
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(t) {
var r, a, s;
for (a = [], s = t.attributes, r = 0; r < s.length; ++r)
a.push(s[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(t, r) {
var a, s, o, l, c;
if (a = e.getAttributeNames(t), s = e.getAttributeNames(r), a.join(",") !== s.join(","))
return !1;
for (var u = 0; u < a.length; ++u)
if (o = a[u], o === "style")
for (var d = t.style, f = r.style, p = /^\d+$/, m = 0, g = Object.keys(d); m < g.length; m++) {
var y = g[m];
if (!p.test(y) && d[y] !== f[y])
return !1;
}
else if (t.getAttribute(o) !== r.getAttribute(o))
return !1;
for (l = t.firstChild, c = r.firstChild; l && c; l = l.nextSibling, c = c.nextSibling) {
if (l.nodeType !== c.nodeType)
return !1;
if (l.nodeType === 1) {
if (!e.isEqualElement(l, c))
return !1;
} else if (l.nodeValue !== c.nodeValue)
return !1;
}
return !(l || c);
}
}, {
key: "hasCSSAnimation",
value: function(t) {
if (t) {
var r = getComputedStyle(t), a = parseFloat(r.getPropertyValue("animation-duration") || "0");
return a > 0;
}
return !1;
}
}, {
key: "hasCSSTransition",
value: function(t) {
if (t) {
var r = getComputedStyle(t), a = parseFloat(r.getPropertyValue("transition-duration") || "0");
return a > 0;
}
return !1;
}
}]);
}();
Hn(Ae, "DATA_PROPS", ["data-"]);
Hn(Ae, "ARIA_PROPS", ["aria", "focus-target"]);
function Or() {
return Or = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Or.apply(null, arguments);
}
function ai(e, n) {
var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (!t) {
if (Array.isArray(e) || (t = Yl(e)) || n) {
t && (e = t);
var r = 0, a = function() {
};
return { s: a, n: function() {
return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
}, e: function(u) {
throw u;
}, 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 s, o = !0, l = !1;
return { s: function() {
t = t.call(e);
}, n: function() {
var u = t.next();
return o = u.done, u;
}, e: function(u) {
l = !0, s = u;
}, f: function() {
try {
o || t.return == null || t.return();
} finally {
if (l) throw s;
}
} };
}
function Yl(e, n) {
if (e) {
if (typeof e == "string") return ii(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ii(e, n) : void 0;
}
}
function ii(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
var ue = /* @__PURE__ */ function() {
function e() {
ia(this, e);
}
return sa(e, null, [{
key: "equals",
value: function(t, r, a) {
return a && t && we(t) === "object" && r && we(r) === "object" ? this.deepEquals(this.resolveFieldData(t, a), this.resolveFieldData(r, a)) : this.deepEquals(t, 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(t, r) {
if (t === r)
return !0;
if (t && r && we(t) === "object" && we(r) === "object") {
var a = Array.isArray(t), s = Array.isArray(r), o, l, c;
if (a && s) {
if (l = t.length, l !== r.length)
return !1;
for (o = l; o-- !== 0; )
if (!this.deepEquals(t[o], r[o]))
return !1;
return !0;
}
if (a !== s)
return !1;
var u = t instanceof Date, d = r instanceof Date;
if (u !== d)
return !1;
if (u && d)
return t.getTime() === r.getTime();
var f = t instanceof RegExp, p = r instanceof RegExp;
if (f !== p)
return !1;
if (f && p)
return t.toString() === r.toString();
var m = Object.keys(t);
if (l = m.length, l !== Object.keys(r).length)
return !1;
for (o = l; o-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(r, m[o]))
return !1;
for (o = l; o-- !== 0; )
if (c = m[o], !this.deepEquals(t[c], r[c]))
return !1;
return !0;
}
return t !== t && r !== r;
}
}, {
key: "resolveFieldData",
value: function(t, r) {
if (!t || !r)
return null;
try {
var a = t[r];
if (this.isNotEmpty(a))
return a;
} catch {
}
if (Object.keys(t).length) {
if (this.isFunction(r))
return r(t);
if (this.isNotEmpty(t[r]))
return t[r];
if (r.indexOf(".") === -1)
return t[r];
for (var s = r.split("."), o = t, l = 0, c = s.length; l < c; ++l) {
if (o == null)
return null;
o = o[s[l]];
}
return o;
}
return null;
}
}, {
key: "findDiffKeys",
value: function(t, r) {
return !t || !r ? {} : Object.keys(t).filter(function(a) {
return !r.hasOwnProperty(a);
}).reduce(function(a, s) {
return a[s] = t[s], a;
}, {});
}
/**
* Removes keys from a JSON object that start with a string such as "data" to get all "data-id" type properties.
*
* @param {any} obj the JSON object to reduce
* @param {string[]} startsWiths the string(s) to check if the property starts with this key
* @returns the JSON object containing only the key/values that match the startsWith string
*/
}, {
key: "reduceKeys",
value: function(t, r) {
var a = {};
return !t || !r || r.length === 0 || Object.keys(t).filter(function(s) {
return r.some(function(o) {
return s.startsWith(o);
});
}).forEach(function(s) {
a[s] = t[s], delete t[s];
}), a;
}
}, {
key: "reorderArray",
value: function(t, r, a) {
t && r !== a && (a >= t.length && (a = a % t.length, r = r % t.length), t.splice(a, 0, t.splice(r, 1)[0]));
}
}, {
key: "findIndexInList",
value: function(t, r, a) {
var s = this;
return r ? a ? r.findIndex(function(o) {
return s.equals(o, t, a);
}) : r.findIndex(function(o) {
return o === t;
}) : -1;
}
}, {
key: "getJSXElement",
value: function(t) {
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
a[s - 1] = arguments[s];
return this.isFunction(t) ? t.apply(void 0, a) : t;
}
}, {
key: "getItemValue",
value: function(t) {
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
a[s - 1] = arguments[s];
return this.isFunction(t) ? t.apply(void 0, a) : t;
}
}, {
key: "getProp",
value: function(t) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = t ? t[r] : void 0;
return s === void 0 ? a[r] : s;
}
}, {
key: "getPropCaseInsensitive",
value: function(t, r) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = this.toFlatCase(r);
for (var o in t)
if (t.hasOwnProperty(o) && this.toFlatCase(o) === s)
return t[o];
for (var l in a)
if (a.hasOwnProperty(l) && this.toFlatCase(l) === s)
return a[l];
}
}, {
key: "getMergedProps",
value: function(t, r) {
return Object.assign({}, r, t);
}
}, {
key: "getDiffProps",
value: function(t, r) {
return this.findDiffKeys(t, r);
}
/**
* Gets the value of a property which can be a function or a direct value.
* If the property is a function, it will be invoked with the provided parameters.
* @param {*} obj - The object to get the value from
* @param {...*} params - Parameters to pass to the function if obj is a function
* @returns {*} The resolved value
*/
}, {
key: "getPropValue",
value: function(t) {
if (!this.isFunction(t))
return t;
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
a[s - 1] = arguments[s];
if (a.length === 1) {
var o = a[0];
return t(Array.isArray(o) ? o[0] : o);
}
return t.apply(void 0, a);
}
}, {
key: "getComponentProp",
value: function(t) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return this.isNotEmpty(t) ? this.getProp(t.props, r, a) : void 0;
}
}, {
key: "getComponentProps",
value: function(t, r) {
return this.isNotEmpty(t) ? this.getMergedProps(t.props, r) : void 0;
}
}, {
key: "getComponentDiffProps",
value: function(t, r) {
return this.isNotEmpty(t) ? this.getDiffProps(t.props, r) : void 0;
}
}, {
key: "isValidChild",
value: function(t, r, a) {
if (t) {
var s, o = this.getComponentProp(t, "__TYPE") || (t.type ? t.type.displayName : void 0);
!o && t !== null && t !== void 0 && (s = t.type) !== null && s !== void 0 && (s = s._payload) !== null && s !== void 0 && s.value && (o = t.type._payload.value.find(function(u) {
return u === r;
}));
var l = o === r;
try {
var c;
} catch {
}
return l;
}
return !1;
}
}, {
key: "getRefElement",
value: function(t) {
return t ? we(t) === "object" && t.hasOwnProperty("current") ? t.current : t : null;
}
}, {
key: "combinedRefs",
value: function(t, r) {
t && r && (typeof r == "function" ? r(t.current) : r.current = t.current);
}
}, {
key: "removeAccents",
value: function(t) {
return t && t.search(/[\xC0-\xFF]/g) > -1 && (t = t.replace(/[\xC0-\xC5]/g, "A").replace(/[\xC6]/g, "AE").replace(/[\xC7]/g, "C").replace(/[\xC8-\xCB]/g, "E").replace(/[\xCC-\xCF]/g, "I").replace(/[\xD0]/g, "D").replace(/[\xD1]/g, "N").replace(/[\xD2-\xD6\xD8]/g, "O").replace(/[\xD9-\xDC]/g, "U").replace(/[\xDD]/g, "Y").replace(/[\xDE]/g, "P").replace(/[\xE0-\xE5]/g, "a").replace(/[\xE6]/g, "ae").replace(/[\xE7]/g, "c").replace(/[\xE8-\xEB]/g, "e").replace(/[\xEC-\xEF]/g, "i").replace(/[\xF1]/g, "n").replace(/[\xF2-\xF6\xF8]/g, "o").replace(/[\xF9-\xFC]/g, "u").replace(/[\xFE]/g, "p").replace(/[\xFD\xFF]/g, "y")), t;
}
}, {
key: "toFlatCase",
value: function(t) {
return this.isNotEmpty(t) && this.isString(t) ? t.replace(/(-|_)/g, "").toLowerCase() : t;
}
}, {
key: "toCapitalCase",
value: function(t) {
return this.isNotEmpty(t) && this.isString(t) ? t[0].toUpperCase() + t.slice(1) : t;
}
}, {
key: "trim",
value: function(t) {
return this.isNotEmpty(t) && this.isString(t) ? t.trim() : t;
}
}, {
key: "isEmpty",
value: function(t) {
return t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && we(t) === "object" && Object.keys(t).length === 0;
}
}, {
key: "isNotEmpty",
value: function(t) {
return !this.isEmpty(t);
}
}, {
key: "isFunction",
value: function(t) {
return !!(t && t.constructor && t.call && t.apply);
}
}, {
key: "isObject",
value: function(t) {
return t !== null && t instanceof Object && t.constructor === Object;
}
}, {
key: "isDate",
value: function(t) {
return t !== null && t instanceof Date && t.constructor === Date;
}
}, {
key: "isArray",
value: function(t) {
return t !== null && Array.isArray(t);
}
}, {
key: "isString",
value: function(t) {
return t !== null && typeof t == "string";
}
}, {
key: "isPrintableCharacter",
value: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return this.isNotEmpty(t) && t.length === 1 && t.match(/\S| /);
}
}, {
key: "isLetter",
value: function(t) {
return /^[a-zA-Z\u00C0-\u017F]$/.test(t);
}
}, {
key: "isScalar",
value: function(t) {
return t != null && (typeof t == "string" || typeof t == "number" || typeof t == "bigint" || typeof t == "boolean");
}
/**
* Firefox-v103 does not currently support the "findLast" method. It is stated that this method will be supported with Firefox-v104.
* https://caniuse.com/mdn-javascript_builtins_array_findlast
*/
}, {
key: "findLast",
value: function(t, r) {
var a;
if (this.isNotEmpty(t))
try {
a = t.findLast(r);
} catch {
a = Mn(t).reverse().find(r);
}
return a;
}
/**
* Firefox-v103 does not currently support the "findLastIndex" method. It is stated that this method will be supported with Firefox-v104.
* https://caniuse.com/mdn-javascript_builtins_array_findlastindex
*/
}, {
key: "findLastIndex",
value: function(t, r) {
var a = -1;
if (this.isNotEmpty(t))
try {
a = t.findLastIndex(r);
} catch {
a = t.lastIndexOf(Mn(t).reverse().find(r));
}
return a;
}
}, {
key: "sort",
value: function(t, r) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, s = arguments.length > 3 ? arguments[3] : void 0, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1, l = this.compare(t, r, s, a), c = a;
return (this.isEmpty(t) || this.isEmpty(r)) && (c = o === 1 ? a : o), c * l;
}
}, {
key: "compare",
value: function(t, r, a) {
var s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1, o = -1, l = this.isEmpty(t), c = this.isEmpty(r);
return l && c ? o = 0 : l ? o = s : c ? o = -s : typeof t == "string" && typeof r == "string" ? o = a(t, r) : o = t < r ? -1 : t > r ? 1 : 0, o;
}
}, {
key: "localeComparator",
value: function(t) {
return new Intl.Collator(t, {
numeric: !0
}).compare;
}
}, {
key: "findChildrenByKey",
value: function(t, r) {
var a = ai(t), s;
try {
for (a.s(); !(s = a.n()).done; ) {
var o = s.value;
if (o.key === r)
return o.children || [];
if (o.children) {
var l = this.findChildrenByKey(o.children, r);
if (l.length > 0)
return l;
}
}
} catch (c) {
a.e(c);
} finally {
a.f();
}
return [];
}
/**
* This function takes mutates and object with a new value given
* a specific field. This will handle deeply nested fields that
* need to be modified or created.
*
* e.g:
* data = {
* nested: {
* foo: "bar"
* }
* }
*
* field = "nested.foo"
* value = "baz"
*
* The function will mutate data to be
* e.g:
* data = {
* nested: {
* foo: "baz"
* }
* }
*
* @param {object} data the object to be modified
* @param {string} field the field in the object to replace
* @param {any} value the value to have replaced in the field
*/
}, {
key: "mutateFieldData",
value: function(t, r, a) {
if (!(we(t) !== "object" || typeof r != "string"))
for (var s = r.split("."), o = t, l = 0, c = s.length; l < c; ++l) {
if (l + 1 - c === 0) {
o[s[l]] = a;
break;
}
o[s[l]] || (o[s[l]] = {}), o = o[s[l]];
}
}
/**
* This helper function takes an object and a dot-separated key path. It traverses the object based on the path,
* returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
*
* Example:
* const obj = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
* const path = 'address.city';
* const result = ObjectUtils.getNestedValue(obj, path);
* console.log(result); // Output: "Wonderland"
*
* @param {object} obj - The object to traverse.
* @param {string} path - The dot-separated key path.
* @returns {*} The value at the specified depth, or undefined if any part of the path is missing or undefined.
*/
}, {
key: "getNestedValue",
value: function(t, r) {
return r.split(".").reduce(function(a, s) {
return a && a[s] !== void 0 ? a[s] : void 0;
}, t);
}
/**
* This function takes an object and a dot-separated key path. It traverses the object based on the path,
* returning the value at the specified depth. If any part of the path is missing or undefined, it returns undefined.
*
* Example:
* const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
* const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
* const result = ObjectUtils.absoluteCompare(objA, objB);
* console.log(result); // Output: true
*
* const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
* const result2 = ObjectUtils.absoluteCompare(objA, objC);
* console.log(result2); // Output: false
*
* @param {object} objA - The first object to compare.
* @param {object} objB - The second object to compare.
* @param {number} [maxDepth=1] - The maximum depth to compare.
* @param {number} [currentDepth=0] - The current depth (used internally for recursion).
* @returns {boolean} True if the objects are equal within the specified depth, false otherwise.
*
*/
}, {
key: "absoluteCompare",
value: function(t, r) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
if (!t || !r || s > a) return !0;
if (we(t) !== we(r)) return !1;
var o = Object.keys(t), l = Object.keys(r);
if (o.length !== l.length) return !1;
for (var c = 0, u = o; c < u.length; c++) {
var d = u[c], f = t[d], p = r[d], m = e.isObject(f) && e.isObject(p), g = e.isFunction(f) && e.isFunction(p);
if ((m || g) && !this.absoluteCompare(f, p, a, s + 1) || !m && f !== p) return !1;
}
return !0;
}
/**
* This helper function takes two objects and a list of keys to compare. It compares the values of the specified keys
* in both objects. If any comparison fails, it returns false. If all specified properties are equal, it returns true.
* It performs a shallow comparison using absoluteCompare if no keys are provided.
*
* Example:
* const objA = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
* const objB = { name: 'Alice', address: { city: 'Wonderland', zip: 12345 } };
* const keysToCompare = ['name', 'address.city', 'address.zip'];
* const result = ObjectUtils.selectiveCompare(objA, objB, keysToCompare);
* console.log(result); // Output: true
*
* const objC = { name: 'Alice', address: { city: 'Wonderland', zip: 12346 } };
* const result2 = ObjectUtils.selectiveCompare(objA, objC, keysToCompare);
* console.log(result2); // Output: false
*
* @param {object} a - The first object to compare.
* @param {object} b - The second object to compare.
* @param {string[]} [keysToCompare] - The keys to compare. If not provided, performs a shallow comparison using absoluteCompare.
* @returns {boolean} True if all specified properties are equal, false otherwise.
*/
}, {
key: "selectiveCompare",
value: function(t, r, a) {
if (t === r) return !0;
if (!t || !r || we(t) !== "object" || we(r) !== "object") return !1;
if (!a) return this.absoluteCompare(t, r, 1);
var s = ai(a), o;
try {
for (s.s(); !(o = s.n()).done; ) {
var l = o.value, c = this.getNestedValue(t, l), u = this.getNestedValue(r, l), d = we(c) === "object" && c !== null && we(u) === "object" && u !== null;
if (d && !this.absoluteCompare(c, u, 1) || !d && c !== u) return !1;
}
} catch (f) {
s.e(f);
} finally {
s.f();
}
return !0;
}
}]);
}(), si = 0;
function Gl() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pr_id_";
return si++, "".concat(e).concat(si);
}
function oi(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function Zl(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? oi(Object(t), !0).forEach(function(r) {
Hn(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : oi(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
var li = /* @__PURE__ */ function() {
function e() {
ia(this, e);
}
return sa(e, null, [{
key: "getJSXIcon",
value: function(t) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = null;
if (t !== null) {
var o = we(t), l = ut(r.className, o === "string" && t);
if (s = /* @__PURE__ */ V.createElement("span", Or({}, r, {
className: l,
key: Gl("icon")
})), o !== "string") {
var c = Zl({
iconProps: r,
element: s
}, a);
return ue.getJSXElement(t, c);
}
}
return s;
}
}]);
}();
function ci(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function ui(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? ci(Object(t), !0).forEach(function(r) {
Hn(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ci(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function Fn(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (e) {
var t = function(o) {
return typeof o == "function";
}, r = n.classNameMergeFunction, a = t(r);
return e.reduce(function(s, o) {
if (!o)
return s;
var l = function() {
var d = o[c];
if (c === "style")
s.style = ui(ui({}, s.style), o.style);
else if (c === "className") {
var f = "";
a ? f = r(s.className, o.className) : f = [s.className, o.className].join(" ").trim(), s.className = f || void 0;
} else if (t(d)) {
var p = s[c];
s[c] = p ? function() {
p.apply(void 0, arguments), d.apply(void 0, arguments);
} : d;
} else
s[c] = d;
};
for (var c in o)
l();
return s;
}, {});
}
}
function Jl() {
var e = [], n = function(l, c) {
var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 999, d = a(l, c, u), f = d.value + (d.key === l ? 0 : u) + 1;
return e.push({
key: l,
value: f
}), f;
}, t = function(l) {
e = e.filter(function(c) {
return c.value !== l;
});
}, r = function(l, c) {
return a(l, c).value;
}, a = function(l, c) {
var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
return Mn(e).reverse().find(function(d) {
return c ? !0 : d.key === l;
}) || {
key: l,
value: u
};
}, s = function(l) {
return l && parseInt(l.style.zIndex, 10) || 0;
};
return {
get: s,
set: function(l, c, u, d) {
c && (c.style.zIndex = String(n(l, u, d)));
},
clear: function(l) {
l && (t(Zt.get(l)), l.style.zIndex = "");
},
getCurrent: function(l, c) {
return r(l, c);
}
};
}
var Zt = Jl(), Le = Object.freeze({
STARTS_WITH: "startsWith",
CONTAINS: "contains",
NOT_CONTAINS: "notContains",
ENDS_WITH: "endsWith",
EQUALS: "equals",
NOT_EQUALS: "notEquals",
IN: "in",
LESS_THAN: "lt",
LESS_THAN_OR_EQUAL_TO: "lte",
GREATER_THAN: "gt",
GREATER_THAN_OR_EQUAL_TO: "gte",
BETWEEN: "between",
DATE_IS: "dateIs",
DATE_IS_NOT: "dateIsNot",
DATE_BEFORE: "dateBefore",
DATE_AFTER: "dateAfter",
CUSTOM: "custom"
});
function an(e) {
"@babel/helpers - typeof";
return an = 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;
}, an(e);
}
function Kl(e, n) {
if (an(e) != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (an(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function Xl(e) {
var n = Kl(e, "string");
return an(n) == "symbol" ? n : n + "";
}
function Ye(e, n, t) {
return (n = Xl(n)) in e ? Object.defineProperty(e, n, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[n] = t, e;
}
function Ql(e, n, t) {
return Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
function ec(e, n) {
if (!(e instanceof n)) throw new TypeError("Cannot call a class as a function");
}
var $e = /* @__PURE__ */ Ql(function e() {
ec(this, e);
});
Ye($e, "ripple", !1);
Ye($e, "inputStyle", "outlined");
Ye($e, "locale", "en");
Ye($e, "appendTo", null);
Ye($e, "cssTransition", !0);
Ye($e, "autoZIndex", !0);
Ye($e, "hideOverlaysOnDocumentScrolling", !1);
Ye($e, "nonce", null);
Ye($e, "nullSortOrder", 1);
Ye($e, "zIndex", {
modal: 1100,
overlay: 1e3,
menu: 1e3,
tooltip: 1100,
toast: 1200
});
Ye($e, "pt", void 0);
Ye($e, "filterMatchModeOptions", {
text: [Le.STARTS_WITH, Le.CONTAINS, Le.NOT_CONTAINS, Le.ENDS_WITH, Le.EQUALS, Le.NOT_EQUALS],
numeric: [Le.EQUALS, Le.NOT_EQUALS, Le.LESS_THAN, Le.LESS_THAN_OR_EQUAL_TO, Le.GREATER_THAN, Le.GREATER_THAN_OR_EQUAL_TO],
date: [Le.DATE_IS, Le.DATE_IS_NOT, Le.DATE_BEFORE, Le.DATE_AFTER]
});
Ye($e, "changeTheme", function(e, n, t, r) {
var a, s = document.getElementById(t);
if (!s)
throw Error("Element with id ".concat(t, " not found."));
var o = s.getAttribute("href").replace(e, n), l = document.createElement("link");
l.setAttribute("rel", "stylesheet"), l.setAttribute("id", t), l.setAttribute("href", o), l.addEventListener("load", function() {
r && r();
}), (a = s.parentNode) === null || a === void 0 || a.replaceChild(l, s);
});
var tc = {
en: {
accept: "Yes",
addRule: "Add Rule",
am: "AM",
apply: "Apply",
cancel: "Cancel",
choose: "Choose",
chooseDate: "Choose Date",
chooseMonth: "Choose Month",
chooseYear: "Choose Year",
clear: "Clear",
completed: "Completed",
contains: "Contains",
custom: "Custom",
dateAfter: "Date is after",
dateBefore: "Date is before",
dateFormat: "mm/dd/yy",
dateIs: "Date is",
dateIsNot: "Date is not",
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
emptyFilterMessage: "No results found",
emptyMessage: "No available options",
emptySearchMessage: "No results found",
emptySelectionMessage: "No selected item",
endsWith: "Ends with",
equals: "Equals",
fileSizeTypes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
filter: "Filter",
firstDayOfWeek: 0,
gt: "Greater than",
gte: "Greater than or equal to",
lt: "Less than",
lte: "Less than or equal to",
matchAll: "Match All",
matchAny: "Match Any",
medium: "Medium",
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
nextDecade: "Next Decade",
nextHour: "Next Hour",
nextMinute: "Next Minute",
nextMonth: "Next Month",
nextSecond: "Next Second",
nextYear: "Next Year",
noFilter: "No Filter",
notContains: "Not contains",
notEquals: "Not equals",
now: "Now",
passwordPrompt: "Enter a password",
pending: "Pending",
pm: "PM",
prevDecade: "Previous Decade",
prevHour: "Previous Hour",
prevMinute: "Previous Minute",
prevMonth: "Previous Month",
prevSecond: "Previous Second",
prevYear: "Previous Year",
reject: "No",
removeRule: "Remove Rule",
searchMessage: "{0} results are available",
selectionMessage: "{0} items selected",
showMonthAfterYear: !1,
startsWith: "Starts with",
strong: "Strong",
today: "Today",
upload: "Upload",
weak: "Weak",
weekHeader: "Wk",
aria: {
cancelEdit: "Cancel Edit",
close: "Close",
collapseRow: "Row Collapsed",
editRow: "Edit Row",
expandRow: "Row Expanded",
falseLabel: "False",
filterConstraint: "Filter Constraint",
filterOperator: "Filter Operator",
firstPageLabel: "First Page",
gridView: "Grid View",
hideFilterMenu: "Hide Filter Menu",
jumpToPageDropdownLabel: "Jump to Page Dropdown",
jumpToPageInputLabel: "Jump to Page Input",
lastPageLabel: "Last Page",
listLabel: "Option List",
listView: "List View",
moveAllToSource: "Move All to Source",
moveAllToTarget: "Move All to Target",
moveBottom: "Move Bottom",
moveDown: "Move Down",
moveToSource: "Move to Source",
moveToTarget: "Move to Target",
moveTop: "Move Top",
moveUp: "Move Up",
navigation: "Navigation",
next: "Next",
nextPageLabel: "Next Page",
nullLabel: "Not Selected",
pageLabel: "Page {page}",
otpLabel: "Please enter one time password character {0}",
passwordHide: "Hide Password",
passwordShow: "Show Password",
previous: "Previous",
prevPageLabel: "Previous Page",
rotateLeft: "Rotate Left",
rotateRight: "Rotate Right",
rowsPerPageLabel: "Rows per page",
saveEdit: "Save Edit",
scrollTop: "Scroll Top",
selectAll: "All items selected",
selectRow: "Row Selected",
showFilterMenu: "Show Filter Menu",
slide: "Slide",
slideNumber: "{slideNumber}",
star: "1 star",
stars: "{star} stars",
trueLabel: "True",
unselectAll: "All items unselected",
unselectRow: "Row Unselected",
zoomImage: "Zoom Image",
zoomIn: "Zoom In",
zoomOut: "Zoom Out"
}
}
};
function nc(e, n) {
if (e.includes("__proto__") || e.includes("prototype"))
throw new Error("Unsafe ariaKey detected");
var t = $e.locale;
try {
var r = rc(t).aria[e];
if (r)
for (var a in n)
n.hasOwnProperty(a) && (r = r.replace("{".concat(a, "}"), n[a]));
return r;
} catch {
throw new Error("The ".concat(e, " option is not found in the current locale('").concat(t, "')."));
}
}
function rc(e) {
var n = e || $e.locale;
if (n.includes("__proto__") || n.includes("prototype"))
throw new Error("Unsafe locale detected");
return tc[n];
}
var $t = /* @__PURE__ */ be.createContext(), tt = $e;
function ac(e) {
if (Array.isArray(e)) return e;
}
function ic(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r, a, s, o, l = [], c = !0, u = !1;
try {
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (l.push(r.value), l.length !== n); c = !0) ;
} catch (d) {
u = !0, a = d;
} finally {
try {
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
} finally {
if (u) throw a;
}
}
return l;
}
}
function di(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
function sc(e, n) {
if (e) {
if (typeof e == "string") return di(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? di(e, n) : void 0;
}
}
function oc() {
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 lc(e, n) {
return ac(e) || ic(e, n) || sc(e, n) || oc();
}
var bn = function(n) {
return V.useEffect(function() {
return n;
}, []);
}, oa = function() {
var n = yn($t);
return function() {
for (var t = arguments.length, r = new Array(t), a = 0; a < t; a++)
r[a] = arguments[a];
return Fn(r, n == null ? void 0 : n.ptOptions);
};
}, la = function(n) {
var t = V.useRef(!1);
return V.useEffect(function() {
if (!t.current)
return t.current = !0, n && n();
}, []);
}, cc = 0, Jt = function(n) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = Z(!1), a = lc(r, 2), s = a[0], o = a[1], l = Ue(null), c = yn($t), u = Ae.isClient() ? window.document : void 0, d = t.document, f = d === void 0 ? u : d, p = t.manual, m = p === void 0 ? !1 : p, g = t.name, y = g === void 0 ? "style_".concat(++cc) : g, x = t.id, j = x === void 0 ? void 0 : x, C = t.media, E = C === void 0 ? void 0 : C, I = function(z) {
var A = z.querySelector('style[data-primereact-style-id="'.concat(y, '"]'));
if (A)
return A;
if (j !== void 0) {
var W = f.getElementById(j);
if (W)
return W;
}
return f.createElement("style");
}, b = function(z) {
s && n !== z && (l.current.textContent = z);
}, $ = function() {
if (!(!f || s)) {
var z = (c == null ? void 0 : c.styleContainer) || f.head;
l.current = I(z), l.current.isConnected || (l.current.type = "text/css", j && (l.current.id = j), E && (l.current.media = E), Ae.addNonce(l.current, c && c.nonce || tt.nonce), z.appendChild(l.current), y && l.current.setAttribute("data-primereact-style-id", y)), l.current.textContent = n, o(!0);
}
}, k = function() {
!f || !l.current || (Ae.removeInlineStyle(l.current), o(!1));
};
return xe(function() {
m || $();
}, [m]), {
id: j,
name: y,
update: b,
unload: k,
load: $,
isLoaded: s
};
}, uc = function(n) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, a = V.useRef(null), s = V.useRef(null), o = V.useCallback(function() {
return clearTimeout(a.current);
}, [a.current]);
return V.useEffect(function() {
s.current = n;
}), V.useEffect(function() {
function l() {
s.current();
}
if (r)
return a.current = setTimeout(l, t), o;
o();
}, [t, r]), bn(function() {
o();
}), [o];
}, Ft = function(n, t) {
var r = V.useRef(!1);
return V.useEffect(function() {
if (!r.current) {
r.current = !0;
return;
}
return n && n();
}, t);
};
function Nr(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
function dc(e) {
if (Array.isArray(e)) return Nr(e);
}
function fc(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function pc(e, n) {
if (e) {
if (typeof e == "string") return Nr(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Nr(e, n) : void 0;
}
}
function mc() {
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 fi(e) {
return dc(e) || fc(e) || pc(e) || mc();
}
function sn(e) {
"@babel/helpers - typeof";
return sn = 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;
}, sn(e);
}
function hc(e, n) {
if (sn(e) != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (sn(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function vc(e) {
var n = hc(e, "string");
return sn(n) == "symbol" ? n : n + "";
}
function kr(e, n, t) {
return (n = vc(n)) in e ? Object.defineProperty(e, n, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[n] = t, e;
}
function pi(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function De(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? pi(Object(t), !0).forEach(function(r) {
kr(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : pi(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
var gc = `
.p-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
opacity: 0;
overflow: hidden;
padding: 0;
pointer-events: none;
position: absolute;
white-space: nowrap;
width: 1px;
}
.p-overflow-hidden {
overflow: hidden;
padding-right: var(--scrollbar-width);
}
`, yc = `
.p-button {
margin: 0;
display: inline-flex;
cursor: pointer;
user-select: none;
align-items: center;
vertical-align: bottom;
text-align: center;
overflow: hidden;
position: relative;
}
.p-button-label {
flex: 1 1 auto;
}
.p-button-icon-right {
order: 1;
}
.p-button:disabled {
cursor: default;
}
.p-button-icon-only {
justify-content: center;
}
.p-button-icon-only .p-button-label {
visibility: hidden;
width: 0;
flex: 0 0 auto;
}
.p-button-vertical {
flex-direction: column;
}
.p-button-icon-bottom {
order: 2;
}
.p-button-group .p-button {
margin: 0;
}
.p-button-group .p-button:not(:last-child) {
border-right: 0 none;
}
.p-button-group .p-button:not(:first-of-type):not(:last-of-type) {
border-radius: 0;
}
.p-button-group .p-button:first-of-type {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.p-button-group .p-button:last-of-type {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.p-button-group .p-button:focus {
position: relative;
z-index: 1;
}
.p-button-group-single .p-button:first-of-type {
border-top-right-radius: var(--border-radius) !important;
border-bottom-right-radius: var(--border-radius) !important;
}
.p-button-group-single .p-button:last-of-type {
border-top-left-radius: var(--border-radius) !important;
border-bottom-left-radius: var(--border-radius) !important;
}
`, bc = `
.p-inputtext {
margin: 0;
}
.p-fluid .p-inputtext {
width: 100%;
}
/* InputGroup */
.p-inputgroup {
display: flex;
align-items: stretch;
width: 100%;
}
.p-inputgroup-addon {
display: flex;
align-items: center;
justify-content: center;
}
.p-inputgroup .p-float-label {
display: flex;
align-items: stretch;
width: 100%;
}
.p-inputgroup .p-inputtext,
.p-fluid .p-inputgroup .p-inputtext,
.p-inputgroup .p-inputwrapper,
.p-fluid .p-inputgroup .p-input {
flex: 1 1 auto;
width: 1%;
}
/* Floating Label */
.p-float-label {
display: block;
position: relative;
}
.p-float-label label {
position: absolute;
pointer-events: none;
top: 50%;
margin-top: -0.5rem;
transition-property: all;
transition-timing-function: ease;
line-height: 1;
}
.p-float-label textarea ~ label,
.p-float-label .p-mention ~ label {
top: 1rem;
}
.p-float-label input:focus ~ label,
.p-float-label input:-webkit-autofill ~ label,
.p-float-label input.p-filled ~ label,
.p-float-label textarea:focus ~ label,
.p-float-label textarea.p-filled ~ label,
.p-float-label .p-inputwrapper-focus ~ label,
.p-float-label .p-inputwrapper-filled ~ label,
.p-float-label .p-tooltip-target-wrapper ~ label {
top: -0.75rem;
font-size: 12px;
}
.p-float-label .p-placeholder,
.p-float-label input::placeholder,
.p-float-label .p-inputtext::placeholder {
opacity: 0;
transition-property: all;
transition-timing-function: ease;
}
.p-float-label .p-focus .p-placeholder,
.p-float-label input:focus::placeholder,
.p-float-label .p-inputtext:focus::placeholder {
opacity: 1;
transition-property: all;
transition-timing-function: ease;
}
.p-input-icon-left,
.p-input-icon-right {
position: relative;
display: inline-block;
}
.p-input-icon-left > i,
.p-input-icon-right > i,
.p-input-icon-left > svg,
.p-input-icon-right > svg,
.p-input-icon-left > .p-input-prefix,
.p-input-icon-right > .p-input-suffix {
position: absolute;
top: 50%;
margin-top: -0.5rem;
}
.p-fluid .p-input-icon-left,
.p-fluid .p-input-icon-right {
display: block;
width: 100%;
}
`, xc = `
.p-icon {
display: inline-block;
}
.p-icon-spin {
-webkit-animation: p-icon-spin 2s infinite linear;
animation: p-icon-spin 2s infinite linear;
}
svg.p-icon {
pointer-events: auto;
}
svg.p-icon g,
.p-disabled svg.p-icon {
pointer-events: none;
}
@-webkit-keyframes p-icon-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes p-icon-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
`, jc = `
@layer primereact {
.p-component, .p-component * {
box-sizing: border-box;
}
.p-hidden {
display: none;
}
.p-hidden-space {
visibility: hidden;
}
.p-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.p-disabled, .p-disabled * {
cursor: default;
pointer-events: none;
user-select: none;
}
.p-component-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.p-unselectable-text {
user-select: none;
}
.p-scrollbar-measure {
width: 100px;
height: 100px;
overflow: scroll;
position: absolute;
top: -9999px;
}
@-webkit-keyframes p-fadein {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes p-fadein {
0% { opacity: 0; }
100% { opacity: 1; }
}
.p-link {
text-align: left;
background-color: transparent;
margin: 0;
padding: 0;
border: none;
cursor: pointer;
user-select: none;
}
.p-link:disabled {
cursor: default;
}
/* Non react overlay animations */
.p-connected-overlay {
opacity: 0;
transform: scaleY(0.8);
transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);
}
.p-connected-overlay-visible {
opacity: 1;
transform: scaleY(1);
}
.p-connected-overlay-hidden {
opacity: 0;
transform: scaleY(1);
transition: opacity .1s linear;
}
/* React based overlay animations */
.p-connected-overlay-enter {
opacity: 0;
transform: scaleY(0.8);
}
.p-connected-overlay-enter-active {
opacity: 1;
transform: scaleY(1);
transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);
}
.p-connected-overlay-enter-done {
transform: none;
}
.p-connected-overlay-exit {
opacity: 1;
}
.p-connected-overlay-exit-active {
opacity: 0;
transition: opacity .1s linear;
}
/* Toggleable Content */
.p-toggleable-content-enter {
max-height: 0;
}
.p-toggleable-content-enter-active {
overflow: hidden;
max-height: 1000px;
transition: max-height 1s ease-in-out;
}
.p-toggleable-content-enter-done {
transform: none;
}
.p-toggleable-content-exit {
max-height: 1000px;
}
.p-toggleable-content-exit-active {
overflow: hidden;
max-height: 0;
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);
}
/* @todo Refactor */
.p-menu .p-menuitem-link {
cursor: pointer;
display: flex;
align-items: center;
text-decoration: none;
overflow: hidden;
position: relative;
}
`.concat(yc, `
`).concat(bc, `
`).concat(xc, `
}
`), Ne = {
cProps: void 0,
cParams: void 0,
cName: void 0,
defaultProps: {
pt: void 0,
ptOptions: void 0,
unstyled: !1
},
context: {},
globalCSS: void 0,
classes: {},
styles: "",
extend: function() {
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = n.css, r = De(De({}, n.defaultProps), Ne.defaultProps), a = {}, s = function(d) {
var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return Ne.context = f, Ne.cProps = d, ue.getMergedProps(d, r);
}, o = function(d) {
return ue.getDiffProps(d, r);
}, l = function() {
var d, f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0;
f.hasOwnProperty("pt") && f.pt !== void 0 && (f = f.pt);
var y = p, x = /./g.test(y) && !!m[y.split(".")[0]], j = x ? ue.toFlatCase(y.split(".")[1]) : ue.toFlatCase(y), C = m.hostName && ue.toFlatCase(m.hostName), E = C || m.props && m.props.__TYPE && ue.toFlatCase(m.props.__TYPE) || "", I = j === "transition", b = "data-pc-", $ = function(q) {
return q != null && q.props ? q.hostName ? q.props.__TYPE === q.hostName ? q.props : $(q.parent) : q.parent : void 0;
}, k = function(q) {
var le, S;
return ((le = m.props) === null || le === void 0 ? void 0 : le[q]) || ((S = $(m)) === null || S === void 0 ? void 0 : S[q]);
};
Ne.cParams = m, Ne.cName = E;
var L = k("ptOptions") || Ne.context.ptOptions || {}, z = L.mergeSections, A = z === void 0 ? !0 : z, W = L.mergeProps, te = W === void 0 ? !1 : W, ne = function() {
var q = lt.apply(void 0, arguments);
return Array.isArray(q) ? {
className: ut.apply(void 0, fi(q))
} : ue.isString(q) ? {
className: q
} : q != null && q.hasOwnProperty("className") && Array.isArray(q.className) ? {
className: ut.apply(void 0, fi(q.className))
} : q;
}, H = g ? x ? is(ne, y, m) : ss(ne, y, m) : void 0, X = x ? void 0 : Un(Wn(f, E), ne, y, m), re = !I && De(De({}, j === "root" && kr({}, "".concat(b, "name"), m.props && m.props.__parentMetadata ? ue.toFlatCase(m.props.__TYPE) : E)), {}, kr({}, "".concat(b, "section"), j));
return A || !A && X ? te ? Fn([H, X, Object.keys(re).length ? re : {}], {
classNameMergeFunction: (d = Ne.context.ptOptions) === null || d === void 0 ? void 0 : d.classNameMergeFunction
}) : De(De(De({}, H), X), Object.keys(re).length ? re : {}) : De(De({}, X), Object.keys(re).length ? re : {});
}, c = function() {
var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, f = d.props, p = d.state, m = function() {
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return l((f || {}).pt, E, De(De({}, d), I));
}, g = function() {
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return l(E, I, b, !1);
}, y = function() {
return Ne.context.unstyled || tt.unstyled || f.unstyled;
}, x = function() {
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return y() ? void 0 : lt(t && t.classes, E, De({
props: f,
state: p
}, I));
}, j = function() {
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
if (b) {
var $, k = lt(t && t.inlineStyles, E, De({
props: f,
state: p
}, I)), L = lt(a, E, De({
props: f,
state: p
}, I));
return Fn([L, k], {
classNameMergeFunction: ($ = Ne.context.ptOptions) === null || $ === void 0 ? void 0 : $.classNameMergeFunction
});
}
};
return {
ptm: m,
ptmo: g,
sx: j,
cx: x,
isUnstyled: y
};
};
return De(De({
getProps: s,
getOtherProps: o,
setMetaData: c
}, n), {}, {
defaultProps: r
});
}
}, lt = function(n) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = String(ue.toFlatCase(t)).split("."), s = a.shift(), o = ue.isNotEmpty(n) ? Object.keys(n).find(function(l) {
return ue.toFlatCase(l) === s;
}) : "";
return s ? ue.isObject(n) ? lt(ue.getItemValue(n[o], r), a.join("."), r) : void 0 : ue.getItemValue(n, r);
}, Wn = function(n) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", r = arguments.length > 2 ? arguments[2] : void 0, a = n == null ? void 0 : n._usept, s = function(l) {
var c, u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, d = r ? r(l) : l, f = ue.toFlatCase(t);
return (c = u ? f !== Ne.cName ? d == null ? void 0 : d[f] : void 0 : d == null ? void 0 : d[f]) !== null && c !== void 0 ? c : d;
};
return ue.isNotEmpty(a) ? {
_usept: a,
originalValue: s(n.originalValue),
value: s(n.value)
} : s(n, !0);
}, Un = function(n, t, r, a) {
var s = function(y) {
return t(y, r, a);
};
if (n != null && n.hasOwnProperty("_usept")) {
var o = n._usept || Ne.context.ptOptions || {}, l = o.mergeSections, c = l === void 0 ? !0 : l, u = o.mergeProps, d = u === void 0 ? !1 : u, f = o.classNameMergeFunction, p = s(n.originalValue), m = s(n.value);
return p === void 0 && m === void 0 ? void 0 : ue.isString(m) ? m : ue.isString(p) ? p : c || !c && m ? d ? Fn([p, m], {
classNameMergeFunction: f
}) : De(De({}, p), m) : m;
}
return s(n);
}, wc = function() {
return Wn(Ne.context.pt || tt.pt, void 0, function(n) {
return ue.getItemValue(n, Ne.cParams);
});
}, Cc = function() {
return Wn(Ne.context.pt || tt.pt, void 0, function(n) {
return lt(n, Ne.cName, Ne.cParams) || ue.getItemValue(n, Ne.cParams);
});
}, is = function(n, t, r) {
return Un(wc(), n, t, r);
}, ss = function(n, t, r) {
return Un(Cc(), n, t, r);
}, Ec = function(n) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
}, r = arguments.length > 2 ? arguments[2] : void 0, a = r.name, s = r.styled, o = s === void 0 ? !1 : s, l = r.hostName, c = l === void 0 ? "" : l, u = is(lt, "global.css", Ne.cParams), d = ue.toFlatCase(a), f = Jt(gc, {
name: "base",
manual: !0
}), p = f.load, m = Jt(jc, {
name: "common",
manual: !0
}), g = m.load, y = Jt(u, {
name: "global",
manual: !0
}), x = y.load, j = Jt(n, {
name: a,
manual: !0
}), C = j.load, E = function(b) {
if (!c) {
var $ = Un(Wn((Ne.cProps || {}).pt, d), lt, "hooks.".concat(b)), k = ss(lt, "hooks.".concat(b));
$ == null || $(), k == null || k();
}
};
E("useMountEffect"), la(function() {
p(), x(), t() || (g(), o || C());
}), Ft(function() {
E("useUpdateEffect");
}), bn(function() {
E("useUnmountEffect");
});
};
function on(e) {
"@babel/helpers - typeof";
return on = 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;
}, on(e);
}
function Tc(e, n) {
if (on(e) != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (on(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function Sc(e) {
var n = Tc(e, "string");
return on(n) == "symbol" ? n : n + "";
}
function Pc(e, n, t) {
return (n = Sc(n)) in e ? Object.defineProperty(e, n, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[n] = t, e;
}
var _r = {
defaultProps: {
__TYPE: "CSSTransition",
children: void 0
},
getProps: function(n) {
return ue.getMergedProps(n, _r.defaultProps);
},
getOtherProps: function(n) {
return ue.getDiffProps(n, _r.defaultProps);
}
};
function mi(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function vr(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? mi(Object(t), !0).forEach(function(r) {
Pc(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : mi(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
var os = /* @__PURE__ */ V.forwardRef(function(e, n) {
var t = _r.getProps(e), r = V.useContext($t), a = t.disabled || t.options && t.options.disabled || r && !r.cssTransition || !tt.cssTransition, s = function(y, x) {
t.onEnter && t.onEnter(y, x), t.options && t.options.onEnter && t.options.onEnter(y, x);
}, o = function(y, x) {
t.onEntering && t.onEntering(y, x), t.options && t.options.onEntering && t.options.onEntering(y, x);
}, l = function(y, x) {
t.onEntered && t.onEntered(y, x), t.options && t.options.onEntered && t.options.onEntered(y, x);
}, c = function(y) {
t.onExit && t.onExit(y), t.options && t.options.onExit && t.options.onExit(y);
}, u = function(y) {
t.onExiting && t.onExiting(y), t.options && t.options.onExiting && t.options.onExiting(y);
}, d = function(y) {
t.onExited && t.onExited(y), t.options && t.options.onExited && t.options.onExited(y);
};
if (Ft(function() {
if (a) {
var g = ue.getRefElement(t.nodeRef);
t.in ? (s(g, !0), o(g, !0), l(g, !0)) : (c(g), u(g), d(g));
}
}, [t.in]), a)
return t.in ? t.children : null;
var f = {
nodeRef: t.nodeRef,
in: t.in,
appear: t.appear,
onEnter: s,
onEntering: o,
onEntered: l,
onExit: c,
onExiting: u,
onExited: d
}, p = {
classNames: t.classNames,
timeout: t.timeout,
unmountOnExit: t.unmountOnExit
}, m = vr(vr(vr({}, p), t.options || {}), f);
return /* @__PURE__ */ V.createElement(na, m, t.children);
});
os.displayName = "CSSTransition";
function Oc(e) {
if (Array.isArray(e)) return e;
}
function Nc(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r, a, s, o, l = [], c = !0, u = !1;
try {
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (l.push(r.value), l.length !== n); c = !0) ;
} catch (d) {
u = !0, a = d;
} finally {
try {
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
} finally {
if (u) throw a;
}
}
return l;
}
}
function hi(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
function kc(e, n) {
if (e) {
if (typeof e == "string") return hi(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? hi(e, n) : void 0;
}
}
function _c() {
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 Ac(e, n) {
return Oc(e) || Nc(e, n) || kc(e, n) || _c();
}
var Ar = {
defaultProps: {
__TYPE: "Portal",
element: null,
appendTo: null,
visible: !1,
onMounted: null,
onUnmounted: null,
children: void 0
},
getProps: function(n) {
return ue.getMergedProps(n, Ar.defaultProps);
},
getOtherProps: function(n) {
return ue.getDiffProps(n, Ar.defaultProps);
}
}, ls = /* @__PURE__ */ V.memo(function(e) {
var n = Ar.getProps(e), t = V.useContext($t), r = V.useState(n.visible && Ae.isClient()), a = Ac(r, 2), s = a[0], o = a[1];
la(function() {
Ae.isClient() && !s && (o(!0), n.onMounted && n.onMounted());
}), Ft(function() {
n.onMounted && n.onMounted();
}, [s]), bn(function() {
n.onUnmounted && n.onUnmounted();
});
var l = n.element || n.children;
if (l && s) {
var c = n.appendTo || t && t.appendTo || tt.appendTo;
return ue.isFunction(c) && (c = c()), c || (c = document.body), c === "self" ? l : /* @__PURE__ */ Yt.createPortal(l, c);
}
return null;
});
ls.displayName = "Portal";
var vt = {
defaultProps: {
__TYPE: "IconBase",
className: null,
label: null,
spin: !1
},
getProps: function(n) {
return ue.getMergedProps(n, vt.defaultProps);
},
getOtherProps: function(n) {
return ue.getDiffProps(n, vt.defaultProps);
},
getPTI: function(n) {
var t = ue.isEmpty(n.label), r = vt.getOtherProps(n), a = {
className: ut("p-icon", {
"p-icon-spin": n.spin
}, n.className),
role: t ? void 0 : "img",
"aria-label": t ? void 0 : n.label,
"aria-hidden": n.label ? t : void 0
};
return ue.getMergedProps(r, a);
}
};
function Rr() {
return Rr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Rr.apply(null, arguments);
}
var cs = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = vt.getPTI(e);
return /* @__PURE__ */ V.createElement("svg", Rr({
ref: n,
width: "14",
height: "14",
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, t), /* @__PURE__ */ V.createElement("path", {
d: "M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z",
fill: "currentColor"
}));
}));
cs.displayName = "CheckIcon";
function Ir() {
return Ir = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Ir.apply(null, arguments);
}
var us = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = vt.getPTI(e);
return /* @__PURE__ */ V.createElement("svg", Ir({
ref: n,
width: "14",
height: "14",
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, t), /* @__PURE__ */ V.createElement("path", {
d: "M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",
fill: "currentColor"
}), /* @__PURE__ */ V.createElement("path", {
d: "M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",
fill: "currentColor"
}), /* @__PURE__ */ V.createElement("path", {
d: "M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",
fill: "currentColor"
}));
}));
us.displayName = "ExclamationTriangleIcon";
function Dr() {
return Dr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Dr.apply(null, arguments);
}
var ds = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = vt.getPTI(e);
return /* @__PURE__ */ V.createElement("svg", Dr({
ref: n,
width: "14",
height: "14",
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, t), /* @__PURE__ */ V.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",
fill: "currentColor"
}));
}));
ds.displayName = "InfoCircleIcon";
function Mr() {
return Mr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Mr.apply(null, arguments);
}
var fs = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = vt.getPTI(e);
return /* @__PURE__ */ V.createElement("svg", Mr({
ref: n,
width: "14",
height: "14",
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, t), /* @__PURE__ */ V.createElement("path", {
d: "M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",
fill: "currentColor"
}));
}));
fs.displayName = "TimesIcon";
function Fr() {
return Fr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Fr.apply(null, arguments);
}
var ps = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = vt.getPTI(e);
return /* @__PURE__ */ V.createElement("svg", Fr({
ref: n,
width: "14",
height: "14",
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, t), /* @__PURE__ */ V.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",
fill: "currentColor"
}));
}));
ps.displayName = "TimesCircleIcon";
function Lr() {
return Lr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Lr.apply(null, arguments);
}
function ln(e) {
"@babel/helpers - typeof";
return ln = 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;
}, ln(e);
}
function Rc(e, n) {
if (ln(e) != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (ln(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function Ic(e) {
var n = Rc(e, "string");
return ln(n) == "symbol" ? n : n + "";
}
function Dc(e, n, t) {
return (n = Ic(n)) in e ? Object.defineProperty(e, n, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[n] = t, e;
}
function Mc(e) {
if (Array.isArray(e)) return e;
}
function Fc(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r, a, s, o, l = [], c = !0, u = !1;
try {
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (l.push(r.value), l.length !== n); c = !0) ;
} catch (d) {
u = !0, a = d;
} finally {
try {
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
} finally {
if (u) throw a;
}
}
return l;
}
}
function vi(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
function Lc(e, n) {
if (e) {
if (typeof e == "string") return vi(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? vi(e, n) : void 0;
}
}
function $c() {
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 Vc(e, n) {
return Mc(e) || Fc(e, n) || Lc(e, n) || $c();
}
var Bc = `
@layer primereact {
.p-ripple {
overflow: hidden;
position: relative;
}
.p-ink {
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.5);
border-radius: 100%;
transform: scale(0);
}
.p-ink-active {
animation: ripple 0.4s linear;
}
.p-ripple-disabled .p-ink {
display: none;
}
}
@keyframes ripple {
100% {
opacity: 0;
transform: scale(2.5);
}
}
`, zc = {
root: "p-ink"
}, Rt = Ne.extend({
defaultProps: {
__TYPE: "Ripple",
children: void 0
},
css: {
styles: Bc,
classes: zc
},
getProps: function(n) {
return ue.getMergedProps(n, Rt.defaultProps);
},
getOtherProps: function(n) {
return ue.getDiffProps(n, Rt.defaultProps);
}
});
function gi(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function Hc(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? gi(Object(t), !0).forEach(function(r) {
Dc(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : gi(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
var ms = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = V.useState(!1), r = Vc(t, 2), a = r[0], s = r[1], o = V.useRef(null), l = V.useRef(null), c = oa(), u = V.useContext($t), d = Rt.getProps(e, u), f = u && u.ripple || tt.ripple, p = {
props: d
};
Jt(Rt.css.styles, {
name: "ripple",
manual: !f
});
var m = Rt.setMetaData(Hc({}, p)), g = m.ptm, y = m.cx, x = function() {
return o.current && o.current.parentElement;
}, j = function() {
l.current && l.current.addEventListener("pointerdown", E);
}, C = function() {
l.current && l.current.removeEventListener("pointerdown", E);
}, E = function(z) {
var A = Ae.getOffset(l.current), W = z.pageX - A.left + document.body.scrollTop - Ae.getWidth(o.current) / 2, te = z.pageY - A.top + document.body.scrollLeft - Ae.getHeight(o.current) / 2;
I(W, te);
}, I = function(z, A) {
!o.current || getComputedStyle(o.current, null).display === "none" || (Ae.removeClass(o.current, "p-ink-active"), $(), o.current.style.top = A + "px", o.current.style.left = z + "px", Ae.addClass(o.current, "p-ink-active"));
}, b = function(z) {
Ae.removeClass(z.currentTarget, "p-ink-active");
}, $ = function() {
if (o.current && !Ae.getHeight(o.current) && !Ae.getWidth(o.current)) {
var z = Math.max(Ae.getOuterWidth(l.current), Ae.getOuterHeight(l.current));
o.current.style.height = z + "px", o.current.style.width = z + "px";
}
};
if (V.useImperativeHandle(n, function() {
return {
props: d,
getInk: function() {
return o.current;
},
getTarget: function() {
return l.current;
}
};
}), la(function() {
s(!0);
}), Ft(function() {
a && o.current && (l.current = x(), $(), j());
}, [a]), Ft(function() {
o.current && !l.current && (l.current = x(), $(), j());
}), bn(function() {
o.current && (l.current = null, C());
}), !f)
return null;
var k = c({
"aria-hidden": !0,
className: ut(y("root"))
}, Rt.getOtherProps(d), g("root"));
return /* @__PURE__ */ V.createElement("span", Lr({
role: "presentation",
ref: o
}, k, {
onAnimationEnd: b
}));
}));
ms.displayName = "Ripple";
function $r() {
return $r = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, $r.apply(null, arguments);
}
function Vr(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = Array(n); t < n; t++) r[t] = e[t];
return r;
}
function Wc(e) {
if (Array.isArray(e)) return Vr(e);
}
function Uc(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function hs(e, n) {
if (e) {
if (typeof e == "string") return Vr(e, n);
var t = {}.toString.call(e).slice(8, -1);
return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Vr(e, n) : void 0;
}
}
function qc() {
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 gr(e) {
return Wc(e) || Uc(e) || hs(e) || qc();
}
function Yc(e) {
if (Array.isArray(e)) return e;
}
function Gc(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r, a, s, o, l = [], c = !0, u = !1;
try {
if (s = (t = t.call(e)).next, n === 0) {
if (Object(t) !== t) return;
c = !1;
} else for (; !(c = (r = s.call(t)).done) && (l.push(r.value), l.length !== n); c = !0) ;
} catch (d) {
u = !0, a = d;
} finally {
try {
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
} finally {
if (u) throw a;
}
}
return l;
}
}
function Zc() {
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 Br(e, n) {
return Yc(e) || Gc(e, n) || hs(e, n) || Zc();
}
function cn(e) {
"@babel/helpers - typeof";
return cn = 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;
}, cn(e);
}
function Jc(e, n) {
if (cn(e) != "object" || !e) return e;
var t = e[Symbol.toPrimitive];
if (t !== void 0) {
var r = t.call(e, n);
if (cn(r) != "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (n === "string" ? String : Number)(e);
}
function Kc(e) {
var n = Jc(e, "string");
return cn(n) == "symbol" ? n : n + "";
}
function vs(e, n, t) {
return (n = Kc(n)) in e ? Object.defineProperty(e, n, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[n] = t, e;
}
var Xc = `
@layer primereact {
.p-toast {
width: calc(100% - var(--toast-indent, 0px));
max-width: 25rem;
}
.p-toast-message-icon {
flex-shrink: 0;
}
.p-toast-message-content {
display: flex;
align-items: flex-start;
}
.p-toast-message-text {
flex: 1 1 auto;
}
.p-toast-summary {
overflow-wrap: anywhere;
}
.p-toast-detail {
overflow-wrap: anywhere;
}
.p-toast-top-center {
transform: translateX(-50%);
}
.p-toast-bottom-center {
transform: translateX(-50%);
}
.p-toast-center {
min-width: 20vw;
transform: translate(-50%, -50%);
}
.p-toast-icon-close {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
}
.p-toast-icon-close.p-link {
cursor: pointer;
}
/* Animations */
.p-toast-message-enter {
opacity: 0;
transform: translateY(50%);
}
.p-toast-message-enter-active {
opacity: 1;
transform: translateY(0);
transition: transform 0.3s, opacity 0.3s;
}
.p-toast-message-enter-done {
transform: none;
}
.p-toast-message-exit {
opacity: 1;
max-height: 1000px;
}
.p-toast .p-toast-message.p-toast-message-exit-active {
opacity: 0;
max-height: 0;
margin-bottom: 0;
overflow: hidden;
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;
}
}
`, Qc = {
root: function(n) {
var t = n.props, r = n.context;
return ut("p-toast p-component p-toast-" + t.position, t.className, {
"p-input-filled": r && r.inputStyle === "filled" || tt.inputStyle === "filled",
"p-ripple-disabled": r && r.ripple === !1 || tt.ripple === !1
});
},
message: {
message: function(n) {
var t = n.severity;
return ut("p-toast-message", vs({}, "p-toast-message-".concat(t), t));
},
content: "p-toast-message-content",
buttonicon: "p-toast-icon-close-icon",
closeButton: "p-toast-icon-close p-link",
icon: "p-toast-message-icon",
text: "p-toast-message-text",
summary: "p-toast-summary",
detail: "p-toast-detail"
},
transition: "p-toast-message"
}, eu = {
root: function(n) {
var t = n.props;
return {
position: "fixed",
top: t.position === "top-right" || t.position === "top-left" || t.position === "top-center" ? "20px" : t.position === "center" ? "50%" : null,
right: (t.position === "top-right" || t.position === "bottom-right") && "20px",
bottom: (t.position === "bottom-left" || t.position === "bottom-right" || t.position === "bottom-center") && "20px",
left: t.position === "top-left" || t.position === "bottom-left" ? "20px" : t.position === "center" || t.position === "top-center" || t.position === "bottom-center" ? "50%" : null
};
}
}, Sn = Ne.extend({
defaultProps: {
__TYPE: "Toast",
id: null,
className: null,
content: null,
style: null,
baseZIndex: 0,
position: "top-right",
transitionOptions: null,
appendTo: "self",
onClick: null,
onRemove: null,
onShow: null,
onHide: null,
onMouseEnter: null,
onMouseLeave: null,
children: void 0
},
css: {
classes: Qc,
styles: Xc,
inlineStyles: eu
}
});
function yi(e, n) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
n && (r = r.filter(function(a) {
return Object.getOwnPropertyDescriptor(e, a).enumerable;
})), t.push.apply(t, r);
}
return t;
}
function Oe(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? arguments[n] : {};
n % 2 ? yi(Object(t), !0).forEach(function(r) {
vs(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : yi(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
var gs = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = oa(), r = e.messageInfo, a = e.metaData, s = e.ptCallbacks, o = s.ptm, l = s.ptmo, c = s.cx, u = e.index, d = r.message, f = d.severity, p = d.content, m = d.summary, g = d.detail, y = d.closable, x = d.life, j = d.sticky, C = d.className, E = d.style, I = d.contentClassName, b = d.contentStyle, $ = d.icon, k = d.closeIcon, L = d.pt, z = {
index: u
}, A = Oe(Oe({}, a), z), W = V.useState(!1), te = Br(W, 2), ne = te[0], H = te[1], X = uc(function() {
le();
}, x || 3e3, !j && !ne), re = Br(X, 1), oe = re[0], q = function(_, K) {
return o(_, Oe({
hostName: e.hostName
}, K));
}, le = function() {
oe(), e.onClose && e.onClose(r);
}, S = function(_) {
e.onClick && !(Ae.hasClass(_.target, "p-toast-icon-close") || Ae.hasClass(_.target, "p-toast-icon-close-icon")) && e.onClick(r.message);
}, B = function(_) {
e.onMouseEnter && e.onMouseEnter(_), !_.defaultPrevented && (j || (oe(), H(!0)));
}, ee = function(_) {
e.onMouseLeave && e.onMouseLeave(_), !_.defaultPrevented && (j || H(!1));
}, D = function() {
var _ = t({
className: c("message.buttonicon")
}, q("buttonicon", A), l(L, "buttonicon", Oe(Oe({}, z), {}, {
hostName: e.hostName
}))), K = k || /* @__PURE__ */ V.createElement(fs, _), w = li.getJSXIcon(K, Oe({}, _), {
props: e
}), ie = t({
type: "button",
className: c("message.closeButton"),
onClick: le,
"aria-label": e.ariaCloseLabel || nc("close")
}, q("closeButton", A), l(L, "closeButton", Oe(Oe({}, z), {}, {
hostName: e.hostName
})));
return y !== !1 ? /* @__PURE__ */ V.createElement("div", null, /* @__PURE__ */ V.createElement("button", ie, w, /* @__PURE__ */ V.createElement(ms, null))) : null;
}, N = function() {
if (r) {
var _ = ue.getJSXElement(p, {
message: r.message,
onClick: S,
onClose: le
}), K = t({
className: c("message.icon")
}, q("icon", A), l(L, "icon", Oe(Oe({}, z), {}, {
hostName: e.hostName
}))), w = $;
if (!$)
switch (f) {
case "info":
w = /* @__PURE__ */ V.createElement(ds, K);
break;
case "warn":
w = /* @__PURE__ */ V.createElement(us, K);
break;
case "error":
w = /* @__PURE__ */ V.createElement(ps, K);
break;
case "success":
w = /* @__PURE__ */ V.createElement(cs, K);
break;
}
var ie = li.getJSXIcon(w, Oe({}, K), {
props: e
}), _e = t({
className: c("message.text")
}, q("text", A), l(L, "text", Oe(Oe({}, z), {}, {
hostName: e.hostName
}))), Ee = t({
className: c("message.summary")
}, q("summary", A), l(L, "summary", Oe(Oe({}, z), {}, {
hostName: e.hostName
}))), Re = t({
className: c("message.detail")
}, q("detail", A), l(L, "detail", Oe(Oe({}, z), {}, {
hostName: e.hostName
})));
return _ || /* @__PURE__ */ V.createElement(V.Fragment, null, ie, /* @__PURE__ */ V.createElement("div", _e, /* @__PURE__ */ V.createElement("span", Ee, m), g && /* @__PURE__ */ V.createElement("div", Re, g)));
}
return null;
}, v = N(), T = D(), P = t({
ref: n,
className: ut(C, c("message.message", {
severity: f
})),
style: E,
role: "alert",
"aria-live": "assertive",
"aria-atomic": "true",
onClick: S,
onMouseEnter: B,
onMouseLeave: ee
}, q("message", A), l(L, "root", Oe(Oe({}, z), {}, {
hostName: e.hostName
}))), M = t({
className: ut(I, c("message.content")),
style: b
}, q("content", A), l(L, "content", Oe(Oe({}, z), {}, {
hostName: e.hostName
})));
return /* @__PURE__ */ V.createElement("div", P, /* @__PURE__ */ V.createElement("div", M, v, T));
}));
gs.displayName = "ToastMessage";
var bi = 0, qn = /* @__PURE__ */ V.memo(/* @__PURE__ */ V.forwardRef(function(e, n) {
var t = oa(), r = V.useContext($t), a = Sn.getProps(e, r), s = V.useState([]), o = Br(s, 2), l = o[0], c = o[1], u = V.useRef(null), d = {
props: a,
state: {
messages: l
}
}, f = Sn.setMetaData(d);
Ec(Sn.css.styles, f.isUnstyled, {
name: "toast"
});
var p = function(k) {
k && c(function(L) {
return m(L, k, !0);
});
}, m = function(k, L, z) {
var A;
if (Array.isArray(L)) {
var W = L.reduce(function(ne, H) {
return ne.push({
_pId: bi++,
message: H
}), ne;
}, []);
z ? A = k ? [].concat(gr(k), gr(W)) : W : A = W;
} else {
var te = {
_pId: bi++,
message: L
};
z ? A = k ? [].concat(gr(k), [te]) : [te] : A = [te];
}
return A;
}, g = function() {
Zt.clear(u.current), c([]);
}, y = function(k) {
c(function(L) {
return m(L, k, !1);
});
}, x = function(k) {
var L = ue.isNotEmpty(k._pId) ? k._pId : k.message || k;
c(function(z) {
return z.filter(function(A) {
return A._pId !== k._pId && !ue.deepEquals(A.message, L);
});
}), a.onRemove && a.onRemove(k.message || L);
}, j = function(k) {
x(k);
}, C = function() {
a.onShow && a.onShow();
}, E = function() {
l.length === 1 && Zt.clear(u.current), a.onHide && a.onHide();
};
Ft(function() {
Zt.set("toast", u.current, r && r.autoZIndex || tt.autoZIndex, a.baseZIndex || r && r.zIndex.toast || tt.zIndex.toast);
}, [l, a.baseZIndex]), bn(function() {
Zt.clear(u.current);
}), V.useImperativeHandle(n, function() {
return {
props: a,
show: p,
replace: y,
remove: x,
clear: g,
getElement: function() {
return u.current;
}
};
});
var I = function() {
var k = t({
ref: u,
id: a.id,
className: f.cx("root", {
context: r
}),
style: f.sx("root")
}, Sn.getOtherProps(a), f.ptm("root")), L = t({
classNames: f.cx("transition"),
timeout: {
enter: 300,
exit: 300
},
options: a.transitionOptions,
unmountOnExit: !0,
onEntered: C,
onExited: E
}, f.ptm("transition"));
return /* @__PURE__ */ V.createElement("div", k, /* @__PURE__ */ V.createElement(aa, null, l && l.map(function(z, A) {
var W = /* @__PURE__ */ V.createRef();
return /* @__PURE__ */ V.createElement(os, $r({
nodeRef: W,
key: z._pId
}, L), e.content ? ue.getJSXElement(e.content, {
message: z.message
}) : /* @__PURE__ */ V.createElement(gs, {
hostName: "Toast",
ref: W,
messageInfo: z,
index: A,
onClick: a.onClick,
onClose: j,
onMouseEnter: a.onMouseEnter,
onMouseLeave: a.onMouseLeave,
closeIcon: a.closeIcon,
ptCallbacks: f,
metaData: d
}));
})));
}, b = I();
return /* @__PURE__ */ V.createElement(ls, {
element: b,
appendTo: a.appendTo
});
}));
qn.displayName = "Toast";
const tu = {
hidden: { opacity: 0, scale: 0.8 },
visible: {
opacity: 1,
scale: 1,
transition: { type: "spring", damping: 20, stiffness: 300 }
},
exit: { opacity: 0, scale: 0.6, transition: { duration: 0.3 } }
}, qe = {
hidden: { opacity: 0, y: 10 },
visible: { opacity: 1, y: 0, transition: { duration: 0.2 } }
}, ys = ({
show: e,
setShowModal: n,
projectName: t = "",
setTasks: r,
teamMembers: a = [],
projects: s = [],
tasks: o = [],
rolePermissions: l,
role: c,
userName: u
}) => {
var D, N;
const d = ((D = a.find((v) => v.name === u)) == null ? void 0 : D.name) || (a.length > 0 ? a[0].name : ""), [f, p] = Z({
id: Date.now(),
title: "",
description: "",
status: "Todo",
assignee: "",
dueDate: "",
project: t,
workType: "Task",
reporter: d,
labels: [],
epic: "",
parent: "",
team: "",
linkedWorkItems: { blocks: "", blockedBy: "" }
}), [m, g] = Z({}), [y, x] = Z(!1), [j, C] = Z(!1), E = Ue(null), I = Ue(null), b = ((N = l[c]) == null ? void 0 : N.canCreateTasks) || !1, $ = f.project ? a.filter((v) => {
var T;
return (T = s.find((P) => P.name === f.project)) == null ? void 0 : T.members.includes(v.name);
}).map((v) => v.name) : a.map((v) => v.name), k = f.project && ["Task", "Bug"].includes(f.workType) ? o.filter((v) => v.project === f.project && v.workType === "Epic").map((v) => ({ id: v.id, title: v.title })) : [], L = (() => {
if (!f.workType || !f.project) return [];
const v = o.filter((T) => T.project === f.project);
return f.workType === "Epic" ? s.map((T) => ({ id: T.id, title: T.name, type: "Project" })) : f.workType === "Story" ? v.filter((T) => T.workType === "Epic").map((T) => ({ id: T.id, title: T.title, type: "Epic" })) : f.workType === "Task" || f.workType === "Bug" ? f.epic ? v.filter((T) => T.workType === "Story" && T.parent === f.epic).map((T) => ({ id: T.id, title: T.title, type: "Story" })) : [] : [];
})();
xe(() => {
if (!f.project || !f.assignee) return;
const v = s.find((P) => P.name === f.project);
if (!v) {
p((P) => ({ ...P, assignee: "" }));
return;
}
a.filter((P) => v.members.includes(P.name)).map((P) => P.name).includes(f.assignee) || p((P) => ({ ...P, assignee: "" }));
}, [f.project, s, a]), xe(() => {
p((v) => {
const T = ["Task", "Bug"].includes(f.workType) ? v.epic : "";
let P = v.parent;
const J = o.filter((_) => _.project === f.project).filter((_) => _.workType === "Epic").map((_) => _.id);
if (f.workType === "Epic") {
const _ = s.find((K) => K.name === f.project);
P = _ ? _.id : "";
} else f.workType === "Story" ? v.project !== f.project && !J.includes(v.parent) && (P = "") : ["Task", "Bug"].includes(f.workType) && (f.epic || (P = ""));
return { ...v, epic: T, parent: P };
});
}, [f.workType, f.project, s, o]), xe(() => {
["Task", "Bug"].includes(f.workType) && !f.epic && p((v) => ({ ...v, parent: "" }));
}, [f.epic]);
const z = () => {
const v = document.createElement("input");
v.setAttribute("type", "file"), v.setAttribute("accept", "image/*"), v.click(), v.onchange = () => {
const T = v.files[0];
if (T) {
const P = new FileReader();
P.onload = (M) => {
const J = M.target.result, _ = I.current.getEditor(), K = _.getSelection(!0);
_.insertEmbed(K.index, "image", J);
}, P.readAsDataURL(T);
}
};
};
xe(() => {
I.current && I.current.getEditor().getModule("toolbar").addHandler("image", z);
}, []);
const A = (v) => {
const { name: T, value: P } = v.target;
p((M) => ({ ...M, [T]: P })), g((M) => ({ ...M, [T]: "" }));
}, W = (v) => {
p((T) => ({ ...T, description: v }));
}, te = (v) => {
const { name: T, value: P } = v.target;
p((M) => ({
...M,
linkedWorkItems: { ...M.linkedWorkItems, [T]: P }
}));
}, ne = (v) => {
const T = Array.from(v.target.selectedOptions, (P) => P.value);
p((P) => ({ ...P, labels: T }));
}, H = () => {
var T, P, M, J;
const v = {};
return (T = f.title) != null && T.trim() || (v.title = "Summary is required"), (P = f.project) != null && P.trim() || (v.project = "Project is required"), (M = f.workType) != null && M.trim() || (v.workType = "Work type is required"), (J = f.reporter) != null && J.trim() || (v.reporter = "Reporter is required"), ["Story", "Task", "Bug"].includes(f.workType) && !f.parent && (v.parent = `${f.workType} must have a parent ${f.workType === "Story" ? "Epic" : "Story"}`), f.workType === "Epic" && !f.parent && (v.parent = "Epic must have a parent Project"), ["Task", "Bug"].includes(f.workType) && !f.epic && (v.epic = `${f.workType} must have a parent Epic`), v;
}, X = (v) => {
v.preventDefault();
const T = H();
if (Object.keys(T).length > 0) {
g(T), E.current.show({
severity: "error",
summary: "Validation Error",
detail: "Please fill in all required fields",
life: 3e3
});
return;
}
if (!b) {
E.current.show({
severity: "error",
summary: "Permission Denied",
detail: "You do not have permission to create tasks",
life: 3e3
});
return;
}
x(!0);
try {
const P = { ...f };
["Task", "Bug"].includes(f.workType) || delete P.epic, r((M) => [...M, P]), E.current.show({
severity: "success",
summary: "Success",
detail: "Task created successfully!",
life: 3e3
}), j || n(!1), p({
id: Date.now(),
title: "",
description: "",
status: "Todo",
assignee: "",
dueDate: "",
project: t,
workType: "Task",
reporter: d,
labels: [],
epic: "",
parent: "",
team: "",
linkedWorkItems: { blocks: "", blockedBy: "" }
}), g({});
} catch (P) {
E.current.show({
severity: "error",
summary: "Error",
detail: P.message || "Failed to create task",
life: 3e3
});
} finally {
x(!1);
}
}, re = ["Todo", "In Progress", "In Review", "Done"], oe = s.map((v) => v.name), q = ["Epic", "Story", "Task", "Bug"], le = s.map((v) => v.name), S = ["Urgent", "High Priority", "Low Priority", "Feature", "Bug"], B = {
toolbar: [
[{ header: [1, 2, !1] }],
["bold", "italic", "underline", "strike"],
[{ list: "ordered" }, { list: "bullet" }],
["link", "image"],
["clean"]
]
}, ee = [
"header",
"bold",
"italic",
"underline",
"strike",
"list",
"bullet",
"link",
"image"
];
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(qn, { ref: E, position: "top-right", style: { height: "50px" } }),
/* @__PURE__ */ i.jsx(Yi, { children: e && /* @__PURE__ */ i.jsx(me, { show: !0, centered: !0, onHide: () => n(!1), backdrop: "static", dialogClassName: "jira-modal", children: /* @__PURE__ */ i.jsxs(
Se.div,
{
className: "modal-content",
variants: tu,
initial: "hidden",
animate: "visible",
exit: "exit",
children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, children: /* @__PURE__ */ i.jsx(me.Title, { children: "Create" }) }),
/* @__PURE__ */ i.jsx(me.Body, { children: /* @__PURE__ */ i.jsxs(O, { onSubmit: X, children: [
/* @__PURE__ */ i.jsx("small", { className: "required-note mb-3 d-block", children: "Required fields are marked with an asterisk *" }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskProject", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Project *" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "project",
value: f.project,
onChange: A,
isInvalid: !!m.project,
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select project" }),
oe.map((v) => /* @__PURE__ */ i.jsx("option", { value: v, children: v }, v))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.project })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskWorkType", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Work type *" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "workType",
value: f.workType,
onChange: A,
isInvalid: !!m.workType,
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select work type" }),
q.map((v) => /* @__PURE__ */ i.jsx("option", { value: v, children: v }, v))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.workType }),
/* @__PURE__ */ i.jsx("small", { children: /* @__PURE__ */ i.jsx("a", { href: "#", className: "text-primary", children: "Learn about work types" }) })
] }) }),
(f.workType === "Task" || f.workType === "Bug") && /* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskEpic", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Epic *" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "epic",
value: f.epic,
onChange: A,
isInvalid: !!m.epic,
disabled: !b || !f.project,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select Epic" }),
k.map((v) => /* @__PURE__ */ i.jsx("option", { value: v.id, children: v.title }, v.id))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.epic }),
/* @__PURE__ */ i.jsxs("small", { className: "form-text", children: [
"Select the Epic this ",
f.workType,
" belongs to."
] })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskParent", children: [
/* @__PURE__ */ i.jsxs(O.Label, { children: [
f.workType === "Epic" ? "Parent Project" : f.workType === "Story" ? "Parent Epic" : "Parent Story",
" *"
] }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "parent",
value: f.parent,
onChange: A,
isInvalid: !!m.parent,
disabled: !b || !f.project || !f.workType || (f.workType === "Task" || f.workType === "Bug") && !f.epic,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select parent" }),
L.map((v) => /* @__PURE__ */ i.jsxs("option", { value: v.id, children: [
v.type,
": ",
v.title
] }, v.id))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.parent }),
/* @__PURE__ */ i.jsxs("small", { className: "form-text", children: [
"Select the parent ",
f.workType === "Epic" ? "Project" : f.workType === "Story" ? "Epic" : "Story",
" for this ",
f.workType,
"."
] })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskStatus", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Status" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "status",
value: f.status,
onChange: A,
isInvalid: !!m.status,
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select status" }),
re.map((v) => /* @__PURE__ */ i.jsx("option", { value: v, children: v }, v))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.status }),
/* @__PURE__ */ i.jsx("small", { className: "form-text", children: "This is the initial status upon creation" })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskTitle", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Summary *" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "text",
name: "title",
value: f.title,
onChange: A,
isInvalid: !!m.title,
placeholder: "Summary",
disabled: !b
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.title })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskDescription", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Description" }),
/* @__PURE__ */ i.jsx(
zo,
{
ref: I,
theme: "snow",
value: f.description,
onChange: W,
modules: B,
formats: ee,
placeholder: "Describe the issue...",
readOnly: !b
}
)
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskAssignee", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Assignee" }),
/* @__PURE__ */ i.jsxs("div", { className: "d-flex align-items-center", children: [
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "assignee",
value: f.assignee,
onChange: A,
style: { flex: 1 },
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Automatic" }),
$.map((v) => /* @__PURE__ */ i.jsx("option", { value: v, children: v }, v))
]
}
),
/* @__PURE__ */ i.jsx(
Te,
{
variant: "link",
onClick: () => p((v) => ({ ...v, assignee: u })),
className: "ms-2",
disabled: !b,
children: "Assign to me"
}
)
] })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskLabels", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Labels" }),
/* @__PURE__ */ i.jsx(
O.Select,
{
multiple: !0,
name: "labels",
value: f.labels,
onChange: ne,
disabled: !b,
children: S.map((v) => /* @__PURE__ */ i.jsx("option", { value: v, children: v }, v))
}
)
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskTeam", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Team" }),
/* @__PURE__ */ i.jsxs(O.Select, { name: "team", value: f.team, onChange: A, disabled: !b, children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Choose a team" }),
le.map((v) => /* @__PURE__ */ i.jsx("option", { value: v, children: v }, v))
] }),
/* @__PURE__ */ i.jsx("small", { className: "form-text", children: "Associate a team to an issue. You can use this field to search and filter issues by team." })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskReporter", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Reporter *" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "reporter",
value: f.reporter,
onChange: A,
isInvalid: !!m.reporter,
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select reporter" }),
a.map((v) => /* @__PURE__ */ i.jsx("option", { value: v.name, children: v.name }, v.name))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.reporter })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskDueDate", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Due Date" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
name: "dueDate",
value: f.dueDate,
onChange: A,
isInvalid: !!m.dueDate,
disabled: !b
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: m.dueDate })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: qe, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", controlId: "taskLinkedWorkItems", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Linked work items" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "blocks",
value: f.linkedWorkItems.blocks,
onChange: te,
className: "mb-2",
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "blocks" }),
o.filter((v) => v.project === f.project).map((v) => /* @__PURE__ */ i.jsx("option", { value: v.id, children: v.title }, v.id))
]
}
),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "blockedBy",
value: f.linkedWorkItems.blockedBy,
onChange: te,
disabled: !b,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "blocked by" }),
o.filter((v) => v.project === f.project).map((v) => /* @__PURE__ */ i.jsx("option", { value: v.id, children: v.title }, v.id))
]
}
)
] }) }),
/* @__PURE__ */ i.jsxs(Me, { className: "mt-4 align-items-center", children: [
/* @__PURE__ */ i.jsx(ye, { children: /* @__PURE__ */ i.jsx(
O.Check,
{
type: "checkbox",
label: "Create another",
checked: j,
onChange: (v) => C(v.target.checked),
disabled: !b
}
) }),
/* @__PURE__ */ i.jsxs(ye, { className: "text-end", children: [
/* @__PURE__ */ i.jsx(
Te,
{
variant: "link",
onClick: () => n(!1),
className: "me-2",
disabled: y,
children: "Cancel"
}
),
/* @__PURE__ */ i.jsx(
Te,
{
variant: "primary",
type: "submit",
disabled: y || !b,
children: y ? /* @__PURE__ */ i.jsx("span", { children: "Creating..." }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(nn, { size: 16, className: "me-1" }),
" Create"
] })
}
)
] })
] })
] }) })
]
}
) }) })
] });
}, nu = {
hidden: { opacity: 0, scale: 0.8 },
visible: {
opacity: 1,
scale: 1,
transition: { type: "spring", damping: 20, stiffness: 300 }
},
exit: { opacity: 0, scale: 0.6, transition: { duration: 0.3 } }
}, Ht = {
hidden: { opacity: 0, y: 10 },
visible: { opacity: 1, y: 0, transition: { duration: 0.2 } }
}, ru = ({ show: e, setShowModal: n, setProjects: t, teamMembers: r = [], role: a }) => {
const [s, o] = Z({
name: "",
members: [],
description: "",
startDate: "",
deadline: ""
}), [l, c] = Z({}), [u, d] = Z(""), [f, p] = Z(!1), m = Ue(null), g = a === "admin" || a === "hr", y = (b) => {
const { name: $, value: k } = b.target;
o((L) => ({ ...L, [$]: k })), c((L) => ({ ...L, [$]: "" }));
}, x = (b) => {
o(($) => {
const k = $.members.includes(b) ? $.members.filter((L) => L !== b) : [...$.members, b];
return { ...$, members: k };
}), c(($) => ({ ...$, members: "" }));
}, j = (b) => {
d(b.target.value);
}, C = r.filter(
(b) => b.name.toLowerCase().includes(u.toLowerCase())
), E = () => {
const b = {};
return s.name.trim() || (b.name = "Project name is required"), s.members.length === 0 && (b.members = "At least one member is required"), s.startDate || (b.startDate = "Start date is required"), s.deadline || (b.deadline = "Deadline is required"), s.startDate && s.deadline && s.deadline < s.startDate && (b.deadline = "Deadline must be after start date"), b;
}, I = (b) => {
b.preventDefault();
const $ = E();
if (Object.keys($).length > 0) {
c($), m.current.show({
severity: "error",
summary: "Validation Error",
detail: "Please fill in all required fields",
life: 3e3
});
return;
}
if (!g) {
m.current.show({
severity: "error",
summary: "Permission Denied",
detail: "You do not have permission to create projects",
life: 3e3
});
return;
}
p(!0);
try {
const k = {
id: Date.now(),
// Temporary; use UUID in production
name: s.name,
short: s.name.slice(0, 2).toUpperCase(),
color: `#${Math.floor(Math.random() * 16777215).toString(16)}`,
// Random color
members: s.members,
description: s.description,
startDate: s.startDate,
deadline: s.deadline
};
t((L) => [...L, k]), m.current.show({
severity: "success",
summary: "Success",
detail: "Project created successfully!",
life: 3e3
}), o({ name: "", members: [], description: "", startDate: "", deadline: "" }), d(""), n(!1), c({});
} catch (k) {
m.current.show({
severity: "error",
summary: "Error",
detail: k.message || "Failed to create project",
life: 3e3
});
} finally {
p(!1);
}
};
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(qn, { ref: m, position: "top-right", style: { height: "50px" } }),
/* @__PURE__ */ i.jsx(Yi, { children: e && /* @__PURE__ */ i.jsx(me, { show: e, onHide: () => n(!1), centered: !0, backdrop: "static", children: /* @__PURE__ */ i.jsxs(
Se.div,
{
className: "modal-content border border-primary rounded-3 shadow-sm",
variants: nu,
initial: "hidden",
animate: "visible",
exit: "exit",
children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, className: "bg-primary text-white", children: /* @__PURE__ */ i.jsx(me.Title, { children: "Create New Project" }) }),
/* @__PURE__ */ i.jsx(me.Body, { className: "p-4", children: /* @__PURE__ */ i.jsxs(O, { onSubmit: I, children: [
/* @__PURE__ */ i.jsx(Se.div, { variants: Ht, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-4", controlId: "projectName", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Project Name *" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "text",
name: "name",
value: s.name,
onChange: y,
isInvalid: !!l.name,
placeholder: "Enter project name",
className: "border-2",
disabled: !g
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: l.name })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: Ht, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-4", controlId: "projectMembers", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Project Members *" }),
/* @__PURE__ */ i.jsx("div", { className: "mb-2", children: s.members.length > 0 ? s.members.map((b) => /* @__PURE__ */ i.jsxs(
Wi,
{
bg: "primary",
className: "me-1 mb-1 p-2",
style: { cursor: "pointer" },
onClick: () => x(b),
children: [
b,
" ",
/* @__PURE__ */ i.jsx(cl, { size: 16 })
]
},
b
)) : /* @__PURE__ */ i.jsx("div", { className: "text-muted small", children: "No members selected" }) }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "text",
placeholder: "Search members...",
value: u,
onChange: j,
className: "mb-2 border-2",
disabled: !g
}
),
/* @__PURE__ */ i.jsx(
"div",
{
style: {
maxHeight: "150px",
overflowY: "auto",
border: "1px solid #ced4da",
borderRadius: "0.25rem",
padding: "0.5rem"
},
children: C.length > 0 ? C.map((b) => /* @__PURE__ */ i.jsx(
"div",
{
className: `member-item ${s.members.includes(b.name) ? "selected" : ""}`,
onClick: () => x(b.name),
children: b.name
},
b.name
)) : /* @__PURE__ */ i.jsx("div", { className: "text-muted", children: "No members found" })
}
),
l.members && /* @__PURE__ */ i.jsx("div", { className: "text-danger small mt-1", children: l.members })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: Ht, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-4", controlId: "projectDescription", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Description" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
as: "textarea",
rows: 3,
name: "description",
value: s.description,
onChange: y,
placeholder: "Enter project description",
className: "border-2",
disabled: !g
}
)
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: Ht, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-4", controlId: "projectStartDate", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Start Date *" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
name: "startDate",
value: s.startDate,
onChange: y,
isInvalid: !!l.startDate,
className: "border-2",
disabled: !g
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: l.startDate })
] }) }),
/* @__PURE__ */ i.jsx(Se.div, { variants: Ht, initial: "hidden", animate: "visible", children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-4", controlId: "projectDeadline", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Deadline *" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
name: "deadline",
value: s.deadline,
onChange: y,
isInvalid: !!l.deadline,
className: "border-2",
disabled: !g
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: l.deadline })
] }) }),
/* @__PURE__ */ i.jsx(Me, { className: "mt-4", children: /* @__PURE__ */ i.jsxs(ye, { className: "text-end", children: [
/* @__PURE__ */ i.jsx(
Te,
{
variant: "outline-secondary",
onClick: () => n(!1),
className: "me-2 px-4",
disabled: f,
children: "Cancel"
}
),
/* @__PURE__ */ i.jsx(
Te,
{
variant: "primary",
type: "submit",
className: "px-4",
disabled: f || !g,
children: f ? /* @__PURE__ */ i.jsx("span", { children: "Creating..." }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(nn, { size: 16, className: "me-1" }),
" Create Project"
] })
}
)
] }) })
] }) })
]
}
) }) })
] });
}, au = ({ tasks: e = [], projects: n = [], userName: t, role: r }) => {
const a = r === "admin" || r === "hr" ? n : n.filter((p) => p.members.includes(t)), s = e.filter(
(p) => a.some((m) => m.name === p.project)
), o = a.length, l = s.length, c = s.filter((p) => p.status === "In Progress").length, u = s.filter((p) => p.status === "Done").length, d = s.filter((p) => new Date(p.dueDate) < /* @__PURE__ */ new Date("2025-05-06") && p.status !== "Done").length, f = [
{
label: "Total Projects",
value: o,
icon: /* @__PURE__ */ i.jsx(il, { size: 24 }),
color: "rgba(187, 132, 147, 0.8)"
},
{
label: "Total Tasks",
value: l,
icon: /* @__PURE__ */ i.jsx(ol, { size: 24 }),
color: "rgba(105, 117, 101, 0.7)"
},
{
label: "In Progress",
value: c,
icon: /* @__PURE__ */ i.jsx(sl, { size: 24 }),
color: "rgba(30, 95, 116, 0.7)"
},
{
label: "Completed Tasks",
value: u,
icon: /* @__PURE__ */ i.jsx(rl, { size: 24 }),
color: "#BED7DC"
},
{
label: "Overdue Tasks",
value: d,
icon: /* @__PURE__ */ i.jsx(al, { size: 24 }),
color: "#BBAB8C"
}
];
return /* @__PURE__ */ i.jsx(Me, { className: "g-4 p-2 pb-4", children: f.map((p, m) => /* @__PURE__ */ i.jsx(ye, { xs: 12, sm: 6, md: 4, lg: 3, xl: 2, children: /* @__PURE__ */ i.jsx(Fe, { className: "h-100 shadow-sm", children: /* @__PURE__ */ i.jsxs(Fe.Body, { className: "text-center", children: [
/* @__PURE__ */ i.jsxs("div", { className: "d-flex justify-content-center align-items-center", children: [
/* @__PURE__ */ i.jsx("div", { className: "mb-2 me-3", style: { color: p.color }, children: p.icon }),
/* @__PURE__ */ i.jsx(Fe.Title, { as: "h6", className: "text-muted fw-semibold", children: /* @__PURE__ */ i.jsx("span", { style: { fontSize: "18px", color: "rgba(128, 128, 128, 0.8)" }, children: p.label }) })
] }),
/* @__PURE__ */ i.jsx("div", { className: "d-flex justify-content-center align-items-center", children: /* @__PURE__ */ i.jsx("span", { className: "display-6 fw-bold", style: { color: p.color }, children: p.value }) })
] }) }) }, m)) });
}, iu = ({
tasks: e = [],
setTasks: n = () => {
},
deleteTask: t = !1,
// Boolean prop to control delete functionality
teamMembers: r = [],
projects: a = [],
setProjects: s = () => {
},
role: o = "admin",
rolePermissions: l = {},
userName: c = "admin",
kanban: u = "true",
table: d = "true",
calendar: f = "true"
}) => {
var M, J;
const p = ct(() => {
const _ = [];
return u === "true" && _.push("kanban"), d === "true" && _.push("table"), f === "true" && _.push("calendar"), _;
}, [u, d, f]), [m, g] = Z(p[0] || "kanban"), [y, x] = Z(!1), [j, C] = Z(!1), [E, I] = Z(null);
xe(() => {
console.log("Tasks:", e), console.log("Team Members:", r), console.log("Projects:", a), console.log("Role:", o), console.log("UserName:", c), console.log("Role Permissions:", l);
}, [e, r, a, o, c, l]);
const b = ct(() => {
if (!Array.isArray(a))
return console.warn("Projects is not an array:", a), [];
const _ = o === "admin" || o === "hr" ? a : a.filter((K) => {
var ie;
const w = ((ie = K == null ? void 0 : K.members) == null ? void 0 : ie.includes(c)) || !1;
return console.log(`Checking project ${K.name}: userName=${c}, members=${K == null ? void 0 : K.members}, isMember=${w}`), w;
});
return console.log("MyTasks - Displayed Projects:", _), _;
}, [a, o, c]), [$, k] = Z("All"), [L, z] = Z("All"), [A, W] = Z("All"), [te, ne] = Z(""), [H, X] = Z(""), re = ["All", ...b.map((_) => _.name)], oe = ["All", ...r.map((_) => _.name)], q = ["All", "Todo", "In Progress", "In Review", "Done"], le = ct(() => {
const _ = b.map((w) => w.name);
if (console.log("MyTasks - Project Names for Filtering:", _), !Array.isArray(e))
return console.warn("Tasks is not an array:", e), [];
const K = e.filter((w) => {
if (!w.project || w.project === "")
return console.log(`Task ${w.id} has no project, including it:`, w), !0;
const ie = _.includes(w.project);
return console.log(`Task ${w.id} - Project: ${w.project}, Matches: ${ie}, Task:`, w), ie;
}).filter((w) => $ === "All" ? !0 : w.project === $).filter((w) => L === "All" ? !0 : w.assignee === L).filter((w) => A === "All" ? !0 : w.status === A).filter((w) => te ? new Date(w.dueDate).toISOString().split("T")[0] === te : !0).filter((w) => {
if (!H) return !0;
const ie = H.toLowerCase(), _e = new Date(w.dueDate).toLocaleDateString();
return w.title.toLowerCase().includes(ie) || w.project.toLowerCase().includes(ie) || w.assignee.toLowerCase().includes(ie) || _e.toLowerCase().includes(ie) || w.status.toLowerCase().includes(ie);
});
return console.log("MyTasks - Filtered Tasks:", K), K;
}, [e, b, $, L, A, te, H]);
xe(() => {
console.log("MyTasks - Filtered Tasks (useEffect):", le);
}, [le]);
const [S, B] = Z({});
xe(() => {
const _ = (le || []).reduce((w, ie) => (w[ie.status] || (w[ie.status] = []), w[ie.status].push({
id: ie.id.toString(),
title: ie.title,
dueDate: new Date(ie.dueDate).toLocaleDateString(),
assignee: ie.assignee || "",
project: ie.project || ""
}), w), {});
["Todo", "In Progress", "In Review", "Done"].forEach((w) => {
_[w] || (_[w] = []);
}), B(_), console.log("MyTasks - Kanban Tasks:", _);
}, [le]);
const ee = Qe((_) => {
const { source: K, destination: w } = _;
if (!w || K.droppableId === w.droppableId && K.index === w.index) return;
const ie = Array.from(S[K.droppableId]), _e = Array.from(S[w.droppableId]), [Ee] = ie.splice(K.index, 1);
_e.splice(w.index, 0, Ee), B({
...S,
[K.droppableId]: ie,
[w.droppableId]: _e
}), n(
(Re) => Re.map(
(st) => st.id.toString() === Ee.id ? { ...st, status: w.droppableId } : st
)
);
}, [S, n]), D = Qe((_) => {
I(_), x(!0);
}, []), N = Qe((_) => {
n((K) => K.filter((w) => w.id !== _));
}, [n]), v = Qe((_) => {
if (!t) {
console.warn("Task deletion is disabled (deleteTask prop is false)");
return;
}
window.confirm("Are you sure you want to delete this task?") && N(_);
}, [t, N]), T = ((M = l[o]) == null ? void 0 : M.canEditProjects) || !1, P = ((J = l[o]) == null ? void 0 : J.canCreateTasks) || !1;
return /* @__PURE__ */ i.jsxs(ht, { fluid: !0, className: "mytasks-wrapper mt-4", children: [
/* @__PURE__ */ i.jsxs(Me, { className: "align-items-center", children: [
/* @__PURE__ */ i.jsxs(ye, { children: [
/* @__PURE__ */ i.jsx("h1", { className: "text-2xl pb-0 m-0", style: { color: "rgba(82, 109, 130, 0.8)", fontFamily: "Rubik, sans-serif", fontWeight: 600 }, children: "My Tasks" }),
/* @__PURE__ */ i.jsx("p", { className: "text-sm pb-4", style: { color: "#9DB2BF" }, children: "View all of your tasks here" })
] }),
/* @__PURE__ */ i.jsxs(ye, { xs: "auto d-flex", children: [
P && /* @__PURE__ */ i.jsxs(
Te,
{
variant: "primary",
size: "sm",
onClick: () => x(!0),
className: "d-flex align-items-center rounded-md me-2",
children: [
/* @__PURE__ */ i.jsx(nn, { size: 16, className: "me-1" }),
" New Task"
]
}
),
T && /* @__PURE__ */ i.jsxs(
Te,
{
variant: "primary",
size: "sm",
onClick: () => C(!0),
className: "d-flex align-items-center rounded-md",
children: [
/* @__PURE__ */ i.jsx(nn, { size: 16, className: "me-1" }),
" New Project"
]
}
)
] })
] }),
/* @__PURE__ */ i.jsx(
au,
{
tasks: e,
projects: a,
userName: c,
role: o
}
),
p.length > 0 && /* @__PURE__ */ i.jsx(Me, { className: "mb-4 align-items-center", children: /* @__PURE__ */ i.jsx(
ts,
{
activeView: m,
setActiveView: g,
allowedViews: p
}
) }),
/* @__PURE__ */ i.jsx(
Ji,
{
selectedProject: $,
setSelectedProject: k,
selectedAssignee: L,
setSelectedAssignee: z,
selectedStatus: A,
setSelectedStatus: W,
selectedDate: te,
setSelectedDate: ne,
searchQuery: H,
setSearchQuery: X,
projectOptions: re,
assigneeOptions: oe,
statusOptions: q
}
),
m === "kanban" && u === "true" && /* @__PURE__ */ i.jsx(qi, { onDragEnd: ee, children: /* @__PURE__ */ i.jsx(Ki, { kanbanTasks: S, projects: a }) }),
m === "table" && d === "true" && /* @__PURE__ */ i.jsx(
Xi,
{
filteredTasks: le,
handleEdit: D,
handleDelete: v,
hideProjectColumn: $ !== "All",
projects: a,
teamMembers: r,
deleteTask: t,
editTask: n,
deleteProject: () => {
},
removeTeamMember: () => {
}
}
),
m === "calendar" && f === "true" && /* @__PURE__ */ i.jsx(Qr, { filteredTasks: le }),
/* @__PURE__ */ i.jsx(
ys,
{
show: y,
setShowModal: x,
taskToEdit: E,
onSave: () => I(null),
setTasks: n,
teamMembers: r,
projects: a,
tasks: e,
rolePermissions: l,
role: o,
userName: c
}
),
/* @__PURE__ */ i.jsx(
ru,
{
show: j,
setShowModal: C,
setProjects: s,
teamMembers: r,
role: o
}
)
] });
};
function xi(e) {
return Ce({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z" }, child: [] }] })(e);
}
function ji(e) {
return Ce({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z" }, child: [] }] })(e);
}
function wi(e) {
return Ce({ attr: { viewBox: "0 0 488 512" }, child: [{ tag: "path", attr: { d: "M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z" }, child: [] }] })(e);
}
function Ci(e) {
return Ce({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z" }, child: [] }] })(e);
}
function su(e) {
return Ce({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM96 424c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm96-192c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm128 368c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z" }, child: [] }] })(e);
}
function ou(e) {
return Ce({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z" }, child: [] }] })(e);
}
function bs(e) {
return Ce({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" }, child: [] }] })(e);
}
function lu(e) {
return Ce({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z" }, child: [] }] })(e);
}
function cu(e) {
return Ce({ attr: { viewBox: "0 0 352 512" }, child: [{ tag: "path", attr: { d: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" }, child: [] }] })(e);
}
function uu(e) {
return Ce({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z" }, child: [] }] })(e);
}
function xs(e) {
return Ce({ attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M624 208h-64v-64c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v64h-64c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h64v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-64h64c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm-400 48c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z" }, child: [] }] })(e);
}
function du(e) {
return Ce({ attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" }, child: [] }] })(e);
}
const fu = ({ show: e, onClose: n, onSubmit: t, roleOptions: r, editingMember: a }) => {
const [s, o] = Z({
name: "",
email: "",
role: "",
avatar: ""
}), [l, c] = Z({}), [u, d] = Z("");
xe(() => {
if (a)
o({
name: a.name,
email: a.email,
role: a.role,
avatar: a.avatar
}), d(a.avatar);
else {
o({ name: "", email: "", role: "", avatar: "" });
const g = Math.floor(Math.random() * 7) + 1;
d(`/user${g}.jpg`);
}
c({});
}, [a, e]);
const f = (g) => {
const { name: y, value: x } = g.target;
o((j) => ({ ...j, [y]: x })), c((j) => ({ ...j, [y]: "" }));
}, p = () => {
const g = {};
return s.name.trim() || (g.name = "Name is required"), s.email.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.email) || (g.email = "Invalid email format") : g.email = "Email is required", s.role || (g.role = "Role is required"), g;
}, m = (g) => {
g.preventDefault();
const y = p();
if (Object.keys(y).length > 0) {
c(y);
return;
}
const x = {
name: s.name,
email: s.email,
role: s.role,
avatar: u
};
t(x);
};
return /* @__PURE__ */ i.jsxs(me, { show: e, onHide: n, centered: !0, children: [
/* @__PURE__ */ i.jsx(me.Header, { closeButton: !0, children: /* @__PURE__ */ i.jsx(me.Title, { children: a ? "Edit Team Member" : "Add New Team Member" }) }),
/* @__PURE__ */ i.jsx(me.Body, { children: /* @__PURE__ */ i.jsxs(O, { onSubmit: m, children: [
/* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Name" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "text",
name: "name",
value: s.name,
onChange: f,
isInvalid: !!l.name,
placeholder: "Enter name"
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: l.name })
] }),
/* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Email" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "email",
name: "email",
value: s.email,
onChange: f,
isInvalid: !!l.email,
placeholder: "Enter email"
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: l.email })
] }),
/* @__PURE__ */ i.jsxs(O.Group, { className: "mb-3", children: [
/* @__PURE__ */ i.jsx(O.Label, { children: "Role" }),
/* @__PURE__ */ i.jsxs(
O.Select,
{
name: "role",
value: s.role,
onChange: f,
isInvalid: !!l.role,
children: [
/* @__PURE__ */ i.jsx("option", { value: "", children: "Select a role" }),
r.map((g) => /* @__PURE__ */ i.jsx("option", { value: g, children: g }, g))
]
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: l.role })
] }),
/* @__PURE__ */ i.jsx(Me, { className: "mt-4", children: /* @__PURE__ */ i.jsxs(ye, { className: "text-end", children: [
/* @__PURE__ */ i.jsx(
Te,
{
variant: "secondary",
onClick: n,
className: "me-2",
children: "Cancel"
}
),
/* @__PURE__ */ i.jsx(Te, { variant: "primary", type: "submit", children: a ? "Save Changes" : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
/* @__PURE__ */ i.jsx(xs, { size: 16, className: "me-1" }),
" Add Member"
] }) })
] }) })
] }) })
] });
};
var ca = jn(), se = (e) => xn(e, ca), ua = jn();
se.write = (e) => xn(e, ua);
var Yn = jn();
se.onStart = (e) => xn(e, Yn);
var da = jn();
se.onFrame = (e) => xn(e, da);
var fa = jn();
se.onFinish = (e) => xn(e, fa);
var Dt = [];
se.setTimeout = (e, n) => {
const t = se.now() + n, r = () => {
const s = Dt.findIndex((o) => o.cancel == r);
~s && Dt.splice(s, 1), mt -= ~s ? 1 : 0;
}, a = { time: t, handler: e, cancel: r };
return Dt.splice(js(t), 0, a), mt += 1, ws(), a;
};
var js = (e) => ~(~Dt.findIndex((n) => n.time > e) || ~Dt.length);
se.cancel = (e) => {
Yn.delete(e), da.delete(e), fa.delete(e), ca.delete(e), ua.delete(e);
};
se.sync = (e) => {
zr = !0, se.batchedUpdates(e), zr = !1;
};
se.throttle = (e) => {
let n;
function t() {
try {
e(...n);
} finally {
n = null;
}
}
function r(...a) {
n = a, se.onStart(t);
}
return r.handler = e, r.cancel = () => {
Yn.delete(t), n = null;
}, r;
};
var pa = typeof window < "u" ? window.requestAnimationFrame : (
// eslint-disable-next-line @typescript-eslint/no-empty-function
() => {
}
);
se.use = (e) => pa = e;
se.now = typeof performance < "u" ? () => performance.now() : Date.now;
se.batchedUpdates = (e) => e();
se.catch = console.error;
se.frameLoop = "always";
se.advance = () => {
se.frameLoop !== "demand" ? console.warn(
"Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"
) : Es();
};
var pt = -1, mt = 0, zr = !1;
function xn(e, n) {
zr ? (n.delete(e), e(0)) : (n.add(e), ws());
}
function ws() {
pt < 0 && (pt = 0, se.frameLoop !== "demand" && pa(Cs));
}
function pu() {
pt = -1;
}
function Cs() {
~pt && (pa(Cs), se.batchedUpdates(Es));
}
function Es() {
const e = pt;
pt = se.now();
const n = js(pt);
if (n && (Ts(Dt.splice(0, n), (t) => t.handler()), mt -= n), !mt) {
pu();
return;
}
Yn.flush(), ca.flush(e ? Math.min(64, pt - e) : 16.667), da.flush(), ua.flush(), fa.flush();
}
function jn() {
let e = /* @__PURE__ */ new Set(), n = e;
return {
add(t) {
mt += n == e && !e.has(t) ? 1 : 0, e.add(t);
},
delete(t) {
return mt -= n == e && e.has(t) ? 1 : 0, e.delete(t);
},
flush(t) {
n.size && (e = /* @__PURE__ */ new Set(), mt -= n.size, Ts(n, (r) => r(t) && e.add(r)), mt += e.size, n = e);
}
};
}
function Ts(e, n) {
e.forEach((t) => {
try {
n(t);
} catch (r) {
se.catch(r);
}
});
}
var mu = Object.defineProperty, hu = (e, n) => {
for (var t in n)
mu(e, t, { get: n[t], enumerable: !0 });
}, nt = {};
hu(nt, {
assign: () => gu,
colors: () => gt,
createStringInterpolator: () => ha,
skipAnimation: () => Ps,
to: () => Ss,
willAdvance: () => va
});
function Hr() {
}
var vu = (e, n, t) => Object.defineProperty(e, n, { value: t, writable: !0, configurable: !0 }), F = {
arr: Array.isArray,
obj: (e) => !!e && e.constructor.name === "Object",
fun: (e) => typeof e == "function",
str: (e) => typeof e == "string",
num: (e) => typeof e == "number",
und: (e) => e === void 0
};
function ot(e, n) {
if (F.arr(e)) {
if (!F.arr(n) || e.length !== n.length)
return !1;
for (let t = 0; t < e.length; t++)
if (e[t] !== n[t])
return !1;
return !0;
}
return e === n;
}
var ce = (e, n) => e.forEach(n);
function at(e, n, t) {
if (F.arr(e)) {
for (let r = 0; r < e.length; r++)
n.call(t, e[r], `${r}`);
return;
}
for (const r in e)
e.hasOwnProperty(r) && n.call(t, e[r], r);
}
var Be = (e) => F.und(e) ? [] : F.arr(e) ? e : [e];
function Xt(e, n) {
if (e.size) {
const t = Array.from(e);
e.clear(), ce(t, n);
}
}
var Kt = (e, ...n) => Xt(e, (t) => t(...n)), ma = () => typeof window > "u" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent), ha, Ss, gt = null, Ps = !1, va = Hr, gu = (e) => {
e.to && (Ss = e.to), e.now && (se.now = e.now), e.colors !== void 0 && (gt = e.colors), e.skipAnimation != null && (Ps = e.skipAnimation), e.createStringInterpolator && (ha = e.createStringInterpolator), e.requestAnimationFrame && se.use(e.requestAnimationFrame), e.batchedUpdates && (se.batchedUpdates = e.batchedUpdates), e.willAdvance && (va = e.willAdvance), e.frameLoop && (se.frameLoop = e.frameLoop);
}, Qt = /* @__PURE__ */ new Set(), Ke = [], yr = [], Ln = 0, Gn = {
get idle() {
return !Qt.size && !Ke.length;
},
/** Advance the given animation on every frame until idle. */
start(e) {
Ln > e.priority ? (Qt.add(e), se.onStart(yu)) : (Os(e), se(Wr));
},
/** Advance all animations by the given time. */
advance: Wr,
/** Call this when an animation's priority changes. */
sort(e) {
if (Ln)
se.onFrame(() => Gn.sort(e));
else {
const n = Ke.indexOf(e);
~n && (Ke.splice(n, 1), Ns(e));
}
},
/**
* Clear all animations. For testing purposes.
*
* ☠️ Never call this from within the frameloop.
*/
clear() {
Ke = [], Qt.clear();
}
};
function yu() {
Qt.forEach(Os), Qt.clear(), se(Wr);
}
function Os(e) {
Ke.includes(e) || Ns(e);
}
function Ns(e) {
Ke.splice(
bu(Ke, (n) => n.priority > e.priority),
0,
e
);
}
function Wr(e) {
const n = yr;
for (let t = 0; t < Ke.length; t++) {
const r = Ke[t];
Ln = r.priority, r.idle || (va(r), r.advance(e), r.idle || n.push(r));
}
return Ln = 0, yr = Ke, yr.length = 0, Ke = n, Ke.length > 0;
}
function bu(e, n) {
const t = e.findIndex(n);
return t < 0 ? e.length : t;
}
var xu = {
transparent: 0,
aliceblue: 4042850303,
antiquewhite: 4209760255,
aqua: 16777215,
aquamarine: 2147472639,
azure: 4043309055,
beige: 4126530815,
bisque: 4293182719,
black: 255,
blanchedalmond: 4293643775,
blue: 65535,
blueviolet: 2318131967,
brown: 2771004159,
burlywood: 3736635391,
burntsienna: 3934150143,
cadetblue: 1604231423,
chartreuse: 2147418367,
chocolate: 3530104575,
coral: 4286533887,
cornflowerblue: 1687547391,
cornsilk: 4294499583,
crimson: 3692313855,
cyan: 16777215,
darkblue: 35839,
darkcyan: 9145343,
darkgoldenrod: 3095792639,
darkgray: 2846468607,
darkgreen: 6553855,
darkgrey: 2846468607,
darkkhaki: 3182914559,
darkmagenta: 2332068863,
darkolivegreen: 1433087999,
darkorange: 4287365375,
darkorchid: 2570243327,
darkred: 2332033279,
darksalmon: 3918953215,
darkseagreen: 2411499519,
darkslateblue: 1211993087,
darkslategray: 793726975,
darkslategrey: 793726975,
darkturquoise: 13554175,
darkviolet: 2483082239,
deeppink: 4279538687,
deepskyblue: 12582911,
dimgray: 1768516095,
dimgrey: 1768516095,
dodgerblue: 512819199,
firebrick: 2988581631,
floralwhite: 4294635775,
forestgreen: 579543807,
fuchsia: 4278255615,
gainsboro: 3705462015,
ghostwhite: 4177068031,
gold: 4292280575,
goldenrod: 3668254975,
gray: 2155905279,
green: 8388863,
greenyellow: 2919182335,
grey: 2155905279,
honeydew: 4043305215,
hotpink: 4285117695,
indianred: 3445382399,
indigo: 1258324735,
ivory: 4294963455,
khaki: 4041641215,
lavender: 3873897215,
lavenderblush: 4293981695,
lawngreen: 2096890111,
lemonchiffon: 4294626815,
lightblue: 2916673279,
lightcoral: 4034953471,
lightcyan: 3774873599,
lightgoldenrodyellow: 4210742015,
lightgray: 3553874943,
lightgreen: 2431553791,
lightgrey: 3553874943,
lightpink: 4290167295,
lightsalmon: 4288707327,
lightseagreen: 548580095,
lightskyblue: 2278488831,
lightslategray: 2005441023,
lightslategrey: 2005441023,
lightsteelblue: 2965692159,
lightyellow: 4294959359,
lime: 16711935,
limegreen: 852308735,
linen: 4210091775,
magenta: 4278255615,
maroon: 2147483903,
mediumaquamarine: 1724754687,
mediumblue: 52735,
mediumorchid: 3126187007,
mediumpurple: 2473647103,
mediumseagreen: 1018393087,
mediumslateblue: 2070474495,
mediumspringgreen: 16423679,
mediumturquoise: 1221709055,
mediumvioletred: 3340076543,
midnightblue: 421097727,
mintcream: 4127193855,
mistyrose: 4293190143,
moccasin: 4293178879,
navajowhite: 4292783615,
navy: 33023,
oldlace: 4260751103,
olive: 2155872511,
olivedrab: 1804477439,
orange: 4289003775,
orangered: 4282712319,
orchid: 3664828159,
palegoldenrod: 4008225535,
palegreen: 2566625535,
paleturquoise: 2951671551,
palevioletred: 3681588223,
papayawhip: 4293907967,
peachpuff: 4292524543,
peru: 3448061951,
pink: 4290825215,
plum: 3718307327,
powderblue: 2967529215,
purple: 2147516671,
rebeccapurple: 1714657791,
red: 4278190335,
rosybrown: 3163525119,
royalblue: 1097458175,
saddlebrown: 2336560127,
salmon: 4202722047,
sandybrown: 4104413439,
seagreen: 780883967,
seashell: 4294307583,
sienna: 2689740287,
silver: 3233857791,
skyblue: 2278484991,
slateblue: 1784335871,
slategray: 1887473919,
slategrey: 1887473919,
snow: 4294638335,
springgreen: 16744447,
steelblue: 1182971135,
tan: 3535047935,
teal: 8421631,
thistle: 3636451583,
tomato: 4284696575,
turquoise: 1088475391,
violet: 4001558271,
wheat: 4125012991,
white: 4294967295,
whitesmoke: 4126537215,
yellow: 4294902015,
yellowgreen: 2597139199
}, et = "[-+]?\\d*\\.?\\d+", $n = et + "%";
function Zn(...e) {
return "\\(\\s*(" + e.join(")\\s*,\\s*(") + ")\\s*\\)";
}
var ju = new RegExp("rgb" + Zn(et, et, et)), wu = new RegExp("rgba" + Zn(et, et, et, et)), Cu = new RegExp("hsl" + Zn(et, $n, $n)), Eu = new RegExp(
"hsla" + Zn(et, $n, $n, et)
), Tu = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, Su = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, Pu = /^#([0-9a-fA-F]{6})$/, Ou = /^#([0-9a-fA-F]{8})$/;
function Nu(e) {
let n;
return typeof e == "number" ? e >>> 0 === e && e >= 0 && e <= 4294967295 ? e : null : (n = Pu.exec(e)) ? parseInt(n[1] + "ff", 16) >>> 0 : gt && gt[e] !== void 0 ? gt[e] : (n = ju.exec(e)) ? (kt(n[1]) << 24 | // r
kt(n[2]) << 16 | // g
kt(n[3]) << 8 | // b
255) >>> // a
0 : (n = wu.exec(e)) ? (kt(n[1]) << 24 | // r
kt(n[2]) << 16 | // g
kt(n[3]) << 8 | // b
Si(n[4])) >>> // a
0 : (n = Tu.exec(e)) ? parseInt(
n[1] + n[1] + // r
n[2] + n[2] + // g
n[3] + n[3] + // b
"ff",
// a
16
) >>> 0 : (n = Ou.exec(e)) ? parseInt(n[1], 16) >>> 0 : (n = Su.exec(e)) ? parseInt(
n[1] + n[1] + // r
n[2] + n[2] + // g
n[3] + n[3] + // b
n[4] + n[4],
// a
16
) >>> 0 : (n = Cu.exec(e)) ? (Ei(
Ti(n[1]),
// h
Pn(n[2]),
// s
Pn(n[3])
// l
) | 255) >>> // a
0 : (n = Eu.exec(e)) ? (Ei(
Ti(n[1]),
// h
Pn(n[2]),
// s
Pn(n[3])
// l
) | Si(n[4])) >>> // a
0 : null;
}
function br(e, n, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? e + (n - e) * 6 * t : t < 1 / 2 ? n : t < 2 / 3 ? e + (n - e) * (2 / 3 - t) * 6 : e;
}
function Ei(e, n, t) {
const r = t < 0.5 ? t * (1 + n) : t + n - t * n, a = 2 * t - r, s = br(a, r, e + 1 / 3), o = br(a, r, e), l = br(a, r, e - 1 / 3);
return Math.round(s * 255) << 24 | Math.round(o * 255) << 16 | Math.round(l * 255) << 8;
}
function kt(e) {
const n = parseInt(e, 10);
return n < 0 ? 0 : n > 255 ? 255 : n;
}
function Ti(e) {
return (parseFloat(e) % 360 + 360) % 360 / 360;
}
function Si(e) {
const n = parseFloat(e);
return n < 0 ? 0 : n > 1 ? 255 : Math.round(n * 255);
}
function Pn(e) {
const n = parseFloat(e);
return n < 0 ? 0 : n > 100 ? 1 : n / 100;
}
function Pi(e) {
let n = Nu(e);
if (n === null)
return e;
n = n || 0;
const t = (n & 4278190080) >>> 24, r = (n & 16711680) >>> 16, a = (n & 65280) >>> 8, s = (n & 255) / 255;
return `rgba(${t}, ${r}, ${a}, ${s})`;
}
var un = (e, n, t) => {
if (F.fun(e))
return e;
if (F.arr(e))
return un({
range: e,
output: n,
extrapolate: t
});
if (F.str(e.output[0]))
return ha(e);
const r = e, a = r.output, s = r.range || [0, 1], o = r.extrapolateLeft || r.extrapolate || "extend", l = r.extrapolateRight || r.extrapolate || "extend", c = r.easing || ((u) => u);
return (u) => {
const d = _u(u, s);
return ku(
u,
s[d],
s[d + 1],
a[d],
a[d + 1],
c,
o,
l,
r.map
);
};
};
function ku(e, n, t, r, a, s, o, l, c) {
let u = c ? c(e) : e;
if (u < n) {
if (o === "identity")
return u;
o === "clamp" && (u = n);
}
if (u > t) {
if (l === "identity")
return u;
l === "clamp" && (u = t);
}
return r === a ? r : n === t ? e <= n ? r : a : (n === -1 / 0 ? u = -u : t === 1 / 0 ? u = u - n : u = (u - n) / (t - n), u = s(u), r === -1 / 0 ? u = -u : a === 1 / 0 ? u = u + r : u = u * (a - r) + r, u);
}
function _u(e, n) {
for (var t = 1; t < n.length - 1 && !(n[t] >= e); ++t)
;
return t - 1;
}
var Au = {
linear: (e) => e
}, dn = Symbol.for("FluidValue.get"), Lt = Symbol.for("FluidValue.observers"), Je = (e) => !!(e && e[dn]), He = (e) => e && e[dn] ? e[dn]() : e, Oi = (e) => e[Lt] || null;
function Ru(e, n) {
e.eventObserved ? e.eventObserved(n) : e(n);
}
function fn(e, n) {
const t = e[Lt];
t && t.forEach((r) => {
Ru(r, n);
});
}
var ks = class {
constructor(e) {
if (!e && !(e = this.get))
throw Error("Unknown getter");
Iu(this, e);
}
}, Iu = (e, n) => _s(e, dn, n);
function Vt(e, n) {
if (e[dn]) {
let t = e[Lt];
t || _s(e, Lt, t = /* @__PURE__ */ new Set()), t.has(n) || (t.add(n), e.observerAdded && e.observerAdded(t.size, n));
}
return n;
}
function pn(e, n) {
const t = e[Lt];
if (t && t.has(n)) {
const r = t.size - 1;
r ? t.delete(n) : e[Lt] = null, e.observerRemoved && e.observerRemoved(r, n);
}
}
var _s = (e, n, t) => Object.defineProperty(e, n, {
value: t,
writable: !0,
configurable: !0
}), _n = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, Du = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi, Ni = new RegExp(`(${_n.source})(%|[a-z]+)`, "i"), Mu = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, Jn = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/, As = (e) => {
const [n, t] = Fu(e);
if (!n || ma())
return e;
const r = window.getComputedStyle(document.documentElement).getPropertyValue(n);
if (r)
return r.trim();
if (t && t.startsWith("--")) {
const a = window.getComputedStyle(document.documentElement).getPropertyValue(t);
return a || e;
} else {
if (t && Jn.test(t))
return As(t);
if (t)
return t;
}
return e;
}, Fu = (e) => {
const n = Jn.exec(e);
if (!n)
return [,];
const [, t, r] = n;
return [t, r];
}, xr, Lu = (e, n, t, r, a) => `rgba(${Math.round(n)}, ${Math.round(t)}, ${Math.round(r)}, ${a})`, Rs = (e) => {
xr || (xr = gt ? (
// match color names, ignore partial matches
new RegExp(`(${Object.keys(gt).join("|")})(?!\\w)`, "g")
) : (
// never match
/^\b$/
));
const n = e.output.map((s) => He(s).replace(Jn, As).replace(Du, Pi).replace(xr, Pi)), t = n.map((s) => s.match(_n).map(Number)), a = t[0].map(
(s, o) => t.map((l) => {
if (!(o in l))
throw Error('The arity of each "output" value must be equal');
return l[o];
})
).map(
(s) => un({ ...e, output: s })
);
return (s) => {
var c;
const o = !Ni.test(n[0]) && ((c = n.find((u) => Ni.test(u))) == null ? void 0 : c.replace(_n, ""));
let l = 0;
return n[0].replace(
_n,
() => `${a[l++](s)}${o || ""}`
).replace(Mu, Lu);
};
}, ga = "react-spring: ", Is = (e) => {
const n = e;
let t = !1;
if (typeof n != "function")
throw new TypeError(`${ga}once requires a function parameter`);
return (...r) => {
t || (n(...r), t = !0);
};
}, $u = Is(console.warn);
function Vu() {
$u(
`${ga}The "interpolate" function is deprecated in v9 (use "to" instead)`
);
}
var Bu = Is(console.warn);
function zu() {
Bu(
`${ga}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`
);
}
function Kn(e) {
return F.str(e) && (e[0] == "#" || /\d/.test(e) || // Do not identify a CSS variable as an AnimatedString if its SSR
!ma() && Jn.test(e) || e in (gt || {}));
}
var It = ma() ? xe : Co, Hu = () => {
const e = Ue(!1);
return It(() => (e.current = !0, () => {
e.current = !1;
}), []), e;
};
function Ds() {
const e = Z()[1], n = Hu();
return () => {
n.current && e(Math.random());
};
}
function Wu(e, n) {
const [t] = Z(
() => ({
inputs: n,
result: e()
})
), r = Ue(), a = r.current;
let s = a;
return s ? n && s.inputs && Uu(n, s.inputs) || (s = {
inputs: n,
result: e()
}) : s = t, xe(() => {
r.current = s, a == t && (t.inputs = t.result = void 0);
}, [s]), s.result;
}
function Uu(e, n) {
if (e.length !== n.length)
return !1;
for (let t = 0; t < e.length; t++)
if (e[t] !== n[t])
return !1;
return !0;
}
var Ms = (e) => xe(e, qu), qu = [];
function Yu(e) {
const n = Ue();
return xe(() => {
n.current = e;
}), n.current;
}
var mn = Symbol.for("Animated:node"), Gu = (e) => !!e && e[mn] === e, rt = (e) => e && e[mn], ya = (e, n) => vu(e, mn, n), Xn = (e) => e && e[mn] && e[mn].getPayload(), Fs = class {
constructor() {
ya(this, this);
}
/** Get every `AnimatedValue` used by this node. */
getPayload() {
return this.payload || [];
}
}, wn = class extends Fs {
constructor(e) {
super(), this._value = e, this.done = !0, this.durationProgress = 0, F.num(this._value) && (this.lastPosition = this._value);
}
/** @internal */
static create(e) {
return new wn(e);
}
getPayload() {
return [this];
}
getValue() {
return this._value;
}
setValue(e, n) {
return F.num(e) && (this.lastPosition = e, n && (e = Math.round(e / n) * n, this.done && (this.lastPosition = e))), this._value === e ? !1 : (this._value = e, !0);
}
reset() {
const { done: e } = this;
this.done = !1, F.num(this._value) && (this.elapsedTime = 0, this.durationProgress = 0, this.lastPosition = this._value, e && (this.lastVelocity = null), this.v0 = null);
}
}, hn = class extends wn {
constructor(e) {
super(0), this._string = null, this._toString = un({
output: [e, e]
});
}
/** @internal */
static create(e) {
return new hn(e);
}
getValue() {
const e = this._string;
return e ?? (this._string = this._toString(this._value));
}
setValue(e) {
if (F.str(e)) {
if (e == this._string)
return !1;
this._string = e, this._value = 1;
} else if (super.setValue(e))
this._string = null;
else
return !1;
return !0;
}
reset(e) {
e && (this._toString = un({
output: [this.getValue(), e]
})), this._value = 0, super.reset();
}
}, Vn = { dependencies: null }, Qn = class extends Fs {
constructor(e) {
super(), this.source = e, this.setValue(e);
}
getValue(e) {
const n = {};
return at(this.source, (t, r) => {
Gu(t) ? n[r] = t.getValue(e) : Je(t) ? n[r] = He(t) : e || (n[r] = t);
}), n;
}
/** Replace the raw object data */
setValue(e) {
this.source = e, this.payload = this._makePayload(e);
}
reset() {
this.payload && ce(this.payload, (e) => e.reset());
}
/** Create a payload set. */
_makePayload(e) {
if (e) {
const n = /* @__PURE__ */ new Set();
return at(e, this._addToPayload, n), Array.from(n);
}
}
/** Add to a payload set. */
_addToPayload(e) {
Vn.dependencies && Je(e) && Vn.dependencies.add(e);
const n = Xn(e);
n && ce(n, (t) => this.add(t));
}
}, Ls = class extends Qn {
constructor(e) {
super(e);
}
/** @internal */
static create(e) {
return new Ls(e);
}
getValue() {
return this.source.map((e) => e.getValue());
}
setValue(e) {
const n = this.getPayload();
return e.length == n.length ? n.map((t, r) => t.setValue(e[r])).some(Boolean) : (super.setValue(e.map(Zu)), !0);
}
};
function Zu(e) {
return (Kn(e) ? hn : wn).create(e);
}
function Ur(e) {
const n = rt(e);
return n ? n.constructor : F.arr(e) ? Ls : Kn(e) ? hn : wn;
}
var ki = (e, n) => {
const t = (
// Function components must use "forwardRef" to avoid being
// re-rendered on every animation frame.
!F.fun(e) || e.prototype && e.prototype.isReactComponent
);
return Kr((r, a) => {
const s = Ue(null), o = t && // eslint-disable-next-line react-hooks/rules-of-hooks
Qe(
(g) => {
s.current = Xu(a, g);
},
[a]
), [l, c] = Ku(r, n), u = Ds(), d = () => {
const g = s.current;
if (t && !g)
return;
(g ? n.applyAnimatedValues(g, l.getValue(!0)) : !1) === !1 && u();
}, f = new Ju(d, c), p = Ue();
It(() => (p.current = f, ce(c, (g) => Vt(g, f)), () => {
p.current && (ce(
p.current.deps,
(g) => pn(g, p.current)
), se.cancel(p.current.update));
})), xe(d, []), Ms(() => () => {
const g = p.current;
ce(g.deps, (y) => pn(y, g));
});
const m = n.getComponentProps(l.getValue());
return /* @__PURE__ */ V.createElement(e, { ...m, ref: o });
});
}, Ju = class {
constructor(e, n) {
this.update = e, this.deps = n;
}
eventObserved(e) {
e.type == "change" && se.write(this.update);
}
};
function Ku(e, n) {
const t = /* @__PURE__ */ new Set();
return Vn.dependencies = t, e.style && (e = {
...e,
style: n.createAnimatedStyle(e.style)
}), e = new Qn(e), Vn.dependencies = null, [e, t];
}
function Xu(e, n) {
return e && (F.fun(e) ? e(n) : e.current = n), n;
}
var _i = Symbol.for("AnimatedComponent"), Qu = (e, {
applyAnimatedValues: n = () => !1,
createAnimatedStyle: t = (a) => new Qn(a),
getComponentProps: r = (a) => a
} = {}) => {
const a = {
applyAnimatedValues: n,
createAnimatedStyle: t,
getComponentProps: r
}, s = (o) => {
const l = Ai(o) || "Anonymous";
return F.str(o) ? o = s[o] || (s[o] = ki(o, a)) : o = o[_i] || (o[_i] = ki(o, a)), o.displayName = `Animated(${l})`, o;
};
return at(e, (o, l) => {
F.arr(e) && (l = Ai(o)), s[l] = s(o);
}), {
animated: s
};
}, Ai = (e) => F.str(e) ? e : e && F.str(e.displayName) ? e.displayName : F.fun(e) && e.name || null;
function We(e, ...n) {
return F.fun(e) ? e(...n) : e;
}
var en = (e, n) => e === !0 || !!(n && e && (F.fun(e) ? e(n) : Be(e).includes(n))), $s = (e, n) => F.obj(e) ? n && e[n] : e, Vs = (e, n) => e.default === !0 ? e[n] : e.default ? e.default[n] : void 0, ed = (e) => e, ba = (e, n = ed) => {
let t = td;
e.default && e.default !== !0 && (e = e.default, t = Object.keys(e));
const r = {};
for (const a of t) {
const s = n(e[a], a);
F.und(s) || (r[a] = s);
}
return r;
}, td = [
"config",
"onProps",
"onStart",
"onChange",
"onPause",
"onResume",
"onRest"
], nd = {
config: 1,
from: 1,
to: 1,
ref: 1,
loop: 1,
reset: 1,
pause: 1,
cancel: 1,
reverse: 1,
immediate: 1,
default: 1,
delay: 1,
onProps: 1,
onStart: 1,
onChange: 1,
onPause: 1,
onResume: 1,
onRest: 1,
onResolve: 1,
// Transition props
items: 1,
trail: 1,
sort: 1,
expires: 1,
initial: 1,
enter: 1,
update: 1,
leave: 1,
children: 1,
onDestroyed: 1,
// Internal props
keys: 1,
callId: 1,
parentId: 1
};
function rd(e) {
const n = {};
let t = 0;
if (at(e, (r, a) => {
nd[a] || (n[a] = r, t++);
}), t)
return n;
}
function xa(e) {
const n = rd(e);
if (n) {
const t = { to: n };
return at(e, (r, a) => a in n || (t[a] = r)), t;
}
return { ...e };
}
function vn(e) {
return e = He(e), F.arr(e) ? e.map(vn) : Kn(e) ? nt.createStringInterpolator({
range: [0, 1],
output: [e, e]
})(1) : e;
}
function ad(e) {
for (const n in e)
return !0;
return !1;
}
function qr(e) {
return F.fun(e) || F.arr(e) && F.obj(e[0]);
}
function Ri(e, n) {
var t;
(t = e.ref) == null || t.delete(e), n == null || n.delete(e);
}
function id(e, n) {
var t;
n && e.ref !== n && ((t = e.ref) == null || t.delete(e), n.add(e), e.ref = n);
}
var sd = {
default: { tension: 170, friction: 26 }
}, Yr = {
...sd.default,
mass: 1,
damping: 1,
easing: Au.linear,
clamp: !1
}, od = class {
constructor() {
this.velocity = 0, Object.assign(this, Yr);
}
};
function ld(e, n, t) {
t && (t = { ...t }, Ii(t, n), n = { ...t, ...n }), Ii(e, n), Object.assign(e, n);
for (const o in Yr)
e[o] == null && (e[o] = Yr[o]);
let { frequency: r, damping: a } = e;
const { mass: s } = e;
return F.und(r) || (r < 0.01 && (r = 0.01), a < 0 && (a = 0), e.tension = Math.pow(2 * Math.PI / r, 2) * s, e.friction = 4 * Math.PI * a * s / r), e;
}
function Ii(e, n) {
if (!F.und(n.decay))
e.duration = void 0;
else {
const t = !F.und(n.tension) || !F.und(n.friction);
(t || !F.und(n.frequency) || !F.und(n.damping) || !F.und(n.mass)) && (e.duration = void 0, e.decay = void 0), t && (e.frequency = void 0);
}
}
var Di = [], cd = class {
constructor() {
this.changed = !1, this.values = Di, this.toValues = null, this.fromValues = Di, this.config = new od(), this.immediate = !1;
}
};
function Bs(e, { key: n, props: t, defaultProps: r, state: a, actions: s }) {
return new Promise((o, l) => {
let c, u, d = en(t.cancel ?? (r == null ? void 0 : r.cancel), n);
if (d)
m();
else {
F.und(t.pause) || (a.paused = en(t.pause, n));
let g = r == null ? void 0 : r.pause;
g !== !0 && (g = a.paused || en(g, n)), c = We(t.delay || 0, n), g ? (a.resumeQueue.add(p), s.pause()) : (s.resume(), p());
}
function f() {
a.resumeQueue.add(p), a.timeouts.delete(u), u.cancel(), c = u.time - se.now();
}
function p() {
c > 0 && !nt.skipAnimation ? (a.delayed = !0, u = se.setTimeout(m, c), a.pauseQueue.add(f), a.timeouts.add(u)) : m();
}
function m() {
a.delayed && (a.delayed = !1), a.pauseQueue.delete(f), a.timeouts.delete(u), e <= (a.cancelId || 0) && (d = !0);
try {
s.start({ ...t, callId: e, cancel: d }, o);
} catch (g) {
l(g);
}
}
});
}
var ja = (e, n) => n.length == 1 ? n[0] : n.some((t) => t.cancelled) ? Mt(e.get()) : n.every((t) => t.noop) ? zs(e.get()) : Xe(
e.get(),
n.every((t) => t.finished)
), zs = (e) => ({
value: e,
noop: !0,
finished: !0,
cancelled: !1
}), Xe = (e, n, t = !1) => ({
value: e,
finished: n,
cancelled: t
}), Mt = (e) => ({
value: e,
cancelled: !0,
finished: !1
});
function Hs(e, n, t, r) {
const { callId: a, parentId: s, onRest: o } = n, { asyncTo: l, promise: c } = t;
return !s && e === l && !n.reset ? c : t.promise = (async () => {
t.asyncId = a, t.asyncTo = e;
const u = ba(
n,
(x, j) => (
// The `onRest` prop is only called when the `runAsync` promise is resolved.
j === "onRest" ? void 0 : x
)
);
let d, f;
const p = new Promise(
(x, j) => (d = x, f = j)
), m = (x) => {
const j = (
// The `cancel` prop or `stop` method was used.
a <= (t.cancelId || 0) && Mt(r) || // The async `to` prop was replaced.
a !== t.asyncId && Xe(r, !1)
);
if (j)
throw x.result = j, f(x), x;
}, g = (x, j) => {
const C = new Mi(), E = new Fi();
return (async () => {
if (nt.skipAnimation)
throw gn(t), E.result = Xe(r, !1), f(E), E;
m(C);
const I = F.obj(x) ? { ...x } : { ...j, to: x };
I.parentId = a, at(u, ($, k) => {
F.und(I[k]) && (I[k] = $);
});
const b = await r.start(I);
return m(C), t.paused && await new Promise(($) => {
t.resumeQueue.add($);
}), b;
})();
};
let y;
if (nt.skipAnimation)
return gn(t), Xe(r, !1);
try {
let x;
F.arr(e) ? x = (async (j) => {
for (const C of j)
await g(C);
})(e) : x = Promise.resolve(e(g, r.stop.bind(r))), await Promise.all([x.then(d), p]), y = Xe(r.get(), !0, !1);
} catch (x) {
if (x instanceof Mi)
y = x.result;
else if (x instanceof Fi)
y = x.result;
else
throw x;
} finally {
a == t.asyncId && (t.asyncId = s, t.asyncTo = s ? l : void 0, t.promise = s ? c : void 0);
}
return F.fun(o) && se.batchedUpdates(() => {
o(y, r, r.item);
}), y;
})();
}
function gn(e, n) {
Xt(e.timeouts, (t) => t.cancel()), e.pauseQueue.clear(), e.resumeQueue.clear(), e.asyncId = e.asyncTo = e.promise = void 0, n && (e.cancelId = n);
}
var Mi = class extends Error {
constructor() {
super(
"An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."
);
}
}, Fi = class extends Error {
constructor() {
super("SkipAnimationSignal");
}
}, Gr = (e) => e instanceof wa, ud = 1, wa = class extends ks {
constructor() {
super(...arguments), this.id = ud++, this._priority = 0;
}
get priority() {
return this._priority;
}
set priority(e) {
this._priority != e && (this._priority = e, this._onPriorityChange(e));
}
/** Get the current value */
get() {
const e = rt(this);
return e && e.getValue();
}
/** Create a spring that maps our value to another value */
to(...e) {
return nt.to(this, e);
}
/** @deprecated Use the `to` method instead. */
interpolate(...e) {
return Vu(), nt.to(this, e);
}
toJSON() {
return this.get();
}
observerAdded(e) {
e == 1 && this._attach();
}
observerRemoved(e) {
e == 0 && this._detach();
}
/** Called when the first child is added. */
_attach() {
}
/** Called when the last child is removed. */
_detach() {
}
/** Tell our children about our new value */
_onChange(e, n = !1) {
fn(this, {
type: "change",
parent: this,
value: e,
idle: n
});
}
/** Tell our children about our new priority */
_onPriorityChange(e) {
this.idle || Gn.sort(this), fn(this, {
type: "priority",
parent: this,
priority: e
});
}
}, Et = Symbol.for("SpringPhase"), Ws = 1, Us = 2, qs = 4, jr = (e) => (e[Et] & Ws) > 0, ft = (e) => (e[Et] & Us) > 0, Wt = (e) => (e[Et] & qs) > 0, Li = (e, n) => n ? e[Et] |= Us | Ws : e[Et] &= -3, $i = (e, n) => n ? e[Et] |= qs : e[Et] &= -5, dd = class extends wa {
constructor(e, n) {
if (super(), this.animation = new cd(), this.defaultProps = {}, this._state = {
paused: !1,
delayed: !1,
pauseQueue: /* @__PURE__ */ new Set(),
resumeQueue: /* @__PURE__ */ new Set(),
timeouts: /* @__PURE__ */ new Set()
}, this._pendingCalls = /* @__PURE__ */ new Set(), this._lastCallId = 0, this._lastToId = 0, this._memoizedDuration = 0, !F.und(e) || !F.und(n)) {
const t = F.obj(e) ? { ...e } : { ...n, from: e };
F.und(t.default) && (t.default = !0), this.start(t);
}
}
/** Equals true when not advancing on each frame. */
get idle() {
return !(ft(this) || this._state.asyncTo) || Wt(this);
}
get goal() {
return He(this.animation.to);
}
get velocity() {
const e = rt(this);
return e instanceof wn ? e.lastVelocity || 0 : e.getPayload().map((n) => n.lastVelocity || 0);
}
/**
* When true, this value has been animated at least once.
*/
get hasAnimated() {
return jr(this);
}
/**
* When true, this value has an unfinished animation,
* which is either active or paused.
*/
get isAnimating() {
return ft(this);
}
/**
* When true, all current and future animations are paused.
*/
get isPaused() {
return Wt(this);
}
/**
*
*
*/
get isDelayed() {
return this._state.delayed;
}
/** Advance the current animation by a number of milliseconds */
advance(e) {
let n = !0, t = !1;
const r = this.animation;
let { toValues: a } = r;
const { config: s } = r, o = Xn(r.to);
!o && Je(r.to) && (a = Be(He(r.to))), r.values.forEach((u, d) => {
if (u.done)
return;
const f = (
// Animated strings always go from 0 to 1.
u.constructor == hn ? 1 : o ? o[d].lastPosition : a[d]
);
let p = r.immediate, m = f;
if (!p) {
if (m = u.lastPosition, s.tension <= 0) {
u.done = !0;
return;
}
let g = u.elapsedTime += e;
const y = r.fromValues[d], x = u.v0 != null ? u.v0 : u.v0 = F.arr(s.velocity) ? s.velocity[d] : s.velocity;
let j;
const C = s.precision || (y == f ? 5e-3 : Math.min(1, Math.abs(f - y) * 1e-3));
if (F.und(s.duration))
if (s.decay) {
const E = s.decay === !0 ? 0.998 : s.decay, I = Math.exp(-(1 - E) * g);
m = y + x / (1 - E) * (1 - I), p = Math.abs(u.lastPosition - m) <= C, j = x * I;
} else {
j = u.lastVelocity == null ? x : u.lastVelocity;
const E = s.restVelocity || C / 10, I = s.clamp ? 0 : s.bounce, b = !F.und(I), $ = y == f ? u.v0 > 0 : y < f;
let k, L = !1;
const z = 1, A = Math.ceil(e / z);
for (let W = 0; W < A && (k = Math.abs(j) > E, !(!k && (p = Math.abs(f - m) <= C, p))); ++W) {
b && (L = m == f || m > f == $, L && (j = -j * I, m = f));
const te = -s.tension * 1e-6 * (m - f), ne = -s.friction * 1e-3 * j, H = (te + ne) / s.mass;
j = j + H * z, m = m + j * z;
}
}
else {
let E = 1;
s.duration > 0 && (this._memoizedDuration !== s.duration && (this._memoizedDuration = s.duration, u.durationProgress > 0 && (u.elapsedTime = s.duration * u.durationProgress, g = u.elapsedTime += e)), E = (s.progress || 0) + g / this._memoizedDuration, E = E > 1 ? 1 : E < 0 ? 0 : E, u.durationProgress = E), m = y + s.easing(E) * (f - y), j = (m - u.lastPosition) / e, p = E == 1;
}
u.lastVelocity = j, Number.isNaN(m) && (console.warn("Got NaN while animating:", this), p = !0);
}
o && !o[d].done && (p = !1), p ? u.done = !0 : n = !1, u.setValue(m, s.round) && (t = !0);
});
const l = rt(this), c = l.getValue();
if (n) {
const u = He(r.to);
(c !== u || t) && !s.decay ? (l.setValue(u), this._onChange(u)) : t && s.decay && this._onChange(c), this._stop();
} else t && this._onChange(c);
}
/** Set the current value, while stopping the current animation */
set(e) {
return se.batchedUpdates(() => {
this._stop(), this._focus(e), this._set(e);
}), this;
}
/**
* Freeze the active animation in time, as well as any updates merged
* before `resume` is called.
*/
pause() {
this._update({ pause: !0 });
}
/** Resume the animation if paused. */
resume() {
this._update({ pause: !1 });
}
/** Skip to the end of the current animation. */
finish() {
if (ft(this)) {
const { to: e, config: n } = this.animation;
se.batchedUpdates(() => {
this._onStart(), n.decay || this._set(e, !1), this._stop();
});
}
return this;
}
/** Push props into the pending queue. */
update(e) {
return (this.queue || (this.queue = [])).push(e), this;
}
start(e, n) {
let t;
return F.und(e) ? (t = this.queue || [], this.queue = []) : t = [F.obj(e) ? e : { ...n, to: e }], Promise.all(
t.map((r) => this._update(r))
).then((r) => ja(this, r));
}
/**
* Stop the current animation, and cancel any delayed updates.
*
* Pass `true` to call `onRest` with `cancelled: true`.
*/
stop(e) {
const { to: n } = this.animation;
return this._focus(this.get()), gn(this._state, e && this._lastCallId), se.batchedUpdates(() => this._stop(n, e)), this;
}
/** Restart the animation. */
reset() {
this._update({ reset: !0 });
}
/** @internal */
eventObserved(e) {
e.type == "change" ? this._start() : e.type == "priority" && (this.priority = e.priority + 1);
}
/**
* Parse the `to` and `from` range from the given `props` object.
*
* This also ensures the initial value is available to animated components
* during the render phase.
*/
_prepareNode(e) {
const n = this.key || "";
let { to: t, from: r } = e;
t = F.obj(t) ? t[n] : t, (t == null || qr(t)) && (t = void 0), r = F.obj(r) ? r[n] : r, r == null && (r = void 0);
const a = { to: t, from: r };
return jr(this) || (e.reverse && ([t, r] = [r, t]), r = He(r), F.und(r) ? rt(this) || this._set(t) : this._set(r)), a;
}
/** Every update is processed by this method before merging. */
_update({ ...e }, n) {
const { key: t, defaultProps: r } = this;
e.default && Object.assign(
r,
ba(
e,
(o, l) => /^on/.test(l) ? $s(o, t) : o
)
), Bi(this, e, "onProps"), qt(this, "onProps", e, this);
const a = this._prepareNode(e);
if (Object.isFrozen(this))
throw Error(
"Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"
);
const s = this._state;
return Bs(++this._lastCallId, {
key: t,
props: e,
defaultProps: r,
state: s,
actions: {
pause: () => {
Wt(this) || ($i(this, !0), Kt(s.pauseQueue), qt(
this,
"onPause",
Xe(this, Ut(this, this.animation.to)),
this
));
},
resume: () => {
Wt(this) && ($i(this, !1), ft(this) && this._resume(), Kt(s.resumeQueue), qt(
this,
"onResume",
Xe(this, Ut(this, this.animation.to)),
this
));
},
start: this._merge.bind(this, a)
}
}).then((o) => {
if (e.loop && o.finished && !(n && o.noop)) {
const l = Ys(e);
if (l)
return this._update(l, !0);
}
return o;
});
}
/** Merge props into the current animation */
_merge(e, n, t) {
if (n.cancel)
return this.stop(!0), t(Mt(this));
const r = !F.und(e.to), a = !F.und(e.from);
if (r || a)
if (n.callId > this._lastToId)
this._lastToId = n.callId;
else
return t(Mt(this));
const { key: s, defaultProps: o, animation: l } = this, { to: c, from: u } = l;
let { to: d = c, from: f = u } = e;
a && !r && (!n.default || F.und(d)) && (d = f), n.reverse && ([d, f] = [f, d]);
const p = !ot(f, u);
p && (l.from = f), f = He(f);
const m = !ot(d, c);
m && this._focus(d);
const g = qr(n.to), { config: y } = l, { decay: x, velocity: j } = y;
(r || a) && (y.velocity = 0), n.config && !g && ld(
y,
We(n.config, s),
// Avoid calling the same "config" prop twice.
n.config !== o.config ? We(o.config, s) : void 0
);
let C = rt(this);
if (!C || F.und(d))
return t(Xe(this, !0));
const E = (
// When `reset` is undefined, the `from` prop implies `reset: true`,
// except for declarative updates. When `reset` is defined, there
// must exist a value to animate from.
F.und(n.reset) ? a && !n.default : !F.und(f) && en(n.reset, s)
), I = E ? f : this.get(), b = vn(d), $ = F.num(b) || F.arr(b) || Kn(b), k = !g && (!$ || en(o.immediate || n.immediate, s));
if (m) {
const W = Ur(d);
if (W !== C.constructor)
if (k)
C = this._set(b);
else
throw Error(
`Cannot animate between ${C.constructor.name} and ${W.name}, as the "to" prop suggests`
);
}
const L = C.constructor;
let z = Je(d), A = !1;
if (!z) {
const W = E || !jr(this) && p;
(m || W) && (A = ot(vn(I), b), z = !A), (!ot(l.immediate, k) && !k || !ot(y.decay, x) || !ot(y.velocity, j)) && (z = !0);
}
if (A && ft(this) && (l.changed && !E ? z = !0 : z || this._stop(c)), !g && ((z || Je(c)) && (l.values = C.getPayload(), l.toValues = Je(d) ? null : L == hn ? [1] : Be(b)), l.immediate != k && (l.immediate = k, !k && !E && this._set(c)), z)) {
const { onRest: W } = l;
ce(fd, (ne) => Bi(this, n, ne));
const te = Xe(this, Ut(this, c));
Kt(this._pendingCalls, te), this._pendingCalls.add(t), l.changed && se.batchedUpdates(() => {
var ne;
l.changed = !E, W == null || W(te, this), E ? We(o.onRest, te) : (ne = l.onStart) == null || ne.call(l, te, this);
});
}
E && this._set(I), g ? t(Hs(n.to, n, this._state, this)) : z ? this._start() : ft(this) && !m ? this._pendingCalls.add(t) : t(zs(I));
}
/** Update the `animation.to` value, which might be a `FluidValue` */
_focus(e) {
const n = this.animation;
e !== n.to && (Oi(this) && this._detach(), n.to = e, Oi(this) && this._attach());
}
_attach() {
let e = 0;
const { to: n } = this.animation;
Je(n) && (Vt(n, this), Gr(n) && (e = n.priority + 1)), this.priority = e;
}
_detach() {
const { to: e } = this.animation;
Je(e) && pn(e, this);
}
/**
* Update the current value from outside the frameloop,
* and return the `Animated` node.
*/
_set(e, n = !0) {
const t = He(e);
if (!F.und(t)) {
const r = rt(this);
if (!r || !ot(t, r.getValue())) {
const a = Ur(t);
!r || r.constructor != a ? ya(this, a.create(t)) : r.setValue(t), r && se.batchedUpdates(() => {
this._onChange(t, n);
});
}
}
return rt(this);
}
_onStart() {
const e = this.animation;
e.changed || (e.changed = !0, qt(
this,
"onStart",
Xe(this, Ut(this, e.to)),
this
));
}
_onChange(e, n) {
n || (this._onStart(), We(this.animation.onChange, e, this)), We(this.defaultProps.onChange, e, this), super._onChange(e, n);
}
// This method resets the animation state (even if already animating) to
// ensure the latest from/to range is used, and it also ensures this spring
// is added to the frameloop.
_start() {
const e = this.animation;
rt(this).reset(He(e.to)), e.immediate || (e.fromValues = e.values.map((n) => n.lastPosition)), ft(this) || (Li(this, !0), Wt(this) || this._resume());
}
_resume() {
nt.skipAnimation ? this.finish() : Gn.start(this);
}
/**
* Exit the frameloop and notify `onRest` listeners.
*
* Always wrap `_stop` calls with `batchedUpdates`.
*/
_stop(e, n) {
if (ft(this)) {
Li(this, !1);
const t = this.animation;
ce(t.values, (a) => {
a.done = !0;
}), t.toValues && (t.onChange = t.onPause = t.onResume = void 0), fn(this, {
type: "idle",
parent: this
});
const r = n ? Mt(this.get()) : Xe(this.get(), Ut(this, e ?? t.to));
Kt(this._pendingCalls, r), t.changed && (t.changed = !1, qt(this, "onRest", r, this));
}
}
};
function Ut(e, n) {
const t = vn(n), r = vn(e.get());
return ot(r, t);
}
function Ys(e, n = e.loop, t = e.to) {
const r = We(n);
if (r) {
const a = r !== !0 && xa(r), s = (a || e).reverse, o = !a || a.reset;
return Bn({
...e,
loop: n,
// Avoid updating default props when looping.
default: !1,
// Never loop the `pause` prop.
pause: void 0,
// For the "reverse" prop to loop as expected, the "to" prop
// must be undefined. The "reverse" prop is ignored when the
// "to" prop is an array or function.
to: !s || qr(t) ? t : void 0,
// Ignore the "from" prop except on reset.
from: o ? e.from : void 0,
reset: o,
// The "loop" prop can return a "useSpring" props object to
// override any of the original props.
...a
});
}
}
function Bn(e) {
const { to: n, from: t } = e = xa(e), r = /* @__PURE__ */ new Set();
return F.obj(n) && Vi(n, r), F.obj(t) && Vi(t, r), e.keys = r.size ? Array.from(r) : null, e;
}
function Vi(e, n) {
at(e, (t, r) => t != null && n.add(r));
}
var fd = [
"onStart",
"onRest",
"onChange",
"onPause",
"onResume"
];
function Bi(e, n, t) {
e.animation[t] = n[t] !== Vs(n, t) ? $s(n[t], e.key) : void 0;
}
function qt(e, n, ...t) {
var r, a, s, o;
(a = (r = e.animation)[n]) == null || a.call(r, ...t), (o = (s = e.defaultProps)[n]) == null || o.call(s, ...t);
}
var pd = ["onStart", "onChange", "onRest"], md = 1, hd = class {
constructor(e, n) {
this.id = md++, this.springs = {}, this.queue = [], this._lastAsyncId = 0, this._active = /* @__PURE__ */ new Set(), this._changed = /* @__PURE__ */ new Set(), this._started = !1, this._state = {
paused: !1,
pauseQueue: /* @__PURE__ */ new Set(),
resumeQueue: /* @__PURE__ */ new Set(),
timeouts: /* @__PURE__ */ new Set()
}, this._events = {
onStart: /* @__PURE__ */ new Map(),
onChange: /* @__PURE__ */ new Map(),
onRest: /* @__PURE__ */ new Map()
}, this._onFrame = this._onFrame.bind(this), n && (this._flush = n), e && this.start({ default: !0, ...e });
}
/**
* Equals `true` when no spring values are in the frameloop, and
* no async animation is currently active.
*/
get idle() {
return !this._state.asyncTo && Object.values(this.springs).every((e) => e.idle && !e.isDelayed && !e.isPaused);
}
get item() {
return this._item;
}
set item(e) {
this._item = e;
}
/** Get the current values of our springs */
get() {
const e = {};
return this.each((n, t) => e[t] = n.get()), e;
}
/** Set the current values without animating. */
set(e) {
for (const n in e) {
const t = e[n];
F.und(t) || this.springs[n].set(t);
}
}
/** Push an update onto the queue of each value. */
update(e) {
return e && this.queue.push(Bn(e)), this;
}
/**
* Start the queued animations for every spring, and resolve the returned
* promise once all queued animations have finished or been cancelled.
*
* When you pass a queue (instead of nothing), that queue is used instead of
* the queued animations added with the `update` method, which are left alone.
*/
start(e) {
let { queue: n } = this;
return e ? n = Be(e).map(Bn) : this.queue = [], this._flush ? this._flush(this, n) : (Ks(this, n), vd(this, n));
}
/** @internal */
stop(e, n) {
if (e !== !!e && (n = e), n) {
const t = this.springs;
ce(Be(n), (r) => t[r].stop(!!e));
} else
gn(this._state, this._lastAsyncId), this.each((t) => t.stop(!!e));
return this;
}
/** Freeze the active animation in time */
pause(e) {
if (F.und(e))
this.start({ pause: !0 });
else {
const n = this.springs;
ce(Be(e), (t) => n[t].pause());
}
return this;
}
/** Resume the animation if paused. */
resume(e) {
if (F.und(e))
this.start({ pause: !1 });
else {
const n = this.springs;
ce(Be(e), (t) => n[t].resume());
}
return this;
}
/** Call a function once per spring value */
each(e) {
at(this.springs, e);
}
/** @internal Called at the end of every animation frame */
_onFrame() {
const { onStart: e, onChange: n, onRest: t } = this._events, r = this._active.size > 0, a = this._changed.size > 0;
(r && !this._started || a && !this._started) && (this._started = !0, Xt(e, ([l, c]) => {
c.value = this.get(), l(c, this, this._item);
}));
const s = !r && this._started, o = a || s && t.size ? this.get() : null;
a && n.size && Xt(n, ([l, c]) => {
c.value = o, l(c, this, this._item);
}), s && (this._started = !1, Xt(t, ([l, c]) => {
c.value = o, l(c, this, this._item);
}));
}
/** @internal */
eventObserved(e) {
if (e.type == "change")
this._changed.add(e.parent), e.idle || this._active.add(e.parent);
else if (e.type == "idle")
this._active.delete(e.parent);
else
return;
se.onFrame(this._onFrame);
}
};
function vd(e, n) {
return Promise.all(n.map((t) => Gs(e, t))).then(
(t) => ja(e, t)
);
}
async function Gs(e, n, t) {
const { keys: r, to: a, from: s, loop: o, onRest: l, onResolve: c } = n, u = F.obj(n.default) && n.default;
o && (n.loop = !1), a === !1 && (n.to = null), s === !1 && (n.from = null);
const d = F.arr(a) || F.fun(a) ? a : void 0;
d ? (n.to = void 0, n.onRest = void 0, u && (u.onRest = void 0)) : ce(pd, (y) => {
const x = n[y];
if (F.fun(x)) {
const j = e._events[y];
n[y] = ({ finished: C, cancelled: E }) => {
const I = j.get(x);
I ? (C || (I.finished = !1), E && (I.cancelled = !0)) : j.set(x, {
value: null,
finished: C || !1,
cancelled: E || !1
});
}, u && (u[y] = n[y]);
}
});
const f = e._state;
n.pause === !f.paused ? (f.paused = n.pause, Kt(n.pause ? f.pauseQueue : f.resumeQueue)) : f.paused && (n.pause = !0);
const p = (r || Object.keys(e.springs)).map(
(y) => e.springs[y].start(n)
), m = n.cancel === !0 || Vs(n, "cancel") === !0;
(d || m && f.asyncId) && p.push(
Bs(++e._lastAsyncId, {
props: n,
state: f,
actions: {
pause: Hr,
resume: Hr,
start(y, x) {
m ? (gn(f, e._lastAsyncId), x(Mt(e))) : (y.onRest = l, x(
Hs(
d,
y,
f,
e
)
));
}
}
})
), f.paused && await new Promise((y) => {
f.resumeQueue.add(y);
});
const g = ja(e, await Promise.all(p));
if (o && g.finished && !(t && g.noop)) {
const y = Ys(n, o, a);
if (y)
return Ks(e, [y]), Gs(e, y, !0);
}
return c && se.batchedUpdates(() => c(g, e, e.item)), g;
}
function gd(e, n) {
const t = { ...e.springs };
return n && ce(Be(n), (r) => {
F.und(r.keys) && (r = Bn(r)), F.obj(r.to) || (r = { ...r, to: void 0 }), Js(t, r, (a) => Zs(a));
}), yd(e, t), t;
}
function yd(e, n) {
at(n, (t, r) => {
e.springs[r] || (e.springs[r] = t, Vt(t, e));
});
}
function Zs(e, n) {
const t = new dd();
return t.key = e, n && Vt(t, n), t;
}
function Js(e, n, t) {
n.keys && ce(n.keys, (r) => {
(e[r] || (e[r] = t(r)))._prepareNode(n);
});
}
function Ks(e, n) {
ce(n, (t) => {
Js(e.springs, t, (r) => Zs(r, e));
});
}
var er = ({
children: e,
...n
}) => {
const t = yn(zn), r = n.pause || !!t.pause, a = n.immediate || !!t.immediate;
n = Wu(() => ({ pause: r, immediate: a }), [r, a]);
const { Provider: s } = zn;
return /* @__PURE__ */ V.createElement(s, { value: n }, e);
}, zn = bd(er, {});
er.Provider = zn.Provider;
er.Consumer = zn.Consumer;
function bd(e, n) {
return Object.assign(e, V.createContext(n)), e.Provider._context = e, e.Consumer._context = e, e;
}
var xd = () => {
const e = [], n = function(r) {
zu();
const a = [];
return ce(e, (s, o) => {
if (F.und(r))
a.push(s.start());
else {
const l = t(r, s, o);
l && a.push(s.start(l));
}
}), a;
};
n.current = e, n.add = function(r) {
e.includes(r) || e.push(r);
}, n.delete = function(r) {
const a = e.indexOf(r);
~a && e.splice(a, 1);
}, n.pause = function() {
return ce(e, (r) => r.pause(...arguments)), this;
}, n.resume = function() {
return ce(e, (r) => r.resume(...arguments)), this;
}, n.set = function(r) {
ce(e, (a, s) => {
const o = F.fun(r) ? r(s, a) : r;
o && a.set(o);
});
}, n.start = function(r) {
const a = [];
return ce(e, (s, o) => {
if (F.und(r))
a.push(s.start());
else {
const l = this._getProps(r, s, o);
l && a.push(s.start(l));
}
}), a;
}, n.stop = function() {
return ce(e, (r) => r.stop(...arguments)), this;
}, n.update = function(r) {
return ce(e, (a, s) => a.update(this._getProps(r, a, s))), this;
};
const t = function(r, a, s) {
return F.fun(r) ? r(s, a) : r;
};
return n._getProps = t, n;
};
function jd(e, n, t) {
const r = F.fun(n) && n, {
reset: a,
sort: s,
trail: o = 0,
expires: l = !0,
exitBeforeEnter: c = !1,
onDestroyed: u,
ref: d,
config: f
} = r ? r() : n, p = ct(
() => r || arguments.length == 3 ? xd() : void 0,
[]
), m = Be(e), g = [], y = Ue(null), x = a ? null : y.current;
It(() => {
y.current = g;
}), Ms(() => (ce(g, (H) => {
p == null || p.add(H.ctrl), H.ctrl.ref = p;
}), () => {
ce(y.current, (H) => {
H.expired && clearTimeout(H.expirationId), Ri(H.ctrl, p), H.ctrl.stop(!0);
});
}));
const j = Cd(m, r ? r() : n, x), C = a && y.current || [];
It(
() => ce(C, ({ ctrl: H, item: X, key: re }) => {
Ri(H, p), We(u, X, re);
})
);
const E = [];
if (x && ce(x, (H, X) => {
H.expired ? (clearTimeout(H.expirationId), C.push(H)) : (X = E[X] = j.indexOf(H.key), ~X && (g[X] = H));
}), ce(m, (H, X) => {
g[X] || (g[X] = {
key: j[X],
item: H,
phase: "mount",
ctrl: new hd()
}, g[X].ctrl.item = H);
}), E.length) {
let H = -1;
const { leave: X } = r ? r() : n;
ce(E, (re, oe) => {
const q = x[oe];
~re ? (H = g.indexOf(q), g[H] = { ...q, item: m[re] }) : X && g.splice(++H, 0, q);
});
}
F.fun(s) && g.sort((H, X) => s(H.item, X.item));
let I = -o;
const b = Ds(), $ = ba(n), k = /* @__PURE__ */ new Map(), L = Ue(/* @__PURE__ */ new Map()), z = Ue(!1);
ce(g, (H, X) => {
const re = H.key, oe = H.phase, q = r ? r() : n;
let le, S;
const B = We(q.delay || 0, re);
if (oe == "mount")
le = q.enter, S = "enter";
else {
const v = j.indexOf(re) < 0;
if (oe != "leave")
if (v)
le = q.leave, S = "leave";
else if (le = q.update)
S = "update";
else
return;
else if (!v)
le = q.enter, S = "enter";
else
return;
}
if (le = We(le, H.item, X), le = F.obj(le) ? xa(le) : { to: le }, !le.config) {
const v = f || $.config;
le.config = We(v, H.item, X, S);
}
I += o;
const ee = {
...$,
// we need to add our props.delay value you here.
delay: B + I,
ref: d,
immediate: q.immediate,
// This prevents implied resets.
reset: !1,
// Merge any phase-specific props.
...le
};
if (S == "enter" && F.und(ee.from)) {
const v = r ? r() : n, T = F.und(v.initial) || x ? v.from : v.initial;
ee.from = We(T, H.item, X);
}
const { onResolve: D } = ee;
ee.onResolve = (v) => {
We(D, v);
const T = y.current, P = T.find((M) => M.key === re);
if (P && !(v.cancelled && P.phase != "update") && P.ctrl.idle) {
const M = T.every((J) => J.ctrl.idle);
if (P.phase == "leave") {
const J = We(l, P.item);
if (J !== !1) {
const _ = J === !0 ? 0 : J;
if (P.expired = !0, !M && _ > 0) {
_ <= 2147483647 && (P.expirationId = setTimeout(b, _));
return;
}
}
}
M && T.some((J) => J.expired) && (L.current.delete(P), c && (z.current = !0), b());
}
};
const N = gd(H.ctrl, ee);
S === "leave" && c ? L.current.set(H, { phase: S, springs: N, payload: ee }) : k.set(H, { phase: S, springs: N, payload: ee });
});
const A = yn(er), W = Yu(A), te = A !== W && ad(A);
It(() => {
te && ce(g, (H) => {
H.ctrl.start({ default: A });
});
}, [A]), ce(k, (H, X) => {
if (L.current.size) {
const re = g.findIndex((oe) => oe.key === X.key);
g.splice(re, 1);
}
}), It(
() => {
ce(
L.current.size ? L.current : k,
({ phase: H, payload: X }, re) => {
const { ctrl: oe } = re;
re.phase = H, p == null || p.add(oe), te && H == "enter" && oe.start({ default: A }), X && (id(oe, X.ref), (oe.ref || p) && !z.current ? oe.update(X) : (oe.start(X), z.current && (z.current = !1)));
}
);
},
a ? void 0 : t
);
const ne = (H) => /* @__PURE__ */ V.createElement(V.Fragment, null, g.map((X, re) => {
const { springs: oe } = k.get(X) || X.ctrl, q = H({ ...oe }, X.item, X, re);
return q && q.type ? /* @__PURE__ */ V.createElement(
q.type,
{
...q.props,
key: F.str(X.key) || F.num(X.key) ? X.key : X.ctrl.id,
ref: q.ref
}
) : q;
}));
return p ? [ne, p] : ne;
}
var wd = 1;
function Cd(e, { key: n, keys: t = n }, r) {
if (t === null) {
const a = /* @__PURE__ */ new Set();
return e.map((s) => {
const o = r && r.find(
(l) => l.item === s && l.phase !== "leave" && !a.has(l)
);
return o ? (a.add(o), o.key) : wd++;
});
}
return F.und(t) ? e : F.fun(t) ? e.map(t) : Be(t);
}
var Ed = class extends wa {
constructor(e, n) {
super(), this.source = e, this.idle = !0, this._active = /* @__PURE__ */ new Set(), this.calc = un(...n);
const t = this._get(), r = Ur(t);
ya(this, r.create(t));
}
advance(e) {
const n = this._get(), t = this.get();
ot(n, t) || (rt(this).setValue(n), this._onChange(n, this.idle)), !this.idle && zi(this._active) && wr(this);
}
_get() {
const e = F.arr(this.source) ? this.source.map(He) : Be(He(this.source));
return this.calc(...e);
}
_start() {
this.idle && !zi(this._active) && (this.idle = !1, ce(Xn(this), (e) => {
e.done = !1;
}), nt.skipAnimation ? (se.batchedUpdates(() => this.advance()), wr(this)) : Gn.start(this));
}
// Observe our sources only when we're observed.
_attach() {
let e = 1;
ce(Be(this.source), (n) => {
Je(n) && Vt(n, this), Gr(n) && (n.idle || this._active.add(n), e = Math.max(e, n.priority + 1));
}), this.priority = e, this._start();
}
// Stop observing our sources once we have no observers.
_detach() {
ce(Be(this.source), (e) => {
Je(e) && pn(e, this);
}), this._active.clear(), wr(this);
}
/** @internal */
eventObserved(e) {
e.type == "change" ? e.idle ? this.advance() : (this._active.add(e.parent), this._start()) : e.type == "idle" ? this._active.delete(e.parent) : e.type == "priority" && (this.priority = Be(this.source).reduce(
(n, t) => Math.max(n, (Gr(t) ? t.priority : 0) + 1),
0
));
}
};
function Td(e) {
return e.idle !== !1;
}
function zi(e) {
return !e.size || Array.from(e).every(Td);
}
function wr(e) {
e.idle || (e.idle = !0, ce(Xn(e), (n) => {
n.done = !0;
}), fn(e, {
type: "idle",
parent: e
}));
}
nt.assign({
createStringInterpolator: Rs,
to: (e, n) => new Ed(e, n)
});
var Xs = /^--/;
function Sd(e, n) {
return n == null || typeof n == "boolean" || n === "" ? "" : typeof n == "number" && n !== 0 && !Xs.test(e) && !(tn.hasOwnProperty(e) && tn[e]) ? n + "px" : ("" + n).trim();
}
var Hi = {};
function Pd(e, n) {
if (!e.nodeType || !e.setAttribute)
return !1;
const t = e.nodeName === "filter" || e.parentNode && e.parentNode.nodeName === "filter", {
className: r,
style: a,
children: s,
scrollTop: o,
scrollLeft: l,
viewBox: c,
...u
} = n, d = Object.values(u), f = Object.keys(u).map(
(p) => t || e.hasAttribute(p) ? p : Hi[p] || (Hi[p] = p.replace(
/([A-Z])/g,
// Attributes are written in dash case
(m) => "-" + m.toLowerCase()
))
);
s !== void 0 && (e.textContent = s);
for (const p in a)
if (a.hasOwnProperty(p)) {
const m = Sd(p, a[p]);
Xs.test(p) ? e.style.setProperty(p, m) : e.style[p] = m;
}
f.forEach((p, m) => {
e.setAttribute(p, d[m]);
}), r !== void 0 && (e.className = r), o !== void 0 && (e.scrollTop = o), l !== void 0 && (e.scrollLeft = l), c !== void 0 && e.setAttribute("viewBox", c);
}
var tn = {
animationIterationCount: !0,
borderImageOutset: !0,
borderImageSlice: !0,
borderImageWidth: !0,
boxFlex: !0,
boxFlexGroup: !0,
boxOrdinalGroup: !0,
columnCount: !0,
columns: !0,
flex: !0,
flexGrow: !0,
flexPositive: !0,
flexShrink: !0,
flexNegative: !0,
flexOrder: !0,
gridRow: !0,
gridRowEnd: !0,
gridRowSpan: !0,
gridRowStart: !0,
gridColumn: !0,
gridColumnEnd: !0,
gridColumnSpan: !0,
gridColumnStart: !0,
fontWeight: !0,
lineClamp: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
tabSize: !0,
widows: !0,
zIndex: !0,
zoom: !0,
// SVG-related properties
fillOpacity: !0,
floodOpacity: !0,
stopOpacity: !0,
strokeDasharray: !0,
strokeDashoffset: !0,
strokeMiterlimit: !0,
strokeOpacity: !0,
strokeWidth: !0
}, Od = (e, n) => e + n.charAt(0).toUpperCase() + n.substring(1), Nd = ["Webkit", "Ms", "Moz", "O"];
tn = Object.keys(tn).reduce((e, n) => (Nd.forEach((t) => e[Od(t, n)] = e[n]), e), tn);
var kd = /^(matrix|translate|scale|rotate|skew)/, _d = /^(translate)/, Ad = /^(rotate|skew)/, Cr = (e, n) => F.num(e) && e !== 0 ? e + n : e, An = (e, n) => F.arr(e) ? e.every((t) => An(t, n)) : F.num(e) ? e === n : parseFloat(e) === n, Rd = class extends Qn {
constructor({ x: e, y: n, z: t, ...r }) {
const a = [], s = [];
(e || n || t) && (a.push([e || 0, n || 0, t || 0]), s.push((o) => [
`translate3d(${o.map((l) => Cr(l, "px")).join(",")})`,
// prettier-ignore
An(o, 0)
])), at(r, (o, l) => {
if (l === "transform")
a.push([o || ""]), s.push((c) => [c, c === ""]);
else if (kd.test(l)) {
if (delete r[l], F.und(o))
return;
const c = _d.test(l) ? "px" : Ad.test(l) ? "deg" : "";
a.push(Be(o)), s.push(
l === "rotate3d" ? ([u, d, f, p]) => [
`rotate3d(${u},${d},${f},${Cr(p, c)})`,
An(p, 0)
] : (u) => [
`${l}(${u.map((d) => Cr(d, c)).join(",")})`,
An(u, l.startsWith("scale") ? 1 : 0)
]
);
}
}), a.length && (r.transform = new Id(a, s)), super(r);
}
}, Id = class extends ks {
constructor(e, n) {
super(), this.inputs = e, this.transforms = n, this._value = null;
}
get() {
return this._value || (this._value = this._get());
}
_get() {
let e = "", n = !0;
return ce(this.inputs, (t, r) => {
const a = He(t[0]), [s, o] = this.transforms[r](
F.arr(a) ? a : t.map(He)
);
e += " " + s, n = n && o;
}), n ? "none" : e;
}
// Start observing our inputs once we have an observer.
observerAdded(e) {
e == 1 && ce(
this.inputs,
(n) => ce(
n,
(t) => Je(t) && Vt(t, this)
)
);
}
// Stop observing our inputs once we have no observers.
observerRemoved(e) {
e == 0 && ce(
this.inputs,
(n) => ce(
n,
(t) => Je(t) && pn(t, this)
)
);
}
eventObserved(e) {
e.type == "change" && (this._value = null), fn(this, e);
}
}, Dd = [
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
"bdi",
"bdo",
"big",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"cite",
"code",
"col",
"colgroup",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"embed",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"legend",
"li",
"link",
"main",
"map",
"mark",
"menu",
"menuitem",
"meta",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"param",
"picture",
"pre",
"progress",
"q",
"rp",
"rt",
"ruby",
"s",
"samp",
"script",
"section",
"select",
"small",
"source",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"u",
"ul",
"var",
"video",
"wbr",
// SVG
"circle",
"clipPath",
"defs",
"ellipse",
"foreignObject",
"g",
"image",
"line",
"linearGradient",
"mask",
"path",
"pattern",
"polygon",
"polyline",
"radialGradient",
"rect",
"stop",
"svg",
"text",
"tspan"
];
nt.assign({
batchedUpdates: Bo,
createStringInterpolator: Rs,
colors: xu
});
var Md = Qu(Dd, {
applyAnimatedValues: Pd,
createAnimatedStyle: (e) => new Rd(e),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getComponentProps: ({ scrollTop: e, scrollLeft: n, ...t }) => t
}), Fd = Md.animated;
const Ld = ({
teamMembers: e = [],
setTeamMembers: n = () => {
},
addTeamMember: t = !1,
removeTeamMember: r = !1,
editTeamMember: a = !1,
rolePermissions: s = {},
role: o = "user"
}) => {
console.log("TeamMembers loaded, version: props-based");
const [l, c] = Z(!1), [u, d] = Z(null), [f, p] = Z(e), [m, g] = Z(null), y = ["Member", "Team Member", "Team Lead", "Project Manager", "Admin", "HR"];
xe(() => {
p(e);
}, [e]), xe(() => {
if (m) {
const A = setTimeout(() => g(null), 500);
return () => clearTimeout(A);
}
}, [m]);
const x = jd(f, {
keys: (A) => A.id,
from: { opacity: 0, transform: "translateX(100%)" },
enter: { opacity: 1, transform: "translateX(0%)" },
leave: { opacity: 0, transform: "translateX(100%)" },
config: { duration: 300 }
}), j = Qe((A) => {
n((W) => [...W, A]);
}, [n]), C = Qe((A) => {
n((W) => W.filter((te) => te.id !== A));
}, [n]), E = Qe((A) => {
n(
(W) => W.map(
(te) => te.id === A.id ? A : te
)
);
}, [n]), I = (A) => {
if (!r) {
console.warn("Team member removal is disabled (removeTeamMember prop is false)");
return;
}
window.confirm("Are you sure you want to remove this team member?") && (p((W) => W.filter((te) => te.id !== A)), setTimeout(() => {
C(A);
}, 300));
}, b = (A) => {
if (!a) {
console.warn("Team member editing is disabled (editTeamMember prop is false)");
return;
}
d(A), c(!0);
}, $ = () => {
c(!1), d(null);
}, k = (A) => {
if (u) {
if (!a) {
console.warn("Team member editing is disabled (editTeamMember prop is false)");
return;
}
const W = {
...u,
name: A.name.trim(),
email: A.email.trim(),
role: A.role,
avatar: A.avatar || "/default-avatar.jpg"
};
console.log("Saving updated member:", W), E(W), g({ memberId: u.id, field: "role" });
} else {
if (!t) {
console.warn("Team member addition is disabled (addTeamMember prop is false)");
return;
}
const W = {
id: Date.now(),
name: A.name.trim(),
email: A.email.trim(),
role: A.role,
avatar: A.avatar || "/default-avatar.jpg"
};
console.log("Adding new member:", W), j(W);
}
$();
}, [L, z] = Z(!1);
return xe(() => {
var A;
z(((A = s[o]) == null ? void 0 : A.canManageUsers) || !1);
}, [o, s]), /* @__PURE__ */ i.jsxs("div", { className: "p-4 bg-light min-vh-100 vw-100", children: [
/* @__PURE__ */ i.jsxs("div", { className: "d-flex justify-content-between align-items-start mb-4", children: [
/* @__PURE__ */ i.jsxs("div", { children: [
/* @__PURE__ */ i.jsx("h3", { className: "fw-bold", children: "Team Members" }),
/* @__PURE__ */ i.jsx("p", { style: { color: "#087cfc" }, children: "Manage your team members and their access" })
] }),
L && t && /* @__PURE__ */ i.jsxs(
Te,
{
variant: "primary",
className: "d-flex align-items-center gap-2",
onClick: () => c(!0),
"aria-label": "Add new team member",
children: [
/* @__PURE__ */ i.jsx(xs, {}),
"Add Member"
]
}
)
] }),
/* @__PURE__ */ i.jsx("div", { className: "bg-white rounded shadow-sm p-3", children: /* @__PURE__ */ i.jsxs(Ui, { hover: !0, responsive: !0, children: [
/* @__PURE__ */ i.jsx("thead", { children: /* @__PURE__ */ i.jsxs("tr", { children: [
/* @__PURE__ */ i.jsx("th", { children: "Member" }),
/* @__PURE__ */ i.jsx("th", { children: "Email" }),
/* @__PURE__ */ i.jsx("th", { children: "Role" }),
/* @__PURE__ */ i.jsx("th", { className: "text-end", children: "Actions" })
] }) }),
/* @__PURE__ */ i.jsx("tbody", { children: x((A, W) => /* @__PURE__ */ i.jsxs(Fd.tr, { style: A, children: [
/* @__PURE__ */ i.jsx("td", { children: /* @__PURE__ */ i.jsxs("div", { className: "d-flex align-items-center gap-2", children: [
/* @__PURE__ */ i.jsx(
"img",
{
src: W.avatar || "/default-avatar.jpg",
alt: `${W.name}'s avatar`,
className: "me-2",
style: { width: "40px", height: "40px", borderRadius: "50%", objectFit: "cover" }
}
),
/* @__PURE__ */ i.jsx("div", { className: "fw-semibold", style: { color: "rgba(11,94,216,255)" }, children: W.name })
] }) }),
/* @__PURE__ */ i.jsx("td", { children: /* @__PURE__ */ i.jsx("span", { children: W.email }) }),
/* @__PURE__ */ i.jsx("td", { className: (m == null ? void 0 : m.memberId) === W.id && (m == null ? void 0 : m.field) === "role" ? "bg-success bg-opacity-10" : "", children: /* @__PURE__ */ i.jsx("span", { children: W.role }) }),
L && /* @__PURE__ */ i.jsxs("td", { className: "text-end", children: [
a && /* @__PURE__ */ i.jsx(
bs,
{
style: { cursor: "pointer", color: "#007bff", marginRight: "10px" },
onClick: () => b(W),
"aria-label": `Edit ${W.name}`,
role: "button"
}
),
r && /* @__PURE__ */ i.jsx(
uu,
{
style: { cursor: "pointer", color: "#dc3545" },
onClick: () => I(W.id),
"aria-label": `Remove ${W.name}`,
role: "button"
}
)
] })
] }, W.id)) })
] }) }),
/* @__PURE__ */ i.jsx(
fu,
{
show: l,
onClose: $,
onSubmit: k,
roleOptions: y,
editingMember: u
}
)
] });
};
class $d extends Eo {
constructor() {
super(...arguments);
Da(this, "state", { hasError: !1 });
}
static getDerivedStateFromError() {
return { hasError: !0 };
}
render() {
return this.state.hasError ? /* @__PURE__ */ i.jsx("h1", { children: "Something went wrong." }) : this.props.children;
}
}
const xt = {
projects: [
{
id: 1,
name: "Project Alpha",
short: "PA",
color: "#BB8493",
members: ["JONY DON", "rahul"]
},
{
id: 2,
name: "Project Beta",
short: "PB",
color: "#697565",
members: ["JONY DON", "user1"]
}
],
role: "admin",
rolePermissions: {
admin: { canEditProjects: !0, canCreateTasks: !0, canManageUsers: !0 },
hr: { canEditProjects: !0, canCreateTasks: !0, canManageUsers: !0 },
user: { canEditProjects: !1, canCreateTasks: !1, canManageUsers: !1 }
},
userName: "JONY DON",
userAvatar: "/user1.jpg",
tasks: [
{
id: 1,
title: "Task 1",
project: "Project Alpha",
assignee: "rahul",
status: "Todo",
dueDate: "2025-06-01",
workType: "Task"
},
{
id: 2,
title: "Task 2",
project: "Project Beta",
assignee: "user1",
status: "In Progress",
dueDate: "2025-06-05",
workType: "Task"
}
],
teamMembers: [
{
id: 1,
name: "rahul",
email: "rahul@example.com",
role: "Team Member",
avatar: "/user2.jpg"
},
{
id: 2,
name: "user1",
email: "user1@example.com",
role: "Team Lead",
avatar: "/user3.jpg"
}
]
}, Vd = [
{ name: "Home", path: "/", icon: /* @__PURE__ */ i.jsx(lu, {}) },
{ name: "My Tasks", path: "/mytasks", icon: /* @__PURE__ */ i.jsx(su, {}) },
{ name: "Settings", path: "/manage-access", icon: /* @__PURE__ */ i.jsx(ou, {}) },
{ name: "Members", path: "/teammembers", icon: /* @__PURE__ */ i.jsx(du, {}) }
];
function Bd() {
const [e, n] = Z(xt.projects), [t, r] = Z(xt.role), [a, s] = Z(xt.rolePermissions), [o, l] = Z(xt.userName), [c, u] = Z(xt.userAvatar), [d, f] = Z(xt.tasks), [p, m] = Z(xt.teamMembers), g = Po(), y = ["/login", "/loginform", "/"].includes(g.pathname);
return xe(() => {
try {
const x = localStorage.getItem("tasks");
x && f(JSON.parse(x));
const j = localStorage.getItem("projects");
j && n(JSON.parse(j));
const C = localStorage.getItem("teamMembers");
C && m(JSON.parse(C));
} catch (x) {
console.error("Failed to load from localStorage:", x);
}
}, []), xe(() => {
try {
localStorage.setItem("tasks", JSON.stringify(d));
} catch (x) {
console.error("Failed to save tasks:", x);
}
}, [d]), xe(() => {
try {
localStorage.setItem("projects", JSON.stringify(e));
} catch (x) {
console.error("Failed to save projects:", x);
}
}, [e]), xe(() => {
try {
localStorage.setItem("teamMembers", JSON.stringify(p));
} catch (x) {
console.error("Failed to save teamMembers:", x);
}
}, [p]), /* @__PURE__ */ i.jsx($d, { children: /* @__PURE__ */ i.jsxs(
"div",
{
style: {
display: "flex",
minHeight: "100vh",
flexDirection: "row",
flexWrap: "wrap",
width: "100vw",
backgroundColor: y ? "rgba(201, 214, 255, 0.6)" : "rgba(235, 232, 230, 0.3)",
background: y ? "linear-gradient(to right, #e2e2e2, #c9d6ff)" : "none"
},
children: [
!y && /* @__PURE__ */ i.jsx(
tl,
{
projects: e,
role: t,
rolePermissions: a,
userName: o,
userAvatar: c,
navLinks: Vd
}
),
/* @__PURE__ */ i.jsx(
"div",
{
style: {
flex: 1,
minWidth: 0,
borderLeft: y ? "none" : "1px solid #ddd",
width: y ? "100%" : "calc(100vw - 280px)",
padding: "20px",
display: "flex",
justifyContent: "center",
alignItems: y ? "center" : "flex-start"
},
children: /* @__PURE__ */ i.jsxs(Oo, { children: [
/* @__PURE__ */ i.jsx(Ot, { path: "/", element: /* @__PURE__ */ i.jsx("div", { children: "Home Page" }) }),
/* @__PURE__ */ i.jsx(
Ot,
{
path: "/mytasks",
element: /* @__PURE__ */ i.jsx(
iu,
{
tasks: d,
setTasks: f,
deleteTask: !0,
teamMembers: p,
projects: e,
setProjects: n,
role: t,
rolePermissions: a,
userName: o,
kanban: "true",
table: "true",
calendar: "true"
}
)
}
),
/* @__PURE__ */ i.jsx(
Ot,
{
path: "/teammembers",
element: p && Array.isArray(p) ? /* @__PURE__ */ i.jsx(
Ld,
{
teamMembers: p,
setTeamMembers: m,
addTeamMember: !0,
removeTeamMember: !0,
editTeamMember: !0,
rolePermissions: a,
role: t
}
) : /* @__PURE__ */ i.jsx("div", { children: "Error: Team members not loaded" })
}
),
/* @__PURE__ */ i.jsx(Ot, { path: "/manage-access", element: /* @__PURE__ */ i.jsx("div", { children: "Settings Page" }) }),
/* @__PURE__ */ i.jsx(Ot, { path: "/loginform", element: /* @__PURE__ */ i.jsx("div", { children: "Login Form Page" }) }),
/* @__PURE__ */ i.jsx(Ot, { path: "*", element: /* @__PURE__ */ i.jsx(No, { to: "/mytasks", replace: !0 }) })
] })
}
)
]
}
) });
}
function lf() {
return /* @__PURE__ */ i.jsx(So, { children: /* @__PURE__ */ i.jsx(Bd, {}) });
}
var zd = ["color", "size", "title", "className"];
function Zr() {
return Zr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Zr.apply(null, arguments);
}
function Hd(e, n) {
if (e == null) return {};
var t, r, a = Wd(e, n);
if (Object.getOwnPropertySymbols) {
var s = Object.getOwnPropertySymbols(e);
for (r = 0; r < s.length; r++) t = s[r], n.indexOf(t) === -1 && {}.propertyIsEnumerable.call(e, t) && (a[t] = e[t]);
}
return a;
}
function Wd(e, n) {
if (e == null) return {};
var t = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
if (n.indexOf(r) !== -1) continue;
t[r] = e[r];
}
return t;
}
var Qs = /* @__PURE__ */ Kr(function(e, n) {
var t = e.color, r = t === void 0 ? "currentColor" : t, a = e.size, s = a === void 0 ? "1em" : a, o = e.title, l = o === void 0 ? null : o, c = e.className, u = c === void 0 ? "" : c, d = Hd(e, zd);
return /* @__PURE__ */ be.createElement("svg", Zr({
ref: n,
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 16 16",
width: s,
height: s,
fill: r,
className: ["bi", "bi-arrow-up", u].filter(Boolean).join(" ")
}, d), l ? /* @__PURE__ */ be.createElement("title", null, l) : null, /* @__PURE__ */ be.createElement("path", {
fillRule: "evenodd",
d: "M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5"
}));
});
Qs.propTypes = {
color: U.string,
size: U.oneOfType([U.string, U.number]),
title: U.string,
className: U.string
};
var Ud = ["color", "size", "title", "className"];
function Jr() {
return Jr = Object.assign ? Object.assign.bind() : function(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (e[r] = t[r]);
}
return e;
}, Jr.apply(null, arguments);
}
function qd(e, n) {
if (e == null) return {};
var t, r, a = Yd(e, n);
if (Object.getOwnPropertySymbols) {
var s = Object.getOwnPropertySymbols(e);
for (r = 0; r < s.length; r++) t = s[r], n.indexOf(t) === -1 && {}.propertyIsEnumerable.call(e, t) && (a[t] = e[t]);
}
return a;
}
function Yd(e, n) {
if (e == null) return {};
var t = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
if (n.indexOf(r) !== -1) continue;
t[r] = e[r];
}
return t;
}
var eo = /* @__PURE__ */ Kr(function(e, n) {
var t = e.color, r = t === void 0 ? "currentColor" : t, a = e.size, s = a === void 0 ? "1em" : a, o = e.title, l = o === void 0 ? null : o, c = e.className, u = c === void 0 ? "" : c, d = qd(e, Ud);
return /* @__PURE__ */ be.createElement("svg", Jr({
ref: n,
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 16 16",
width: s,
height: s,
fill: r,
className: ["bi", "bi-plus", u].filter(Boolean).join(" ")
}, d), l ? /* @__PURE__ */ be.createElement("title", null, l) : null, /* @__PURE__ */ be.createElement("path", {
d: "M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"
}));
});
eo.propTypes = {
color: U.string,
size: U.oneOfType([U.string, U.number]),
title: U.string,
className: U.string
};
const cf = () => /* @__PURE__ */ i.jsxs(ht, { fluid: !0, className: "p-4 bg-light min-vh-100", children: [
/* @__PURE__ */ i.jsxs(Me, { className: "align-items-center mb-4", children: [
/* @__PURE__ */ i.jsxs(ye, { children: [
/* @__PURE__ */ i.jsx("h3", { children: "Home" }),
/* @__PURE__ */ i.jsx("p", { className: "text-muted", children: "Monitor all of your projects and tasks here" })
] }),
/* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsx(O.Control, { type: "text", placeholder: "Search..." }) })
] }),
/* @__PURE__ */ i.jsx(Me, { className: "mb-4", children: [
{ title: "Total Projects", value: 14, info: 2 },
{ title: "Total Tasks", value: 14, info: 14 },
{ title: "Assigned Tasks", value: 14, info: 7 },
{ title: "Completed Tasks", value: 2, info: 2 },
{ title: "Overdue Tasks", value: 0, info: 0 }
].map((e, n) => /* @__PURE__ */ i.jsx(ye, { md: 2, children: /* @__PURE__ */ i.jsx(Fe, { className: "text-center", children: /* @__PURE__ */ i.jsxs(Fe.Body, { children: [
/* @__PURE__ */ i.jsx(Fe.Title, { children: e.title }),
/* @__PURE__ */ i.jsxs("h4", { children: [
e.value,
" ",
/* @__PURE__ */ i.jsx(Qs, { className: "text-success ms-2", size: 16 })
] })
] }) }) }, n)) }),
/* @__PURE__ */ i.jsxs(Me, { className: "mb-4", children: [
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsxs(Fe, { children: [
/* @__PURE__ */ i.jsx(Fe.Header, { children: "Assigned Tasks (14)" }),
/* @__PURE__ */ i.jsx(At, { variant: "flush", children: [
{ task: "Conduct usability testing", project: "Mobile App Development", date: "October 15th, 2024" },
{ task: "Implement offline mode", project: "Mobile App Development", date: "October 14th, 2024" },
{ task: "Integrate push notifications", project: "Mobile App Development", date: "October 13th, 2024" }
].map((e, n) => /* @__PURE__ */ i.jsxs(At.Item, { children: [
/* @__PURE__ */ i.jsx("div", { className: "fw-semibold", children: e.task }),
/* @__PURE__ */ i.jsxs("div", { className: "text-muted small", children: [
e.project,
" ",
/* @__PURE__ */ i.jsx("span", { className: "text-warning", children: e.date })
] })
] }, n)) }),
/* @__PURE__ */ i.jsx(Fe.Footer, { className: "text-center bg-light", children: /* @__PURE__ */ i.jsx(Te, { variant: "light", children: "Show All" }) })
] }) }),
/* @__PURE__ */ i.jsxs(ye, { md: 6, children: [
/* @__PURE__ */ i.jsxs("div", { className: "d-flex justify-content-between align-items-center mb-2", children: [
/* @__PURE__ */ i.jsx("h5", { children: "Projects (2)" }),
/* @__PURE__ */ i.jsx(Te, { size: "sm", children: /* @__PURE__ */ i.jsx(eo, { size: 18 }) })
] }),
/* @__PURE__ */ i.jsxs(Me, { children: [
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsx(Fe, { className: "text-center bg-primary text-white", children: /* @__PURE__ */ i.jsxs(Fe.Body, { children: [
/* @__PURE__ */ i.jsx("div", { className: "rounded-circle bg-white text-primary d-inline-block p-2 mb-2 fw-bold", children: "M" }),
/* @__PURE__ */ i.jsx("div", { children: "Mobile App Development" })
] }) }) }),
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsx(Fe, { className: "text-center bg-purple text-white", children: /* @__PURE__ */ i.jsxs(Fe.Body, { children: [
/* @__PURE__ */ i.jsx("div", { className: "rounded-circle bg-white text-purple d-inline-block p-2 mb-2 fw-bold", children: "W" }),
/* @__PURE__ */ i.jsx("div", { children: "Website Redesign" })
] }) }) })
] })
] })
] }),
/* @__PURE__ */ i.jsx("h5", { className: "mb-3", children: "People (2)" }),
/* @__PURE__ */ i.jsx(Me, { children: [
{ name: "Antonio", email: "antonio@mail.com" },
{ name: "John", email: "john@mail.com" }
].map((e, n) => /* @__PURE__ */ i.jsx(ye, { md: 3, children: /* @__PURE__ */ i.jsx(Fe, { className: "text-center", children: /* @__PURE__ */ i.jsxs(Fe.Body, { children: [
/* @__PURE__ */ i.jsx("div", { className: "rounded-circle bg-secondary text-white d-inline-block p-3 fw-bold mb-2", children: e.name[0] }),
/* @__PURE__ */ i.jsx(Fe.Title, { children: e.name }),
/* @__PURE__ */ i.jsx(Fe.Text, { className: "text-muted", children: e.email })
] }) }) }, n)) })
] }), Gd = To(), Ca = () => yn(Gd), Er = {
hidden: { opacity: 0, y: 20 },
visible: { opacity: 1, y: 0, transition: { duration: 0.3 } }
}, uf = () => {
const { projectId: e } = ko(), { projects: n, tasks: t, setTasks: r, deleteTask: a, teamMembers: s, editProject: o, role: l, rolePermissions: c } = Ca(), u = Ue(null), d = n.find((Y) => Y.id === e);
if (!d)
return /* @__PURE__ */ i.jsx(ht, { fluid: !0, className: "project-details-wrapper", children: /* @__PURE__ */ i.jsx(Se.div, { initial: "hidden", animate: "visible", variants: Er, children: /* @__PURE__ */ i.jsx("h1", { className: "project-title", children: "Project Not Found" }) }) });
const [f, p] = Z("kanban"), [m, g] = Z(!1), [y, x] = Z(!1), [j, C] = Z({
name: d.name,
startDate: d.startDate,
deadline: d.deadline,
members: d.members
}), [E, I] = Z(""), [b, $] = Z(!1);
xe(() => {
C({
name: d.name,
startDate: d.startDate,
deadline: d.deadline,
members: d.members
});
}, [d]);
const [k, L] = Z("All"), [z, A] = Z("All"), [W, te] = Z(""), [ne, H] = Z(""), X = ["All", ...d.members], re = ["All", "Todo", "In Progress", "In Review", "Done"], oe = ct(() => t.filter((Y) => Y.project === d.name), [t, d.name]), q = ct(() => oe.filter((Y) => k === "All" ? !0 : Y.assignee === k).filter((Y) => z === "All" ? !0 : Y.status === z).filter((Y) => W ? new Date(Y.dueDate).toISOString().split("T")[0] === W : !0).filter((Y) => {
if (!ne) return !0;
const Q = ne.toLowerCase(), fe = new Date(Y.dueDate).toLocaleDateString();
return Y.title.toLowerCase().includes(Q) || Y.project.toLowerCase().includes(Q) || Y.assignee.toLowerCase().includes(Q) || fe.toLowerCase().includes(Q) || Y.status.toLowerCase().includes(Q);
}), [oe, k, z, W, ne]), [le, S] = Z(1), B = 5;
Math.ceil(q.length / B);
const ee = (le - 1) * B, D = q.slice(ee, ee + B), [N, v] = Z({});
xe(() => {
const Y = q.reduce((fe, Ie) => (fe[Ie.status] || (fe[Ie.status] = []), fe[Ie.status].push({
id: Ie.id.toString(),
title: Ie.title,
dueDate: new Date(Ie.dueDate).toLocaleDateString(),
assignee: Ie.assignee,
project: Ie.project
}), fe), {});
["Todo", "In Progress", "In Review", "Done"].forEach((fe) => {
Y[fe] || (Y[fe] = []);
}), v(Y);
}, [q]);
const T = Qe((Y) => {
const { source: Q, destination: fe } = Y;
if (!fe || Q.droppableId === fe.droppableId && Q.index === fe.index) return;
const Ie = Array.from(N[Q.droppableId]), yt = Array.from(N[fe.droppableId]), [dt] = Ie.splice(Q.index, 1);
yt.splice(fe.index, 0, dt), v({
...N,
[Q.droppableId]: Ie,
[fe.droppableId]: yt
}), r(
(tr) => tr.map(
(Tt) => Tt.id.toString() === dt.id ? { ...Tt, status: fe.droppableId } : Tt
)
);
}, [N, r]);
Qe((Y) => {
window.confirm("Are you sure you want to delete this task?") && (a(Y), u.current.show({
severity: "success",
summary: "Success",
detail: "Task deleted successfully!",
life: 3e3
}));
}, [a, u]), Qe((Y) => {
S(Y);
}, []);
const P = () => {
x(!0), C({
name: d.name,
startDate: d.startDate,
deadline: d.deadline,
members: d.members
}), I("");
}, M = () => {
x(!1), C({
name: d.name,
startDate: d.startDate,
deadline: d.deadline,
members: d.members
}), I("");
}, J = (Y) => {
Y.preventDefault(), $(!0);
let Q = "";
if (!j.name.trim())
Q = "Project name cannot be empty";
else if (!j.startDate)
Q = "Start date is required";
else if (!j.deadline)
Q = "Deadline is required";
else {
const fe = new Date(j.startDate), Ie = new Date(j.deadline);
isNaN(fe.getTime()) || isNaN(Ie.getTime()) ? Q = "Please enter valid dates" : Ie < fe && (Q = "Deadline cannot be before start date");
}
if (Q) {
I(Q), u.current.show({
severity: "error",
summary: "Validation Error",
detail: Q,
life: 3e3
}), $(!1);
return;
}
try {
j.name !== d.name && r((Ie) => Ie.map(
(dt) => dt.project === d.name ? { ...dt, project: j.name } : dt
));
const fe = {
...d,
name: j.name,
startDate: j.startDate,
deadline: j.deadline,
members: j.members
};
o(d.id, fe), x(!1), I(""), u.current.show({
severity: "success",
summary: "Success",
detail: "Project updated successfully!",
life: 3e3
});
} catch (fe) {
I(fe.message || "Failed to update project"), u.current.show({
severity: "error",
summary: "Error",
detail: fe.message || "Failed to update project",
life: 3e3
});
} finally {
$(!1);
}
}, _ = (Y) => {
window.confirm(`Are you sure you want to remove ${Y} from the project?`) && C((Q) => ({
...Q,
members: Q.members.filter((fe) => fe !== Y)
}));
}, K = (Y) => {
C((Q) => ({
...Q,
members: [...Q.members, Y]
}));
}, w = s.map((Y) => Y.name).filter((Y) => !j.members.includes(Y)), ie = (Y) => {
if (!Y) return "U";
const Q = Y.trim().split(" ");
return Q.length === 1 ? Q[0].charAt(0).toUpperCase() : (Q[0].charAt(0) + Q[Q.length - 1].charAt(0)).toUpperCase();
}, [_e, Ee] = Z(!1), [Re, st] = Z(!1);
return xe(() => {
var Y, Q;
Ee((Y = c[l]) == null ? void 0 : Y.canEditProjects), st((Q = c[l]) == null ? void 0 : Q.canCreateTasks), console.log("canManageProjects", _e);
}, [l]), /* @__PURE__ */ i.jsxs(ht, { fluid: !0, className: "project-details-wrapper", children: [
/* @__PURE__ */ i.jsx(qn, { ref: u, position: "top-right", style: { height: "50px" } }),
/* @__PURE__ */ i.jsxs(Se.div, { initial: "hidden", animate: "visible", variants: Er, children: [
/* @__PURE__ */ i.jsx("div", { className: "project-card", children: y ? /* @__PURE__ */ i.jsx(O, { onSubmit: J, children: /* @__PURE__ */ i.jsxs(Me, { className: "mb-0 align-items-center", children: [
/* @__PURE__ */ i.jsxs(ye, { children: [
/* @__PURE__ */ i.jsxs(O.Group, { className: "mb-2", controlId: "projectName", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Project Name" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "text",
value: j.name,
onChange: (Y) => C((Q) => ({ ...Q, name: Y.target.value })),
className: "project-input",
placeholder: "Enter project name",
isInvalid: !!E && E.includes("name")
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: E.includes("name") && E })
] }),
/* @__PURE__ */ i.jsxs(O.Group, { className: "mb-2", controlId: "projectDescription", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Description" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
as: "textarea",
rows: 2,
value: d.description || "",
readOnly: !0,
className: "project-input",
placeholder: "No description available"
}
)
] }),
/* @__PURE__ */ i.jsxs(Me, { children: [
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-2", controlId: "projectStartDate", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Start Date" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
value: j.startDate,
onChange: (Y) => C((Q) => ({ ...Q, startDate: Y.target.value })),
className: "project-input",
isInvalid: !!E && E.includes("Start date")
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: E.includes("Start date") && E })
] }) }),
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsxs(O.Group, { className: "mb-2", controlId: "projectDeadline", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Deadline" }),
/* @__PURE__ */ i.jsx(
O.Control,
{
type: "date",
value: j.deadline,
onChange: (Y) => C((Q) => ({ ...Q, deadline: Y.target.value })),
className: "project-input",
isInvalid: !!E && E.includes("Deadline")
}
),
/* @__PURE__ */ i.jsx(O.Control.Feedback, { type: "invalid", children: E.includes("Deadline") && E })
] }) })
] }),
/* @__PURE__ */ i.jsxs(O.Group, { className: "mb-2", controlId: "projectMembers", children: [
/* @__PURE__ */ i.jsx(O.Label, { className: "fw-semibold", children: "Members" }),
/* @__PURE__ */ i.jsx("div", { className: "mb-2", children: j.members.length > 0 ? j.members.map((Y) => /* @__PURE__ */ i.jsxs("span", { className: "member-badge", children: [
/* @__PURE__ */ i.jsx("div", { className: "member-avatar", children: ie(Y) }),
Y,
/* @__PURE__ */ i.jsx(
"button",
{
onClick: () => _(Y),
className: "member-remove-btn",
style: { backgroundColor: "transparent", padding: "5px", border: "none", ":hover": { border: "none" } },
"aria-label": `Remove ${Y}`,
children: /* @__PURE__ */ i.jsx(cu, { size: 12 })
}
)
] }, Y)) : /* @__PURE__ */ i.jsx("div", { className: "text-muted small", children: "No members assigned" }) }),
w.length > 0 && /* @__PURE__ */ i.jsxs(Ze, { children: [
/* @__PURE__ */ i.jsx(
Ze.Toggle,
{
variant: "outline-primary",
className: "project-input",
disabled: b,
children: "Add Member"
}
),
/* @__PURE__ */ i.jsx(Ze.Menu, { children: w.map((Y) => /* @__PURE__ */ i.jsx(
Ze.Item,
{
onClick: () => K(Y),
children: Y
},
Y
)) })
] })
] }),
E && /* @__PURE__ */ i.jsx("div", { className: "text-danger small mb-2", children: E })
] }),
/* @__PURE__ */ i.jsxs(ye, { xs: "auto", children: [
/* @__PURE__ */ i.jsx(
Te,
{
variant: "primary",
size: "sm",
onClick: J,
className: "action-btn me-2",
disabled: b,
children: b ? "Saving..." : "Save"
}
),
/* @__PURE__ */ i.jsx(
Te,
{
variant: "outline-secondary",
size: "sm",
onClick: M,
className: "action-btn",
disabled: b,
children: "Cancel"
}
)
] })
] }) }) : /* @__PURE__ */ i.jsxs(Me, { className: "mb-0 align-items-center", children: [
/* @__PURE__ */ i.jsxs(ye, { children: [
/* @__PURE__ */ i.jsxs("div", { className: "d-flex align-items-center mb-3", children: [
/* @__PURE__ */ i.jsx(
"div",
{
className: "project-logo",
style: {
backgroundColor: `${d.color}aa`,
borderRadius: "50%",
width: "40px",
height: "40px",
display: "flex",
justifyContent: "center",
alignItems: "center",
fontSize: "20px",
marginRight: "10px",
color: "white"
},
children: d.short
}
),
/* @__PURE__ */ i.jsx("div", { children: /* @__PURE__ */ i.jsx(
"h1",
{
className: "project-title mb-0",
style: { color: "#526D82" },
children: d.name
}
) })
] }),
/* @__PURE__ */ i.jsx(
"p",
{
className: "mb-4",
style: { color: "rgba(82, 109, 130, 1)" },
children: d.description || "No description available."
}
),
/* @__PURE__ */ i.jsxs(Me, { className: "mb-3", children: [
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsxs("div", { className: "text-muted", children: [
/* @__PURE__ */ i.jsx("strong", { children: "Start Date:" }),
" ",
d.startDate
] }) }),
/* @__PURE__ */ i.jsx(ye, { md: 6, children: /* @__PURE__ */ i.jsxs("div", { className: "text-muted", children: [
/* @__PURE__ */ i.jsx("strong", { children: "Deadline:" }),
" ",
d.deadline
] }) })
] }),
/* @__PURE__ */ i.jsxs("div", { className: "text-muted", children: [
/* @__PURE__ */ i.jsx("strong", { children: "Members:" }),
d.members.length > 0 ? /* @__PURE__ */ i.jsx("div", { className: "mt-2", children: d.members.map((Y) => /* @__PURE__ */ i.jsxs("span", { className: "member-badge", children: [
/* @__PURE__ */ i.jsx("div", { className: "member-avatar", children: ie(Y) }),
Y
] }, Y)) }) : /* @__PURE__ */ i.jsx("div", { className: "text-muted small mt-2", children: "No members assigned." })
] })
] }),
/* @__PURE__ */ i.jsx(ye, { xs: "auto", children: /* @__PURE__ */ i.jsxs("div", { style: { display: "flex" }, children: [
_e && /* @__PURE__ */ i.jsxs(
Te,
{
variant: "outline-primary",
size: "sm",
onClick: P,
className: "action-btn me-2",
children: [
/* @__PURE__ */ i.jsx(bs, { size: 14, className: "me-1" }),
" Edit Project"
]
}
),
Re && /* @__PURE__ */ i.jsxs(
Te,
{
variant: "primary",
size: "sm",
onClick: () => g(!0),
className: "action-btn d-flex align-items-center",
children: [
/* @__PURE__ */ i.jsx(nn, { size: 16, className: "me-1" }),
" New Task"
]
}
)
] }) })
] }) }),
/* @__PURE__ */ i.jsxs(
Se.div,
{
initial: "hidden",
animate: "visible",
variants: Er,
className: "project-card",
children: [
/* @__PURE__ */ i.jsx(Me, { className: "mb-4 align-items-center", children: /* @__PURE__ */ i.jsx(ts, { activeView: f, setActiveView: p }) }),
/* @__PURE__ */ i.jsx(
Ji,
{
selectedProject: d.name,
setSelectedProject: () => {
},
selectedAssignee: k,
setSelectedAssignee: L,
selectedStatus: z,
setSelectedStatus: A,
selectedDate: W,
setSelectedDate: te,
searchQuery: ne,
setSearchQuery: H,
projectOptions: [d.name],
assigneeOptions: X,
statusOptions: re,
isProjectView: !0
}
),
f === "kanban" && /* @__PURE__ */ i.jsx(qi, { onDragEnd: T, children: /* @__PURE__ */ i.jsx(Ki, { kanbanTasks: N }) }),
f === "table" && /* @__PURE__ */ i.jsx(
Xi,
{
filteredTasks: D,
hideProjectColumn: !0
}
),
f === "calendar" && /* @__PURE__ */ i.jsx(Qr, { filteredTasks: q })
]
},
f
),
/* @__PURE__ */ i.jsx(
ys,
{
show: m,
setShowModal: g,
projectName: d.name
}
)
] })
] });
}, df = () => {
const [e, n] = Z(!1), [t, r] = Z(""), a = _o(), { teamMembers: s, setRole: o, setUserName: l, setUserAvatar: c } = Ca();
xe(() => {
console.log("Team Members:", s), console.log(s);
}, []);
const u = (p) => {
const m = s.find((g) => g.email === p);
m ? (o(m.role.replace(/\s+/g, "").toLowerCase()), l(m.name), c(m.avatar), a("/mytasks")) : alert("User not found");
}, d = () => {
n(!e);
}, f = (p) => {
p.preventDefault(), u(t);
};
return /* @__PURE__ */ i.jsxs("div", { className: `login-container ${e ? "active" : ""}`, children: [
/* @__PURE__ */ i.jsx("div", { className: "login-form-container login-sign-up", children: /* @__PURE__ */ i.jsxs("form", { children: [
/* @__PURE__ */ i.jsx("h1", { children: "Create Account" }),
/* @__PURE__ */ i.jsxs("div", { className: "login-social-icons", children: [
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(wi, {}) }),
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(xi, {}) }),
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(ji, {}) }),
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(Ci, {}) })
] }),
/* @__PURE__ */ i.jsx("span", { children: "or use your email for registration" }),
/* @__PURE__ */ i.jsx("input", { type: "text", placeholder: "Name" }),
/* @__PURE__ */ i.jsx("input", { type: "email", placeholder: "Email" }),
/* @__PURE__ */ i.jsx("input", { type: "password", placeholder: "Password" }),
/* @__PURE__ */ i.jsx("button", { children: "Sign Up" })
] }) }),
/* @__PURE__ */ i.jsx("div", { className: "login-form-container login-sign-in", children: /* @__PURE__ */ i.jsxs("form", { onSubmit: f, children: [
/* @__PURE__ */ i.jsx("h1", { children: "Sign In" }),
/* @__PURE__ */ i.jsxs("div", { className: "login-social-icons", children: [
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(wi, {}) }),
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(xi, {}) }),
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(ji, {}) }),
/* @__PURE__ */ i.jsx("a", { href: "#", className: "icon", children: /* @__PURE__ */ i.jsx(Ci, {}) })
] }),
/* @__PURE__ */ i.jsx("span", { children: "or use your email password" }),
/* @__PURE__ */ i.jsx("input", { type: "email", placeholder: "Email", value: t, onChange: (p) => r(p.target.value) }),
/* @__PURE__ */ i.jsx("input", { type: "password", placeholder: "Password" }),
/* @__PURE__ */ i.jsx("a", { href: "#", children: "Forget Your Password?" }),
/* @__PURE__ */ i.jsx("button", { type: "submit", children: "Sign In" })
] }) }),
/* @__PURE__ */ i.jsx("div", { className: "login-toggle-container", children: /* @__PURE__ */ i.jsxs("div", { className: "login-toggle", children: [
/* @__PURE__ */ i.jsxs("div", { className: "login-toggle-panel login-toggle-left", children: [
/* @__PURE__ */ i.jsx("h1", { children: "Welcome Back!" }),
/* @__PURE__ */ i.jsx("p", { children: "Enter your personal details to use all of site features" }),
/* @__PURE__ */ i.jsx("button", { className: "hidden", onClick: d, children: "Sign In" })
] }),
/* @__PURE__ */ i.jsxs("div", { className: "login-toggle-panel login-toggle-right", children: [
/* @__PURE__ */ i.jsx("h1", { children: "Hello, Friend!" }),
/* @__PURE__ */ i.jsx("p", { children: "Register with your personal details to use all of site features" }),
/* @__PURE__ */ i.jsx("button", { className: "hidden", onClick: d, children: "Sign Up" })
] })
] }) })
] });
}, ff = () => {
const { role: e, rolePermissions: n, togglePermission: t, resetRolePermissions: r } = Ca();
if (e !== "admin")
return /* @__PURE__ */ i.jsx(ht, { className: "mt-4", children: /* @__PURE__ */ i.jsx(Fa, { variant: "danger", className: "text-center", children: "Access Denied: Only admins can manage permissions." }) });
if (!t)
return console.error("PermissionsManagement: togglePermission is undefined"), /* @__PURE__ */ i.jsx(ht, { className: "mt-4", children: /* @__PURE__ */ i.jsx(Fa, { variant: "danger", className: "text-center", children: "Error: Permission toggling functionality is unavailable." }) });
const a = Object.keys(n.teammember || {}), s = Object.keys(n || {}), o = (c, u) => {
console.log(`PermissionsManagement: Toggling ${c}.${u}`), t(c, u);
}, l = () => {
console.log("PermissionsManagement: Resetting permissions to default"), r();
};
return /* @__PURE__ */ i.jsxs(ht, { className: "permissions-management mt-4", children: [
/* @__PURE__ */ i.jsx("h2", { className: "mb-4", style: { fontWeight: 600, color: "#526D82" }, children: "Manage Role Permissions" }),
/* @__PURE__ */ i.jsxs(
Te,
{
variant: "danger",
size: "sm",
onClick: l,
className: "mb-4 d-flex align-items-center",
children: [
/* @__PURE__ */ i.jsx(nl, { className: "me-2" }),
"Reset Permissions to Default"
]
}
),
/* @__PURE__ */ i.jsxs(Ui, { striped: !0, bordered: !0, hover: !0, responsive: !0, className: "shadow-sm", children: [
/* @__PURE__ */ i.jsx("thead", { style: { backgroundColor: "#F8F9FA" }, children: /* @__PURE__ */ i.jsxs("tr", { children: [
/* @__PURE__ */ i.jsx("th", { className: "text-muted text-uppercase small", children: "Permission" }),
s.map((c) => /* @__PURE__ */ i.jsx("th", { className: "text-muted text-uppercase small text-center", children: c.charAt(0).toUpperCase() + c.slice(1) }, c))
] }) }),
/* @__PURE__ */ i.jsx("tbody", { children: a.map((c) => /* @__PURE__ */ i.jsxs("tr", { children: [
/* @__PURE__ */ i.jsx("td", { className: "fw-medium align-middle", children: c.replace(/can/g, "").replace(/([A-Z])/g, " $1").trim() }),
s.map((u) => {
var d;
return /* @__PURE__ */ i.jsx("td", { className: "text-center align-middle", children: /* @__PURE__ */ i.jsxs("label", { className: "switch", children: [
/* @__PURE__ */ i.jsx(
"input",
{
type: "checkbox",
checked: ((d = n[u]) == null ? void 0 : d[c]) ?? !1,
onChange: () => o(u, c)
}
),
/* @__PURE__ */ i.jsx("span", { className: "slider round" })
] }) }, `${u}-${c}`);
})
] }, c)) })
] })
] });
};
export {
fu as AddMemberModal,
lf as App,
au as DashboardStats,
cf as Home,
df as LoginForm,
iu as Mytasks,
ys as NewTaskModal,
ff as PermissionsManagement,
uf as ProjectDetails,
ru as ProjectModal,
tl as Sidebar,
Qr as TaskCalendarView,
Ji as TaskFilters,
Ki as TaskKanbanView,
Xi as TaskTableView,
Ld as TeamMembers,
ts as ViewToggle
};
//# sourceMappingURL=index.es.js.map