@unifiedsoftware/react-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2209 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+
59
+ // src/index.ts
60
+ var src_exports = {};
61
+ __export(src_exports, {
62
+ AppBreadCrumb: () => AppBreadCrumb,
63
+ AppBreadCrumbNav: () => AppBreadCrumbNav,
64
+ AppLoader: () => AppLoader,
65
+ BreadCrumbContext: () => BreadCrumbContext,
66
+ BreadCrumbContextProvider: () => BreadCrumbContextProvider,
67
+ BreadCrumbTitle: () => BreadCrumbTitle,
68
+ Breadcrumb: () => Breadcrumb,
69
+ Button: () => Button,
70
+ CloseIcon: () => CloseIcon,
71
+ DrawerContext: () => DrawerContext,
72
+ DrawerContextProvider: () => DrawerContextProvider,
73
+ DropEnumList: () => DropEnumList,
74
+ GlobalProvider: () => GlobalProvider,
75
+ HistoryContext: () => HistoryContext,
76
+ HistoryContextProvider: () => HistoryContextProvider,
77
+ ItemLinkSidebar: () => ItemLinkSidebar,
78
+ ItemSidebar: () => ItemSidebar,
79
+ LoaderGrid: () => LoaderGrid,
80
+ Main: () => Main,
81
+ MenuItem: () => MenuItem,
82
+ MenuOptions: () => MenuOptions,
83
+ MenuTitle: () => MenuTitle,
84
+ NavOptions: () => NavOptions,
85
+ Navbar: () => Navbar,
86
+ SidebarMainContext: () => SidebarMainContext,
87
+ SidebarMainContextProvider: () => SidebarMainContextProvider,
88
+ SidebarNavigation: () => SidebarNavigation,
89
+ Tab: () => Tab,
90
+ Tabs: () => Tabs,
91
+ Title: () => Title,
92
+ useLocalStorage: () => useLocalStorage,
93
+ usePrevious: () => usePrevious,
94
+ useStep: () => useStep
95
+ });
96
+ module.exports = __toCommonJS(src_exports);
97
+
98
+ // src/components/Button/Button.tsx
99
+ var import_clsx = __toESM(require("clsx"));
100
+ var import_react = require("react");
101
+ var import_jsx_runtime = require("react/jsx-runtime");
102
+ var prefixCls = "us-";
103
+ var Button = (0, import_react.forwardRef)(
104
+ (_a, ref) => {
105
+ var _b = _a, { as: Component2 = "button", children, className, variant = "text", color = "primary", size = "md" } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
106
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
107
+ Component2,
108
+ __spreadProps(__spreadValues({
109
+ ref,
110
+ className: (0, import_clsx.default)(
111
+ `${prefixCls}button`,
112
+ {
113
+ [`${prefixCls}button--${variant}`]: variant,
114
+ [`${prefixCls}button--${color}`]: color,
115
+ [`${prefixCls}button--${size}`]: size
116
+ },
117
+ className
118
+ )
119
+ }, rest), {
120
+ children: [
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}button__elevation` }),
122
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}button__outline` }),
123
+ children
124
+ ]
125
+ })
126
+ );
127
+ }
128
+ );
129
+
130
+ // src/components/Tabs/Tab.tsx
131
+ var import_clsx2 = __toESM(require("clsx"));
132
+ var import_merge_refs = __toESM(require("merge-refs"));
133
+ var import_react3 = require("react");
134
+
135
+ // src/components/Tabs/TabsContext.ts
136
+ var import_react2 = require("react");
137
+ var TabsContext = (0, import_react2.createContext)(null);
138
+ var useTabs = () => {
139
+ const context = (0, import_react2.useContext)(TabsContext);
140
+ if (!context) {
141
+ throw new Error("`useTabs` must be used within a `<Tabs />`");
142
+ }
143
+ return context;
144
+ };
145
+
146
+ // src/components/Tabs/Tab.tsx
147
+ var import_jsx_runtime2 = require("react/jsx-runtime");
148
+ var prefixCls2 = "us-";
149
+ var Tab = (0, import_react3.forwardRef)(
150
+ (_a, ref) => {
151
+ var _b = _a, { as: Component2 = "div", children, className, value, onClick } = _b, rest = __objRest(_b, ["as", "children", "className", "value", "onClick"]);
152
+ const tabRef = (0, import_react3.useRef)(null);
153
+ const tabs = useTabs();
154
+ const handleClick = (event) => {
155
+ const previousTab = tabs.previousTabRef.current;
156
+ const currentTab = tabRef.current;
157
+ if (!currentTab)
158
+ return;
159
+ if (previousTab) {
160
+ const previousIndicator = previousTab.querySelector(`.${prefixCls2}tab__indicator`);
161
+ const currentIndicator = currentTab.querySelector(`.${prefixCls2}tab__indicator`);
162
+ if (!previousIndicator || !currentIndicator)
163
+ return;
164
+ const from = {};
165
+ const fromRect = previousIndicator.getBoundingClientRect();
166
+ const fromPos = fromRect.left;
167
+ const fromWidth = fromRect.width;
168
+ const toRect = currentIndicator.getBoundingClientRect();
169
+ const toPos = toRect.left;
170
+ const toWidth = toRect.width;
171
+ const scale = fromWidth / toWidth;
172
+ if (scale) {
173
+ from["transform"] = `translateX(${(fromPos - toPos).toFixed(4)}px) scaleX(${scale.toFixed(4)})`;
174
+ } else {
175
+ from["opacity"] = 0;
176
+ }
177
+ const keyframes = [from, { transform: "none" }];
178
+ currentIndicator.animate(keyframes, {
179
+ duration: 250,
180
+ easing: "cubic-bezier(.3,0,0,1)"
181
+ });
182
+ tabs.previousTabRef.current = tabRef.current;
183
+ }
184
+ tabs.previousTabRef.current = tabRef.current;
185
+ tabs.onChange(value);
186
+ onClick == null ? void 0 : onClick(event);
187
+ };
188
+ (0, import_react3.useEffect)(() => {
189
+ if (value === tabs.value) {
190
+ tabs.previousTabRef.current = tabRef.current;
191
+ }
192
+ }, []);
193
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
194
+ Component2,
195
+ __spreadProps(__spreadValues({
196
+ ref: (0, import_merge_refs.default)(tabRef, ref),
197
+ className: (0, import_clsx2.default)(`${prefixCls2}tab`, { [`${prefixCls2}tab--selected`]: value === tabs.value }, className),
198
+ onClick: handleClick
199
+ }, rest), {
200
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `${prefixCls2}tab__content`, children: [
201
+ children,
202
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${prefixCls2}tab__indicator` })
203
+ ] })
204
+ })
205
+ );
206
+ }
207
+ );
208
+
209
+ // src/components/Tabs/Tabs.tsx
210
+ var import_clsx3 = __toESM(require("clsx"));
211
+ var import_react4 = require("react");
212
+ var import_jsx_runtime3 = require("react/jsx-runtime");
213
+ var prefixCls3 = "us-";
214
+ var Tabs = (_a) => {
215
+ var _b = _a, { children, className, value, defaultValue, onChange } = _b, rest = __objRest(_b, ["children", "className", "value", "defaultValue", "onChange"]);
216
+ const previousTabRef = (0, import_react4.useRef)(null);
217
+ const [selfValue, setSelfValue] = (0, import_react4.useState)(value != null ? value : defaultValue);
218
+ const handleChange = (value2) => {
219
+ setSelfValue(value2);
220
+ onChange == null ? void 0 : onChange(value2);
221
+ };
222
+ (0, import_react4.useEffect)(() => {
223
+ if (value !== void 0) {
224
+ setSelfValue(value);
225
+ }
226
+ }, [value]);
227
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(TabsContext.Provider, { value: { previousTabRef, value: selfValue, onChange: handleChange }, children: [
228
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_clsx3.default)(`${prefixCls3}tabs`, className) }, rest), { children })),
229
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: `${prefixCls3}divider` })
230
+ ] });
231
+ };
232
+
233
+ // src/components/DropdownEnumList.tsx
234
+ var import_kendo_react_dropdowns = require("@progress/kendo-react-dropdowns");
235
+ var import_react5 = require("react");
236
+ var import_jsx_runtime4 = require("react/jsx-runtime");
237
+ function parsearDataForComboBox(array, key, text, itemAll = false) {
238
+ const dataForComboBox = [];
239
+ if (itemAll)
240
+ dataForComboBox.push({ key: "", text: "ALL" });
241
+ if (array !== void 0) {
242
+ array.map((a) => {
243
+ dataForComboBox.push({ key: a[key], text: a[text] });
244
+ });
245
+ }
246
+ return dataForComboBox;
247
+ }
248
+ function GetEnumDescription(key, typeEnum, description) {
249
+ const listLabel = description.get(typeEnum);
250
+ let label = void 0;
251
+ if (listLabel != void 0)
252
+ label = listLabel.get(parseInt(key));
253
+ if (label == void 0) {
254
+ label = typeEnum[key];
255
+ return label.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
256
+ }
257
+ return label;
258
+ }
259
+ function EnumToArray(typeEnum, replaceGuionForSpace = true, description) {
260
+ const values = [];
261
+ for (const key in typeEnum) {
262
+ if (typeof typeEnum[key] === "string")
263
+ values.push({
264
+ value: Number(key),
265
+ label: replaceGuionForSpace ? GetEnumDescription(key, typeEnum, description) : typeEnum[key]
266
+ });
267
+ }
268
+ return values;
269
+ }
270
+ var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) => {
271
+ const [value, setValue] = (0, import_react5.useState)("");
272
+ const [data, setData] = (0, import_react5.useState)([]);
273
+ (0, import_react5.useEffect)(() => {
274
+ setData(
275
+ parsearDataForComboBox(EnumToArray(dataEnum, true, description), "value", "label", false).sort(
276
+ (a, b) => Number(a.key) - Number(b.key)
277
+ )
278
+ );
279
+ }, []);
280
+ (0, import_react5.useEffect)(() => {
281
+ if (data.length > 0) {
282
+ setValue(data.filter((x) => x.key == defaultValue)[0]);
283
+ }
284
+ }, [data]);
285
+ const handleOptionClick = (e) => {
286
+ onChange(e);
287
+ setValue(e);
288
+ };
289
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
290
+ import_kendo_react_dropdowns.DropDownList,
291
+ {
292
+ className: "d-inline-block align-middle mr-2",
293
+ data,
294
+ dataItemKey: "key",
295
+ id: "cmbDisplay",
296
+ name: "cmbDisplay",
297
+ onChange: (event) => {
298
+ handleOptionClick(event.value);
299
+ },
300
+ textField: "text",
301
+ style: {
302
+ width: `${width}px`
303
+ },
304
+ defaultValue: value
305
+ }
306
+ ) });
307
+ };
308
+
309
+ // src/contexts/BreadCrumbContext.tsx
310
+ var import_react9 = require("react");
311
+
312
+ // src/hooks/useLocalStorage.tsx
313
+ var import_react8 = require("react");
314
+
315
+ // src/hooks/useEventListener.tsx
316
+ var import_react7 = require("react");
317
+
318
+ // src/hooks/useIsomorphicLayoutEffect.tsx
319
+ var import_react6 = require("react");
320
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react6.useLayoutEffect : import_react6.useEffect;
321
+ var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
322
+
323
+ // src/hooks/useEventListener.tsx
324
+ function useEventListener(handler) {
325
+ const savedHandler = (0, import_react7.useRef)(handler);
326
+ useIsomorphicLayoutEffect_default(() => {
327
+ savedHandler.current = handler;
328
+ }, [handler]);
329
+ }
330
+ var useEventListener_default = useEventListener;
331
+
332
+ // src/hooks/useLocalStorage.tsx
333
+ function useLocalStorage(key, initialValue) {
334
+ const readValue = (0, import_react8.useCallback)(() => {
335
+ if (typeof window === "undefined") {
336
+ return initialValue;
337
+ }
338
+ try {
339
+ const item = window.localStorage.getItem(key);
340
+ return item ? parseJSON(item) : initialValue;
341
+ } catch (error) {
342
+ console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
343
+ return initialValue;
344
+ }
345
+ }, [initialValue, key]);
346
+ const [storedValue, setStoredValue] = (0, import_react8.useState)(readValue);
347
+ const setValue = (0, import_react8.useCallback)(
348
+ (value) => {
349
+ if (typeof window == "undefined") {
350
+ console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
351
+ }
352
+ try {
353
+ const newValue = value instanceof Function ? value(storedValue) : value;
354
+ window.localStorage.setItem(key, JSON.stringify(newValue));
355
+ setStoredValue(newValue);
356
+ window.dispatchEvent(new Event("local-storage"));
357
+ } catch (error) {
358
+ console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
359
+ }
360
+ },
361
+ [key, storedValue]
362
+ );
363
+ (0, import_react8.useEffect)(() => {
364
+ setStoredValue(readValue());
365
+ }, []);
366
+ const handleStorageChange = (0, import_react8.useCallback)(() => {
367
+ setStoredValue(readValue());
368
+ }, [readValue]);
369
+ useEventListener_default("storage", handleStorageChange);
370
+ useEventListener_default("local-storage", handleStorageChange);
371
+ return [storedValue, setValue];
372
+ }
373
+ function parseJSON(value) {
374
+ try {
375
+ return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
376
+ } catch (e) {
377
+ console.log("parsing error on", { value });
378
+ return void 0;
379
+ }
380
+ }
381
+
382
+ // src/contexts/BreadCrumbContext.tsx
383
+ var import_jsx_runtime5 = require("react/jsx-runtime");
384
+ var BreadCrumbContext = (0, import_react9.createContext)({});
385
+ var BreadCrumbContextProvider = ({ children }) => {
386
+ const [active, setActive] = useLocalStorage("@active", "");
387
+ const [path, setPath] = useLocalStorage("@path", "/");
388
+ const [goBack, setGoBack] = useLocalStorage("@goBack", false);
389
+ const [pathChild, setPathChild] = useLocalStorage("@pathChild", "");
390
+ const [routes, setRoutes] = (0, import_react9.useState)([]);
391
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
392
+ BreadCrumbContext.Provider,
393
+ {
394
+ value: {
395
+ active,
396
+ setActive,
397
+ path,
398
+ setPath,
399
+ goBack,
400
+ setGoBack,
401
+ pathChild,
402
+ setPathChild,
403
+ routes,
404
+ setRoutes
405
+ },
406
+ children
407
+ }
408
+ );
409
+ };
410
+
411
+ // src/contexts/DrawerContext.tsx
412
+ var import_react10 = require("react");
413
+ var import_jsx_runtime6 = require("react/jsx-runtime");
414
+ var DrawerContext = (0, import_react10.createContext)({});
415
+ var DrawerContextProvider = ({ children }) => {
416
+ const [active, setActive] = (0, import_react10.useState)(false);
417
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DrawerContext.Provider, { value: { active, setActive }, children });
418
+ };
419
+
420
+ // src/contexts/HistoryContext.tsx
421
+ var import_react11 = require("react");
422
+ var import_jsx_runtime7 = require("react/jsx-runtime");
423
+ var HistoryContext = (0, import_react11.createContext)({});
424
+ var HistoryContextProvider = ({ children }) => {
425
+ const [list, setList] = useLocalStorage("@list_paths", []);
426
+ const updateList = (value) => {
427
+ setList(
428
+ (prev) => prev.concat({
429
+ path: value.path,
430
+ name: value.name,
431
+ date: /* @__PURE__ */ new Date()
432
+ })
433
+ );
434
+ };
435
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HistoryContext.Provider, { value: { list, updateList }, children });
436
+ };
437
+
438
+ // src/contexts/SidebarMainContext.tsx
439
+ var import_react12 = require("react");
440
+ var import_jsx_runtime8 = require("react/jsx-runtime");
441
+ var SidebarMainContext = (0, import_react12.createContext)({});
442
+ var SidebarMainContextProvider = ({ children }) => {
443
+ const [open, setOpen] = (0, import_react12.useState)(true);
444
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SidebarMainContext.Provider, { value: { open, setOpen }, children });
445
+ };
446
+
447
+ // src/contexts/GlobalProvider.tsx
448
+ var import_jsx_runtime9 = require("react/jsx-runtime");
449
+ function GlobalProvider({ children }) {
450
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HistoryContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BreadCrumbContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SidebarMainContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DrawerContextProvider, { children }) }) }) });
451
+ }
452
+
453
+ // src/hooks/usePrevious.tsx
454
+ var import_react13 = require("react");
455
+ var usePrevious = (value) => {
456
+ const ref = (0, import_react13.useRef)();
457
+ (0, import_react13.useEffect)(() => {
458
+ ref.current = value;
459
+ });
460
+ return ref.current;
461
+ };
462
+
463
+ // src/hooks/useStep.tsx
464
+ var import_react14 = require("react");
465
+ var useStep = (maxStep) => {
466
+ const [currentStep, setCurrentStep] = (0, import_react14.useState)(1);
467
+ const canGoToNextStep = (0, import_react14.useMemo)(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
468
+ const canGoToPrevStep = (0, import_react14.useMemo)(() => currentStep - 1 >= 1, [currentStep]);
469
+ const setStep = (0, import_react14.useCallback)(
470
+ (step) => {
471
+ const newStep = step instanceof Function ? step(currentStep) : step;
472
+ if (newStep >= 1 && newStep <= maxStep) {
473
+ setCurrentStep(newStep);
474
+ return;
475
+ }
476
+ throw new Error("Step not valid");
477
+ },
478
+ [maxStep, currentStep]
479
+ );
480
+ const goToNextStep = (0, import_react14.useCallback)(() => {
481
+ if (canGoToNextStep) {
482
+ setCurrentStep((step) => step + 1);
483
+ }
484
+ }, [canGoToNextStep]);
485
+ const goToPrevStep = (0, import_react14.useCallback)(() => {
486
+ if (canGoToPrevStep) {
487
+ setCurrentStep((step) => step - 1);
488
+ }
489
+ }, [canGoToPrevStep]);
490
+ const reset = (0, import_react14.useCallback)(() => {
491
+ setCurrentStep(1);
492
+ }, []);
493
+ return [
494
+ currentStep,
495
+ {
496
+ goToNextStep,
497
+ goToPrevStep,
498
+ canGoToNextStep,
499
+ canGoToPrevStep,
500
+ setStep,
501
+ reset
502
+ }
503
+ ];
504
+ };
505
+
506
+ // src/layout/AppBreadcrumb.tsx
507
+ var import_react15 = require("react");
508
+ var import_md = require("react-icons/md");
509
+ var import_vsc = require("react-icons/vsc");
510
+
511
+ // ../../../node_modules/react-router-dom/dist/index.js
512
+ var React2 = __toESM(require("react"));
513
+
514
+ // ../../../node_modules/react-router/dist/index.js
515
+ var React = __toESM(require("react"));
516
+
517
+ // ../../../node_modules/@remix-run/router/dist/router.js
518
+ function _extends() {
519
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
520
+ for (var i = 1; i < arguments.length; i++) {
521
+ var source = arguments[i];
522
+ for (var key in source) {
523
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
524
+ target[key] = source[key];
525
+ }
526
+ }
527
+ }
528
+ return target;
529
+ };
530
+ return _extends.apply(this, arguments);
531
+ }
532
+ var Action;
533
+ (function(Action2) {
534
+ Action2["Pop"] = "POP";
535
+ Action2["Push"] = "PUSH";
536
+ Action2["Replace"] = "REPLACE";
537
+ })(Action || (Action = {}));
538
+ function invariant(value, message) {
539
+ if (value === false || value === null || typeof value === "undefined") {
540
+ throw new Error(message);
541
+ }
542
+ }
543
+ function warning(cond, message) {
544
+ if (!cond) {
545
+ if (typeof console !== "undefined")
546
+ console.warn(message);
547
+ try {
548
+ throw new Error(message);
549
+ } catch (e) {
550
+ }
551
+ }
552
+ }
553
+ function createPath(_ref) {
554
+ let {
555
+ pathname = "/",
556
+ search = "",
557
+ hash = ""
558
+ } = _ref;
559
+ if (search && search !== "?")
560
+ pathname += search.charAt(0) === "?" ? search : "?" + search;
561
+ if (hash && hash !== "#")
562
+ pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
563
+ return pathname;
564
+ }
565
+ function parsePath(path) {
566
+ let parsedPath = {};
567
+ if (path) {
568
+ let hashIndex = path.indexOf("#");
569
+ if (hashIndex >= 0) {
570
+ parsedPath.hash = path.substr(hashIndex);
571
+ path = path.substr(0, hashIndex);
572
+ }
573
+ let searchIndex = path.indexOf("?");
574
+ if (searchIndex >= 0) {
575
+ parsedPath.search = path.substr(searchIndex);
576
+ path = path.substr(0, searchIndex);
577
+ }
578
+ if (path) {
579
+ parsedPath.pathname = path;
580
+ }
581
+ }
582
+ return parsedPath;
583
+ }
584
+ var ResultType;
585
+ (function(ResultType2) {
586
+ ResultType2["data"] = "data";
587
+ ResultType2["deferred"] = "deferred";
588
+ ResultType2["redirect"] = "redirect";
589
+ ResultType2["error"] = "error";
590
+ })(ResultType || (ResultType = {}));
591
+ function convertRouteMatchToUiMatch(match, loaderData) {
592
+ let {
593
+ route,
594
+ pathname,
595
+ params
596
+ } = match;
597
+ return {
598
+ id: route.id,
599
+ pathname,
600
+ params,
601
+ data: loaderData[route.id],
602
+ handle: route.handle
603
+ };
604
+ }
605
+ function stripBasename(pathname, basename) {
606
+ if (basename === "/")
607
+ return pathname;
608
+ if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
609
+ return null;
610
+ }
611
+ let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
612
+ let nextChar = pathname.charAt(startIndex);
613
+ if (nextChar && nextChar !== "/") {
614
+ return null;
615
+ }
616
+ return pathname.slice(startIndex) || "/";
617
+ }
618
+ function resolvePath(to, fromPathname) {
619
+ if (fromPathname === void 0) {
620
+ fromPathname = "/";
621
+ }
622
+ let {
623
+ pathname: toPathname,
624
+ search = "",
625
+ hash = ""
626
+ } = typeof to === "string" ? parsePath(to) : to;
627
+ let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
628
+ return {
629
+ pathname,
630
+ search: normalizeSearch(search),
631
+ hash: normalizeHash(hash)
632
+ };
633
+ }
634
+ function resolvePathname(relativePath, fromPathname) {
635
+ let segments = fromPathname.replace(/\/+$/, "").split("/");
636
+ let relativeSegments = relativePath.split("/");
637
+ relativeSegments.forEach((segment) => {
638
+ if (segment === "..") {
639
+ if (segments.length > 1)
640
+ segments.pop();
641
+ } else if (segment !== ".") {
642
+ segments.push(segment);
643
+ }
644
+ });
645
+ return segments.length > 1 ? segments.join("/") : "/";
646
+ }
647
+ function getInvalidPathError(char, field, dest, path) {
648
+ return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
649
+ }
650
+ function getPathContributingMatches(matches) {
651
+ return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
652
+ }
653
+ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
654
+ if (isPathRelative === void 0) {
655
+ isPathRelative = false;
656
+ }
657
+ let to;
658
+ if (typeof toArg === "string") {
659
+ to = parsePath(toArg);
660
+ } else {
661
+ to = _extends({}, toArg);
662
+ invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
663
+ invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
664
+ invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
665
+ }
666
+ let isEmptyPath = toArg === "" || to.pathname === "";
667
+ let toPathname = isEmptyPath ? "/" : to.pathname;
668
+ let from;
669
+ if (isPathRelative || toPathname == null) {
670
+ from = locationPathname;
671
+ } else {
672
+ let routePathnameIndex = routePathnames.length - 1;
673
+ if (toPathname.startsWith("..")) {
674
+ let toSegments = toPathname.split("/");
675
+ while (toSegments[0] === "..") {
676
+ toSegments.shift();
677
+ routePathnameIndex -= 1;
678
+ }
679
+ to.pathname = toSegments.join("/");
680
+ }
681
+ from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
682
+ }
683
+ let path = resolvePath(to, from);
684
+ let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
685
+ let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
686
+ if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
687
+ path.pathname += "/";
688
+ }
689
+ return path;
690
+ }
691
+ var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
692
+ var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
693
+ var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
694
+ var validMutationMethodsArr = ["post", "put", "patch", "delete"];
695
+ var validMutationMethods = new Set(validMutationMethodsArr);
696
+ var validRequestMethodsArr = ["get", ...validMutationMethodsArr];
697
+ var validRequestMethods = new Set(validRequestMethodsArr);
698
+ var UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
699
+
700
+ // ../../../node_modules/react-router/dist/index.js
701
+ function _extends2() {
702
+ _extends2 = Object.assign ? Object.assign.bind() : function(target) {
703
+ for (var i = 1; i < arguments.length; i++) {
704
+ var source = arguments[i];
705
+ for (var key in source) {
706
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
707
+ target[key] = source[key];
708
+ }
709
+ }
710
+ }
711
+ return target;
712
+ };
713
+ return _extends2.apply(this, arguments);
714
+ }
715
+ var DataRouterContext = /* @__PURE__ */ React.createContext(null);
716
+ if (process.env.NODE_ENV !== "production") {
717
+ DataRouterContext.displayName = "DataRouter";
718
+ }
719
+ var DataRouterStateContext = /* @__PURE__ */ React.createContext(null);
720
+ if (process.env.NODE_ENV !== "production") {
721
+ DataRouterStateContext.displayName = "DataRouterState";
722
+ }
723
+ var AwaitContext = /* @__PURE__ */ React.createContext(null);
724
+ if (process.env.NODE_ENV !== "production") {
725
+ AwaitContext.displayName = "Await";
726
+ }
727
+ var NavigationContext = /* @__PURE__ */ React.createContext(null);
728
+ if (process.env.NODE_ENV !== "production") {
729
+ NavigationContext.displayName = "Navigation";
730
+ }
731
+ var LocationContext = /* @__PURE__ */ React.createContext(null);
732
+ if (process.env.NODE_ENV !== "production") {
733
+ LocationContext.displayName = "Location";
734
+ }
735
+ var RouteContext = /* @__PURE__ */ React.createContext({
736
+ outlet: null,
737
+ matches: [],
738
+ isDataRoute: false
739
+ });
740
+ if (process.env.NODE_ENV !== "production") {
741
+ RouteContext.displayName = "Route";
742
+ }
743
+ var RouteErrorContext = /* @__PURE__ */ React.createContext(null);
744
+ if (process.env.NODE_ENV !== "production") {
745
+ RouteErrorContext.displayName = "RouteError";
746
+ }
747
+ function useHref(to, _temp) {
748
+ let {
749
+ relative
750
+ } = _temp === void 0 ? {} : _temp;
751
+ !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
752
+ false,
753
+ // TODO: This error is probably because they somehow have 2 versions of the
754
+ // router loaded. We can help them understand how to avoid that.
755
+ "useHref() may be used only in the context of a <Router> component."
756
+ ) : invariant(false) : void 0;
757
+ let {
758
+ basename,
759
+ navigator
760
+ } = React.useContext(NavigationContext);
761
+ let {
762
+ hash,
763
+ pathname,
764
+ search
765
+ } = useResolvedPath(to, {
766
+ relative
767
+ });
768
+ let joinedPathname = pathname;
769
+ if (basename !== "/") {
770
+ joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
771
+ }
772
+ return navigator.createHref({
773
+ pathname: joinedPathname,
774
+ search,
775
+ hash
776
+ });
777
+ }
778
+ function useInRouterContext() {
779
+ return React.useContext(LocationContext) != null;
780
+ }
781
+ function useLocation() {
782
+ !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
783
+ false,
784
+ // TODO: This error is probably because they somehow have 2 versions of the
785
+ // router loaded. We can help them understand how to avoid that.
786
+ "useLocation() may be used only in the context of a <Router> component."
787
+ ) : invariant(false) : void 0;
788
+ return React.useContext(LocationContext).location;
789
+ }
790
+ var navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
791
+ function useIsomorphicLayoutEffect2(cb) {
792
+ let isStatic = React.useContext(NavigationContext).static;
793
+ if (!isStatic) {
794
+ React.useLayoutEffect(cb);
795
+ }
796
+ }
797
+ function useNavigate() {
798
+ let {
799
+ isDataRoute
800
+ } = React.useContext(RouteContext);
801
+ return isDataRoute ? useNavigateStable() : useNavigateUnstable();
802
+ }
803
+ function useNavigateUnstable() {
804
+ !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
805
+ false,
806
+ // TODO: This error is probably because they somehow have 2 versions of the
807
+ // router loaded. We can help them understand how to avoid that.
808
+ "useNavigate() may be used only in the context of a <Router> component."
809
+ ) : invariant(false) : void 0;
810
+ let dataRouterContext = React.useContext(DataRouterContext);
811
+ let {
812
+ basename,
813
+ navigator
814
+ } = React.useContext(NavigationContext);
815
+ let {
816
+ matches
817
+ } = React.useContext(RouteContext);
818
+ let {
819
+ pathname: locationPathname
820
+ } = useLocation();
821
+ let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
822
+ let activeRef = React.useRef(false);
823
+ useIsomorphicLayoutEffect2(() => {
824
+ activeRef.current = true;
825
+ });
826
+ let navigate = React.useCallback(function(to, options) {
827
+ if (options === void 0) {
828
+ options = {};
829
+ }
830
+ process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
831
+ if (!activeRef.current)
832
+ return;
833
+ if (typeof to === "number") {
834
+ navigator.go(to);
835
+ return;
836
+ }
837
+ let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
838
+ if (dataRouterContext == null && basename !== "/") {
839
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
840
+ }
841
+ (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
842
+ }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);
843
+ return navigate;
844
+ }
845
+ function useResolvedPath(to, _temp2) {
846
+ let {
847
+ relative
848
+ } = _temp2 === void 0 ? {} : _temp2;
849
+ let {
850
+ matches
851
+ } = React.useContext(RouteContext);
852
+ let {
853
+ pathname: locationPathname
854
+ } = useLocation();
855
+ let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
856
+ return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
857
+ }
858
+ var DataRouterHook = /* @__PURE__ */ function(DataRouterHook3) {
859
+ DataRouterHook3["UseBlocker"] = "useBlocker";
860
+ DataRouterHook3["UseRevalidator"] = "useRevalidator";
861
+ DataRouterHook3["UseNavigateStable"] = "useNavigate";
862
+ return DataRouterHook3;
863
+ }(DataRouterHook || {});
864
+ var DataRouterStateHook = /* @__PURE__ */ function(DataRouterStateHook3) {
865
+ DataRouterStateHook3["UseBlocker"] = "useBlocker";
866
+ DataRouterStateHook3["UseLoaderData"] = "useLoaderData";
867
+ DataRouterStateHook3["UseActionData"] = "useActionData";
868
+ DataRouterStateHook3["UseRouteError"] = "useRouteError";
869
+ DataRouterStateHook3["UseNavigation"] = "useNavigation";
870
+ DataRouterStateHook3["UseRouteLoaderData"] = "useRouteLoaderData";
871
+ DataRouterStateHook3["UseMatches"] = "useMatches";
872
+ DataRouterStateHook3["UseRevalidator"] = "useRevalidator";
873
+ DataRouterStateHook3["UseNavigateStable"] = "useNavigate";
874
+ DataRouterStateHook3["UseRouteId"] = "useRouteId";
875
+ return DataRouterStateHook3;
876
+ }(DataRouterStateHook || {});
877
+ function getDataRouterConsoleError(hookName) {
878
+ return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
879
+ }
880
+ function useDataRouterContext(hookName) {
881
+ let ctx = React.useContext(DataRouterContext);
882
+ !ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
883
+ return ctx;
884
+ }
885
+ function useDataRouterState(hookName) {
886
+ let state = React.useContext(DataRouterStateContext);
887
+ !state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
888
+ return state;
889
+ }
890
+ function useRouteContext(hookName) {
891
+ let route = React.useContext(RouteContext);
892
+ !route ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
893
+ return route;
894
+ }
895
+ function useCurrentRouteId(hookName) {
896
+ let route = useRouteContext(hookName);
897
+ let thisRoute = route.matches[route.matches.length - 1];
898
+ !thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
899
+ return thisRoute.route.id;
900
+ }
901
+ function useRouteId() {
902
+ return useCurrentRouteId(DataRouterStateHook.UseRouteId);
903
+ }
904
+ function useNavigation() {
905
+ let state = useDataRouterState(DataRouterStateHook.UseNavigation);
906
+ return state.navigation;
907
+ }
908
+ function useMatches() {
909
+ let {
910
+ matches,
911
+ loaderData
912
+ } = useDataRouterState(DataRouterStateHook.UseMatches);
913
+ return React.useMemo(() => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]);
914
+ }
915
+ function useNavigateStable() {
916
+ let {
917
+ router
918
+ } = useDataRouterContext(DataRouterHook.UseNavigateStable);
919
+ let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
920
+ let activeRef = React.useRef(false);
921
+ useIsomorphicLayoutEffect2(() => {
922
+ activeRef.current = true;
923
+ });
924
+ let navigate = React.useCallback(function(to, options) {
925
+ if (options === void 0) {
926
+ options = {};
927
+ }
928
+ process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
929
+ if (!activeRef.current)
930
+ return;
931
+ if (typeof to === "number") {
932
+ router.navigate(to);
933
+ } else {
934
+ router.navigate(to, _extends2({
935
+ fromRouteId: id
936
+ }, options));
937
+ }
938
+ }, [router, id]);
939
+ return navigate;
940
+ }
941
+ var START_TRANSITION = "startTransition";
942
+ var startTransitionImpl = React[START_TRANSITION];
943
+ function Router(_ref5) {
944
+ let {
945
+ basename: basenameProp = "/",
946
+ children = null,
947
+ location: locationProp,
948
+ navigationType = Action.Pop,
949
+ navigator,
950
+ static: staticProp = false
951
+ } = _ref5;
952
+ !!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(false) : void 0;
953
+ let basename = basenameProp.replace(/^\/*/, "/");
954
+ let navigationContext = React.useMemo(() => ({
955
+ basename,
956
+ navigator,
957
+ static: staticProp
958
+ }), [basename, navigator, staticProp]);
959
+ if (typeof locationProp === "string") {
960
+ locationProp = parsePath(locationProp);
961
+ }
962
+ let {
963
+ pathname = "/",
964
+ search = "",
965
+ hash = "",
966
+ state = null,
967
+ key = "default"
968
+ } = locationProp;
969
+ let locationContext = React.useMemo(() => {
970
+ let trailingPathname = stripBasename(pathname, basename);
971
+ if (trailingPathname == null) {
972
+ return null;
973
+ }
974
+ return {
975
+ location: {
976
+ pathname: trailingPathname,
977
+ search,
978
+ hash,
979
+ state,
980
+ key
981
+ },
982
+ navigationType
983
+ };
984
+ }, [basename, pathname, search, hash, state, key, navigationType]);
985
+ process.env.NODE_ENV !== "production" ? warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash + '" because it does not start with the ') + "basename, so the <Router> won't render anything.") : void 0;
986
+ if (locationContext == null) {
987
+ return null;
988
+ }
989
+ return /* @__PURE__ */ React.createElement(NavigationContext.Provider, {
990
+ value: navigationContext
991
+ }, /* @__PURE__ */ React.createElement(LocationContext.Provider, {
992
+ children,
993
+ value: locationContext
994
+ }));
995
+ }
996
+ var neverSettledPromise = new Promise(() => {
997
+ });
998
+
999
+ // ../../../node_modules/react-router-dom/dist/index.js
1000
+ function _extends3() {
1001
+ _extends3 = Object.assign ? Object.assign.bind() : function(target) {
1002
+ for (var i = 1; i < arguments.length; i++) {
1003
+ var source = arguments[i];
1004
+ for (var key in source) {
1005
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1006
+ target[key] = source[key];
1007
+ }
1008
+ }
1009
+ }
1010
+ return target;
1011
+ };
1012
+ return _extends3.apply(this, arguments);
1013
+ }
1014
+ function _objectWithoutPropertiesLoose(source, excluded) {
1015
+ if (source == null)
1016
+ return {};
1017
+ var target = {};
1018
+ var sourceKeys = Object.keys(source);
1019
+ var key, i;
1020
+ for (i = 0; i < sourceKeys.length; i++) {
1021
+ key = sourceKeys[i];
1022
+ if (excluded.indexOf(key) >= 0)
1023
+ continue;
1024
+ target[key] = source[key];
1025
+ }
1026
+ return target;
1027
+ }
1028
+ var defaultMethod = "get";
1029
+ var defaultEncType = "application/x-www-form-urlencoded";
1030
+ function isHtmlElement(object) {
1031
+ return object != null && typeof object.tagName === "string";
1032
+ }
1033
+ function isButtonElement(object) {
1034
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
1035
+ }
1036
+ function isFormElement(object) {
1037
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
1038
+ }
1039
+ function isInputElement(object) {
1040
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
1041
+ }
1042
+ function isModifiedEvent(event) {
1043
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
1044
+ }
1045
+ function shouldProcessLinkClick(event, target) {
1046
+ return event.button === 0 && // Ignore everything but left clicks
1047
+ (!target || target === "_self") && // Let browser handle "target=_blank" etc.
1048
+ !isModifiedEvent(event);
1049
+ }
1050
+ var _formDataSupportsSubmitter = null;
1051
+ function isFormDataSubmitterSupported() {
1052
+ if (_formDataSupportsSubmitter === null) {
1053
+ try {
1054
+ new FormData(
1055
+ document.createElement("form"),
1056
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
1057
+ 0
1058
+ );
1059
+ _formDataSupportsSubmitter = false;
1060
+ } catch (e) {
1061
+ _formDataSupportsSubmitter = true;
1062
+ }
1063
+ }
1064
+ return _formDataSupportsSubmitter;
1065
+ }
1066
+ var supportedFormEncTypes = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
1067
+ function getFormEncType(encType) {
1068
+ if (encType != null && !supportedFormEncTypes.has(encType)) {
1069
+ process.env.NODE_ENV !== "production" ? warning(false, '"' + encType + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + defaultEncType + '"')) : void 0;
1070
+ return null;
1071
+ }
1072
+ return encType;
1073
+ }
1074
+ function getFormSubmissionInfo(target, basename) {
1075
+ let method;
1076
+ let action;
1077
+ let encType;
1078
+ let formData;
1079
+ let body;
1080
+ if (isFormElement(target)) {
1081
+ let attr = target.getAttribute("action");
1082
+ action = attr ? stripBasename(attr, basename) : null;
1083
+ method = target.getAttribute("method") || defaultMethod;
1084
+ encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
1085
+ formData = new FormData(target);
1086
+ } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
1087
+ let form = target.form;
1088
+ if (form == null) {
1089
+ throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
1090
+ }
1091
+ let attr = target.getAttribute("formaction") || form.getAttribute("action");
1092
+ action = attr ? stripBasename(attr, basename) : null;
1093
+ method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
1094
+ encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
1095
+ formData = new FormData(form, target);
1096
+ if (!isFormDataSubmitterSupported()) {
1097
+ let {
1098
+ name,
1099
+ type,
1100
+ value
1101
+ } = target;
1102
+ if (type === "image") {
1103
+ let prefix = name ? name + "." : "";
1104
+ formData.append(prefix + "x", "0");
1105
+ formData.append(prefix + "y", "0");
1106
+ } else if (name) {
1107
+ formData.append(name, value);
1108
+ }
1109
+ }
1110
+ } else if (isHtmlElement(target)) {
1111
+ throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
1112
+ } else {
1113
+ method = defaultMethod;
1114
+ action = null;
1115
+ encType = defaultEncType;
1116
+ body = target;
1117
+ }
1118
+ if (formData && encType === "text/plain") {
1119
+ body = formData;
1120
+ formData = void 0;
1121
+ }
1122
+ return {
1123
+ action,
1124
+ method: method.toLowerCase(),
1125
+ encType,
1126
+ formData,
1127
+ body
1128
+ };
1129
+ }
1130
+ var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"];
1131
+ var _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];
1132
+ var _excluded3 = ["reloadDocument", "replace", "state", "method", "action", "onSubmit", "submit", "relative", "preventScrollReset"];
1133
+ var START_TRANSITION2 = "startTransition";
1134
+ var startTransitionImpl2 = React2[START_TRANSITION2];
1135
+ function HistoryRouter(_ref3) {
1136
+ let {
1137
+ basename,
1138
+ children,
1139
+ future,
1140
+ history
1141
+ } = _ref3;
1142
+ let [state, setStateImpl] = React2.useState({
1143
+ action: history.action,
1144
+ location: history.location
1145
+ });
1146
+ let {
1147
+ v7_startTransition
1148
+ } = future || {};
1149
+ let setState = React2.useCallback((newState) => {
1150
+ v7_startTransition && startTransitionImpl2 ? startTransitionImpl2(() => setStateImpl(newState)) : setStateImpl(newState);
1151
+ }, [setStateImpl, v7_startTransition]);
1152
+ React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
1153
+ return /* @__PURE__ */ React2.createElement(Router, {
1154
+ basename,
1155
+ children,
1156
+ location: state.location,
1157
+ navigationType: state.action,
1158
+ navigator: history
1159
+ });
1160
+ }
1161
+ if (process.env.NODE_ENV !== "production") {
1162
+ HistoryRouter.displayName = "unstable_HistoryRouter";
1163
+ }
1164
+ var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
1165
+ var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1166
+ var Link = /* @__PURE__ */ React2.forwardRef(function LinkWithRef(_ref4, ref) {
1167
+ let {
1168
+ onClick,
1169
+ relative,
1170
+ reloadDocument,
1171
+ replace,
1172
+ state,
1173
+ target,
1174
+ to,
1175
+ preventScrollReset
1176
+ } = _ref4, rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
1177
+ let {
1178
+ basename
1179
+ } = React2.useContext(NavigationContext);
1180
+ let absoluteHref;
1181
+ let isExternal = false;
1182
+ if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
1183
+ absoluteHref = to;
1184
+ if (isBrowser) {
1185
+ try {
1186
+ let currentUrl = new URL(window.location.href);
1187
+ let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
1188
+ let path = stripBasename(targetUrl.pathname, basename);
1189
+ if (targetUrl.origin === currentUrl.origin && path != null) {
1190
+ to = path + targetUrl.search + targetUrl.hash;
1191
+ } else {
1192
+ isExternal = true;
1193
+ }
1194
+ } catch (e) {
1195
+ process.env.NODE_ENV !== "production" ? warning(false, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.') : void 0;
1196
+ }
1197
+ }
1198
+ }
1199
+ let href = useHref(to, {
1200
+ relative
1201
+ });
1202
+ let internalOnClick = useLinkClickHandler(to, {
1203
+ replace,
1204
+ state,
1205
+ target,
1206
+ preventScrollReset,
1207
+ relative
1208
+ });
1209
+ function handleClick(event) {
1210
+ if (onClick)
1211
+ onClick(event);
1212
+ if (!event.defaultPrevented) {
1213
+ internalOnClick(event);
1214
+ }
1215
+ }
1216
+ return (
1217
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1218
+ /* @__PURE__ */ React2.createElement("a", _extends3({}, rest, {
1219
+ href: absoluteHref || href,
1220
+ onClick: isExternal || reloadDocument ? onClick : handleClick,
1221
+ ref,
1222
+ target
1223
+ }))
1224
+ );
1225
+ });
1226
+ if (process.env.NODE_ENV !== "production") {
1227
+ Link.displayName = "Link";
1228
+ }
1229
+ var NavLink = /* @__PURE__ */ React2.forwardRef(function NavLinkWithRef(_ref5, ref) {
1230
+ let {
1231
+ "aria-current": ariaCurrentProp = "page",
1232
+ caseSensitive = false,
1233
+ className: classNameProp = "",
1234
+ end = false,
1235
+ style: styleProp,
1236
+ to,
1237
+ children
1238
+ } = _ref5, rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
1239
+ let path = useResolvedPath(to, {
1240
+ relative: rest.relative
1241
+ });
1242
+ let location = useLocation();
1243
+ let routerState = React2.useContext(DataRouterStateContext);
1244
+ let {
1245
+ navigator
1246
+ } = React2.useContext(NavigationContext);
1247
+ let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
1248
+ let locationPathname = location.pathname;
1249
+ let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
1250
+ if (!caseSensitive) {
1251
+ locationPathname = locationPathname.toLowerCase();
1252
+ nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
1253
+ toPathname = toPathname.toLowerCase();
1254
+ }
1255
+ let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
1256
+ let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
1257
+ let ariaCurrent = isActive ? ariaCurrentProp : void 0;
1258
+ let className;
1259
+ if (typeof classNameProp === "function") {
1260
+ className = classNameProp({
1261
+ isActive,
1262
+ isPending
1263
+ });
1264
+ } else {
1265
+ className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
1266
+ }
1267
+ let style = typeof styleProp === "function" ? styleProp({
1268
+ isActive,
1269
+ isPending
1270
+ }) : styleProp;
1271
+ return /* @__PURE__ */ React2.createElement(Link, _extends3({}, rest, {
1272
+ "aria-current": ariaCurrent,
1273
+ className,
1274
+ ref,
1275
+ style,
1276
+ to
1277
+ }), typeof children === "function" ? children({
1278
+ isActive,
1279
+ isPending
1280
+ }) : children);
1281
+ });
1282
+ if (process.env.NODE_ENV !== "production") {
1283
+ NavLink.displayName = "NavLink";
1284
+ }
1285
+ var Form = /* @__PURE__ */ React2.forwardRef((props, ref) => {
1286
+ let submit = useSubmit();
1287
+ return /* @__PURE__ */ React2.createElement(FormImpl, _extends3({}, props, {
1288
+ submit,
1289
+ ref
1290
+ }));
1291
+ });
1292
+ if (process.env.NODE_ENV !== "production") {
1293
+ Form.displayName = "Form";
1294
+ }
1295
+ var FormImpl = /* @__PURE__ */ React2.forwardRef((_ref6, forwardedRef) => {
1296
+ let {
1297
+ reloadDocument,
1298
+ replace,
1299
+ state,
1300
+ method = defaultMethod,
1301
+ action,
1302
+ onSubmit,
1303
+ submit,
1304
+ relative,
1305
+ preventScrollReset
1306
+ } = _ref6, props = _objectWithoutPropertiesLoose(_ref6, _excluded3);
1307
+ let formMethod = method.toLowerCase() === "get" ? "get" : "post";
1308
+ let formAction = useFormAction(action, {
1309
+ relative
1310
+ });
1311
+ let submitHandler = (event) => {
1312
+ onSubmit && onSubmit(event);
1313
+ if (event.defaultPrevented)
1314
+ return;
1315
+ event.preventDefault();
1316
+ let submitter = event.nativeEvent.submitter;
1317
+ let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
1318
+ submit(submitter || event.currentTarget, {
1319
+ method: submitMethod,
1320
+ replace,
1321
+ state,
1322
+ relative,
1323
+ preventScrollReset
1324
+ });
1325
+ };
1326
+ return /* @__PURE__ */ React2.createElement("form", _extends3({
1327
+ ref: forwardedRef,
1328
+ method: formMethod,
1329
+ action: formAction,
1330
+ onSubmit: reloadDocument ? onSubmit : submitHandler
1331
+ }, props));
1332
+ });
1333
+ if (process.env.NODE_ENV !== "production") {
1334
+ FormImpl.displayName = "FormImpl";
1335
+ }
1336
+ function ScrollRestoration(_ref7) {
1337
+ let {
1338
+ getKey,
1339
+ storageKey
1340
+ } = _ref7;
1341
+ useScrollRestoration({
1342
+ getKey,
1343
+ storageKey
1344
+ });
1345
+ return null;
1346
+ }
1347
+ if (process.env.NODE_ENV !== "production") {
1348
+ ScrollRestoration.displayName = "ScrollRestoration";
1349
+ }
1350
+ var DataRouterHook2;
1351
+ (function(DataRouterHook3) {
1352
+ DataRouterHook3["UseScrollRestoration"] = "useScrollRestoration";
1353
+ DataRouterHook3["UseSubmit"] = "useSubmit";
1354
+ DataRouterHook3["UseSubmitFetcher"] = "useSubmitFetcher";
1355
+ DataRouterHook3["UseFetcher"] = "useFetcher";
1356
+ })(DataRouterHook2 || (DataRouterHook2 = {}));
1357
+ var DataRouterStateHook2;
1358
+ (function(DataRouterStateHook3) {
1359
+ DataRouterStateHook3["UseFetchers"] = "useFetchers";
1360
+ DataRouterStateHook3["UseScrollRestoration"] = "useScrollRestoration";
1361
+ })(DataRouterStateHook2 || (DataRouterStateHook2 = {}));
1362
+ function getDataRouterConsoleError2(hookName) {
1363
+ return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
1364
+ }
1365
+ function useDataRouterContext2(hookName) {
1366
+ let ctx = React2.useContext(DataRouterContext);
1367
+ !ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
1368
+ return ctx;
1369
+ }
1370
+ function useDataRouterState2(hookName) {
1371
+ let state = React2.useContext(DataRouterStateContext);
1372
+ !state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
1373
+ return state;
1374
+ }
1375
+ function useLinkClickHandler(to, _temp) {
1376
+ let {
1377
+ target,
1378
+ replace: replaceProp,
1379
+ state,
1380
+ preventScrollReset,
1381
+ relative
1382
+ } = _temp === void 0 ? {} : _temp;
1383
+ let navigate = useNavigate();
1384
+ let location = useLocation();
1385
+ let path = useResolvedPath(to, {
1386
+ relative
1387
+ });
1388
+ return React2.useCallback((event) => {
1389
+ if (shouldProcessLinkClick(event, target)) {
1390
+ event.preventDefault();
1391
+ let replace = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);
1392
+ navigate(to, {
1393
+ replace,
1394
+ state,
1395
+ preventScrollReset,
1396
+ relative
1397
+ });
1398
+ }
1399
+ }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);
1400
+ }
1401
+ function validateClientSideSubmission() {
1402
+ if (typeof document === "undefined") {
1403
+ throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
1404
+ }
1405
+ }
1406
+ function useSubmit() {
1407
+ let {
1408
+ router
1409
+ } = useDataRouterContext2(DataRouterHook2.UseSubmit);
1410
+ let {
1411
+ basename
1412
+ } = React2.useContext(NavigationContext);
1413
+ let currentRouteId = useRouteId();
1414
+ return React2.useCallback(function(target, options) {
1415
+ if (options === void 0) {
1416
+ options = {};
1417
+ }
1418
+ validateClientSideSubmission();
1419
+ let {
1420
+ action,
1421
+ method,
1422
+ encType,
1423
+ formData,
1424
+ body
1425
+ } = getFormSubmissionInfo(target, basename);
1426
+ router.navigate(options.action || action, {
1427
+ preventScrollReset: options.preventScrollReset,
1428
+ formData,
1429
+ body,
1430
+ formMethod: options.method || method,
1431
+ formEncType: options.encType || encType,
1432
+ replace: options.replace,
1433
+ state: options.state,
1434
+ fromRouteId: currentRouteId
1435
+ });
1436
+ }, [router, basename, currentRouteId]);
1437
+ }
1438
+ function useFormAction(action, _temp2) {
1439
+ let {
1440
+ relative
1441
+ } = _temp2 === void 0 ? {} : _temp2;
1442
+ let {
1443
+ basename
1444
+ } = React2.useContext(NavigationContext);
1445
+ let routeContext = React2.useContext(RouteContext);
1446
+ !routeContext ? process.env.NODE_ENV !== "production" ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;
1447
+ let [match] = routeContext.matches.slice(-1);
1448
+ let path = _extends3({}, useResolvedPath(action ? action : ".", {
1449
+ relative
1450
+ }));
1451
+ let location = useLocation();
1452
+ if (action == null) {
1453
+ path.search = location.search;
1454
+ if (match.route.index) {
1455
+ let params = new URLSearchParams(path.search);
1456
+ params.delete("index");
1457
+ path.search = params.toString() ? "?" + params.toString() : "";
1458
+ }
1459
+ }
1460
+ if ((!action || action === ".") && match.route.index) {
1461
+ path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
1462
+ }
1463
+ if (basename !== "/") {
1464
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
1465
+ }
1466
+ return createPath(path);
1467
+ }
1468
+ var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
1469
+ var savedScrollPositions = {};
1470
+ function useScrollRestoration(_temp3) {
1471
+ let {
1472
+ getKey,
1473
+ storageKey
1474
+ } = _temp3 === void 0 ? {} : _temp3;
1475
+ let {
1476
+ router
1477
+ } = useDataRouterContext2(DataRouterHook2.UseScrollRestoration);
1478
+ let {
1479
+ restoreScrollPosition,
1480
+ preventScrollReset
1481
+ } = useDataRouterState2(DataRouterStateHook2.UseScrollRestoration);
1482
+ let {
1483
+ basename
1484
+ } = React2.useContext(NavigationContext);
1485
+ let location = useLocation();
1486
+ let matches = useMatches();
1487
+ let navigation = useNavigation();
1488
+ React2.useEffect(() => {
1489
+ window.history.scrollRestoration = "manual";
1490
+ return () => {
1491
+ window.history.scrollRestoration = "auto";
1492
+ };
1493
+ }, []);
1494
+ usePageHide(React2.useCallback(() => {
1495
+ if (navigation.state === "idle") {
1496
+ let key = (getKey ? getKey(location, matches) : null) || location.key;
1497
+ savedScrollPositions[key] = window.scrollY;
1498
+ }
1499
+ sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
1500
+ window.history.scrollRestoration = "auto";
1501
+ }, [storageKey, getKey, navigation.state, location, matches]));
1502
+ if (typeof document !== "undefined") {
1503
+ React2.useLayoutEffect(() => {
1504
+ try {
1505
+ let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
1506
+ if (sessionPositions) {
1507
+ savedScrollPositions = JSON.parse(sessionPositions);
1508
+ }
1509
+ } catch (e) {
1510
+ }
1511
+ }, [storageKey]);
1512
+ React2.useLayoutEffect(() => {
1513
+ let getKeyWithoutBasename = getKey && basename !== "/" ? (location2, matches2) => getKey(
1514
+ // Strip the basename to match useLocation()
1515
+ _extends3({}, location2, {
1516
+ pathname: stripBasename(location2.pathname, basename) || location2.pathname
1517
+ }),
1518
+ matches2
1519
+ ) : getKey;
1520
+ let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);
1521
+ return () => disableScrollRestoration && disableScrollRestoration();
1522
+ }, [router, basename, getKey]);
1523
+ React2.useLayoutEffect(() => {
1524
+ if (restoreScrollPosition === false) {
1525
+ return;
1526
+ }
1527
+ if (typeof restoreScrollPosition === "number") {
1528
+ window.scrollTo(0, restoreScrollPosition);
1529
+ return;
1530
+ }
1531
+ if (location.hash) {
1532
+ let el = document.getElementById(decodeURIComponent(location.hash.slice(1)));
1533
+ if (el) {
1534
+ el.scrollIntoView();
1535
+ return;
1536
+ }
1537
+ }
1538
+ if (preventScrollReset === true) {
1539
+ return;
1540
+ }
1541
+ window.scrollTo(0, 0);
1542
+ }, [location, restoreScrollPosition, preventScrollReset]);
1543
+ }
1544
+ }
1545
+ function usePageHide(callback, options) {
1546
+ let {
1547
+ capture
1548
+ } = options || {};
1549
+ React2.useEffect(() => {
1550
+ let opts = capture != null ? {
1551
+ capture
1552
+ } : void 0;
1553
+ window.addEventListener("pagehide", callback, opts);
1554
+ return () => {
1555
+ window.removeEventListener("pagehide", callback, opts);
1556
+ };
1557
+ }, [callback, capture]);
1558
+ }
1559
+
1560
+ // src/styled-components/breadcrumb.ts
1561
+ var import_styled_components = __toESM(require("styled-components"));
1562
+ var Breadcrumb = import_styled_components.default.div`
1563
+ font-family: 'Inter', sans-serif;
1564
+ padding: 10px 0px;
1565
+ text-transform: uppercase;
1566
+ font-weight: bold;
1567
+ font-size: 0.9rem;
1568
+ color: #92190e;
1569
+ display: flex;
1570
+ justify-content: space-between;
1571
+ align-items: center;
1572
+ background-color: white;
1573
+ align-items: center;
1574
+
1575
+ .link {
1576
+ color: #92190e;
1577
+ &:hover {
1578
+ color: #92190e;
1579
+ cursor: pointer;
1580
+ }
1581
+ }
1582
+ `;
1583
+ var BreadCrumbTitle = import_styled_components.default.div`
1584
+ font-family: 'Inter', sans-serif;
1585
+ font-weight: bold;
1586
+ font-size: 1.2rem !important;
1587
+ color: #92190e;
1588
+ margin-top: 15px;
1589
+ `;
1590
+ var TitlePage = import_styled_components.default.div`
1591
+ font-family: 'Inter', sans-serif;
1592
+ font-weight: bold;
1593
+ font-size: 1.2rem !important;
1594
+ color: #92190e;
1595
+ margin-top: 15px;
1596
+ `;
1597
+
1598
+ // src/styled-components/menu.ts
1599
+ var import_styled_components2 = __toESM(require("styled-components"));
1600
+ var MenuItem = (0, import_styled_components2.default)(Link)`
1601
+ text-decoration: none;
1602
+ color: black;
1603
+ display: flex;
1604
+ justify-content: ${(props) => props.type === "col" ? "center" : "flex-start"};
1605
+ align-items: center;
1606
+ flex-direction: ${(props) => props.type === "col" ? "column" : "row"};
1607
+ border: 1px solid transparent;
1608
+ width: ${(props) => props.width ? props.width : "100px"};
1609
+ padding: 10px;
1610
+ text-decoration: none !important;
1611
+ &:hover {
1612
+ box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
1613
+ }
1614
+
1615
+ .icon {
1616
+ width: 30px;
1617
+ text-decoration: none;
1618
+ }
1619
+ .text {
1620
+ text-align: center;
1621
+ font-size: 12px;
1622
+ text-decoration: none !important;
1623
+ color: black;
1624
+ margin-top: ${(props) => props.type === "col" ? "0px" : "15px"};
1625
+ &:hover {
1626
+ text-decoration: none !important;
1627
+ }
1628
+ }
1629
+ `;
1630
+ var MenuTitle = import_styled_components2.default.p`
1631
+ font-size: 16px;
1632
+ font-weight: bold !important;
1633
+ `;
1634
+
1635
+ // src/styled-components/navbar.ts
1636
+ var import_styled_components3 = __toESM(require("styled-components"));
1637
+ var Navbar = import_styled_components3.default.nav`
1638
+ background: ${(props) => {
1639
+ return !props.gradient ? ` linear-gradient( 90.03deg, #92190e 80.71%, #f0b92c 107.21% ) !important` : `#92190e`;
1640
+ }};
1641
+ z-index: 10;
1642
+ width: 100%;
1643
+ max-width: 100vw;
1644
+ display: flex;
1645
+ justify-content: space-between;
1646
+ padding-top: 10px;
1647
+ padding-bottom: 10px;
1648
+ position: sticky;
1649
+ top: 0px;
1650
+ height: 40px;
1651
+ .input {
1652
+ border-radius: 2px !important;
1653
+ padding: 2px !important;
1654
+ font-size: 12px !important;
1655
+ height: 20px !important;
1656
+ border: none;
1657
+ &:focus {
1658
+ outline: none !important;
1659
+ }
1660
+ ::placeholder {
1661
+ color: #92190e;
1662
+ }
1663
+ @media (max-width: 470px) {
1664
+ display: none;
1665
+ }
1666
+ }
1667
+ .dialog {
1668
+ z-index: 20000 !important;
1669
+ position: absolute;
1670
+ width: 400px;
1671
+ height: 500px;
1672
+ min-height: 500px;
1673
+ overflow: scroll;
1674
+ overflow-x: hidden;
1675
+ min-width: 400px;
1676
+ max-width: 400px;
1677
+ background-color: white;
1678
+ border-radius: 20px;
1679
+ top: 50%;
1680
+ left: 50%;
1681
+ transform: translate(-50%, -50%);
1682
+ }
1683
+ `;
1684
+
1685
+ // src/styled-components/options.ts
1686
+ var import_styled_components4 = __toESM(require("styled-components"));
1687
+ var MenuOptions = import_styled_components4.default.div`
1688
+ font-size: bold;
1689
+ display: flex;
1690
+ width: 100%;
1691
+ gap: 10px;
1692
+ justify-content: flex-start;
1693
+ border-bottom: 1px solid #e6e6e6;
1694
+ background-color: white;
1695
+ flex-wrap: wrap;
1696
+ .button-option {
1697
+ display: flex;
1698
+ flex-direction: row;
1699
+ justify-content: space-between;
1700
+ align-items: center;
1701
+ gap: 5px;
1702
+ padding: 10px 20px;
1703
+ font-weight: bold;
1704
+ background-color: white !important;
1705
+ border: none;
1706
+ .icon {
1707
+ color: #92190e;
1708
+ }
1709
+ .text {
1710
+ @media (max-width: 470px) {
1711
+ display: none;
1712
+ }
1713
+ }
1714
+ }
1715
+ `;
1716
+
1717
+ // src/styled-components/sidebar.ts
1718
+ var import_styled_components5 = __toESM(require("styled-components"));
1719
+ var ItemSidebar = import_styled_components5.default.div`
1720
+ padding: 10px 25px;
1721
+ display: flex;
1722
+ align-items: center;
1723
+ gap: 30px;
1724
+ font-family: 'Inter', sans-serif;
1725
+ &:hover {
1726
+ color: white !important;
1727
+ text-decoration: none;
1728
+ background: #92190e;
1729
+ .icon-sidebar {
1730
+ color: white !important;
1731
+ }
1732
+ }
1733
+ &:active {
1734
+ color: white !important;
1735
+ text-decoration: none;
1736
+ background: #92190e;
1737
+ .icon-sidebar {
1738
+ color: white !important;
1739
+ }
1740
+ }
1741
+ `;
1742
+ var SidebarNavigation = import_styled_components5.default.nav`
1743
+ position: ${({ fixed = true }) => fixed ? "fixed" : "static"};
1744
+ top: 0;
1745
+ left: 0;
1746
+ min-height: 100vh;
1747
+ box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
1748
+ -webkit-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
1749
+ -moz-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
1750
+ background: white;
1751
+ font-family: 'Inter', sans-serif;
1752
+ padding: 0;
1753
+ width: ${({ fixed = true, active = true }) => fixed ? active ? "270px" : "0px" : "auto"};
1754
+ z-index: 11;
1755
+ transition: width 0.2s ease-in-out;
1756
+
1757
+ overflow: hidden;
1758
+ height: 100vh;
1759
+ overflow-y: auto;
1760
+ box-shadow: ${({ shadow = true }) => shadow ? "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px" : "none"};
1761
+
1762
+ &::-webkit-scrollbar {
1763
+ display: none !important;
1764
+ }
1765
+ .nav {
1766
+ flex-wrap: nowrap;
1767
+ flex-direction: column;
1768
+ font-size: 12px;
1769
+
1770
+ .nav-item {
1771
+ .collapse {
1772
+ z-index: 999;
1773
+ }
1774
+
1775
+ .collapse.show,
1776
+ .collapsing {
1777
+ background: rgba(0, 0, 0);
1778
+ }
1779
+
1780
+ .nav-link {
1781
+ align-items: center;
1782
+ display: flex;
1783
+ padding-left: 40px;
1784
+ white-space: nowrap;
1785
+
1786
+ color: #92190e;
1787
+ i {
1788
+ margin-right: 20px;
1789
+ }
1790
+ .menu-title {
1791
+ color: inherit;
1792
+ display: inline-block;
1793
+ line-height: 1;
1794
+ color: black;
1795
+ vertical-align: middle;
1796
+ cursor: pointer;
1797
+ }
1798
+ }
1799
+
1800
+ &.active {
1801
+ > .nav-link {
1802
+ color: white;
1803
+ }
1804
+
1805
+ &.not-navigation-link {
1806
+ position: relative;
1807
+ }
1808
+ }
1809
+
1810
+ &:not(.sub-menu) {
1811
+ > .nav-item {
1812
+ &:hover {
1813
+ &:not(.nav-profile) {
1814
+ > .nav-link {
1815
+ background: $sidebar-light-menu-hover-bg;
1816
+ color: $sidebar-light-menu-hover-color;
1817
+ }
1818
+ }
1819
+ }
1820
+ }
1821
+ }
1822
+
1823
+ &.sub-menu {
1824
+ margin-bottom: 0;
1825
+ padding: $sidebar-submenu-padding;
1826
+
1827
+ .rtl & {
1828
+ padding: 0 4rem 0 0;
1829
+ }
1830
+
1831
+ .nav-item {
1832
+ .nav-link {
1833
+ color: $sidebar-light-submenu-color;
1834
+ padding: $sidebar-submenu-item-padding;
1835
+ font-size: $sidebar-submenu-font-size;
1836
+ line-height: 1;
1837
+ height: auto;
1838
+
1839
+ &.active {
1840
+ color: $sidebar-light-menu-active-color;
1841
+ background: transparent;
1842
+
1843
+ &:before {
1844
+ background: $sidebar-light-menu-active-color;
1845
+ }
1846
+ }
1847
+ }
1848
+
1849
+ &:hover {
1850
+ > .nav-link {
1851
+ background: $sidebar-light-submenu-hover-bg;
1852
+ color: $sidebar-light-submenu-hover-color;
1853
+
1854
+ &:before {
1855
+ background: $sidebar-light-submenu-hover-color;
1856
+ }
1857
+ }
1858
+ }
1859
+ }
1860
+ }
1861
+
1862
+ &.sub-menu2 {
1863
+ margin-bottom: 0;
1864
+ padding: $sidebar-submenu2-padding;
1865
+
1866
+ .rtl & {
1867
+ padding: 0 4rem 0 0;
1868
+ }
1869
+
1870
+ .nav-item {
1871
+ .nav-link {
1872
+ color: $sidebar-light-submenu-color;
1873
+ padding: $sidebar-submenu-item-padding;
1874
+ font-size: $sidebar-submenu-font-size;
1875
+ line-height: 1;
1876
+ height: auto;
1877
+
1878
+ &.active {
1879
+ color: $sidebar-light-menu-active-color;
1880
+ background: transparent;
1881
+
1882
+ &:before {
1883
+ background: $sidebar-light-menu-active-color;
1884
+ }
1885
+ }
1886
+ }
1887
+
1888
+ &:hover {
1889
+ > .nav-link {
1890
+ background: $sidebar-light-submenu-hover-bg;
1891
+ color: $sidebar-light-submenu-hover-color;
1892
+
1893
+ &:before {
1894
+ background: $sidebar-light-submenu-hover-color;
1895
+ }
1896
+ }
1897
+ }
1898
+ }
1899
+ }
1900
+ }
1901
+ }
1902
+ `;
1903
+ var ConfigurationOption = import_styled_components5.default.nav`
1904
+ position: fixed;
1905
+ top: 50px;
1906
+ right: 0;
1907
+ min-height: 100vh;
1908
+ box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
1909
+ -webkit-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
1910
+ -moz-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
1911
+ min-height: calc(100vh);
1912
+
1913
+ font-family: 'Inter', sans-serif;
1914
+ padding: 0;
1915
+ width: ${(props) => props.active ? "300px" : "0px"};
1916
+ z-index: 11;
1917
+ transition: width 0.2s ease-in-out;
1918
+ overflow: hidden !important;
1919
+ `;
1920
+ var ItemLinkSidebar = (0, import_styled_components5.default)(Link)`
1921
+ padding: 10px 25px;
1922
+ display: flex;
1923
+ align-items: center;
1924
+ gap: 30px;
1925
+ color: #343a40;
1926
+ text-decoration: none;
1927
+ font-family: 'Inter', sans-serif;
1928
+ &:hover {
1929
+ color: white !important;
1930
+ text-decoration: none;
1931
+ background: #92190e;
1932
+ .icon-sidebar {
1933
+ color: white !important;
1934
+ }
1935
+ }
1936
+ `;
1937
+
1938
+ // src/styled-components/template.ts
1939
+ var import_styled_components6 = __toESM(require("styled-components"));
1940
+ var Main = import_styled_components6.default.main`
1941
+ width: 100%;
1942
+ min-height: 90vh;
1943
+ display: flex;
1944
+ flex-direction: column;
1945
+ justify-content: space-between;
1946
+ background-color: white;
1947
+ padding: 10px 60px;
1948
+ position: relative;
1949
+ padding-left: ${(props) => {
1950
+ return props.activeDrawer ? `300px` : `30px`;
1951
+ }};
1952
+ @media (max-width: 470px) {
1953
+ padding: 10px 10px;
1954
+ }
1955
+ `;
1956
+ var CloseIcon = import_styled_components6.default.button`
1957
+ color: black;
1958
+ text-decoration: none;
1959
+ border: none;
1960
+ padding: 10px 10px;
1961
+ background-color: white;
1962
+ border-radius: 50%;
1963
+ display: flex;
1964
+ align-items: center;
1965
+ justify-content: center;
1966
+ cursor: pointer;
1967
+ top: 10px;
1968
+ right: 10px;
1969
+ text-align: center;
1970
+ &:hover {
1971
+ color: black;
1972
+ text-decoration: none;
1973
+ background-color: #e8e8e8;
1974
+ }
1975
+ `;
1976
+
1977
+ // src/layout/AppBreadcrumb.tsx
1978
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1979
+ var AppBreadCrumb = ({ title, paths }) => {
1980
+ const { setRoutes } = (0, import_react15.useContext)(BreadCrumbContext);
1981
+ (0, import_react15.useEffect)(() => {
1982
+ if (!(paths == null ? void 0 : paths.length))
1983
+ return;
1984
+ setRoutes(paths != null ? paths : []);
1985
+ }, []);
1986
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BreadCrumbTitle, { children: title != null ? title : "Home" });
1987
+ };
1988
+ var AppBreadCrumbNav = ({ paths }) => {
1989
+ const { active, path, routes, setRoutes } = (0, import_react15.useContext)(BreadCrumbContext);
1990
+ const navigate = useNavigate();
1991
+ const { updateList } = (0, import_react15.useContext)(HistoryContext);
1992
+ (0, import_react15.useEffect)(() => {
1993
+ updateList({ name: active, path });
1994
+ }, [path, active]);
1995
+ (0, import_react15.useEffect)(() => {
1996
+ setRoutes(paths != null ? paths : []);
1997
+ }, [paths]);
1998
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Breadcrumb, { children: [
1999
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "d-flex align-items-center", children: [
2000
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Link, { to: "/", className: "link", children: "HOME" }),
2001
+ routes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_vsc.VscChevronRight, { color: "black" }),
2002
+ routes.length > 0 ? routes.map((i, idx, arr) => {
2003
+ if (i.route === -1) {
2004
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "link", onClick: () => navigate(-1), children: [
2005
+ i.title,
2006
+ " ",
2007
+ idx + 1 === arr.length ? "" : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_vsc.VscChevronRight, { color: "black" })
2008
+ ] }, idx);
2009
+ }
2010
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Link, { to: i.route, className: "link", children: [
2011
+ i.title,
2012
+ " ",
2013
+ idx + 1 === arr.length ? "" : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_vsc.VscChevronRight, { color: "black" })
2014
+ ] }, idx);
2015
+ }) : ""
2016
+ ] }),
2017
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2018
+ CloseIcon,
2019
+ {
2020
+ onClick: () => {
2021
+ if ((routes == null ? void 0 : routes.length) === 1) {
2022
+ navigate("/");
2023
+ setRoutes([]);
2024
+ return;
2025
+ }
2026
+ navigate(`${routes && routes[(routes == null ? void 0 : routes.length) - 2].route}`);
2027
+ },
2028
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_md.MdClose, { fontSize: 20 })
2029
+ }
2030
+ )
2031
+ ] });
2032
+ };
2033
+
2034
+ // src/layout/AppLoader.tsx
2035
+ var import_react16 = require("react");
2036
+ var import_react_dom = __toESM(require("react-dom"));
2037
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2038
+ var LoaderGrid = () => {
2039
+ const Loader = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "k-loading-mask", children: [
2040
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "k-loading-text", children: "Loading" }),
2041
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "k-loading-image" }),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "k-loading-color" })
2043
+ ] });
2044
+ const gridContent = document && document.querySelector(".k-grid-content");
2045
+ const reportContent = document && document.querySelector(".loading-report");
2046
+ return gridContent ? import_react_dom.default.createPortal(Loader, gridContent) : reportContent ? import_react_dom.default.createPortal(Loader, reportContent) : Loader;
2047
+ };
2048
+ var AppLoader = (props) => {
2049
+ const { type = "grid", parent, minDuration } = props;
2050
+ const parentEl = type === "grid" ? document.querySelector(parent != null ? parent : ".k-grid-container") : parent ? document.querySelector(parent) : null;
2051
+ const Loading = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: `${type}-loading k-loading-mask`, children: [
2052
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "k-loading-text", children: "Loading" }),
2053
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "k-loading-image" }),
2054
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "k-loading-color" })
2055
+ ] });
2056
+ (0, import_react16.useEffect)(() => {
2057
+ if (type === "button") {
2058
+ const loadingEl = document.createElement("div");
2059
+ loadingEl.className = "icon button-loading k-loading-mask";
2060
+ loadingEl.innerHTML = `
2061
+ <div class="k-loading-image"></div>
2062
+ `;
2063
+ if (parentEl) {
2064
+ const button = parentEl;
2065
+ button.classList.add("btn-loading");
2066
+ button.disabled = true;
2067
+ button.insertBefore(loadingEl, button.firstChild);
2068
+ }
2069
+ return () => {
2070
+ if (parentEl) {
2071
+ if (minDuration) {
2072
+ setTimeout(() => {
2073
+ const button = parentEl;
2074
+ button.classList.remove("btn-loading");
2075
+ button.removeChild(loadingEl);
2076
+ button.disabled = false;
2077
+ }, minDuration);
2078
+ } else {
2079
+ const button = parentEl;
2080
+ button.classList.remove("btn-loading");
2081
+ button.removeChild(loadingEl);
2082
+ button.disabled = false;
2083
+ }
2084
+ }
2085
+ };
2086
+ }
2087
+ }, []);
2088
+ return type === "button" ? null : parentEl ? import_react_dom.default.createPortal(Loading, parentEl) : Loading;
2089
+ };
2090
+
2091
+ // src/layout/NavOptions.tsx
2092
+ var import_bs = require("react-icons/bs");
2093
+ var import_fi = require("react-icons/fi");
2094
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2095
+ var NavOptions = ({ onCreate, onRefresh, onSelect, onClear, onExpandScreen, CustomButtons }) => {
2096
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MenuOptions, { children: [
2097
+ onCreate && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { className: "button-option", onClick: onCreate, children: [
2098
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_fi.FiPlusSquare, { className: "icon" }),
2099
+ " ",
2100
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text", children: "New" })
2101
+ ] }),
2102
+ onRefresh && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { className: "button-option", onClick: onRefresh, children: [
2103
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_fi.FiRefreshCcw, { className: "icon" }),
2104
+ " ",
2105
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text", children: "Refresh" })
2106
+ ] }),
2107
+ onSelect && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { className: "button-option", onClick: onSelect, children: [
2108
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_fi.FiCheckCircle, { className: "icon" }),
2109
+ " ",
2110
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text", children: "Select All" })
2111
+ ] }),
2112
+ onClear && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { className: "button-option", onClick: onClear, children: [
2113
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_fi.FiFilter, { className: "icon" }),
2114
+ " ",
2115
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text", children: "Clear Filters" })
2116
+ ] }),
2117
+ onExpandScreen && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { className: "button-option", onClick: onExpandScreen, children: [
2118
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_bs.BsArrowsFullscreen, { className: "icon" }),
2119
+ " ",
2120
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text", children: "Full Page" })
2121
+ ] }),
2122
+ CustomButtons == null ? void 0 : CustomButtons.map((custom, index) => {
2123
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { className: "button-option", onClick: custom.fn, children: [
2124
+ custom.Icon !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(custom.Icon, { className: "icon" }),
2125
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text", children: custom.title })
2126
+ ] }, index);
2127
+ })
2128
+ ] });
2129
+ };
2130
+
2131
+ // src/layout/title.tsx
2132
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2133
+ var Title = ({ title }) => {
2134
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TitlePage, { children: title != null ? title : "Home" });
2135
+ };
2136
+ // Annotate the CommonJS export names for ESM import in node:
2137
+ 0 && (module.exports = {
2138
+ AppBreadCrumb,
2139
+ AppBreadCrumbNav,
2140
+ AppLoader,
2141
+ BreadCrumbContext,
2142
+ BreadCrumbContextProvider,
2143
+ BreadCrumbTitle,
2144
+ Breadcrumb,
2145
+ Button,
2146
+ CloseIcon,
2147
+ DrawerContext,
2148
+ DrawerContextProvider,
2149
+ DropEnumList,
2150
+ GlobalProvider,
2151
+ HistoryContext,
2152
+ HistoryContextProvider,
2153
+ ItemLinkSidebar,
2154
+ ItemSidebar,
2155
+ LoaderGrid,
2156
+ Main,
2157
+ MenuItem,
2158
+ MenuOptions,
2159
+ MenuTitle,
2160
+ NavOptions,
2161
+ Navbar,
2162
+ SidebarMainContext,
2163
+ SidebarMainContextProvider,
2164
+ SidebarNavigation,
2165
+ Tab,
2166
+ Tabs,
2167
+ Title,
2168
+ useLocalStorage,
2169
+ usePrevious,
2170
+ useStep
2171
+ });
2172
+ /*! Bundled license information:
2173
+
2174
+ @remix-run/router/dist/router.js:
2175
+ (**
2176
+ * @remix-run/router v1.9.0
2177
+ *
2178
+ * Copyright (c) Remix Software Inc.
2179
+ *
2180
+ * This source code is licensed under the MIT license found in the
2181
+ * LICENSE.md file in the root directory of this source tree.
2182
+ *
2183
+ * @license MIT
2184
+ *)
2185
+
2186
+ react-router/dist/index.js:
2187
+ (**
2188
+ * React Router v6.16.0
2189
+ *
2190
+ * Copyright (c) Remix Software Inc.
2191
+ *
2192
+ * This source code is licensed under the MIT license found in the
2193
+ * LICENSE.md file in the root directory of this source tree.
2194
+ *
2195
+ * @license MIT
2196
+ *)
2197
+
2198
+ react-router-dom/dist/index.js:
2199
+ (**
2200
+ * React Router DOM v6.16.0
2201
+ *
2202
+ * Copyright (c) Remix Software Inc.
2203
+ *
2204
+ * This source code is licensed under the MIT license found in the
2205
+ * LICENSE.md file in the root directory of this source tree.
2206
+ *
2207
+ * @license MIT
2208
+ *)
2209
+ */