mfg-ui-components
Version:
React UI library with reusable components
1,149 lines (1,084 loc) • 298 kB
JavaScript
'use strict';
var React = require('react');
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
var jsxRuntime = {exports: {}};
var reactJsxRuntime_production = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredReactJsxRuntime_production;
function requireReactJsxRuntime_production () {
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
hasRequiredReactJsxRuntime_production = 1;
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
function jsxProd(type, config, maybeKey) {
var key = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
config = maybeKey.ref;
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
ref: void 0 !== config ? config : null,
props: maybeKey
};
}
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
reactJsxRuntime_production.jsx = jsxProd;
reactJsxRuntime_production.jsxs = jsxProd;
return reactJsxRuntime_production;
}
var reactJsxRuntime_development = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredReactJsxRuntime_development;
function requireReactJsxRuntime_development () {
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
hasRequiredReactJsxRuntime_development = 1;
"production" !== process.env.NODE_ENV &&
(function () {
function getComponentNameFromType(type) {
if (null == type) return null;
if ("function" === typeof type)
return type.$$typeof === REACT_CLIENT_REFERENCE$2
? null
: type.displayName || type.name || null;
if ("string" === typeof type) return type;
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if ("object" === typeof type)
switch (
("number" === typeof type.tag &&
console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
),
type.$$typeof)
) {
case REACT_CONTEXT_TYPE:
return (type.displayName || "Context") + ".Provider";
case REACT_CONSUMER_TYPE:
return (type._context.displayName || "Context") + ".Consumer";
case REACT_FORWARD_REF_TYPE:
var innerType = type.render;
type = type.displayName;
type ||
((type = innerType.displayName || innerType.name || ""),
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
return type;
case REACT_MEMO_TYPE:
return (
(innerType = type.displayName || null),
null !== innerType
? innerType
: getComponentNameFromType(type.type) || "Memo"
);
case REACT_LAZY_TYPE:
innerType = type._payload;
type = type._init;
try {
return getComponentNameFromType(type(innerType));
} catch (x) {}
}
return null;
}
function testStringCoercion(value) {
return "" + value;
}
function checkKeyStringCoercion(value) {
try {
testStringCoercion(value);
var JSCompiler_inline_result = !1;
} catch (e) {
JSCompiler_inline_result = true;
}
if (JSCompiler_inline_result) {
JSCompiler_inline_result = console;
var JSCompiler_temp_const = JSCompiler_inline_result.error;
var JSCompiler_inline_result$jscomp$0 =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object";
JSCompiler_temp_const.call(
JSCompiler_inline_result,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result$jscomp$0
);
return testStringCoercion(value);
}
}
function disabledLog() {}
function disableLogs() {
if (0 === disabledDepth) {
prevLog = console.log;
prevInfo = console.info;
prevWarn = console.warn;
prevError = console.error;
prevGroup = console.group;
prevGroupCollapsed = console.groupCollapsed;
prevGroupEnd = console.groupEnd;
var props = {
configurable: true,
enumerable: true,
value: disabledLog,
writable: true
};
Object.defineProperties(console, {
info: props,
log: props,
warn: props,
error: props,
group: props,
groupCollapsed: props,
groupEnd: props
});
}
disabledDepth++;
}
function reenableLogs() {
disabledDepth--;
if (0 === disabledDepth) {
var props = { configurable: true, enumerable: true, writable: true };
Object.defineProperties(console, {
log: assign({}, props, { value: prevLog }),
info: assign({}, props, { value: prevInfo }),
warn: assign({}, props, { value: prevWarn }),
error: assign({}, props, { value: prevError }),
group: assign({}, props, { value: prevGroup }),
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
groupEnd: assign({}, props, { value: prevGroupEnd })
});
}
0 > disabledDepth &&
console.error(
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
);
}
function describeBuiltInComponentFrame(name) {
if (void 0 === prefix)
try {
throw Error();
} catch (x) {
var match = x.stack.trim().match(/\n( *(at )?)/);
prefix = (match && match[1]) || "";
suffix =
-1 < x.stack.indexOf("\n at")
? " (<anonymous>)"
: -1 < x.stack.indexOf("@")
? "@unknown:0:0"
: "";
}
return "\n" + prefix + name + suffix;
}
function describeNativeComponentFrame(fn, construct) {
if (!fn || reentry) return "";
var frame = componentFrameCache.get(fn);
if (void 0 !== frame) return frame;
reentry = true;
frame = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var previousDispatcher = null;
previousDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = null;
disableLogs();
try {
var RunInRootFrame = {
DetermineComponentFrameRoot: function () {
try {
if (construct) {
var Fake = function () {
throw Error();
};
Object.defineProperty(Fake.prototype, "props", {
set: function () {
throw Error();
}
});
if ("object" === typeof Reflect && Reflect.construct) {
try {
Reflect.construct(Fake, []);
} catch (x) {
var control = x;
}
Reflect.construct(fn, [], Fake);
} else {
try {
Fake.call();
} catch (x$0) {
control = x$0;
}
fn.call(Fake.prototype);
}
} else {
try {
throw Error();
} catch (x$1) {
control = x$1;
}
(Fake = fn()) &&
"function" === typeof Fake.catch &&
Fake.catch(function () {});
}
} catch (sample) {
if (sample && control && "string" === typeof sample.stack)
return [sample.stack, control.stack];
}
return [null, null];
}
};
RunInRootFrame.DetermineComponentFrameRoot.displayName =
"DetermineComponentFrameRoot";
var namePropDescriptor = Object.getOwnPropertyDescriptor(
RunInRootFrame.DetermineComponentFrameRoot,
"name"
);
namePropDescriptor &&
namePropDescriptor.configurable &&
Object.defineProperty(
RunInRootFrame.DetermineComponentFrameRoot,
"name",
{ value: "DetermineComponentFrameRoot" }
);
var _RunInRootFrame$Deter =
RunInRootFrame.DetermineComponentFrameRoot(),
sampleStack = _RunInRootFrame$Deter[0],
controlStack = _RunInRootFrame$Deter[1];
if (sampleStack && controlStack) {
var sampleLines = sampleStack.split("\n"),
controlLines = controlStack.split("\n");
for (
_RunInRootFrame$Deter = namePropDescriptor = 0;
namePropDescriptor < sampleLines.length &&
!sampleLines[namePropDescriptor].includes(
"DetermineComponentFrameRoot"
);
)
namePropDescriptor++;
for (
;
_RunInRootFrame$Deter < controlLines.length &&
!controlLines[_RunInRootFrame$Deter].includes(
"DetermineComponentFrameRoot"
);
)
_RunInRootFrame$Deter++;
if (
namePropDescriptor === sampleLines.length ||
_RunInRootFrame$Deter === controlLines.length
)
for (
namePropDescriptor = sampleLines.length - 1,
_RunInRootFrame$Deter = controlLines.length - 1;
1 <= namePropDescriptor &&
0 <= _RunInRootFrame$Deter &&
sampleLines[namePropDescriptor] !==
controlLines[_RunInRootFrame$Deter];
)
_RunInRootFrame$Deter--;
for (
;
1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
namePropDescriptor--, _RunInRootFrame$Deter--
)
if (
sampleLines[namePropDescriptor] !==
controlLines[_RunInRootFrame$Deter]
) {
if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
do
if (
(namePropDescriptor--,
_RunInRootFrame$Deter--,
0 > _RunInRootFrame$Deter ||
sampleLines[namePropDescriptor] !==
controlLines[_RunInRootFrame$Deter])
) {
var _frame =
"\n" +
sampleLines[namePropDescriptor].replace(
" at new ",
" at "
);
fn.displayName &&
_frame.includes("<anonymous>") &&
(_frame = _frame.replace("<anonymous>", fn.displayName));
"function" === typeof fn &&
componentFrameCache.set(fn, _frame);
return _frame;
}
while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
}
break;
}
}
} finally {
(reentry = false),
(ReactSharedInternals.H = previousDispatcher),
reenableLogs(),
(Error.prepareStackTrace = frame);
}
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
? describeBuiltInComponentFrame(sampleLines)
: "";
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
return sampleLines;
}
function describeUnknownElementTypeFrameInDEV(type) {
if (null == type) return "";
if ("function" === typeof type) {
var prototype = type.prototype;
return describeNativeComponentFrame(
type,
!(!prototype || !prototype.isReactComponent)
);
}
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
switch (type) {
case REACT_SUSPENSE_TYPE:
return describeBuiltInComponentFrame("Suspense");
case REACT_SUSPENSE_LIST_TYPE:
return describeBuiltInComponentFrame("SuspenseList");
}
if ("object" === typeof type)
switch (type.$$typeof) {
case REACT_FORWARD_REF_TYPE:
return (type = describeNativeComponentFrame(type.render, false)), type;
case REACT_MEMO_TYPE:
return describeUnknownElementTypeFrameInDEV(type.type);
case REACT_LAZY_TYPE:
prototype = type._payload;
type = type._init;
try {
return describeUnknownElementTypeFrameInDEV(type(prototype));
} catch (x) {}
}
return "";
}
function getOwner() {
var dispatcher = ReactSharedInternals.A;
return null === dispatcher ? null : dispatcher.getOwner();
}
function hasValidKey(config) {
if (hasOwnProperty.call(config, "key")) {
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
if (getter && getter.isReactWarning) return false;
}
return void 0 !== config.key;
}
function defineKeyPropWarningGetter(props, displayName) {
function warnAboutAccessingKey() {
specialPropKeyWarningShown ||
((specialPropKeyWarningShown = true),
console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
displayName
));
}
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, "key", {
get: warnAboutAccessingKey,
configurable: true
});
}
function elementRefGetterWithDeprecationWarning() {
var componentName = getComponentNameFromType(this.type);
didWarnAboutElementRef[componentName] ||
((didWarnAboutElementRef[componentName] = true),
console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
));
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, self, source, owner, props) {
self = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== self ? self : null)
? Object.defineProperty(type, "ref", {
enumerable: false,
get: elementRefGetterWithDeprecationWarning
})
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
type._store = {};
Object.defineProperty(type._store, "validated", {
configurable: false,
enumerable: false,
writable: true,
value: 0
});
Object.defineProperty(type, "_debugInfo", {
configurable: false,
enumerable: false,
writable: true,
value: null
});
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
return type;
}
function jsxDEVImpl(
type,
config,
maybeKey,
isStaticChildren,
source,
self
) {
if (
"string" === typeof type ||
"function" === typeof type ||
type === REACT_FRAGMENT_TYPE ||
type === REACT_PROFILER_TYPE ||
type === REACT_STRICT_MODE_TYPE ||
type === REACT_SUSPENSE_TYPE ||
type === REACT_SUSPENSE_LIST_TYPE ||
type === REACT_OFFSCREEN_TYPE ||
("object" === typeof type &&
null !== type &&
(type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
type.$$typeof === REACT_CONSUMER_TYPE ||
type.$$typeof === REACT_FORWARD_REF_TYPE ||
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
void 0 !== type.getModuleId))
) {
var children = config.children;
if (void 0 !== children)
if (isStaticChildren)
if (isArrayImpl(children)) {
for (
isStaticChildren = 0;
isStaticChildren < children.length;
isStaticChildren++
)
validateChildKeys(children[isStaticChildren], type);
Object.freeze && Object.freeze(children);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else validateChildKeys(children, type);
} else {
children = "";
if (
void 0 === type ||
("object" === typeof type &&
null !== type &&
0 === Object.keys(type).length)
)
children +=
" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
null === type
? (isStaticChildren = "null")
: isArrayImpl(type)
? (isStaticChildren = "array")
: void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
? ((isStaticChildren =
"<" +
(getComponentNameFromType(type.type) || "Unknown") +
" />"),
(children =
" Did you accidentally export a JSX literal instead of a component?"))
: (isStaticChildren = typeof type);
console.error(
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
isStaticChildren,
children
);
}
if (hasOwnProperty.call(config, "key")) {
children = getComponentNameFromType(type);
var keys = Object.keys(config).filter(function (k) {
return "key" !== k;
});
isStaticChildren =
0 < keys.length
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
: "{key: someKey}";
didWarnAboutKeySpread[children + isStaticChildren] ||
((keys =
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
console.error(
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
isStaticChildren,
children,
keys,
children
),
(didWarnAboutKeySpread[children + isStaticChildren] = true));
}
children = null;
void 0 !== maybeKey &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
children &&
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type
);
return ReactElement(type, children, self, source, getOwner(), maybeKey);
}
function validateChildKeys(node, parentType) {
if (
"object" === typeof node &&
node &&
node.$$typeof !== REACT_CLIENT_REFERENCE
)
if (isArrayImpl(node))
for (var i = 0; i < node.length; i++) {
var child = node[i];
isValidElement(child) && validateExplicitKey(child, parentType);
}
else if (isValidElement(node))
node._store && (node._store.validated = 1);
else if (
(null === node || "object" !== typeof node
? (i = null)
: ((i =
(MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
node["@@iterator"]),
(i = "function" === typeof i ? i : null)),
"function" === typeof i &&
i !== node.entries &&
((i = i.call(node)), i !== node))
)
for (; !(node = i.next()).done; )
isValidElement(node.value) &&
validateExplicitKey(node.value, parentType);
}
function isValidElement(object) {
return (
"object" === typeof object &&
null !== object &&
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function validateExplicitKey(element, parentType) {
if (
element._store &&
!element._store.validated &&
null == element.key &&
((element._store.validated = 1),
(parentType = getCurrentComponentErrorInfo(parentType)),
!ownerHasKeyUseWarning[parentType])
) {
ownerHasKeyUseWarning[parentType] = true;
var childOwner = "";
element &&
null != element._owner &&
element._owner !== getOwner() &&
((childOwner = null),
"number" === typeof element._owner.tag
? (childOwner = getComponentNameFromType(element._owner.type))
: "string" === typeof element._owner.name &&
(childOwner = element._owner.name),
(childOwner = " It was passed a child from " + childOwner + "."));
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
ReactSharedInternals.getCurrentStack = function () {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
return stack;
};
console.error(
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
parentType,
childOwner
);
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
}
}
function getCurrentComponentErrorInfo(parentType) {
var info = "",
owner = getOwner();
owner &&
(owner = getComponentNameFromType(owner.type)) &&
(info = "\n\nCheck the render method of `" + owner + "`.");
info ||
((parentType = getComponentNameFromType(parentType)) &&
(info =
"\n\nCheck the top-level render call using <" + parentType + ">."));
return info;
}
var React$1 = React,
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
ReactSharedInternals =
React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
hasOwnProperty = Object.prototype.hasOwnProperty,
assign = Object.assign,
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
isArrayImpl = Array.isArray,
disabledDepth = 0,
prevLog,
prevInfo,
prevWarn,
prevError,
prevGroup,
prevGroupCollapsed,
prevGroupEnd;
disabledLog.__reactDisabledLog = true;
var prefix,
suffix,
reentry = false;
var componentFrameCache = new (
"function" === typeof WeakMap ? WeakMap : Map
)();
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
specialPropKeyWarningShown;
var didWarnAboutElementRef = {};
var didWarnAboutKeySpread = {},
ownerHasKeyUseWarning = {};
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
return jsxDEVImpl(type, config, maybeKey, false, source, self);
};
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
return jsxDEVImpl(type, config, maybeKey, true, source, self);
};
})();
return reactJsxRuntime_development;
}
var hasRequiredJsxRuntime;
function requireJsxRuntime () {
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
hasRequiredJsxRuntime = 1;
if (process.env.NODE_ENV === 'production') {
jsxRuntime.exports = requireReactJsxRuntime_production();
} else {
jsxRuntime.exports = requireReactJsxRuntime_development();
}
return jsxRuntime.exports;
}
var jsxRuntimeExports = requireJsxRuntime();
function getRefValue(ref) {
return ref.current;
}
const SingleAccord = ({ title, content, isOpen, btnOnClick, children, style, btnStyle, contentStyle, btnClass, contentClass }) => {
const contentRef = React.useRef(null);
const [height, setHeight] = React.useState(0);
React.useEffect(() => {
if (isOpen) {
const contentEl = getRefValue(contentRef);
if (contentEl) {
setHeight(contentEl.scrollHeight);
}
}
else {
setHeight(0);
}
}, [isOpen]);
return (jsxRuntimeExports.jsxs("li", { className: `accordion-item ${isOpen ? "active" : ""}`, children: [jsxRuntimeExports.jsx("h2", { className: "accordion-item-title", children: jsxRuntimeExports.jsx("button", { className: `accordion-item-btn ${btnClass && btnClass}`, style: btnStyle && btnStyle, id: title?.toString().replace(/ /g, ''), "aria-controls": title?.toString().replace(/ /g, ''), onClick: btnOnClick, "aria-expanded": isOpen ? 'true' : 'false', children: title ? title : children }) }), jsxRuntimeExports.jsx("div", { className: "accordion-item-container", style: {
height: `${height}px`,
overflow: isOpen ? "visible" : "hidden",
}, id: title?.toString().replace(/ /g, ''), "aria-labelledby": title?.toString().replace(/ /g, ''), children: jsxRuntimeExports.jsx("div", { ref: contentRef, className: `accordion-item-content ${contentClass && contentClass}`, style: contentStyle && contentStyle, children: content ? content : children }) })] }));
};
const Accordian = ({ title, content, style, btnStyle, contentStyle, btnClass, contentClass }) => {
const [currentIdx, setCurrentIdx] = React.useState(0);
const btnOnClick = (idx) => {
setCurrentIdx((currentValue) => (currentValue !== idx ? idx : -1));
};
return (jsxRuntimeExports.jsx("ul", { className: "mfg-accordion", children: title?.map((item, idx) => (jsxRuntimeExports.jsx(SingleAccord, { title: title[idx], content: content[idx], isOpen: idx === currentIdx, btnOnClick: () => btnOnClick(idx), style: style && style, btnStyle: btnStyle && btnStyle, contentStyle: contentStyle && contentStyle, btnClass: btnClass && btnClass, contentClass: contentClass && contentClass }, idx))) }));
};
const Alert = ({ customClass, alertId, showAlrt, alertType = "success", alertTitle, alertContent, alertIcon, style = {}, }) => {
const [showA, setShowA] = React.useState(showAlrt);
const closeAlert = () => {
setShowA(!showA);
};
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: showA !== false && showAlrt && (jsxRuntimeExports.jsxs("div", { className: `mfg-alert${customClass ? " " + customClass : ""} alert-${alertType}`, id: alertId, role: "alert", style: style && style, children: [jsxRuntimeExports.jsxs("div", { className: "alert-content", children: [alertIcon && jsxRuntimeExports.jsx("img", { src: alertIcon, alt: alertType }), jsxRuntimeExports.jsxs("div", { className: "alrtCont", children: [alertTitle && jsxRuntimeExports.jsx("h3", { children: alertTitle }), jsxRuntimeExports.jsx("p", { children: alertContent })] })] }), jsxRuntimeExports.jsx("button", { className: "alrtClose", onClick: closeAlert, children: "X" })] })) }));
};
const Badge = ({ size = "mfg-small", type = "mfg-normal", customClass, id, onBadgerClick, badgeLink, badgeData, removeBadge, removeVisible, style = {}, }) => {
return (jsxRuntimeExports.jsx("div", { className: `mfg-badge${customClass ? " " + customClass : ""}`, id: id, style: style && style, children: badgeData && (jsxRuntimeExports.jsx("ul", { children: badgeData.map((item, index) => (jsxRuntimeExports.jsxs("li", { className: `${size && size} ${type && type}`, children: [badgeLink ? (jsxRuntimeExports.jsx("a", { href: badgeLink[index], children: item })) : onBadgerClick ? (jsxRuntimeExports.jsx("button", { onClick: onBadgerClick, children: item })) : (jsxRuntimeExports.jsx("span", { children: item })), removeVisible && (jsxRuntimeExports.jsx("button", { onClick: removeBadge, className: "removeBadge", children: "X" }))] }, item))) })) }));
};
const Banner = ({ bannerClass, bannerId, bannerSize, bannerImage, alterText, children, bannerOverlay = 'noOverlay', style = {}, childStyle = {} }) => {
return (jsxRuntimeExports.jsxs("div", { className: `mfg-banner${bannerClass ? (" " + bannerClass) : ''}${bannerSize ? (" " + bannerSize) : ''}${bannerOverlay ? (" " + bannerOverlay) : ''}`, id: bannerId, style: style && style, children: [bannerImage ? jsxRuntimeExports.jsx("img", { src: bannerImage, alt: alterText }) : "", jsxRuntimeExports.jsx("div", { className: "bannerChildren", style: childStyle && childStyle, children: children })] }));
};
const BreadCrumb = ({ seprator = "/", className = "", homeLabel = "Home", mainStyle, listStyle, linkStyle }) => {
const pathSegments = window.location.pathname
.split("/")
.filter((segment) => segment)
.map((segment, index, array) => {
const url = `/${array.slice(0, index + 1).join("/")}`;
return { name: decodeURIComponent(segment), url };
});
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx("nav", { "aria-label": "breadcrumb", className: `mfg-breadcrumbs${className ? " " + className : ""}`, style: mainStyle && mainStyle, children: jsxRuntimeExports.jsxs("ul", { children: [jsxRuntimeExports.jsx("li", { style: linkStyle && linkStyle, children: jsxRuntimeExports.jsx("a", { href: "/", style: linkStyle && linkStyle, children: homeLabel }) }, homeLabel), pathSegments.map((segment, index) => {
const isLast = index === pathSegments.length - 1;
return (jsxRuntimeExports.jsxs("li", { "aria-current": isLast ? "page" : undefined, className: `breadcrumb-item${isLast ? " active" : ""}`, style: linkStyle && linkStyle, children: [jsxRuntimeExports.jsx("span", { className: "mx-2", children: seprator }), !isLast ? (jsxRuntimeExports.jsx("a", { href: segment.url, style: linkStyle && linkStyle, children: segment.name })) : (jsxRuntimeExports.jsx("span", { children: segment.name }))] }, index));
})] }) }) }));
};
const Button = ({ ButtonClass = "mfg-primary", ButtonId, children, onClick, link, customClass, tabIndex, role, ariaSelected, target, ariaControl, disabled, type = 'button', style = {} }) => {
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: link ? (jsxRuntimeExports.jsx("a", { href: link, className: `mfg-btn mfg-btn-link${customClass ? " " + customClass : ""}`, id: ButtonId, onClick: onClick, target: target, style: style && style, children: children })) : (jsxRuntimeExports.jsx("button", { "aria-selected": ariaSelected, role: role, className: `mfg-btn${ButtonClass ? " " + ButtonClass : ""}${customClass ? " " + customClass : ""}`, id: ButtonId, onClick: onClick, tabIndex: tabIndex, "aria-controls": ariaControl, disabled: disabled, type: type, style: style && style, children: children })) }));
};
const Heading = ({ Type: Element = "h2", HeadingClass, children, HeadingId, style }) => {
return jsxRuntimeExports.jsx(Element, { style: style && style, className: HeadingClass, id: HeadingId, children: children });
};
const Card = ({ cardHeading, cardBodyChildren, cardFooterChildren, CardBodyClass, CardHeadingClass, CardBodyId, CardHeadingId, CardHeadingType = "h2", CardImagePath, CardImageAlt, CardFooterClass, CardFooterId, CardView = "mfg-grid", cardContentClass, CardCustomClass, mainStyle = {}, cardHeadingStyle = {}, cardBodyStyle = {}, cardFooterStyle = {}, CardImageStyle = {}, cardContentStyle = {}, }) => {
return (jsxRuntimeExports.jsxs("div", { className: `mfg-card${CardView ? " " + CardView : ""}${CardCustomClass ? " " + CardCustomClass : ""}`, style: mainStyle && mainStyle, children: [CardImagePath && (jsxRuntimeExports.jsx("div", { className: "cardImage", style: CardImageStyle && CardImageStyle, children: jsxRuntimeExports.jsx("img", { src: CardImagePath, alt: CardImageAlt }) })), jsxRuntimeExports.jsxs("div", { style: cardContentStyle && cardContentStyle, className: `cardContent${cardContentClass ? " " + cardContentClass : ""}${(cardHeading || cardBodyChildren || cardFooterChildren) &&
CardImagePath
? " " + "contentPadding"
: ""}${(cardHeading || cardBodyChildren || cardFooterChildren) &&
!CardImagePath
? " " + "contentPaddingFull"
: ""}`, children: [cardHeading && (jsxRuntimeExports.jsx(Heading, { Type: CardHeadingType, HeadingClass: `cardHeading${CardHeadingClass ? " " + CardHeadingClass : ""}`, HeadingId: CardHeadingId, style: cardHeadingStyle && cardHeadingStyle, children: cardHeading })), cardBodyChildren && (jsxRuntimeExports.jsx("div", { className: `cBody${CardBodyClass ? " " + CardBodyClass : ""}`, id: CardBodyId, style: cardBodyStyle && cardBodyStyle, children: cardBodyChildren })), cardFooterChildren && (jsxRuntimeExports.jsx("div", { className: `cFooter${CardFooterClass ? " " + CardFooterClass : ""}`, id: CardFooterId, style: cardFooterStyle && cardFooterStyle, children: cardFooterChildren }))] })] }));
};
const monthName = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
const dayName = [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
];
const getNumberOfDays = (year, month) => {
return new Date(year, month + 1, 0).getDate();
};
const getSortedDays = (year, month) => {
// const dayIndex = getNumberOfDays(year, month);
const dayIndex = new Date(year, month, 1).getDay();
const firstHalf = dayName?.slice(dayIndex);
return [...firstHalf, ...dayName?.slice(0, dayIndex)];
};
const Range = (start, end) => {
const length = Math.abs((end - start) / 1);
const { result } = Array.from({ length: length }).reduce(({ result, current }) => ({
result: [...result, current],
current: current + 1,
}), { result: [], current: start });
return result;
};
var DefaultContext = {
color: undefined,
size: undefined,
className: undefined,
style: undefined,
attr: undefined
};
var IconContext = React.createContext && /*#__PURE__*/React.createContext(DefaultContext);
var _excluded = ["attr", "size", "title"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function Tree2Element(tree) {
return tree && tree.map((node, i) => /*#__PURE__*/React.createElement(node.tag, _objectSpread({
key: i
}, node.attr), Tree2Element(node.child)));
}
function GenIcon(data) {
return props => /*#__PURE__*/React.createElement(IconBase, _extends({
attr: _objectSpread({}, data.attr)
}, props), Tree2Element(data.child));
}
function IconBase(props) {
var elem = conf => {
var {
attr,
size,
title
} = props,
svgProps = _objectWithoutProperties(props, _excluded);
var computedSize = size || conf.size || "1em";
var className;
if (conf.className) className = conf.className;
if (props.className) className = (className ? className + " " : "") + props.className;
return /*#__PURE__*/React.createElement("svg", _extends({
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0"
}, conf.attr, attr, svgProps, {
className: className,
style: _objectSpread(_objectSpread({
color: props.color || conf.color
}, conf.style), props.style),
height: computedSize,
width: computedSize,
xmlns: "http://www.w3.org/2000/svg"
}), title && /*#__PURE__*/React.createElement("title", null, title), props.children);
};
return IconContext !== undefined ? /*#__PURE__*/React.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);
}
// THIS FILE IS AUTO GENERATED
function FaBars (props) {
return GenIcon({"attr":{"viewBox":"0 0 448 512"},"child":[{"tag":"path","attr":{"d":"M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"},"child":[]}]})(props);
}function FaCaretDown (props) {
return GenIcon({"attr":{"viewBox":"0 0 320 512"},"child":[{"tag":"path","attr":{"d":"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"},"child":[]}]})(props);
}function FaXmark (props) {
return GenIcon({"attr":{"viewBox":"0 0 384 512"},"child":[{"tag":"path","attr":{"d":"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"},"child":[]}]})(props);
}function FaRegCalendarDays (props) {
return GenIcon({"attr":{"viewBox":"0 0 448 512"},"child":[{"tag":"path","attr":{"d":"M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L64 64C28.7 64 0 92.7 0 128l0 16 0 48L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256 0-48 0-16c0-35.3-28.7-64-64-64l-40 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM48 192l80 0 0 56-80 0 0-56zm0 104l80 0 0 64-80 0 0-64zm128 0l96 0 0 64-96 0 0-64zm144 0l80 0 0 64-80 0 0-64zm80-48l-80 0 0-56 80 0 0 56zm0 160l0 40c0 8.8-7.2 16-16 16l-64 0 0-56 80 0zm-128 0l0 56-96 0 0-56 96 0zm-144 0l0 56-64 0c-8.8 0-16-7.2-16-16l0-40 80 0zM272 248l-96 0 0-56 96 0 0 56z"},"child":[]}]})(props);
}
function commonjsRequire(path) {
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var moment$2 = {exports: {}};
var moment$1 = moment$2.exports;
var hasRequiredMoment;
function requireMoment () {
if (hasRequiredMoment) return moment$2.exports;
hasRequiredMoment = 1;
(function (module, exports) {
(function (global, factory) {
module.exports = factory() ;
}(moment$1, (function () {
var hookCallback;
function hooks() {
return hookCallback.apply(null, arguments);
}
// This is done to register the method called with moment()
// without creating circular dependencies.
function setHookCallback(callback) {
hookCallback = callback;
}
function isArray(input) {
return (
input instanceof Array ||
Object.prototype.toString.call(input) === '[object Array]'
);
}
function isObject(input) {
// IE8 will treat undefined and null as object if it wasn't for
// input != null
return (
input != null &&
Object.prototype.toString.call(input) === '[object Object]'
);
}
function hasOwnProp(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
function isObjectEmpty(obj) {
if (Object.getOwnPropertyNames) {
return Object.getOwnPropertyNames(obj).length === 0;
} else {
var k;
for (k in obj) {
if (hasOwnProp(obj, k)) {
return false;
}
}
return true;
}
}
function isUndefined(input) {
return input === void 0;
}
function isNumber(input) {
return (
typeof input === 'number' ||
Object.prototype.toString.call(input) === '[object Number]'
);
}
function isDate(input) {
return (
input instanceof Date ||
Object.prototype.toString.call(input) === '[object Date]'
);
}
function map(arr, fn) {
var res = [],
i,
arrLen = arr.length;
for (i = 0; i < arrLen; ++i) {
res.push(fn(arr[i], i));
}
return res;
}
function extend(a, b) {
for (var i in b) {
if (hasOwnProp(b, i)) {
a[i] = b[i];
}
}
if (hasOwnProp(b, 'toString')) {
a.toString = b.toString;
}
if (hasOwnProp(b, 'valueOf')) {
a.valueOf = b.valueOf;
}
return a;
}
function createUTC(input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, true).utc();
}
function defaultParsingFlags() {
// We need to deep clone this object.
return {
empty: false,
unusedTokens: [],
unusedInput: [],
overflow: -2,
charsLeftOver: 0,
nullInput: false,
invalidEra: null,
invalidMonth: null,
invalidFormat: false,
userInvalidated: false,
iso: false,
parsedDateParts: [],
era: null,
meridiem: null,
rfc2822: false,
weekdayMismatch: false,
};
}
function getParsingFlags(m) {
if (m._pf == null) {
m._pf = defaultParsingFlags();
}
return m._pf;
}
var some;
if (Array.prototype.some) {
some = Array.prototype.some;
} else {
some = function (fun) {
var t = Object(this),
len = t.length >>> 0,
i;
for (i = 0; i < len; i++) {
if (i in t && fun.call(this, t[i], i, t)) {
return true;
}
}
return false;
};
}
function isValid(m) {
var flags = null,
parsedParts = false,
isNowValid = m._d && !isNaN(m._d.getTime());
if (isNowValid) {
flags = getParsingFlags(m);
parsedParts = some.call(flags.parsedDateParts, function (i) {
return i != null;
});
isNowValid =
flags.overflow < 0 &&
!flags.empty &&
!flags.invalidEra &&
!flags.invalidMonth &&
!flags.invalidWeekday &&
!flags.weekdayMismatch &&
!flags.nullInput &&
!flags.invalidFormat &&
!flags.userInvalidated &&
(!flags.meridiem || (flags.meridiem && parsedParts));
if (m._strict) {
isNowValid =
isNowValid &&
flags.charsLeftOver === 0 &&
flags.unusedTokens.length === 0 &&
flags.bigHour === undefined;
}
}
if (Object.isFrozen == null || !Object.isFrozen(m)) {
m._isValid = isNowValid;
} else {
return isNowValid;
}
return m._isValid;
}
function createInvalid(flags) {
var m = createUTC(NaN);
if (flags != null) {
extend(getParsingFlags(m), flags);
} else {
getParsingFlags(m).userInvalidated = true;
}
return m;
}
// Plugins that add properties should also add the key here (null value),
// so we can properly clone ourselves.
var momentProperties = (hooks.momentProperties = []),
updateInProgress = false;
function copyConfig(to, from) {
var i,
prop,
val,
momentPropertiesLen = momentProperties.length;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
}
if (!isUndefined(from._i)) {
to._i = from._i;
}