@beweco/aurora-ui 0.1.6 → 0.1.8

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.
Files changed (79) hide show
  1. package/dist/assets/css/styles.css +1 -1
  2. package/dist/index.cjs.js +2077 -1440
  3. package/dist/index.esm.js +2074 -1445
  4. package/dist/types/components/analytics-card/AnalyticsCard.d.ts +10 -0
  5. package/dist/types/components/analytics-card/AnalyticsCard.d.ts.map +1 -0
  6. package/dist/types/components/analytics-card/AnalyticsCard.types.d.ts +65 -0
  7. package/dist/types/components/analytics-card/AnalyticsCard.types.d.ts.map +1 -0
  8. package/dist/types/components/analytics-card/index.d.ts +3 -0
  9. package/dist/types/components/analytics-card/index.d.ts.map +1 -0
  10. package/dist/types/components/autocomplete/index.d.ts +1 -1
  11. package/dist/types/components/autocomplete/index.d.ts.map +1 -1
  12. package/dist/types/components/button/index.d.ts +2 -2
  13. package/dist/types/components/button/index.d.ts.map +1 -1
  14. package/dist/types/components/copy-text/CopyText.d.ts +12 -0
  15. package/dist/types/components/copy-text/CopyText.d.ts.map +1 -0
  16. package/dist/types/components/copy-text/CopyText.types.d.ts +8 -0
  17. package/dist/types/components/copy-text/CopyText.types.d.ts.map +1 -0
  18. package/dist/types/components/copy-text/index.d.ts +3 -0
  19. package/dist/types/components/copy-text/index.d.ts.map +1 -0
  20. package/dist/types/components/date-selector/DateSelector.d.ts +9 -0
  21. package/dist/types/components/date-selector/DateSelector.d.ts.map +1 -0
  22. package/dist/types/components/date-selector/DateSelector.types.d.ts +37 -0
  23. package/dist/types/components/date-selector/DateSelector.types.d.ts.map +1 -0
  24. package/dist/types/components/date-selector/index.d.ts +3 -0
  25. package/dist/types/components/date-selector/index.d.ts.map +1 -0
  26. package/dist/types/components/datepicker/index.d.ts +2 -2
  27. package/dist/types/components/datepicker/index.d.ts.map +1 -1
  28. package/dist/types/components/daterangepicker/index.d.ts +2 -2
  29. package/dist/types/components/daterangepicker/index.d.ts.map +1 -1
  30. package/dist/types/components/h1/H1.d.ts +3 -0
  31. package/dist/types/components/h1/H1.d.ts.map +1 -0
  32. package/dist/types/components/h1/index.d.ts +2 -0
  33. package/dist/types/components/h1/index.d.ts.map +1 -0
  34. package/dist/types/components/input/Input.d.ts.map +1 -1
  35. package/dist/types/components/multi-step-wizard/MultiStepWizard.d.ts +3 -0
  36. package/dist/types/components/multi-step-wizard/MultiStepWizard.d.ts.map +1 -0
  37. package/dist/types/components/multi-step-wizard/MultiStepWizard.types.d.ts +25 -0
  38. package/dist/types/components/multi-step-wizard/MultiStepWizard.types.d.ts.map +1 -0
  39. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.d.ts +4 -0
  40. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.d.ts.map +1 -0
  41. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.types.d.ts +13 -0
  42. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.types.d.ts.map +1 -0
  43. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.d.ts +4 -0
  44. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.d.ts.map +1 -0
  45. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.types.d.ts +8 -0
  46. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.types.d.ts.map +1 -0
  47. package/dist/types/components/multi-step-wizard/_internal/index.d.ts +3 -0
  48. package/dist/types/components/multi-step-wizard/_internal/index.d.ts.map +1 -0
  49. package/dist/types/components/multi-step-wizard/index.d.ts +3 -0
  50. package/dist/types/components/multi-step-wizard/index.d.ts.map +1 -0
  51. package/dist/types/components/p/P.d.ts.map +1 -1
  52. package/dist/types/components/phone/Phone.d.ts.map +1 -1
  53. package/dist/types/components/promotional-banner/PromotionalBanner.d.ts +7 -0
  54. package/dist/types/components/promotional-banner/PromotionalBanner.d.ts.map +1 -0
  55. package/dist/types/components/promotional-banner/PromotionalBanner.types.d.ts +69 -0
  56. package/dist/types/components/promotional-banner/PromotionalBanner.types.d.ts.map +1 -0
  57. package/dist/types/components/promotional-banner/index.d.ts +3 -0
  58. package/dist/types/components/promotional-banner/index.d.ts.map +1 -0
  59. package/dist/types/components/row-steps/RowSteps.d.ts +4 -0
  60. package/dist/types/components/row-steps/RowSteps.d.ts.map +1 -0
  61. package/dist/types/components/row-steps/RowSteps.types.d.ts +21 -0
  62. package/dist/types/components/row-steps/RowSteps.types.d.ts.map +1 -0
  63. package/dist/types/components/row-steps/index.d.ts +3 -0
  64. package/dist/types/components/row-steps/index.d.ts.map +1 -0
  65. package/dist/types/components/step-indicator/StepIndicator.d.ts +4 -0
  66. package/dist/types/components/step-indicator/StepIndicator.d.ts.map +1 -0
  67. package/dist/types/components/step-indicator/StepIndicator.types.d.ts +14 -0
  68. package/dist/types/components/step-indicator/StepIndicator.types.d.ts.map +1 -0
  69. package/dist/types/components/step-indicator/index.d.ts +3 -0
  70. package/dist/types/components/step-indicator/index.d.ts.map +1 -0
  71. package/dist/types/components/vertical-steps/VerticalSteps.d.ts +4 -0
  72. package/dist/types/components/vertical-steps/VerticalSteps.d.ts.map +1 -0
  73. package/dist/types/components/vertical-steps/VerticalSteps.types.d.ts +57 -0
  74. package/dist/types/components/vertical-steps/VerticalSteps.types.d.ts.map +1 -0
  75. package/dist/types/components/vertical-steps/index.d.ts +3 -0
  76. package/dist/types/components/vertical-steps/index.d.ts.map +1 -0
  77. package/dist/types/index.d.ts +19 -11
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/package.json +4 -2
package/dist/index.cjs.js CHANGED
@@ -4,6 +4,8 @@ var react = require('@heroui/react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var react$1 = require('@iconify/react');
7
+ var recharts = require('recharts');
8
+ var framerMotion = require('framer-motion');
7
9
  var reactDom = require('react-dom');
8
10
  var useTheme = require('@heroui/use-theme');
9
11
 
@@ -62,25 +64,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
62
64
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
63
65
  };
64
66
 
65
- /**
66
- * AutoComplete genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
67
- *
68
- * Reglas aplicadas:
69
- * - Variant: Bordered (por defecto)
70
- * - Radius: md (por defecto)
71
- * - labelPlacement: Outside
72
- * - Size: sm, md, lg (configurable)
73
- */
74
- var AutoComplete = function (_a) {
75
- var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, props = __rest(_a, ["label", "id", "size", "variant", "radius"]);
76
- var generatedId = React.useId();
77
- var autoId = id || generatedId;
78
- return (jsxRuntime.jsxs("div", { children: [label && (jsxRuntime.jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsxRuntime.jsx(react.Autocomplete, __assign({}, props, { id: autoId, label: undefined, labelPlacement: "outside", variant: variant, size: size, radius: radius, classNames: {
79
- base: "[&_[data-slot=input-wrapper][data-focus=true]]:!border-primary-500",
80
- popoverContent: "[&_li[data-hover=true]]:!bg-primary-50 [&_li[data-hover=true]]:!text-default-600 [&_li]:!text-default-500",
81
- } }))] }));
82
- };
83
-
84
67
  exports.HolidayType = void 0;
85
68
  (function (HolidayType) {
86
69
  HolidayType["SingleDay"] = "singleDay";
@@ -152,10 +135,11 @@ var Input = function (_a) {
152
135
  return (jsxRuntime.jsx(react.Input, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
153
136
  label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
154
137
  inputWrapper: "focus-within:!border-primary-500",
138
+ errorMessage: "text-left",
155
139
  } })));
156
140
  };
157
141
 
158
- var defaultTranslations$3 = {
142
+ var defaultTranslations$7 = {
159
143
  addHolidayTitle: "Add holiday",
160
144
  dayOption: "Day",
161
145
  dateRangeOption: "Date range",
@@ -179,7 +163,7 @@ var INITIAL_HOLIDAY_STATE = {
179
163
  */
180
164
  var AddHolidayForm = function (_a) {
181
165
  var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
182
- var t = __assign(__assign({}, defaultTranslations$3), translations);
166
+ var t = __assign(__assign({}, defaultTranslations$7), translations);
183
167
  var _b = React.useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
184
168
  /**
185
169
  * A boolean flag that determines if a date has been set.
@@ -239,1249 +223,176 @@ var AddHolidayForm = function (_a) {
239
223
  }, "aria-label": t.optionalTitle }), jsxRuntime.jsx("div", { className: "w-full", children: jsxRuntime.jsx(Button, __assign({ size: "sm", fullWidth: true, variant: "flat", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), onPress: handleAddHoliday, isDisabled: !isDateSet }, buttonProps, { children: t.addButton })) })] }));
240
224
  };
241
225
 
242
- function normalizeClass(value) {
243
- if (typeof value === "string") {
244
- return value || undefined;
226
+ var H2 = function (_a) {
227
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
228
+ return (jsxRuntime.jsx("h2", __assign({ className: react.cn("text-lg font-semibold", className) }, props, { children: children })));
229
+ };
230
+
231
+ var P = function (_a) {
232
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
233
+ return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-sm text-default-500 font-normal", className) }, props, { children: children })));
234
+ };
235
+
236
+ var defaultTranslations$6 = {
237
+ title: "Analytics",
238
+ description: "Monthly growth of your metrics during the selected period",
239
+ viewDetails: "View Details",
240
+ exportData: "Export Data",
241
+ setAlert: "Set Alert",
242
+ months6: "6 Months",
243
+ months3: "3 Months",
244
+ days30: "30 Days",
245
+ days7: "7 Days",
246
+ hours24: "24 Hours",
247
+ };
248
+ var formatValue = function (value, type) {
249
+ if (type === "number") {
250
+ if (value >= 1000000) {
251
+ return "".concat((value / 1000000).toFixed(1), "M");
252
+ }
253
+ if (value >= 1000) {
254
+ return "".concat((value / 1000).toFixed(0), "k");
255
+ }
256
+ return value.toLocaleString();
245
257
  }
246
- if (Array.isArray(value)) {
247
- return value.filter(Boolean).join(" ") || undefined;
258
+ if (type === "percentage") {
259
+ return "".concat(value, "%");
248
260
  }
249
- return undefined;
250
- }
251
- var getSectionClasses = function (isCollapsed, sectionClassesProp) {
252
- if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
253
- return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
254
- var k = _a[0], v = _a[1];
255
- return [k, normalizeClass(v)];
256
- }))), { base: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
257
- "p-0 max-w-[44px]": isCollapsed,
258
- })), group: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.group, {
259
- "flex flex-col gap-1": isCollapsed,
260
- })), heading: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.heading, {
261
- hidden: isCollapsed,
262
- })) }));
261
+ return value;
263
262
  };
264
- var getItemClasses = function (isCollapsed, itemClassesProp) {
265
- if (itemClassesProp === void 0) { itemClassesProp = {}; }
266
- return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
267
- var k = _a[0], v = _a[1];
268
- return [k, normalizeClass(v)];
269
- }))), { base: normalizeClass(react.cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
270
- "w-11 h-11 gap-0 p-0": isCollapsed,
271
- })) }));
263
+ var formatMonth = function (month) {
264
+ var _a;
265
+ var monthNumber = (_a = {
266
+ Jan: 0,
267
+ Feb: 1,
268
+ Mar: 2,
269
+ Apr: 3,
270
+ May: 4,
271
+ Jun: 5,
272
+ Jul: 6,
273
+ Aug: 7,
274
+ Sep: 8,
275
+ Oct: 9,
276
+ Nov: 10,
277
+ Dec: 11,
278
+ }[month]) !== null && _a !== void 0 ? _a : 0;
279
+ return new Intl.DateTimeFormat("en-US", { month: "long" }).format(new Date(2024, monthNumber, 1));
272
280
  };
273
-
274
- var EnumMenuNavListItem;
275
- (function (EnumMenuNavListItem) {
276
- EnumMenuNavListItem["Nest"] = "nest";
277
- })(EnumMenuNavListItem || (EnumMenuNavListItem = {}));
278
-
279
281
  /**
280
- * @component MenuNavList
281
- * @description A versatile navigation list component that can be displayed in an expanded or collapsed state.
282
- * It supports nested items, sections, and tooltips for items in the collapsed state.
283
- *
284
- * @param {MenuNavListProps} props - Props for configuring the component.
285
- * @param {MenuNavListItem[]} props.items - Array of items to display in the list.
286
- * @param {boolean} [props.isCollapsed] - If `true`, the menu is displayed in its collapsed state (icons only).
287
- * @param {React.Key} [props.defaultSelectedKey] - The key of the default selected item.
288
- * @param {(key: React.Key) => void} [props.onSelect] - Callback executed when an item is selected.
289
- * @param {boolean} [props.hideEndContent] - If `true`, hides the end content of the items.
290
- * @param {object} [props.sectionClasses] - CSS classes to customize the sections.
291
- * @param {object} [props.itemClasses] - CSS classes to customize the items.
292
- * @param {string} [props.iconClassName] - CSS class for the icons.
293
- * @param {object} [props.classNames] - CSS classes to customize the Listbox component.
294
- * @param {string} [props.className] - CSS class for the main container.
282
+ * AnalyticsCard genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
295
283
  *
296
- * @forwardRef
284
+ * 🚨 This component requires installing the `recharts` package:
285
+ * `npm install recharts`
297
286
  */
298
- var MenuNavList = React.forwardRef(function (_a, ref) {
299
- var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
300
- var _d = React.useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
301
- // Component styles
302
- var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
303
- var itemClasses = getItemClasses(isCollapsed, itemClassesProp);
304
- // Handles the click event on an item, updating the selection state.
305
- // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
306
- var handleItemPress = React.useCallback(function (item, parentKey) {
307
- var keySelected = typeof parentKey === "string" ? parentKey : item.key;
308
- setSelected(keySelected);
309
- // Force blur to remove hover state after click.
310
- if (document.activeElement instanceof HTMLElement) {
311
- document.activeElement.blur();
312
- }
313
- }, [setSelected]);
314
- // Renders the item displayed inside the Popover when the menu is collapsed.
315
- var renderCompactItem = React.useCallback(function (item, parentKey) {
316
- var _a, _b;
317
- return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
318
- }, [handleItemPress, iconClassName]);
319
- // Renders a nested item, i.e., an item that has sub-items.
320
- // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
321
- var renderNestItem = React.useCallback(function (item) {
322
- var _a, _b, _c, _d, _e, _f, _g;
323
- var isNestType = item.items &&
324
- ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
325
- (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
326
- if (isNestType) {
327
- item.href = undefined;
328
- }
329
- return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, classNames: {
330
- base: react.cn({
331
- "h-auto p-0": !isCollapsed && isNestType,
332
- }, {
333
- "inline-block w-11": isCollapsed && isNestType,
334
- }, {
335
- "data-[selected=true]:bg-primary-100 h-11 justify-center items-center flex": isCollapsed && isNestType,
336
- }, "rounded-large"),
337
- }, endContent: isCollapsed || isNestType || hideEndContent
338
- ? null
339
- : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-foreground", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), title: isCollapsed || isNestType ? null : item.title }),
340
- isCollapsed && isNestType ? (jsxRuntime.jsxs(react.Popover, { placement: "right", offset: 10, children: [jsxRuntime.jsx(react.PopoverTrigger, { children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", classNames: {
341
- base: "text-default-500",
342
- }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) }) }) }), jsxRuntime.jsx(react.PopoverContent, { className: "p-0", children: jsxRuntime.jsxs("div", { className: "min-w-[200px] rounded-large p-2", children: [jsxRuntime.jsx("div", { className: "p-2 text-small font-semibold text-default-500", children: item.title }), jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", "aria-label": "Nested menu items", items: item.items, variant: "flat", children: item.items && ((_e = item.items) === null || _e === void 0 ? void 0 : _e.length) > 0
343
- ? item.items.map(function (child) {
344
- return renderCompactItem(child, item.key);
345
- })
346
- : renderCompactItem(item) })] }) })] })) : null,
347
- !isCollapsed && isNestType ? (jsxRuntime.jsx(react.Accordion, { className: "p-0", children: jsxRuntime.jsx(react.AccordionItem, { "aria-label": item.title, classNames: {
348
- heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
349
- trigger: "p-0",
350
- content: "py-0 pl-4",
351
- }, title: item.icon ? (jsxRuntime.jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" }), jsxRuntime.jsx("span", { className: "text-small font-medium text-default-500 group-data-[selected=true]:text-default-600", children: item.title })] })) : (((_f = item.startContent) !== null && _f !== void 0 ? _f : null)), children: item.items && ((_g = item.items) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", classNames: {
352
- list: react.cn("border-l border-default-200 pl-4"),
353
- }, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
354
- }, [isCollapsed, hideEndContent, iconClassName, items, selected]);
355
- // Renders a simple item (without children) in the navigation list.
356
- // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
357
- var renderItem = React.useCallback(function (item, parentKey) {
358
- var _a, _b, _c, _d;
359
- var isNestType = item.items &&
360
- ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
361
- (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
362
- if (isNestType) {
363
- return renderNestItem(item);
364
- }
365
- var isItemSelected = selected === item.key;
366
- return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
367
- base: "text-default-500",
368
- }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
369
- },
370
- // eslint-disable-next-line react-hooks/exhaustive-deps
371
- [isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
372
- return (jsxRuntime.jsx(react.Listbox, __assign({ ref: ref, hideSelectedIcon: true, as: "nav", className: react.cn("list-none", className), classNames: __assign(__assign({}, classNames), { list: react.cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign(__assign({}, itemClasses), { base: react.cn("px-3 min-h-11 rounded-large h-[44px] data-[selected=true]:bg-primary-100", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base), title: react.cn("text-small font-medium text-default-500 group-data-[selected=true]:text-default-600 ", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.title) }), items: items, selectedKeys: [selected], selectionMode: "single", variant: "flat" }, props, { children: function (item) {
373
- var _a, _b;
374
- return item.items &&
375
- ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
376
- (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest ? (renderNestItem(item)) : item.items && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxRuntime.jsx(react.ListboxSection, { classNames: sectionClasses, showDivider: isCollapsed, title: item.title, children: item.items.map(renderItem) }, item.key)) : (renderItem(item));
377
- } }), isCollapsed ? "compact" : "default"));
378
- });
379
- MenuNavList.displayName = "MenuNavList";
287
+ var AnalyticsCard = function (_a) {
288
+ var _b, _c;
289
+ var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
290
+ var t = __assign(__assign({}, defaultTranslations$6), translations);
291
+ var _h = React.useState((_c = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""), activeChart = _h[0], setActiveChart = _h[1];
292
+ var activeChartData = React.useMemo(function () {
293
+ var _a;
294
+ var chart = data.find(function (d) { return d.key === activeChart; });
295
+ return {
296
+ chartData: (_a = chart === null || chart === void 0 ? void 0 : chart.chartData) !== null && _a !== void 0 ? _a : [],
297
+ color: (chart === null || chart === void 0 ? void 0 : chart.changeType) === "positive"
298
+ ? "success"
299
+ : (chart === null || chart === void 0 ? void 0 : chart.changeType) === "negative"
300
+ ? "danger"
301
+ : "default",
302
+ suffix: chart === null || chart === void 0 ? void 0 : chart.suffix,
303
+ type: chart === null || chart === void 0 ? void 0 : chart.type,
304
+ };
305
+ }, [activeChart, data]);
306
+ var chartData = activeChartData.chartData, color = activeChartData.color, suffix = activeChartData.suffix, type = activeChartData.type;
307
+ var handleChartChange = function (chartKey) {
308
+ setActiveChart(chartKey);
309
+ onChartChange === null || onChartChange === void 0 ? void 0 : onChartChange(chartKey);
310
+ };
311
+ var handleMenuAction = function (action) {
312
+ onMenuAction === null || onMenuAction === void 0 ? void 0 : onMenuAction(action);
313
+ };
314
+ var handleTimePeriodChange = function (period) {
315
+ onTimePeriodChange === null || onTimePeriodChange === void 0 ? void 0 : onTimePeriodChange(period);
316
+ };
317
+ return (jsxRuntime.jsx(react.Card, __assign({ as: "dl", className: "dark:border-default-100 border border-transparent" }, props, { children: jsxRuntime.jsxs("section", { className: "flex flex-col flex-nowrap", children: [jsxRuntime.jsx("div", { className: "flex flex-col justify-between gap-y-2 p-6", children: jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-2", children: [jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-0", children: [jsxRuntime.jsx(H2, { children: t.title }), jsxRuntime.jsx(P, { children: t.description })] }), jsxRuntime.jsx(react.Spacer, { y: 2 }), showTimePeriods && (jsxRuntime.jsxs(react.Tabs, { size: "md", className: " self-end", onSelectionChange: function (key) { return handleTimePeriodChange(String(key)); }, children: [jsxRuntime.jsx(react.Tab, { title: t.months6 }, "6-months"), jsxRuntime.jsx(react.Tab, { title: t.months3 }, "3-months"), jsxRuntime.jsx(react.Tab, { title: t.days30 }, "30-days"), jsxRuntime.jsx(react.Tab, { title: t.days7 }, "7-days"), jsxRuntime.jsx(react.Tab, { title: t.hours24 }, "24-hours")] })), showMetricCards && (jsxRuntime.jsx("div", { className: "mt-2 flex w-full items-center", children: jsxRuntime.jsx("div", { className: "-my-3 flex w-full max-w-[800px] items-center gap-x-3 overflow-x-auto py-3", children: data.map(function (_a) {
318
+ var key = _a.key, change = _a.change, changeType = _a.changeType, type = _a.type, value = _a.value, title = _a.title;
319
+ return (jsxRuntime.jsxs("button", { type: "button", className: react.cn("rounded-medium flex w-full flex-col gap-2 p-3 transition-colors", {
320
+ "bg-default-100": activeChart === key,
321
+ }), onClick: function () { return handleChartChange(key); }, children: [jsxRuntime.jsx("span", { className: react.cn("text-small text-default-500 font-medium transition-colors", {
322
+ "text-primary": activeChart === key,
323
+ }), children: title }), jsxRuntime.jsxs("div", { className: "flex items-center gap-x-3", children: [jsxRuntime.jsx("span", { className: "text-foreground text-2xl font-bold", children: formatValue(value, type) }), jsxRuntime.jsx(react.Chip, { classNames: {
324
+ content: "font-medium",
325
+ }, color: changeType === "positive"
326
+ ? "success"
327
+ : changeType === "negative"
328
+ ? "danger"
329
+ : "default", radius: "md", size: "sm", startContent: changeType === "positive" ? (jsxRuntime.jsx(IconComponent, { icon: "solar:arrow-right-up-linear", size: "sm" })) : changeType === "negative" ? (jsxRuntime.jsx(IconComponent, { icon: "solar:arrow-right-down-linear", size: "sm" })) : (jsxRuntime.jsx(IconComponent, { icon: "solar:arrow-right-linear", size: "sm" })), variant: "bordered", children: jsxRuntime.jsx("span", { children: change }) })] })] }, key));
330
+ }) }) }))] }) }), jsxRuntime.jsx(recharts.ResponsiveContainer, { className: "min-h-[300px] [&_.recharts-surface]:outline-hidden", height: "100%", width: "100%", children: jsxRuntime.jsxs(recharts.AreaChart, { accessibilityLayer: true, data: chartData, height: 300, margin: {
331
+ left: 0,
332
+ right: 0,
333
+ }, width: 500, children: [jsxRuntime.jsx("defs", { children: jsxRuntime.jsxs("linearGradient", { id: "colorGradient", x1: "0", x2: "0", y1: "0", y2: "1", children: [jsxRuntime.jsx("stop", { offset: "10%", stopColor: "hsl(var(--heroui-".concat(color, "-500))"), stopOpacity: 0.3 }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: "hsl(var(--heroui-".concat(color, "-100))"), stopOpacity: 0.1 })] }) }), jsxRuntime.jsx(recharts.CartesianGrid, { horizontalCoordinatesGenerator: function () { return [200, 150, 100, 50]; }, stroke: "hsl(var(--heroui-default-200))", strokeDasharray: "3 3", vertical: false }), jsxRuntime.jsx(recharts.XAxis, { axisLine: false, dataKey: "month", style: {
334
+ fontSize: "var(--heroui-font-size-tiny)",
335
+ transform: "translateX(-40px)",
336
+ }, tickLine: false }), jsxRuntime.jsx(recharts.Tooltip, { content: function (_a) {
337
+ var label = _a.label, payload = _a.payload;
338
+ return (jsxRuntime.jsx("div", { className: "rounded-medium bg-foreground text-tiny shadow-small flex h-auto min-w-[120px] items-center gap-x-2 p-2", children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col gap-y-0", children: [payload === null || payload === void 0 ? void 0 : payload.map(function (p, index) {
339
+ var name = p.name;
340
+ var value = p.value;
341
+ return (jsxRuntime.jsx("div", { className: "flex w-full items-center gap-x-2", children: jsxRuntime.jsxs("div", { className: "text-small text-background flex w-full items-center gap-x-1", children: [jsxRuntime.jsx("span", { children: formatValue(value, type) }), jsxRuntime.jsx("span", { children: suffix })] }) }, "".concat(index, "-").concat(name)));
342
+ }), jsxRuntime.jsxs("span", { className: "text-small text-foreground-400 font-medium", children: [formatMonth(String(label || "")), " 25, 2024"] })] }) }));
343
+ }, cursor: {
344
+ strokeWidth: 0,
345
+ } }), jsxRuntime.jsx(recharts.Area, { activeDot: {
346
+ stroke: "hsl(var(--heroui-".concat(color, "))"),
347
+ strokeWidth: 2,
348
+ fill: "hsl(var(--heroui-background))",
349
+ r: 5,
350
+ }, dot: {
351
+ stroke: "hsl(var(--heroui-".concat(color, "))"),
352
+ strokeWidth: 2,
353
+ fill: "hsl(var(--heroui-".concat(color, "))"),
354
+ r: 4,
355
+ }, animationDuration: 1000, animationEasing: "ease", dataKey: "value", fill: "url(#colorGradient)", stroke: "hsl(var(--heroui-".concat(color, "))"), strokeWidth: 2, type: "monotone" })] }) }), showDropdownMenu && (jsxRuntime.jsxs(react.Dropdown, { classNames: {
356
+ content: "min-w-[120px]",
357
+ }, placement: "bottom-end", children: [jsxRuntime.jsx(react.DropdownTrigger, { children: jsxRuntime.jsx(react.Button, { isIconOnly: true, className: "absolute top-2 right-2 w-auto rounded-full", size: "lg", variant: "bordered", children: jsxRuntime.jsx(IconComponent, { icon: "solar:menu-dots-bold", size: "sm" }) }) }), jsxRuntime.jsxs(react.DropdownMenu, { itemClasses: {
358
+ title: "text-tiny",
359
+ }, variant: "bordered", onAction: function (key) { return handleMenuAction(String(key)); }, children: [jsxRuntime.jsx(react.DropdownItem, { children: t.viewDetails }, "view-details"), jsxRuntime.jsx(react.DropdownItem, { children: t.exportData }, "export-data"), jsxRuntime.jsx(react.DropdownItem, { children: t.setAlert }, "set-alert")] })] }))] }) })));
360
+ };
380
361
 
381
362
  /**
382
- * Sidebar menu component for navigation and user actions.
383
- * @param commerceInfo - Object with logo and name of the company.
384
- * @param userInfo - Object with user avatar, name, and email.
385
- * @param helpButton - Help button configuration.
386
- * @param upgradeCard - Optional upgrade card configuration.
387
- * @param isOpenSidebar - Controls sidebar visibility.
388
- * @param onOpenSidebarChange - Callback to open/close sidebar.
363
+ * AutoComplete genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
364
+ *
365
+ * Reglas aplicadas:
366
+ * - Variant: Bordered (por defecto)
367
+ * - Radius: md (por defecto)
368
+ * - labelPlacement: Outside
369
+ * - Size: sm, md, lg (configurable)
389
370
  */
390
- var MenuComponent = React.memo(function Menu(_a) {
391
- var commerceInfo = _a.commerceInfo, userInfo = _a.userInfo, helpButton = _a.helpButton, upgradeCard = _a.upgradeCard, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, menuItems = _a.menuItems;
392
- // State to control menu collapse on desktop devices
393
- var _b = React.useState(false), isCollapsed = _b[0], setIsCollapsed = _b[1];
394
- // Memoized handlers for performance
395
- var handleSidebarClose = React.useCallback(function () {
396
- onOpenSidebarChange === null || onOpenSidebarChange === void 0 ? void 0 : onOpenSidebarChange(false);
397
- }, [onOpenSidebarChange]);
398
- var handleCollapseToggle = React.useCallback(function () {
399
- setIsCollapsed(function (prev) { return !prev; });
400
- }, []);
401
- var handleUpgradeClick = React.useCallback(function () {
402
- if (upgradeCard) {
403
- window.open(upgradeCard.buttonLink, "_blank");
404
- }
405
- }, [upgradeCard]);
406
- var handleHelpClick = React.useCallback(function () {
407
- window.open(helpButton.redirect, "_blank");
408
- }, [helpButton]);
409
- if (!isOpenSidebar) {
410
- return null;
411
- }
412
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { type: "button", "aria-label": "Close sidebar", className: "fixed inset-0 bg-black bg-opacity-40 z-40 xs:block sm:hidden", onClick: handleSidebarClose, style: { border: "none", padding: 0, margin: 0 } }), jsxRuntime.jsx("div", { className: "container__menu ".concat(isCollapsed
413
- ? "container__menu--collapsed"
414
- : "container__menu--expanded"), children: jsxRuntime.jsxs("div", { className: "content__menu", children: [jsxRuntime.jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsxRuntime.jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsxRuntime.jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsxRuntime.jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsxRuntime.jsx(IconComponent, { icon: isCollapsed
415
- ? "solar:alt-arrow-right-outline"
416
- : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), jsxRuntime.jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxRuntime.jsxs("div", { className: "collapsible-item flex flex-col", children: [jsxRuntime.jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsxRuntime.jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsxRuntime.jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsxRuntime.jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxRuntime.jsxs("div", { className: "collapsible-item relative", children: [jsxRuntime.jsxs(react.Card, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxRuntime.jsxs(react.CardBody, { className: "items-center py-5 text-center gap-1", children: [jsxRuntime.jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsxRuntime.jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsxRuntime.jsx(react.CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsxRuntime.jsx(react.Button, { className: "px-10 shadow-md", color: "primary", radius: "full", variant: "shadow", onPress: handleUpgradeClick, children: upgradeCard.buttonText }) })] }), jsxRuntime.jsx(react.Spacer, { y: 9 })] })), jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item", children: helpButton.title })) }) })] }) })] }));
371
+ var AutoComplete = function (_a) {
372
+ var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, props = __rest(_a, ["label", "id", "size", "variant", "radius"]);
373
+ var generatedId = React.useId();
374
+ var autoId = id || generatedId;
375
+ return (jsxRuntime.jsxs("div", { children: [label && (jsxRuntime.jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsxRuntime.jsx(react.Autocomplete, __assign({}, props, { id: autoId, label: undefined, labelPlacement: "outside", variant: variant, size: size, radius: radius, classNames: {
376
+ base: "[&_[data-slot=input-wrapper][data-focus=true]]:!border-primary-500",
377
+ popoverContent: "[&_li[data-hover=true]]:!bg-primary-50 [&_li[data-hover=true]]:!text-default-600 [&_li]:!text-default-500",
378
+ } }))] }));
379
+ };
380
+
381
+ var ThemeContext = React.createContext({
382
+ mode: "light",
383
+ color: "blue",
384
+ // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
385
+ setMode: function () { },
386
+ // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
387
+ setColor: function () { },
417
388
  });
418
-
419
- // Lista simple de países con bandera emoji y código
420
- var countries = [
421
- { code: "+57", name: "Colombia", flag: "🇨🇴" },
422
- { code: "+54", name: "Argentina", flag: "🇦🇷" },
423
- { code: "+55", name: "Brazil", flag: "🇧🇷" },
424
- { code: "+52", name: "Mexico", flag: "🇲🇽" },
425
- { code: "+503", name: "El Salvador", flag: "🇸🇻" },
426
- { code: "+51", name: "Peru", flag: "🇵🇪" },
427
- { code: "+56", name: "Chile", flag: "🇨🇱" },
428
- { code: "+1", name: "United States", flag: "🇺🇸" },
429
- { code: "+7", name: "Russia", flag: "🇷🇺" },
430
- { code: "+20", name: "Egypt", flag: "🇪🇬" },
431
- { code: "+27", name: "South Africa", flag: "🇿🇦" },
432
- { code: "+33", name: "France", flag: "🇫🇷" },
433
- { code: "+34", name: "Spain", flag: "🇪🇸" },
434
- { code: "+39", name: "Italy", flag: "🇮🇹" },
435
- { code: "+44", name: "United Kingdom", flag: "🇬🇧" },
436
- { code: "+49", name: "Germany", flag: "🇩🇪" },
437
- { code: "+51", name: "Peru", flag: "🇵🇪" },
438
- { code: "+52", name: "Mexico", flag: "🇲🇽" },
439
- { code: "+54", name: "Argentina", flag: "🇦🇷" },
440
- { code: "+55", name: "Brazil", flag: "🇧🇷" },
441
- { code: "+56", name: "Chile", flag: "🇨🇱" },
442
- { code: "+57", name: "Colombia", flag: "🇨🇴" },
443
- { code: "+60", name: "Malaysia", flag: "🇲🇾" },
444
- { code: "+61", name: "Australia", flag: "🇦🇺" },
445
- { code: "+62", name: "Indonesia", flag: "🇮🇩" },
446
- { code: "+64", name: "New Zealand", flag: "🇳🇿" },
447
- { code: "+65", name: "Singapore", flag: "🇸🇬" },
448
- { code: "+66", name: "Thailand", flag: "🇹🇭" },
449
- { code: "+81", name: "Japan", flag: "🇯🇵" },
450
- { code: "+82", name: "South Korea", flag: "🇰🇷" },
451
- { code: "+84", name: "Vietnam", flag: "🇻🇳" },
452
- { code: "+86", name: "China", flag: "🇨🇳" },
453
- { code: "+91", name: "India", flag: "🇮🇳" },
454
- { code: "+351", name: "Portugal", flag: "🇵🇹" },
455
- { code: "+503", name: "El Salvador", flag: "🇸🇻" },
456
- { code: "+966", name: "Saudi Arabia", flag: "🇸🇦" },
457
- { code: "+971", name: "UAE", flag: "🇦🇪" },
458
- ];
459
- var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
460
- // Traducciones por defecto
461
- var defaultTranslations$2 = {
462
- label: "Teléfono",
463
- placeholder: "Número de teléfono",
464
- searchPlaceholder: "Buscar país...",
465
- selectCountryAriaLabel: "Seleccionar país",
466
- expandListAriaLabel: "Desplegar lista de países",
467
- noCountriesFound: "No se encontraron países",
468
- };
469
-
470
- var Phone = function (_a) {
471
- var id = _a.id, label = _a.label, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.errorText, errorText = _d === void 0 ? "" : _d, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.name, name = _f === void 0 ? "phone" : _f, _g = _a.translations, translations = _g === void 0 ? {} : _g;
472
- var _h = React.useState(false), isDropdownOpen = _h[0], setIsDropdownOpen = _h[1];
473
- var _j = React.useState(uniqueCountries[0]), selectedCountry = _j[0], setSelectedCountry = _j[1];
474
- var _k = React.useState(""), inputValue = _k[0], setInputValue = _k[1];
475
- var dropdownRef = React.useRef(null);
476
- var portalDropdownRef = React.useRef(null);
477
- var _l = React.useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
478
- var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
479
- var t = __assign(__assign({}, defaultTranslations$2), translations);
480
- var finalLabel = label || t.label;
481
- React.useEffect(function () {
482
- if (value) {
483
- var found = uniqueCountries.find(function (c) { return c.code === value.countryCode; });
484
- if (found) {
485
- setSelectedCountry(found);
486
- }
487
- setInputValue(value.phoneNumber);
488
- }
489
- }, [value]);
490
- React.useEffect(function () {
491
- if (isDropdownOpen) {
492
- setFilteredCountries(uniqueCountries);
493
- }
494
- }, [isDropdownOpen]);
495
- React.useLayoutEffect(function () {
496
- if (isDropdownOpen && dropdownRef.current) {
497
- var rect = dropdownRef.current.getBoundingClientRect();
498
- setDropdownPosition({
499
- position: "absolute",
500
- top: "".concat(rect.bottom + window.scrollY + 4, "px"),
501
- left: "".concat(rect.left + window.scrollX, "px"),
502
- width: "15rem",
503
- zIndex: 50,
504
- });
505
- }
506
- }, [isDropdownOpen]);
507
- React.useEffect(function () {
508
- var handleClickOutside = function (event) {
509
- if (dropdownRef.current &&
510
- !dropdownRef.current.contains(event.target) &&
511
- portalDropdownRef.current &&
512
- !portalDropdownRef.current.contains(event.target)) {
513
- setIsDropdownOpen(false);
514
- }
515
- };
516
- if (isDropdownOpen) {
517
- document.addEventListener("mousedown", handleClickOutside);
518
- }
519
- return function () {
520
- document.removeEventListener("mousedown", handleClickOutside);
521
- };
522
- }, [isDropdownOpen]);
523
- var handleCountrySelect = function (country) {
524
- setSelectedCountry(country);
525
- setIsDropdownOpen(false);
526
- if (onChange) {
527
- onChange({ countryCode: country.code, phoneNumber: inputValue });
528
- }
529
- };
530
- var handleInputChange = function (e) {
531
- var val = e.target.value.replace(/\D/g, "");
532
- setInputValue(val);
533
- if (onChange) {
534
- onChange({ countryCode: selectedCountry.code, phoneNumber: val });
535
- }
536
- };
537
- return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 dark:focus-within:border-primary-500 ".concat(error ? "border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: "text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
538
- reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
539
- var searchTerm = e.target.value.toLowerCase();
540
- var filtered = uniqueCountries.filter(function (country) {
541
- return country.name.toLowerCase().includes(searchTerm) ||
542
- country.code.toLowerCase().includes(searchTerm);
543
- });
544
- setFilteredCountries(filtered);
545
- } }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.code === selectedCountry.code
546
- ? "bg-primary-50"
547
- : ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3 text-lg", children: country.flag }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: country.code })] }, country.code)); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
548
- };
549
-
550
- /**
551
- * Select genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
552
- *
553
- * Reglas aplicadas:
554
- * - Variant: Bordered (por defecto)
555
- * - Radius: md (por defecto)
556
- * - labelPlacement: Outside
557
- * - Size: sm, md, lg (configurable)
558
- */
559
- var Select = function (_a) {
560
- var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
561
- var generatedId = React.useId();
562
- var selectId = id || generatedId;
563
- return (jsxRuntime.jsx("div", { className: "group", children: jsxRuntime.jsx(react.Select, __assign({}, props, { id: selectId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
564
- label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
565
- trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
566
- popoverContent: "[&_[data-focus-visible=true]]:!outline-none [&_[data-selectable=true]:focus]:!bg-primary-50 [&_li]:!text-default-500 [&_li[data-hover=true]]:!text-default-600",
567
- } })) }));
568
- };
569
-
570
- function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
571
- return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
572
- }
573
- function $14e0f24ef4ac5c92$var$timeToMs(a) {
574
- return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
575
- }
576
-
577
- function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
578
- let inverseDuration = {};
579
- for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
580
- return inverseDuration;
581
- }
582
- function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
583
- let mutableValue = value.copy();
584
- if (fields.hour != null) mutableValue.hour = fields.hour;
585
- if (fields.minute != null) mutableValue.minute = fields.minute;
586
- if (fields.second != null) mutableValue.second = fields.second;
587
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
588
- $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
589
- return mutableValue;
590
- }
591
- function $735220c2d4774dd3$var$balanceTime(time) {
592
- time.second += Math.floor(time.millisecond / 1000);
593
- time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
594
- time.minute += Math.floor(time.second / 60);
595
- time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
596
- time.hour += Math.floor(time.minute / 60);
597
- time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
598
- let days = Math.floor(time.hour / 24);
599
- time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
600
- return days;
601
- }
602
- function $735220c2d4774dd3$export$7555de1e070510cb(time) {
603
- time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
604
- time.second = Math.max(0, Math.min(time.second, 59));
605
- time.minute = Math.max(0, Math.min(time.minute, 59));
606
- time.hour = Math.max(0, Math.min(time.hour, 23));
607
- }
608
- function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
609
- let result = a % b;
610
- if (result < 0) result += b;
611
- return result;
612
- }
613
- function $735220c2d4774dd3$var$addTimeFields(time, duration) {
614
- time.hour += duration.hours || 0;
615
- time.minute += duration.minutes || 0;
616
- time.second += duration.seconds || 0;
617
- time.millisecond += duration.milliseconds || 0;
618
- return $735220c2d4774dd3$var$balanceTime(time);
619
- }
620
- function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
621
- let res = time.copy();
622
- $735220c2d4774dd3$var$addTimeFields(res, duration);
623
- return res;
624
- }
625
- function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
626
- return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
627
- }
628
- function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
629
- let mutable = value.copy();
630
- switch(field){
631
- case 'hour':
632
- {
633
- let hours = value.hour;
634
- let min = 0;
635
- let max = 23;
636
- if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
637
- let isPM = hours >= 12;
638
- min = isPM ? 12 : 0;
639
- max = isPM ? 23 : 11;
640
- }
641
- mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
642
- break;
643
- }
644
- case 'minute':
645
- mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
646
- break;
647
- case 'second':
648
- mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
649
- break;
650
- case 'millisecond':
651
- mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
652
- break;
653
- default:
654
- throw new Error('Unsupported field ' + field);
655
- }
656
- return mutable;
657
- }
658
- function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
659
- if (round) {
660
- value += Math.sign(amount);
661
- if (value < min) value = max;
662
- let div = Math.abs(amount);
663
- if (amount > 0) value = Math.ceil(value / div) * div;
664
- else value = Math.floor(value / div) * div;
665
- if (value > max) value = min;
666
- } else {
667
- value += amount;
668
- if (value < min) value = max - (min - value - 1);
669
- else if (value > max) value = min + (value - max - 1);
670
- }
671
- return value;
672
- }
673
-
674
- function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
675
- return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
676
- }
677
-
678
- function _check_private_redeclaration(obj, privateCollection) {
679
- if (privateCollection.has(obj)) {
680
- throw new TypeError("Cannot initialize the same private elements twice on an object");
681
- }
682
- }
683
-
684
- function _class_private_field_init(obj, privateMap, value) {
685
- _check_private_redeclaration(obj, privateMap);
686
- privateMap.set(obj, value);
687
- }
688
-
689
- var // This prevents TypeScript from allowing other types with the same fields to match.
690
- // @ts-ignore
691
- $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
692
- class $35ea8db9cb2ccb90$export$680ea196effce5f {
693
- /** Returns a copy of this time. */ copy() {
694
- return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
695
- }
696
- /** Returns a new `Time` with the given duration added to it. */ add(duration) {
697
- return ($735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
698
- }
699
- /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
700
- return ($735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
701
- }
702
- /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
703
- return ($735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
704
- }
705
- /**
706
- * Returns a new `Time` with the given field adjusted by a specified amount.
707
- * When the resulting value reaches the limits of the field, it wraps around.
708
- */ cycle(field, amount, options) {
709
- return ($735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
710
- }
711
- /** Converts the time to an ISO 8601 formatted string. */ toString() {
712
- return ($fae977aafc393c5c$export$f59dee82248f5ad4)(this);
713
- }
714
- /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
715
- return ($14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
716
- }
717
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
718
- (_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type1, {
719
- writable: true,
720
- value: void 0
721
- });
722
- this.hour = hour;
723
- this.minute = minute;
724
- this.second = second;
725
- this.millisecond = millisecond;
726
- ($735220c2d4774dd3$export$7555de1e070510cb)(this);
727
- }
728
- }
729
-
730
- var Switch = function (_a) {
731
- var id = _a.id, props = __rest(_a, ["id"]);
732
- var generatedId = React.useId();
733
- var autoId = id || generatedId;
734
- return jsxRuntime.jsx(react.Switch, __assign({}, props, { id: autoId }));
735
- };
736
-
737
- /**
738
- * TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
739
- */
740
- var TimeInput = function (_a) {
741
- var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "bordered" : _d, props = __rest(_a, ["label", "id", "size", "radius", "variant"]);
742
- var generatedId = React.useId();
743
- var autoId = id || generatedId;
744
- return (jsxRuntime.jsx(react.TimeInput, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
745
- label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
746
- inputWrapper: "focus-within:!border-primary-500",
747
- } })));
748
- };
749
-
750
- /**
751
- * @component ScheduleRow
752
- * @description A React component for managing the schedule of a single day.
753
- * It allows users to open or close the schedule, add or remove time slots,
754
- * and modify the start and end times of each slot. The component is fully
755
- * controlled and reports changes to the parent via the `onChange` callback.
756
- *
757
- * @param {ScheduleRowProps} props - The props for the component.
758
- * @returns {React.ReactElement} The rendered ScheduleRow component.
759
- */
760
- var ScheduleRow = function (_a) {
761
- var day = _a.day, daySchedule = _a.daySchedule, translations = _a.translations, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
762
- /**
763
- * @function validateTimeSlots
764
- * @description Validates all time slots to ensure the "from" time is not after the "to" time.
765
- * @param {TimeSlot[]} timeSlots - The array of time slots to validate.
766
- * @returns {TimeSlot[]} The updated array of time slots with error messages if any.
767
- */
768
- var validateTimeSlots = function (timeSlots) {
769
- return timeSlots.map(function (slot) {
770
- if (slot.from && slot.to) {
771
- var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
772
- var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
773
- if (fromTime.compare(toTime) > 0) {
774
- return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
775
- }
776
- }
777
- return __assign(__assign({}, slot), { error: null });
778
- });
779
- };
780
- /**
781
- * @function toTimeValue
782
- * @description Converts a time string (e.g., "09:00") to a `TimeValue` object
783
- * required by the `TimeInput` component.
784
- * @param {string} time - The time string to convert.
785
- * @returns {TimeValue | null} The corresponding `TimeValue` object, or `null` if the input is empty.
786
- */
787
- var toTimeValue = function (time) {
788
- if (!time) {
789
- return null;
790
- }
791
- var _a = time.split(":").map(Number), hour = _a[0], minute = _a[1];
792
- return new $35ea8db9cb2ccb90$export$680ea196effce5f(hour, minute);
793
- };
794
- /**
795
- * @function fromTimeValue
796
- * @description Converts a `TimeValue` object back to a formatted time string (e.g., "09:00").
797
- * @param {TimeValue | null} time - The `TimeValue` object to convert.
798
- * @returns {string} The formatted time string.
799
- */
800
- var fromTimeValue = function (time) {
801
- if (!time) {
802
- return "";
803
- }
804
- return "".concat(String(time.hour).padStart(2, "0"), ":").concat(String(time.minute).padStart(2, "0"));
805
- };
806
- /**
807
- * @function handleToggleDay
808
- * @description Toggles the `isOpen` status of the schedule for the day.
809
- */
810
- var handleToggleDay = function () {
811
- onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
812
- };
813
- /**
814
- * @function handleTimeChange
815
- * @description Updates the time for a specific time slot.
816
- * @param {number} index - The index of the time slot to modify.
817
- * @param {"from" | "to"} field - The field to update ("from" or "to").
818
- * @param {TimeValue | null} value - The new time value from the `TimeInput` component.
819
- */
820
- var handleTimeChange = function (index, field, value) {
821
- var _a;
822
- var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
823
- newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
824
- var validatedSlots = validateTimeSlots(newTimeSlots);
825
- onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
826
- };
827
- /**
828
- * @function handleAddTimeSlot
829
- * @description Adds a new, empty time slot to the schedule.
830
- */
831
- var handleAddTimeSlot = function () {
832
- var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
833
- onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
834
- };
835
- /**
836
- * @function handleRemoveTimeSlot
837
- * @description Removes a time slot from the schedule at the specified index.
838
- * @param {number} index - The index of the time slot to remove.
839
- */
840
- var handleRemoveTimeSlot = function (index) {
841
- var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
842
- onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
843
- };
844
- return (jsxRuntime.jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsxRuntime.jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsxRuntime.jsx(react.Chip, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? translations.open : translations.closed })] }), jsxRuntime.jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsxRuntime.jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsxRuntime.jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: translations.copyToAll })] })] }), daySchedule.isOpen && (jsxRuntime.jsxs("div", { className: "flex flex-col justify-around gap-y-3 ", children: [daySchedule.timeSlots.map(function (slot, index) { return (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxRuntime.jsx(TimeInput, { label: translations.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsxRuntime.jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), jsxRuntime.jsx(TimeInput, { label: translations.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: daySchedule.timeSlots.length === 1, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) })] }, "".concat(day, "-timeslot-").concat(slot.from, "-").concat(slot.to, "-").concat(index))); }), daySchedule.timeSlots.length < 2 && (jsxRuntime.jsx(Button, { size: "sm", variant: "flat", onPress: function () { return handleAddTimeSlot(); }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), children: translations.addTimeSlot }))] }))] }, day));
845
- };
846
-
847
- function AuraTable(_a) {
848
- var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
849
- return (jsxRuntime.jsxs(react.Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsxRuntime.jsx(react.TableHeader, { columns: columns, children: function (column) { return jsxRuntime.jsx(react.TableColumn, { children: column.label }, column.key); } }), jsxRuntime.jsx(react.TableBody, { items: items, children: function (item) { return (jsxRuntime.jsx(react.TableRow, { children: function (columnKey) { return (jsxRuntime.jsx(react.TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
850
- }
851
-
852
- /**
853
- * Textarea component that wraps the HeroUI TextArea component.
854
- */
855
- var Textarea = function (_a) {
856
- var id = _a.id, label = _a.label, placeholder = _a.placeholder, description = _a.description, errorMessage = _a.errorMessage, _b = _a.variant, variant = _b === void 0 ? "bordered" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.size, size = _d === void 0 ? "md" : _d; _a.labelPlacement; var props = __rest(_a, ["id", "label", "placeholder", "description", "errorMessage", "variant", "radius", "size", "labelPlacement"]);
857
- var generatedId = React.useId();
858
- var autoId = id || generatedId;
859
- return (jsxRuntime.jsx(react.Textarea, __assign({}, props, { id: autoId, label: label, variant: variant, radius: radius, size: size, labelPlacement: "outside", placeholder: placeholder, description: description, errorMessage: errorMessage, classNames: {
860
- label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
861
- inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
862
- } })));
863
- };
864
-
865
- // Traducciones por defecto en español según las reglas de diseño
866
- var defaultTranslations$1 = {
867
- lightTheme: "Claro",
868
- darkTheme: "Oscuro",
869
- };
870
- /**
871
- * Selector de tema visual con preview interactivo siguiendo las reglas de diseño BeweOS.
872
- *
873
- * Reglas aplicadas:
874
- * - Soporte completo de traducciones mediante props
875
- * - Sin dependencias de sistemas i18n específicos
876
- * - Dark mode compatible
877
- * - Uso exclusivo de Tailwind CSS
878
- */
879
- var ThemePicker = function (_a) {
880
- var value = _a.value, onChange = _a.onChange, className = _a.className, _b = _a.translations, translations = _b === void 0 ? {} : _b;
881
- // Combinar traducciones por defecto con las proporcionadas
882
- var t = __assign(__assign({}, defaultTranslations$1), translations);
883
- var themes = [
884
- {
885
- key: "light",
886
- label: t.lightTheme,
887
- cardClass: "bg-white border border-[#E4E4E7] text-zinc-900",
888
- previewClass: "bg-[#F4F4F5] border border-[#E4E4E7]",
889
- labelClass: "font-medium text-[14px] leading-[20px] text-zinc-900",
890
- radioColor: "primary",
891
- previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#E4E4E7] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#E4E4E7] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#E4E4E7]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#E4E4E7]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#F4F4F5] rounded-lg mt-2" })] })),
892
- },
893
- {
894
- key: "dark",
895
- label: t.darkTheme,
896
- cardClass: "bg-black border border-[#3F3F46] text-white",
897
- previewClass: "bg-[#27272A] border border-[#3F3F46]",
898
- labelClass: "font-medium text-[14px] leading-[20px] text-white",
899
- radioColor: "primary",
900
- previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#3F3F46] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#3F3F46] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#3F3F46]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#3F3F46]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#27272A] rounded-lg mt-2" })] })),
901
- },
902
- ];
903
- return (jsxRuntime.jsx(react.RadioGroup, { value: value, onChange: function (e) { return onChange(e.target.value); }, className: "flex justify-center ".concat(className || ""), orientation: "horizontal", classNames: {
904
- wrapper: "gap-3",
905
- }, children: themes.map(function (theme) { return (jsxRuntime.jsxs("div", { className: "relative rounded-2xl ".concat(theme.cardClass, " p-4 flex-1 transition-all duration-200 flex flex-col justify-start"), children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsxRuntime.jsx("span", { className: theme.labelClass, children: theme.label }), jsxRuntime.jsx(react.Radio, { "aria-label": theme.label, color: theme.radioColor, size: "sm", value: theme.key })] }), theme.previewContent] }, theme.key)); }) }));
906
- };
907
-
908
- var ConfigMenu = function (_a) {
909
- var _b;
910
- var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
911
- return (jsxRuntime.jsxs(react.Dropdown, { className: "min-w-40", children: [jsxRuntime.jsx(react.DropdownTrigger, { children: jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "default", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:settings-linear" }) }) }), jsxRuntime.jsxs(react.DropdownMenu, { "aria-label": "Configuration", children: [jsxRuntime.jsx(react.DropdownSection, { showDivider: true, className: "mb-0", children: options.map(function (item) { return (jsxRuntime.jsx(react.DropdownItem, { href: item.href, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
912
- base: "text-default-500",
913
- }, startContent: item.icon ? jsxRuntime.jsx(IconComponent, { icon: item.icon }) : undefined, children: item.label }, item.label)); }) }), jsxRuntime.jsx(react.DropdownSection, { children: jsxRuntime.jsx(react.DropdownItem, { onPress: onLogout, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
914
- base: "text-default-500",
915
- }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:logout-2-linear" }), children: (_b = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _b !== void 0 ? _b : "Logout" }, "logout") })] })] }));
916
- };
917
- ConfigMenu.displayName = "ConfigMenu";
918
-
919
- var NotificationButton = function (_a) {
920
- var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
921
- return (jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "secondary", variant: "flat", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:bell-bing-linear" }), children: notificationCount > 0 && (jsxRuntime.jsx("span", { className: "notification__alert", children: notificationCount })) }));
922
- };
923
- NotificationButton.displayName = "NotificationButton";
924
-
925
- var HeaderComponent = function (_a) {
926
- var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations;
927
- return (jsxRuntime.jsxs("header", { className: "header__container", children: [jsxRuntime.jsx(react.Button, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [jsxRuntime.jsx(NotificationButton, { notificationCount: notificationCount }), jsxRuntime.jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }));
928
- };
929
- HeaderComponent.displayName = "Header";
930
-
931
- var ToastContext = React.createContext(undefined);
932
- var useAuraToast = function () {
933
- var context = React.useContext(ToastContext);
934
- if (!context) {
935
- throw new Error("useAuraToast must be used within a AuraToastProvider");
936
- }
937
- return context;
938
- };
939
-
940
- function GlobalToast() {
941
- var _a = useAuraToast(), toast = _a.toast, hideToast = _a.hideToast;
942
- if (!toast.isVisible) {
943
- return null;
944
- }
945
- return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-50 w-full max-w-sm", children: jsxRuntime.jsx(react.Alert, { hideIconWrapper: true, color: toast.color, variant: "flat", title: toast.title, description: toast.description, isClosable: true, onClose: hideToast }) }));
946
- }
947
-
948
- // Traducciones por defecto en español
949
- var defaultTranslations = {
950
- uploadText: "Da clic y selecciona tus archivos",
951
- subText: "",
952
- dragText: "Suelta el archivo aquí",
953
- multipleFilesError: "Solo puedes subir un archivo",
954
- maxFilesError: "Puedes subir máximo {maxFiles} archivos",
955
- invalidFileTypeError: "Solo se aceptan archivos de tipo: {acceptedTypes}",
956
- maxFileSizeError: "El archivo excede el tamaño máximo permitido de {maxSize}",
957
- removeFileAriaLabel: "Remover archivo",
958
- uploadAreaAriaLabel: "Área de carga de archivos",
959
- cropModalTitle: "Recortar imagen",
960
- cropSaveButton: "Guardar",
961
- cropCancelButton: "Cancelar",
962
- cropZoomLabel: "Zoom",
963
- cropInstructions: "Arrastra para mover la imagen y usa el zoom para ajustar el tamaño",
964
- cropBackgroundLabel: "Color de fondo",
965
- cropBackgroundWhite: "Blanco",
966
- cropBackgroundBlack: "Negro",
967
- cropBackgroundTransparent: "Transparente",
968
- };
969
- /**
970
- * Formatea el tipo de archivo para mostrar
971
- */
972
- var formatFileType = function (type) {
973
- var _a;
974
- if (type.startsWith(".")) {
975
- return type.toUpperCase();
976
- }
977
- if (type.includes("/")) {
978
- var parts = type.split("/");
979
- return ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || type;
980
- }
981
- return type.toUpperCase();
982
- };
983
- /**
984
- * Formatea el tamaño del archivo de forma legible
985
- */
986
- var formatFileSize = function (bytes) {
987
- if (bytes === 0) {
988
- return "0 Bytes";
989
- }
990
- var k = 1024;
991
- var sizes = ["Bytes", "KB", "MB", "GB"];
992
- var i = Math.floor(Math.log(bytes) / Math.log(k));
993
- return "".concat(Math.round(bytes / Math.pow(k, i)), " ").concat(sizes[i]);
994
- };
995
- /**
996
- * Componente de recorte de imagen usando Canvas API
997
- */
998
- var ImageCropModal = function (_a) {
999
- var isOpen = _a.isOpen, imageUrl = _a.imageUrl, targetWidth = _a.targetWidth, targetHeight = _a.targetHeight, onSave = _a.onSave, onCancel = _a.onCancel, translations = _a.translations;
1000
- var canvasRef = React.useRef(null);
1001
- var _b = React.useState(null), imageElement = _b[0], setImageElement = _b[1];
1002
- var _c = React.useState(0), zoomValue = _c[0], setZoomValue = _c[1]; // Valor del slider de -1 a 1
1003
- var _d = React.useState({ x: 0, y: 0 }), position = _d[0], setPosition = _d[1];
1004
- var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
1005
- var _f = React.useState({ x: 0, y: 0 }), dragStart = _f[0], setDragStart = _f[1];
1006
- var _g = React.useState(1), baseScale = _g[0], setBaseScale = _g[1]; // Escala base inicial
1007
- var _h = React.useState({ width: 400, height: 300 }), canvasSize = _h[0], setCanvasSize = _h[1];
1008
- var _j = React.useState("white"), backgroundColor = _j[0], setBackgroundColor = _j[1];
1009
- // Función para convertir el valor del zoom slider a escala real
1010
- var getScaleFromZoom = function (zoomValue) {
1011
- if (zoomValue === 0) {
1012
- return baseScale;
1013
- }
1014
- if (zoomValue > 0) {
1015
- // Zoom in: de baseScale a baseScale * 3
1016
- return baseScale + baseScale * 2 * zoomValue;
1017
- }
1018
- // Zoom out: de baseScale * 0.3 a baseScale
1019
- return baseScale + baseScale * 0.7 * zoomValue;
1020
- };
1021
- var currentScale = getScaleFromZoom(zoomValue);
1022
- // Cargar imagen cuando se abre el modal
1023
- React.useEffect(function () {
1024
- if (isOpen && imageUrl) {
1025
- var img_1 = new Image();
1026
- img_1.onload = function () {
1027
- setImageElement(img_1);
1028
- // Calcular escala inicial para que la imagen quepa en el área de crop
1029
- var scaleX = targetWidth / img_1.width;
1030
- var scaleY = targetHeight / img_1.height;
1031
- var initialScale = Math.max(scaleX, scaleY);
1032
- setBaseScale(initialScale);
1033
- setZoomValue(0); // Empezar en el centro
1034
- setPosition({ x: 0, y: 0 });
1035
- setBackgroundColor("white"); // Reset color de fondo
1036
- };
1037
- img_1.src = imageUrl;
1038
- }
1039
- }, [isOpen, imageUrl, targetWidth, targetHeight]);
1040
- // Dibujar en el canvas
1041
- React.useEffect(function () {
1042
- if (!(imageElement && canvasRef.current)) {
1043
- return;
1044
- }
1045
- var canvas = canvasRef.current;
1046
- var ctx = canvas.getContext("2d");
1047
- if (!ctx) {
1048
- return;
1049
- }
1050
- // Limpiar canvas
1051
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1052
- // Dibujar fondo gris del canvas
1053
- ctx.fillStyle = "#f3f4f6";
1054
- ctx.fillRect(0, 0, canvas.width, canvas.height);
1055
- // Calcular posición y tamaño de la imagen
1056
- var imgWidth = imageElement.width * currentScale;
1057
- var imgHeight = imageElement.height * currentScale;
1058
- var imgX = (canvas.width - imgWidth) / 2 + position.x;
1059
- var imgY = (canvas.height - imgHeight) / 2 + position.y;
1060
- // Dibujar imagen
1061
- ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
1062
- // Dibujar overlay para mostrar área de recorte
1063
- ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
1064
- ctx.fillRect(0, 0, canvas.width, canvas.height);
1065
- // Limpiar área de recorte (centro)
1066
- var cropX = (canvas.width - targetWidth) / 2;
1067
- var cropY = (canvas.height - targetHeight) / 2;
1068
- ctx.clearRect(cropX, cropY, targetWidth, targetHeight);
1069
- // Dibujar color de fondo del área de recorte
1070
- if (backgroundColor !== "transparent") {
1071
- ctx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
1072
- ctx.fillRect(cropX, cropY, targetWidth, targetHeight);
1073
- }
1074
- // Redibujar imagen solo en el área de recorte
1075
- ctx.save();
1076
- ctx.beginPath();
1077
- ctx.rect(cropX, cropY, targetWidth, targetHeight);
1078
- ctx.clip();
1079
- ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
1080
- ctx.restore();
1081
- // Dibujar borde del área de recorte
1082
- ctx.strokeStyle = "#3b82f6";
1083
- ctx.lineWidth = 2;
1084
- ctx.strokeRect(cropX, cropY, targetWidth, targetHeight);
1085
- }, [
1086
- imageElement,
1087
- currentScale,
1088
- position,
1089
- targetWidth,
1090
- targetHeight,
1091
- backgroundColor,
1092
- ]);
1093
- var handleMouseDown = function (e) {
1094
- var _a;
1095
- e.preventDefault();
1096
- setIsDragging(true);
1097
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1098
- if (rect) {
1099
- setDragStart({
1100
- x: e.clientX - rect.left - position.x,
1101
- y: e.clientY - rect.top - position.y,
1102
- });
1103
- }
1104
- };
1105
- var handleMouseMove = function (e) {
1106
- var _a;
1107
- if (!isDragging) {
1108
- return;
1109
- }
1110
- e.preventDefault();
1111
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1112
- if (rect) {
1113
- setPosition({
1114
- x: e.clientX - rect.left - dragStart.x,
1115
- y: e.clientY - rect.top - dragStart.y,
1116
- });
1117
- }
1118
- };
1119
- var handleMouseUp = function () {
1120
- setIsDragging(false);
1121
- };
1122
- // Eventos táctiles para dispositivos móviles
1123
- var handleTouchStart = function (e) {
1124
- var _a;
1125
- e.preventDefault();
1126
- if (e.touches.length === 1) {
1127
- setIsDragging(true);
1128
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1129
- if (rect) {
1130
- var touch = e.touches[0];
1131
- setDragStart({
1132
- x: touch.clientX - rect.left - position.x,
1133
- y: touch.clientY - rect.top - position.y,
1134
- });
1135
- }
1136
- }
1137
- };
1138
- var handleTouchMove = function (e) {
1139
- var _a;
1140
- if (!isDragging || e.touches.length !== 1) {
1141
- return;
1142
- }
1143
- e.preventDefault();
1144
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1145
- if (rect) {
1146
- var touch = e.touches[0];
1147
- setPosition({
1148
- x: touch.clientX - rect.left - dragStart.x,
1149
- y: touch.clientY - rect.top - dragStart.y,
1150
- });
1151
- }
1152
- };
1153
- var handleTouchEnd = function () {
1154
- setIsDragging(false);
1155
- };
1156
- var handleSave = function () {
1157
- if (!(imageElement && canvasRef.current)) {
1158
- return;
1159
- }
1160
- // Crear canvas temporal para el recorte
1161
- var tempCanvas = document.createElement("canvas");
1162
- tempCanvas.width = targetWidth;
1163
- tempCanvas.height = targetHeight;
1164
- var tempCtx = tempCanvas.getContext("2d");
1165
- if (!tempCtx) {
1166
- return;
1167
- }
1168
- // Dibujar color de fondo si no es transparente
1169
- if (backgroundColor !== "transparent") {
1170
- tempCtx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
1171
- tempCtx.fillRect(0, 0, targetWidth, targetHeight);
1172
- }
1173
- // Calcular parámetros de recorte
1174
- var canvas = canvasRef.current;
1175
- var imgWidth = imageElement.width * currentScale;
1176
- var imgHeight = imageElement.height * currentScale;
1177
- var imgX = (canvas.width - imgWidth) / 2 + position.x;
1178
- var imgY = (canvas.height - imgHeight) / 2 + position.y;
1179
- var cropX = (canvas.width - targetWidth) / 2;
1180
- var cropY = (canvas.height - targetHeight) / 2;
1181
- // Calcular área fuente en la imagen original
1182
- var sourceX = (cropX - imgX) / currentScale;
1183
- var sourceY = (cropY - imgY) / currentScale;
1184
- var sourceWidth = targetWidth / currentScale;
1185
- var sourceHeight = targetHeight / currentScale;
1186
- // Dibujar recorte sobre el fondo
1187
- tempCtx.drawImage(imageElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, targetWidth, targetHeight);
1188
- // Convertir a blob y crear archivo
1189
- var fileType = backgroundColor === "transparent" ? "image/png" : "image/png";
1190
- tempCanvas.toBlob(function (blob) {
1191
- if (blob) {
1192
- var timestamp = new Date().getTime();
1193
- var file = new File([blob], "cropped-image-".concat(timestamp, ".png"), {
1194
- type: fileType,
1195
- });
1196
- onSave(file, imageElement.src);
1197
- }
1198
- }, fileType);
1199
- };
1200
- // Calcular dimensiones responsive del canvas
1201
- var updateCanvasSize = React.useCallback(function () {
1202
- var minCanvasWidth = Math.min(350, window.innerWidth - 40);
1203
- var minCanvasHeight = Math.min(250, window.innerHeight - 300);
1204
- var newCanvasWidth = Math.max(minCanvasWidth, targetWidth + 60);
1205
- var newCanvasHeight = Math.max(minCanvasHeight, targetHeight + 60);
1206
- setCanvasSize({ width: newCanvasWidth, height: newCanvasHeight });
1207
- }, [targetWidth, targetHeight]);
1208
- // Actualizar tamaño del canvas al cambiar el tamaño de la ventana
1209
- React.useEffect(function () {
1210
- if (!isOpen) {
1211
- return;
1212
- }
1213
- updateCanvasSize();
1214
- var handleResize = function () {
1215
- updateCanvasSize();
1216
- };
1217
- window.addEventListener("resize", handleResize);
1218
- return function () {
1219
- window.removeEventListener("resize", handleResize);
1220
- };
1221
- }, [isOpen, updateCanvasSize]);
1222
- return (jsxRuntime.jsx(react.Modal, { isOpen: isOpen, onClose: onCancel, size: "5xl", className: "sm:max-w-4xl", scrollBehavior: "inside", backdrop: "blur", classNames: {
1223
- backdrop: "bg-black/80",
1224
- wrapper: "p-0 sm:p-4",
1225
- base: "m-0 sm:m-4 max-h-screen sm:max-h-[90vh] w-full sm:w-auto",
1226
- }, children: jsxRuntime.jsxs(react.ModalContent, { className: "m-0 sm:m-0 h-screen sm:h-auto sm:max-h-[90vh] sm:rounded-lg", children: [jsxRuntime.jsxs(react.ModalHeader, { className: "flex flex-col gap-1 px-4 sm:px-6", children: [translations.cropModalTitle, jsxRuntime.jsx("p", { className: "text-xs sm:text-sm text-gray-500 font-normal", children: translations.cropInstructions })] }), jsxRuntime.jsx(react.ModalBody, { className: "px-4 sm:px-6 py-4", children: jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [jsxRuntime.jsx("div", { className: "flex justify-center overflow-hidden", children: jsxRuntime.jsx("canvas", { ref: canvasRef, width: canvasSize.width, height: canvasSize.height, className: "border border-gray-300 cursor-move select-none max-w-full max-h-[50vh] sm:max-h-[60vh]", onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { touchAction: "none" } }) }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("label", { htmlFor: "zoom-slider", className: "text-sm font-medium", children: translations.cropZoomLabel }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 w-full", children: [jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "-" }), jsxRuntime.jsx(react.Slider, { id: "zoom-slider", size: "sm", step: 0.1, minValue: -1, maxValue: 1, value: zoomValue, onChange: function (value) { return setZoomValue(value); }, className: "flex-1", marks: [
1227
- { value: -1, label: "Out" },
1228
- { value: 0, label: "0" },
1229
- { value: 1, label: "In" },
1230
- ] }), jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "+" })] })] }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "text-sm font-medium", children: translations.cropBackgroundLabel }), jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-3 sm:gap-4", children: [jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "white", checked: backgroundColor === "white", onChange: function (e) {
1231
- return setBackgroundColor(e.target.value);
1232
- }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-white border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundWhite })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "black", checked: backgroundColor === "black", onChange: function (e) {
1233
- return setBackgroundColor(e.target.value);
1234
- }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-black border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundBlack })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "transparent", checked: backgroundColor === "transparent", onChange: function (e) {
1235
- return setBackgroundColor(e.target.value);
1236
- }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-gray-200 border border-gray-300 rounded", style: {
1237
- backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
1238
- backgroundSize: "8px 8px",
1239
- backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
1240
- } }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxRuntime.jsxs(react.ModalFooter, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsxRuntime.jsx(react.Button, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsxRuntime.jsx(react.Button, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
1241
- };
1242
- /**
1243
- * Componente de previsualización de archivo
1244
- */
1245
- var FilePreview = function (_a) {
1246
- var file = _a.file, onRemove = _a.onRemove, removeAriaLabel = _a.removeAriaLabel;
1247
- var _b = React.useState(""), previewUrl = _b[0], setPreviewUrl = _b[1];
1248
- React.useEffect(function () {
1249
- if (file === null || file === void 0 ? void 0 : file.type.startsWith("image/")) {
1250
- var url_1 = URL.createObjectURL(file);
1251
- setPreviewUrl(url_1);
1252
- return function () { return URL.revokeObjectURL(url_1); };
1253
- }
1254
- }, [file]);
1255
- if (!(file === null || file === void 0 ? void 0 : file.type.startsWith("image/"))) {
1256
- return null;
1257
- }
1258
- return (jsxRuntime.jsxs("div", { className: "absolute inset-0 overflow-hidden z-10", children: [jsxRuntime.jsx("img", { src: previewUrl, alt: file.name, className: "w-full h-full object-cover" }), jsxRuntime.jsx(react.Button, { isIconOnly: true, size: "sm", color: "danger", variant: "solid", className: "absolute top-2 right-2 sm:top-3 sm:right-3 z-20 bg-red-100 hover:bg-red-200 text-red-600 min-w-8 h-8 sm:min-w-10 sm:h-10", onPress: onRemove, "aria-label": removeAriaLabel, children: jsxRuntime.jsx(IconComponent, { icon: "heroicons:trash", size: "sm" }) })] }));
1259
- };
1260
- /**
1261
- * Componente UploadDocument basado en Hero UI con funcionalidad mejorada
1262
- *
1263
- * @example
1264
- * ```tsx
1265
- * <UploadDocument
1266
- * onUpload={(files) => console.log(files)}
1267
- * acceptedFiles="image/*,.pdf"
1268
- * multiple={false}
1269
- * translations={{
1270
- * uploadText: "Upload your files",
1271
- * dragText: "Drop files here"
1272
- * }}
1273
- * />
1274
- * ```
1275
- */
1276
- var UploadFile = function (_a) {
1277
- var text = _a.text, textColor = _a.textColor, subText = _a.subText,
1278
- // borderColor, // TODO: Implementar colores personalizados
1279
- iconColor = _a.iconColor,
1280
- // backgroundColor, // TODO: Implementar colores personalizados
1281
- _b = _a.width,
1282
- // backgroundColor, // TODO: Implementar colores personalizados
1283
- width = _b === void 0 ? "100%" : _b, _c = _a.height, height = _c === void 0 ? "auto" : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.maxFiles, maxFiles = _e === void 0 ? 1 : _e, maxFileSize = _a.maxFileSize, _f = _a.acceptedFiles, acceptedFiles = _f === void 0 ? ".pdf" : _f, _g = _a.icon, icon = _g === void 0 ? "heroicons:arrow-up-on-square" : _g, onUpload = _a.onUpload, onError = _a.onError, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.success, success = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, errorText = _a.errorText, cropConfig = _a.cropConfig, image = _a.image, _l = _a.className, className = _l === void 0 ? "" : _l, _m = _a.translations, translations = _m === void 0 ? {} : _m;
1284
- var inputRef = React.useRef(null);
1285
- var uploadImageRef = React.useRef(image || null);
1286
- var _o = React.useState(false), isDragging = _o[0], setIsDragging = _o[1];
1287
- // Estados para el modal de crop
1288
- var _p = React.useState(false), showCropModal = _p[0], setShowCropModal = _p[1];
1289
- var _q = React.useState(""), selectedImageUrl = _q[0], setSelectedImageUrl = _q[1];
1290
- var _r = React.useState(null); _r[0]; var setOriginalFile = _r[1];
1291
- // Combinar traducciones por defecto con las proporcionadas
1292
- var t = React.useMemo(function () { return (__assign(__assign({}, defaultTranslations), translations)); }, [translations]);
1293
- // Actualizar texto si se pasa como prop (retrocompatibilidad)
1294
- var finalText = text || t.uploadText;
1295
- var finalSubText = subText || t.subText;
1296
- var handleClick = function () {
1297
- var _a;
1298
- if (!(disabled || uploadImageRef.current)) {
1299
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
1300
- }
1301
- };
1302
- var validateFiles = React.useCallback(function (files) {
1303
- var filesArray = Array.from(files);
1304
- if (!multiple && filesArray.length > 1) {
1305
- onError === null || onError === void 0 ? void 0 : onError(t.multipleFilesError);
1306
- return [];
1307
- }
1308
- if (filesArray.length > maxFiles) {
1309
- onError === null || onError === void 0 ? void 0 : onError(t.maxFilesError.replace("{maxFiles}", maxFiles.toString()));
1310
- return [];
1311
- }
1312
- // Validar tamaño de archivo
1313
- if (maxFileSize) {
1314
- var oversizedFiles = filesArray.filter(function (file) { return file.size > maxFileSize; });
1315
- if (oversizedFiles.length > 0) {
1316
- var maxSizeFormatted = formatFileSize(maxFileSize);
1317
- onError === null || onError === void 0 ? void 0 : onError(t.maxFileSizeError.replace("{maxSize}", maxSizeFormatted));
1318
- return [];
1319
- }
1320
- }
1321
- // Validar tipos de archivo
1322
- var acceptedExtensions = Array.isArray(acceptedFiles)
1323
- ? acceptedFiles.map(function (ext) { return ext.trim().toLowerCase(); })
1324
- : acceptedFiles.split(",").map(function (ext) { return ext.trim().toLowerCase(); });
1325
- var validFiles = filesArray.filter(function (file) {
1326
- var _a;
1327
- if (acceptedFiles.includes("image/*") &&
1328
- file.type.startsWith("image/")) {
1329
- return true;
1330
- }
1331
- if (acceptedExtensions.some(function (ext) { return ext.includes("/"); })) {
1332
- return acceptedExtensions.some(function (type) { return file.type === type; });
1333
- }
1334
- var fileExtension = ".".concat((_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
1335
- return acceptedExtensions.some(function (ext) { return ext === fileExtension || ext === "*"; });
1336
- });
1337
- if (validFiles.length === 0) {
1338
- var formattedTypes = acceptedExtensions
1339
- .map(formatFileType)
1340
- .join(", ");
1341
- onError === null || onError === void 0 ? void 0 : onError(t.invalidFileTypeError.replace("{acceptedTypes}", formattedTypes));
1342
- return [];
1343
- }
1344
- return validFiles;
1345
- }, [multiple, maxFiles, maxFileSize, acceptedFiles, t, onError]);
1346
- var handleFileUpload = React.useCallback(function (files) {
1347
- var validFiles = validateFiles(files);
1348
- if (validFiles.length > 0) {
1349
- var file_1 = validFiles[0];
1350
- // Si es imagen y hay configuración de crop, abrir modal
1351
- if (file_1.type.startsWith("image/") && cropConfig) {
1352
- var reader_1 = new FileReader();
1353
- reader_1.onload = function () {
1354
- setSelectedImageUrl(reader_1.result);
1355
- setOriginalFile(file_1);
1356
- setShowCropModal(true);
1357
- };
1358
- reader_1.readAsDataURL(file_1);
1359
- }
1360
- else {
1361
- // Procesar directamente si no necesita crop
1362
- uploadImageRef.current = file_1;
1363
- onUpload(validFiles);
1364
- }
1365
- }
1366
- }, [onUpload, validateFiles, cropConfig]);
1367
- // Manejar guardado de imagen recortada
1368
- var handleCropSave = React.useCallback(function (croppedFile) {
1369
- uploadImageRef.current = croppedFile;
1370
- setShowCropModal(false);
1371
- setSelectedImageUrl("");
1372
- setOriginalFile(null);
1373
- onUpload([croppedFile]);
1374
- }, [onUpload]);
1375
- // Manejar cancelación de crop
1376
- var handleCropCancel = React.useCallback(function () {
1377
- setShowCropModal(false);
1378
- setSelectedImageUrl("");
1379
- setOriginalFile(null);
1380
- }, []);
1381
- var handleChange = function (event) {
1382
- var files = event.target.files;
1383
- if (files && files.length > 0) {
1384
- handleFileUpload(files);
1385
- }
1386
- // Limpiar el input
1387
- if (inputRef.current) {
1388
- inputRef.current.value = "";
1389
- }
1390
- };
1391
- var handleDragEnter = React.useCallback(function (e) {
1392
- e.preventDefault();
1393
- e.stopPropagation();
1394
- if (!disabled) {
1395
- setIsDragging(true);
1396
- }
1397
- }, [disabled]);
1398
- var handleDragLeave = React.useCallback(function (e) {
1399
- e.preventDefault();
1400
- e.stopPropagation();
1401
- setIsDragging(false);
1402
- }, []);
1403
- var handleDragOver = React.useCallback(function (e) {
1404
- e.preventDefault();
1405
- e.stopPropagation();
1406
- }, []);
1407
- var handleDrop = React.useCallback(function (e) {
1408
- e.preventDefault();
1409
- e.stopPropagation();
1410
- setIsDragging(false);
1411
- if (disabled) {
1412
- return;
1413
- }
1414
- var droppedFiles = e.dataTransfer.files;
1415
- if (droppedFiles.length > 0) {
1416
- handleFileUpload(droppedFiles);
1417
- }
1418
- }, [disabled, handleFileUpload]);
1419
- var handleRemoveImage = function () {
1420
- uploadImageRef.current = null;
1421
- onUpload([]);
1422
- };
1423
- // Clases CSS dinámicas usando Tailwind
1424
- var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-3 transition-all duration-300 bg-red-500\n\t\t".concat(width !== "100%" ? "w-[".concat(width, "]") : "w-full", "\n\t\t").concat(height !== "auto" ? "h-[".concat(height, "]") : "min-h-28", "\n\t\t").concat(isDragging
1425
- ? "border-primary-500 bg-primary-50 dark:bg-primary-900"
1426
- : error
1427
- ? "border-danger-500 bg-danger-50 dark:bg-danger-950"
1428
- : success
1429
- ? "border-success-500 bg-success-50 dark:bg-success-950"
1430
- : disabled
1431
- ? "border-gray-300 bg-gray-100 dark:bg-gray-800"
1432
- : "border-gray-300 hover:border-gray-400 bg-primary-50 dark:bg-gray-900", "\n\t\t").concat(!(disabled || uploadImageRef.current) ? "cursor-pointer" : "cursor-default", "\n\t\t").concat(className, "\n\t")
1433
- .trim()
1434
- .replace(/\s+/g, " ");
1435
- var textClasses = "\n\t\ttext-centertext-base ont-medium\n\t\t".concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
1436
- var subTextClasses = "\n\t\ttext-tiny text-center\n\t\t".concat(disabled ? "text-default-400" : "text-default-500 dark:text-default-400", "\n\t");
1437
- return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(react.Card, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxRuntime.jsxs(react.CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative overflow-hidden", onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [uploadImageRef.current && (jsxRuntime.jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsxRuntime.jsx("div", { className: uploadImageRef.current
1438
- ? "opacity-0"
1439
- : "opacity-100 transition-opacity", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsxRuntime.jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxRuntime.jsxs("div", { className: "text-center px-2", children: [jsxRuntime.jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsxRuntime.jsx("p", { className: subTextClasses, children: finalSubText }))] })] }) }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
1440
- ? acceptedFiles.join(",")
1441
- : acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsxRuntime.jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsxRuntime.jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
1442
- };
1443
- UploadFile.displayName = "UploadFile";
1444
-
1445
- var Pagination = function (_a) {
1446
- _a.size; var props = __rest(_a, ["size"]);
1447
- return jsxRuntime.jsx(react.Pagination, __assign({ showControls: true, isCompact: true }, props));
1448
- };
1449
-
1450
- var H2 = function (_a) {
1451
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1452
- return (jsxRuntime.jsx("h2", __assign({ className: react.cn("text-lg font-medium", className) }, props, { children: children })));
1453
- };
1454
-
1455
- var H3 = function (_a) {
1456
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1457
- return (jsxRuntime.jsx("h3", __assign({ className: react.cn("text-base font-medium mb-1", className) }, props, { children: children })));
1458
- };
1459
-
1460
- var H4 = function (_a) {
1461
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1462
- return (jsxRuntime.jsx("h4", __assign({ className: react.cn("text-sm font-medium mb-1", className) }, props, { children: children })));
1463
- };
1464
-
1465
- var P = function (_a) {
1466
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1467
- return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-sm text-default-500", className) }, props, { children: children })));
1468
- };
1469
-
1470
- var ThemeContext = React.createContext({
1471
- mode: "light",
1472
- color: "blue",
1473
- // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
1474
- setMode: function () { },
1475
- // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
1476
- setColor: function () { },
1477
- });
1478
- var useThemeContext = function () {
1479
- var context = React.useContext(ThemeContext);
1480
- if (!context) {
1481
- throw new Error("useThemeContext debe ser usado dentro de un ThemeProvider");
1482
- }
1483
- return context;
1484
- };
389
+ var useThemeContext = function () {
390
+ var context = React.useContext(ThemeContext);
391
+ if (!context) {
392
+ throw new Error("useThemeContext debe ser usado dentro de un ThemeProvider");
393
+ }
394
+ return context;
395
+ };
1485
396
 
1486
397
  var themeColors = {
1487
398
  "blue-light": {
@@ -1814,200 +725,1918 @@ var themeColors = {
1814
725
  foreground: "#000",
1815
726
  DEFAULT: "#ff4f4f",
1816
727
  },
1817
- focus: "#ff4f4f",
728
+ focus: "#ff4f4f",
729
+ },
730
+ },
731
+ "green-light": {
732
+ extend: "light",
733
+ colors: {
734
+ primary: {
735
+ 50: "#EFFFEF",
736
+ 100: "#CFFCD1",
737
+ 200: "#A0F9AC",
738
+ 300: "#6FEE8D",
739
+ 400: "#49DE7B",
740
+ 500: "#16C964",
741
+ 600: "#10AC64",
742
+ 700: "#0B905F",
743
+ 800: "#077457",
744
+ 900: "#046051",
745
+ foreground: "#000",
746
+ DEFAULT: "#16C964",
747
+ },
748
+ secondary: {
749
+ "50": "#e3eaff",
750
+ "100": "#D7DFFE",
751
+ "200": "#AFBFFE",
752
+ "300": "#889DFD",
753
+ "400": "#6A82FB",
754
+ "500": "#3956F9",
755
+ "600": "#2941D6",
756
+ "700": "#1C2EB3",
757
+ "800": "#121F90",
758
+ "900": "#0A1477",
759
+ foreground: "#fff",
760
+ DEFAULT: "#3956F9",
761
+ },
762
+ success: {
763
+ "50": "#e7fde3",
764
+ "100": "#E8FCD3",
765
+ "200": "#CBFAA8",
766
+ "300": "#A4F17B",
767
+ "400": "#7EE358",
768
+ "500": "#49D127",
769
+ "600": "#2FB31C",
770
+ "700": "#1A9613",
771
+ "800": "#0C790E",
772
+ "900": "#076410",
773
+ foreground: "#000",
774
+ DEFAULT: "#49D127",
775
+ },
776
+ warning: {
777
+ "50": "#fff9da",
778
+ "100": "#FFF7CC",
779
+ "200": "#FFEE99",
780
+ "300": "#FFE266",
781
+ "400": "#FFD63F",
782
+ "500": "#FFC300",
783
+ "600": "#DBA200",
784
+ "700": "#B78300",
785
+ "800": "#936600",
786
+ "900": "#7A5100",
787
+ foreground: "#000",
788
+ DEFAULT: "#FFC300",
789
+ },
790
+ danger: {
791
+ "50": "#ffe2e5",
792
+ "100": "#FFE3D8",
793
+ "200": "#FFC1B2",
794
+ "300": "#FF988B",
795
+ "400": "#FF726F",
796
+ "500": "#FF3F4C",
797
+ "600": "#DB2E49",
798
+ "700": "#B71F45",
799
+ "800": "#93143F",
800
+ "900": "#7A0C3B",
801
+ foreground: "#000",
802
+ DEFAULT: "#FF3F4C",
803
+ },
804
+ focus: "#66cc8a",
805
+ overlay: "#000000",
806
+ },
807
+ },
808
+ "green-dark": {
809
+ extend: "dark",
810
+ colors: {
811
+ primary: {
812
+ 50: "#EFFFEF",
813
+ 100: "#CFFCD1",
814
+ 200: "#A0F9AC",
815
+ 300: "#6FEE8D",
816
+ 400: "#49DE7B",
817
+ 500: "#16C964",
818
+ 600: "#10AC64",
819
+ 700: "#0B905F",
820
+ 800: "#077457",
821
+ 900: "#046051",
822
+ foreground: "#000",
823
+ DEFAULT: "#16C964",
824
+ },
825
+ secondary: {
826
+ "50": "#e3eaff",
827
+ "100": "#D7DFFE",
828
+ "200": "#AFBFFE",
829
+ "300": "#889DFD",
830
+ "400": "#6A82FB",
831
+ "500": "#3956F9",
832
+ "600": "#2941D6",
833
+ "700": "#1C2EB3",
834
+ "800": "#121F90",
835
+ "900": "#0A1477",
836
+ foreground: "#fff",
837
+ DEFAULT: "#3956F9",
838
+ },
839
+ success: {
840
+ "50": "#e7fde3",
841
+ "100": "#E8FCD3",
842
+ "200": "#CBFAA8",
843
+ "300": "#A4F17B",
844
+ "400": "#7EE358",
845
+ "500": "#49D127",
846
+ "600": "#2FB31C",
847
+ "700": "#1A9613",
848
+ "800": "#0C790E",
849
+ "900": "#076410",
850
+ foreground: "#000",
851
+ DEFAULT: "#49D127",
852
+ },
853
+ warning: {
854
+ "50": "#fff9da",
855
+ "100": "#FFF7CC",
856
+ "200": "#FFEE99",
857
+ "300": "#FFE266",
858
+ "400": "#FFD63F",
859
+ "500": "#FFC300",
860
+ "600": "#DBA200",
861
+ "700": "#B78300",
862
+ "800": "#936600",
863
+ "900": "#7A5100",
864
+ foreground: "#000",
865
+ DEFAULT: "#FFC300",
866
+ },
867
+ danger: {
868
+ "50": "#ffe2e5",
869
+ "100": "#FFE3D8",
870
+ "200": "#FFC1B2",
871
+ "300": "#FF988B",
872
+ "400": "#FF726F",
873
+ "500": "#FF3F4C",
874
+ "600": "#DB2E49",
875
+ "700": "#B71F45",
876
+ "800": "#93143F",
877
+ "900": "#7A0C3B",
878
+ foreground: "#fff",
879
+ DEFAULT: "#FF3F4C",
880
+ },
881
+ focus: "#66cc8a",
882
+ overlay: "#ffffff",
1818
883
  },
1819
884
  },
1820
- "green-light": {
1821
- extend: "light",
1822
- colors: {
1823
- primary: {
1824
- 50: "#EFFFEF",
1825
- 100: "#CFFCD1",
1826
- 200: "#A0F9AC",
1827
- 300: "#6FEE8D",
1828
- 400: "#49DE7B",
1829
- 500: "#16C964",
1830
- 600: "#10AC64",
1831
- 700: "#0B905F",
1832
- 800: "#077457",
1833
- 900: "#046051",
1834
- foreground: "#000",
1835
- DEFAULT: "#16C964",
1836
- },
1837
- secondary: {
1838
- "50": "#e3eaff",
1839
- "100": "#D7DFFE",
1840
- "200": "#AFBFFE",
1841
- "300": "#889DFD",
1842
- "400": "#6A82FB",
1843
- "500": "#3956F9",
1844
- "600": "#2941D6",
1845
- "700": "#1C2EB3",
1846
- "800": "#121F90",
1847
- "900": "#0A1477",
1848
- foreground: "#fff",
1849
- DEFAULT: "#3956F9",
1850
- },
1851
- success: {
1852
- "50": "#e7fde3",
1853
- "100": "#E8FCD3",
1854
- "200": "#CBFAA8",
1855
- "300": "#A4F17B",
1856
- "400": "#7EE358",
1857
- "500": "#49D127",
1858
- "600": "#2FB31C",
1859
- "700": "#1A9613",
1860
- "800": "#0C790E",
1861
- "900": "#076410",
1862
- foreground: "#000",
1863
- DEFAULT: "#49D127",
1864
- },
1865
- warning: {
1866
- "50": "#fff9da",
1867
- "100": "#FFF7CC",
1868
- "200": "#FFEE99",
1869
- "300": "#FFE266",
1870
- "400": "#FFD63F",
1871
- "500": "#FFC300",
1872
- "600": "#DBA200",
1873
- "700": "#B78300",
1874
- "800": "#936600",
1875
- "900": "#7A5100",
1876
- foreground: "#000",
1877
- DEFAULT: "#FFC300",
1878
- },
1879
- danger: {
1880
- "50": "#ffe2e5",
1881
- "100": "#FFE3D8",
1882
- "200": "#FFC1B2",
1883
- "300": "#FF988B",
1884
- "400": "#FF726F",
1885
- "500": "#FF3F4C",
1886
- "600": "#DB2E49",
1887
- "700": "#B71F45",
1888
- "800": "#93143F",
1889
- "900": "#7A0C3B",
1890
- foreground: "#000",
1891
- DEFAULT: "#FF3F4C",
1892
- },
1893
- focus: "#66cc8a",
1894
- overlay: "#000000",
885
+ };
886
+
887
+ var ColorSelector = function (_a) {
888
+ var selectedColor = _a.selectedColor, onColorChange = _a.onColorChange;
889
+ var mode = useThemeContext().mode;
890
+ /**
891
+ * Filters and maps the available theme colors to the current theme mode (light/dark).
892
+ * Each color option contains:
893
+ * - value: the theme name (e.g., "blue-light")
894
+ * - label: the base color name (e.g., "blue")
895
+ * - color: the primary color hex value
896
+ */
897
+ var colorOptions = Object.entries(themeColors)
898
+ .filter(function (_a) {
899
+ var themeData = _a[1];
900
+ var themeMode = themeData.extend;
901
+ return mode === "light" ? themeMode === "light" : themeMode === "dark";
902
+ })
903
+ .map(function (_a) {
904
+ var themeName = _a[0], theme = _a[1];
905
+ return ({
906
+ value: themeName,
907
+ label: themeName.split("-")[0],
908
+ color: theme.colors.primary.DEFAULT,
909
+ });
910
+ });
911
+ return (jsxRuntime.jsx(react.RadioGroup, { value: selectedColor, onValueChange: onColorChange, orientation: "horizontal", className: "flex flex-wrap !gap-2", classNames: {
912
+ base: "flex flex-wrap !gap-2",
913
+ wrapper: "flex flex-wrap !gap-2",
914
+ }, children: colorOptions.map(function (color) { return (jsxRuntime.jsx(react.Radio, { value: color.label, className: "p-0 m-0", classNames: {
915
+ base: "p-0 m-0",
916
+ wrapper: "hidden",
917
+ labelWrapper: "p-0 m-0",
918
+ }, children: jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full border-2 cursor-pointer transition-all ".concat(selectedColor === color.label
919
+ ? "border-black border-opacity-20 scale-110"
920
+ : "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
921
+ };
922
+
923
+ // Traducciones por defecto en español
924
+ var defaultTranslations$5 = {
925
+ dayOption: "Día específico",
926
+ dateRangeOption: "Rango de fechas",
927
+ selectDateAriaLabel: "Seleccionar fecha",
928
+ selectDateRangeAriaLabel: "Seleccionar rango de fechas",
929
+ };
930
+ /**
931
+ * DateSelector - Componente para seleccionar fechas individuales o rangos de fechas
932
+ * basado en HeroUI siguiendo las reglas de diseño BeweOS.
933
+ * Maneja su propio estado interno de manera autónoma.
934
+ */
935
+ var DateSelector = function (_a) {
936
+ var _b = _a.initialType, initialType = _b === void 0 ? exports.HolidayType.SingleDay : _b, initialDate = _a.initialDate, initialDateRange = _a.initialDateRange, onChange = _a.onChange, _c = _a.translations, translations = _c === void 0 ? {} : _c, radioGroupProps = _a.radioGroupProps, radioItemProps = _a.radioItemProps, datePickerProps = _a.datePickerProps, dateRangePickerProps = _a.dateRangePickerProps, _d = _a.className, className = _d === void 0 ? "" : _d;
937
+ // Estado interno del componente
938
+ var _e = React.useState(initialType), type = _e[0], setType = _e[1];
939
+ var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
940
+ var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
941
+ // Combinar traducciones por defecto con las proporcionadas
942
+ var t = __assign(__assign({}, defaultTranslations$5), translations);
943
+ var handleTypeChange = function (value) {
944
+ var newType = value;
945
+ setType(newType);
946
+ // Limpiar valores cuando cambia el tipo
947
+ if (newType === exports.HolidayType.SingleDay) {
948
+ setDateRange(null);
949
+ }
950
+ else {
951
+ setDate(null);
952
+ }
953
+ // Notificar cambio
954
+ onChange === null || onChange === void 0 ? void 0 : onChange({
955
+ type: newType,
956
+ date: newType === exports.HolidayType.SingleDay ? date : null,
957
+ dateRange: newType === exports.HolidayType.DateRange ? dateRange : null,
958
+ });
959
+ };
960
+ var handleDateChange = function (selectedDate) {
961
+ setDate(selectedDate);
962
+ onChange === null || onChange === void 0 ? void 0 : onChange({
963
+ type: type,
964
+ date: selectedDate,
965
+ dateRange: null,
966
+ });
967
+ };
968
+ var handleDateRangeChange = function (range) {
969
+ setDateRange(range);
970
+ onChange === null || onChange === void 0 ? void 0 : onChange({
971
+ type: type,
972
+ date: null,
973
+ dateRange: range,
974
+ });
975
+ };
976
+ return (jsxRuntime.jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center ".concat(className), children: [jsxRuntime.jsxs(react.RadioGroup, __assign({ color: "primary", orientation: "horizontal", size: "sm", value: type, onValueChange: handleTypeChange }, radioGroupProps, { children: [jsxRuntime.jsx(react.Radio, __assign({ value: exports.HolidayType.SingleDay }, radioItemProps, { children: t.dayOption })), jsxRuntime.jsx(react.Radio, __assign({ value: exports.HolidayType.DateRange }, radioItemProps, { children: t.dateRangeOption }))] })), type === exports.HolidayType.DateRange ? (jsxRuntime.jsx(react.DateRangePicker, __assign({ className: "xs:w-full md:flex-1 md:max-w-xs", value: dateRange || null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsxRuntime.jsx(react.DatePicker, __assign({ className: "xs:w-full md:flex-1 md:max-w-40", value: date || null, onChange: handleDateChange, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }, datePickerProps)))] }));
977
+ };
978
+
979
+ var H1 = function (_a) {
980
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
981
+ return (jsxRuntime.jsx("h1", __assign({ className: react.cn("text-xl font-bold", className) }, props, { children: children })));
982
+ };
983
+
984
+ var H3 = function (_a) {
985
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
986
+ return (jsxRuntime.jsx("h3", __assign({ className: react.cn("text-base font-medium", className) }, props, { children: children })));
987
+ };
988
+
989
+ var H4 = function (_a) {
990
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
991
+ return (jsxRuntime.jsx("h4", __assign({ className: react.cn("text-sm font-medium ", className) }, props, { children: children })));
992
+ };
993
+
994
+ var ConfigMenu = function (_a) {
995
+ var _b;
996
+ var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
997
+ return (jsxRuntime.jsxs(react.Dropdown, { className: "min-w-40", children: [jsxRuntime.jsx(react.DropdownTrigger, { children: jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "default", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:settings-linear" }) }) }), jsxRuntime.jsxs(react.DropdownMenu, { "aria-label": "Configuration", children: [jsxRuntime.jsx(react.DropdownSection, { showDivider: true, className: "mb-0", children: options.map(function (item) { return (jsxRuntime.jsx(react.DropdownItem, { href: item.href, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
998
+ base: "text-default-500",
999
+ }, startContent: item.icon ? jsxRuntime.jsx(IconComponent, { icon: item.icon }) : undefined, children: item.label }, item.label)); }) }), jsxRuntime.jsx(react.DropdownSection, { children: jsxRuntime.jsx(react.DropdownItem, { onPress: onLogout, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
1000
+ base: "text-default-500",
1001
+ }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:logout-2-linear" }), children: (_b = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _b !== void 0 ? _b : "Logout" }, "logout") })] })] }));
1002
+ };
1003
+ ConfigMenu.displayName = "ConfigMenu";
1004
+
1005
+ var NotificationButton = function (_a) {
1006
+ var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
1007
+ return (jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "secondary", variant: "flat", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:bell-bing-linear" }), children: notificationCount > 0 && (jsxRuntime.jsx("span", { className: "notification__alert", children: notificationCount })) }));
1008
+ };
1009
+ NotificationButton.displayName = "NotificationButton";
1010
+
1011
+ var HeaderComponent = function (_a) {
1012
+ var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations;
1013
+ return (jsxRuntime.jsxs("header", { className: "header__container", children: [jsxRuntime.jsx(react.Button, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [jsxRuntime.jsx(NotificationButton, { notificationCount: notificationCount }), jsxRuntime.jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }));
1014
+ };
1015
+ HeaderComponent.displayName = "Header";
1016
+
1017
+ function normalizeClass(value) {
1018
+ if (typeof value === "string") {
1019
+ return value || undefined;
1020
+ }
1021
+ if (Array.isArray(value)) {
1022
+ return value.filter(Boolean).join(" ") || undefined;
1023
+ }
1024
+ return undefined;
1025
+ }
1026
+ var getSectionClasses = function (isCollapsed, sectionClassesProp) {
1027
+ if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
1028
+ return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
1029
+ var k = _a[0], v = _a[1];
1030
+ return [k, normalizeClass(v)];
1031
+ }))), { base: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
1032
+ "p-0 max-w-[44px]": isCollapsed,
1033
+ })), group: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.group, {
1034
+ "flex flex-col gap-1": isCollapsed,
1035
+ })), heading: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.heading, {
1036
+ hidden: isCollapsed,
1037
+ })) }));
1038
+ };
1039
+ var getItemClasses = function (isCollapsed, itemClassesProp) {
1040
+ if (itemClassesProp === void 0) { itemClassesProp = {}; }
1041
+ return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
1042
+ var k = _a[0], v = _a[1];
1043
+ return [k, normalizeClass(v)];
1044
+ }))), { base: normalizeClass(react.cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
1045
+ "w-11 h-11 gap-0 p-0": isCollapsed,
1046
+ })) }));
1047
+ };
1048
+
1049
+ var EnumMenuNavListItem;
1050
+ (function (EnumMenuNavListItem) {
1051
+ EnumMenuNavListItem["Nest"] = "nest";
1052
+ })(EnumMenuNavListItem || (EnumMenuNavListItem = {}));
1053
+
1054
+ /**
1055
+ * @component MenuNavList
1056
+ * @description A versatile navigation list component that can be displayed in an expanded or collapsed state.
1057
+ * It supports nested items, sections, and tooltips for items in the collapsed state.
1058
+ *
1059
+ * @param {MenuNavListProps} props - Props for configuring the component.
1060
+ * @param {MenuNavListItem[]} props.items - Array of items to display in the list.
1061
+ * @param {boolean} [props.isCollapsed] - If `true`, the menu is displayed in its collapsed state (icons only).
1062
+ * @param {React.Key} [props.defaultSelectedKey] - The key of the default selected item.
1063
+ * @param {(key: React.Key) => void} [props.onSelect] - Callback executed when an item is selected.
1064
+ * @param {boolean} [props.hideEndContent] - If `true`, hides the end content of the items.
1065
+ * @param {object} [props.sectionClasses] - CSS classes to customize the sections.
1066
+ * @param {object} [props.itemClasses] - CSS classes to customize the items.
1067
+ * @param {string} [props.iconClassName] - CSS class for the icons.
1068
+ * @param {object} [props.classNames] - CSS classes to customize the Listbox component.
1069
+ * @param {string} [props.className] - CSS class for the main container.
1070
+ *
1071
+ * @forwardRef
1072
+ */
1073
+ var MenuNavList = React.forwardRef(function (_a, ref) {
1074
+ var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
1075
+ var _d = React.useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
1076
+ // Component styles
1077
+ var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
1078
+ var itemClasses = getItemClasses(isCollapsed, itemClassesProp);
1079
+ // Handles the click event on an item, updating the selection state.
1080
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
1081
+ var handleItemPress = React.useCallback(function (item, parentKey) {
1082
+ var keySelected = typeof parentKey === "string" ? parentKey : item.key;
1083
+ setSelected(keySelected);
1084
+ // Force blur to remove hover state after click.
1085
+ if (document.activeElement instanceof HTMLElement) {
1086
+ document.activeElement.blur();
1087
+ }
1088
+ }, [setSelected]);
1089
+ // Renders the item displayed inside the Popover when the menu is collapsed.
1090
+ var renderCompactItem = React.useCallback(function (item, parentKey) {
1091
+ var _a, _b;
1092
+ return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
1093
+ }, [handleItemPress, iconClassName]);
1094
+ // Renders a nested item, i.e., an item that has sub-items.
1095
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
1096
+ var renderNestItem = React.useCallback(function (item) {
1097
+ var _a, _b, _c, _d, _e, _f, _g;
1098
+ var isNestType = item.items &&
1099
+ ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1100
+ (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
1101
+ if (isNestType) {
1102
+ item.href = undefined;
1103
+ }
1104
+ return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, classNames: {
1105
+ base: react.cn({
1106
+ "h-auto p-0": !isCollapsed && isNestType,
1107
+ }, {
1108
+ "inline-block w-11": isCollapsed && isNestType,
1109
+ }, {
1110
+ "data-[selected=true]:bg-primary-100 h-11 justify-center items-center flex": isCollapsed && isNestType,
1111
+ }, "rounded-large"),
1112
+ }, endContent: isCollapsed || isNestType || hideEndContent
1113
+ ? null
1114
+ : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-foreground", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), title: isCollapsed || isNestType ? null : item.title }),
1115
+ isCollapsed && isNestType ? (jsxRuntime.jsxs(react.Popover, { placement: "right", offset: 10, children: [jsxRuntime.jsx(react.PopoverTrigger, { children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", classNames: {
1116
+ base: "text-default-500",
1117
+ }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) }) }) }), jsxRuntime.jsx(react.PopoverContent, { className: "p-0", children: jsxRuntime.jsxs("div", { className: "min-w-[200px] rounded-large p-2", children: [jsxRuntime.jsx("div", { className: "p-2 text-small font-semibold text-default-500", children: item.title }), jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", "aria-label": "Nested menu items", items: item.items, variant: "flat", children: item.items && ((_e = item.items) === null || _e === void 0 ? void 0 : _e.length) > 0
1118
+ ? item.items.map(function (child) {
1119
+ return renderCompactItem(child, item.key);
1120
+ })
1121
+ : renderCompactItem(item) })] }) })] })) : null,
1122
+ !isCollapsed && isNestType ? (jsxRuntime.jsx(react.Accordion, { className: "p-0", children: jsxRuntime.jsx(react.AccordionItem, { "aria-label": item.title, classNames: {
1123
+ heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
1124
+ trigger: "p-0",
1125
+ content: "py-0 pl-4",
1126
+ }, title: item.icon ? (jsxRuntime.jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" }), jsxRuntime.jsx("span", { className: "text-small font-medium text-default-500 group-data-[selected=true]:text-default-600", children: item.title })] })) : (((_f = item.startContent) !== null && _f !== void 0 ? _f : null)), children: item.items && ((_g = item.items) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", classNames: {
1127
+ list: react.cn("border-l border-default-200 pl-4"),
1128
+ }, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
1129
+ }, [isCollapsed, hideEndContent, iconClassName, items, selected]);
1130
+ // Renders a simple item (without children) in the navigation list.
1131
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
1132
+ var renderItem = React.useCallback(function (item, parentKey) {
1133
+ var _a, _b, _c, _d;
1134
+ var isNestType = item.items &&
1135
+ ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1136
+ (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
1137
+ if (isNestType) {
1138
+ return renderNestItem(item);
1139
+ }
1140
+ var isItemSelected = selected === item.key;
1141
+ return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
1142
+ base: "text-default-500",
1143
+ }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
1144
+ },
1145
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1146
+ [isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
1147
+ return (jsxRuntime.jsx(react.Listbox, __assign({ ref: ref, hideSelectedIcon: true, as: "nav", className: react.cn("list-none", className), classNames: __assign(__assign({}, classNames), { list: react.cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign(__assign({}, itemClasses), { base: react.cn("px-3 min-h-11 rounded-large h-[44px] data-[selected=true]:bg-primary-100", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base), title: react.cn("text-small font-medium text-default-500 group-data-[selected=true]:text-default-600 ", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.title) }), items: items, selectedKeys: [selected], selectionMode: "single", variant: "flat" }, props, { children: function (item) {
1148
+ var _a, _b;
1149
+ return item.items &&
1150
+ ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1151
+ (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest ? (renderNestItem(item)) : item.items && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxRuntime.jsx(react.ListboxSection, { classNames: sectionClasses, showDivider: isCollapsed, title: item.title, children: item.items.map(renderItem) }, item.key)) : (renderItem(item));
1152
+ } }), isCollapsed ? "compact" : "default"));
1153
+ });
1154
+ MenuNavList.displayName = "MenuNavList";
1155
+
1156
+ /**
1157
+ * Sidebar menu component for navigation and user actions.
1158
+ * @param commerceInfo - Object with logo and name of the company.
1159
+ * @param userInfo - Object with user avatar, name, and email.
1160
+ * @param helpButton - Help button configuration.
1161
+ * @param upgradeCard - Optional upgrade card configuration.
1162
+ * @param isOpenSidebar - Controls sidebar visibility.
1163
+ * @param onOpenSidebarChange - Callback to open/close sidebar.
1164
+ */
1165
+ var MenuComponent = React.memo(function Menu(_a) {
1166
+ var commerceInfo = _a.commerceInfo, userInfo = _a.userInfo, helpButton = _a.helpButton, upgradeCard = _a.upgradeCard, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, menuItems = _a.menuItems;
1167
+ // State to control menu collapse on desktop devices
1168
+ var _b = React.useState(false), isCollapsed = _b[0], setIsCollapsed = _b[1];
1169
+ // Memoized handlers for performance
1170
+ var handleSidebarClose = React.useCallback(function () {
1171
+ onOpenSidebarChange === null || onOpenSidebarChange === void 0 ? void 0 : onOpenSidebarChange(false);
1172
+ }, [onOpenSidebarChange]);
1173
+ var handleCollapseToggle = React.useCallback(function () {
1174
+ setIsCollapsed(function (prev) { return !prev; });
1175
+ }, []);
1176
+ var handleUpgradeClick = React.useCallback(function () {
1177
+ if (upgradeCard) {
1178
+ window.open(upgradeCard.buttonLink, "_blank");
1179
+ }
1180
+ }, [upgradeCard]);
1181
+ var handleHelpClick = React.useCallback(function () {
1182
+ window.open(helpButton.redirect, "_blank");
1183
+ }, [helpButton]);
1184
+ if (!isOpenSidebar) {
1185
+ return null;
1186
+ }
1187
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { type: "button", "aria-label": "Close sidebar", className: "fixed inset-0 bg-black bg-opacity-40 z-40 xs:block sm:hidden", onClick: handleSidebarClose, style: { border: "none", padding: 0, margin: 0 } }), jsxRuntime.jsx("div", { className: "container__menu ".concat(isCollapsed
1188
+ ? "container__menu--collapsed"
1189
+ : "container__menu--expanded"), children: jsxRuntime.jsxs("div", { className: "content__menu", children: [jsxRuntime.jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsxRuntime.jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsxRuntime.jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsxRuntime.jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsxRuntime.jsx(IconComponent, { icon: isCollapsed
1190
+ ? "solar:alt-arrow-right-outline"
1191
+ : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), jsxRuntime.jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxRuntime.jsxs("div", { className: "collapsible-item flex flex-col", children: [jsxRuntime.jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsxRuntime.jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsxRuntime.jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsxRuntime.jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxRuntime.jsxs("div", { className: "collapsible-item relative", children: [jsxRuntime.jsxs(react.Card, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxRuntime.jsxs(react.CardBody, { className: "items-center py-5 text-center gap-1", children: [jsxRuntime.jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsxRuntime.jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsxRuntime.jsx(react.CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsxRuntime.jsx(react.Button, { className: "px-10 shadow-md", color: "primary", radius: "full", variant: "shadow", onPress: handleUpgradeClick, children: upgradeCard.buttonText }) })] }), jsxRuntime.jsx(react.Spacer, { y: 9 })] })), jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item", children: helpButton.title })) }) })] }) })] }));
1192
+ });
1193
+
1194
+ var StepIndicator = function (_a) {
1195
+ var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.showStepText, showStepText = _c === void 0 ? true : _c, stepTextFormatter = _a.stepTextFormatter, className = _a.className, props = __rest(_a, ["currentStep", "totalSteps", "color", "showStepText", "stepTextFormatter", "className"]);
1196
+ var progressPercentage = Math.min((currentStep / totalSteps) * 100, 100);
1197
+ var colorClasses = {
1198
+ primary: "bg-primary",
1199
+ secondary: "bg-secondary",
1200
+ success: "bg-success",
1201
+ warning: "bg-warning",
1202
+ danger: "bg-danger",
1203
+ };
1204
+ var defaultStepText = function (current, total) {
1205
+ return "Step ".concat(current, " of ").concat(total);
1206
+ };
1207
+ var stepText = stepTextFormatter
1208
+ ? stepTextFormatter(currentStep, totalSteps)
1209
+ : defaultStepText(currentStep, totalSteps);
1210
+ return (jsxRuntime.jsxs("div", __assign({ className: react.cn("w-full", className) }, props, { children: [showStepText && (jsxRuntime.jsx("div", { className: "text-center text-sm font-medium text-default-400 mb-3", children: stepText })), jsxRuntime.jsx("div", { className: "w-full bg-content2 rounded-full h-2 overflow-hidden", children: jsxRuntime.jsx("div", { className: react.cn("h-full transition-all duration-300 ease-out rounded-full", colorClasses[color]), style: { width: "".concat(progressPercentage, "%") } }) })] })));
1211
+ };
1212
+
1213
+ /*
1214
+ * Copyright 2020 Adobe. All rights reserved.
1215
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1216
+ * you may not use this file except in compliance with the License. You may obtain a copy
1217
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1218
+ *
1219
+ * Unless required by applicable law or agreed to in writing, software distributed under
1220
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1221
+ * OF ANY KIND, either express or implied. See the License for the specific language
1222
+ * governing permissions and limitations under the License.
1223
+ */
1224
+ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
1225
+ let [stateValue, setStateValue] = (React.useState)(value || defaultValue);
1226
+ let isControlledRef = (React.useRef)(value !== undefined);
1227
+ let isControlled = value !== undefined;
1228
+ (React.useEffect)(()=>{
1229
+ let wasControlled = isControlledRef.current;
1230
+ if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
1231
+ isControlledRef.current = isControlled;
1232
+ }, [
1233
+ isControlled
1234
+ ]);
1235
+ let currentValue = isControlled ? value : stateValue;
1236
+ let setValue = (React.useCallback)((value, ...args)=>{
1237
+ let onChangeCaller = (value, ...onChangeArgs)=>{
1238
+ if (onChange) {
1239
+ if (!Object.is(currentValue, value)) onChange(value, ...onChangeArgs);
1240
+ }
1241
+ if (!isControlled) // If uncontrolled, mutate the currentValue local variable so that
1242
+ // calling setState multiple times with the same value only emits onChange once.
1243
+ // We do not use a ref for this because we specifically _do_ want the value to
1244
+ // reset every render, and assigning to a ref in render breaks aborted suspended renders.
1245
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1246
+ currentValue = value;
1247
+ };
1248
+ if (typeof value === 'function') {
1249
+ if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
1250
+ // this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
1251
+ // when someone using useControlledState calls setControlledState(myFunc)
1252
+ // this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
1253
+ // if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
1254
+ // otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
1255
+ let updateFunction = (oldValue, ...functionArgs)=>{
1256
+ let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
1257
+ onChangeCaller(interceptedValue, ...args);
1258
+ if (!isControlled) return interceptedValue;
1259
+ return oldValue;
1260
+ };
1261
+ setStateValue(updateFunction);
1262
+ } else {
1263
+ if (!isControlled) setStateValue(value);
1264
+ onChangeCaller(value, ...args);
1265
+ }
1266
+ }, [
1267
+ isControlled,
1268
+ currentValue,
1269
+ onChange
1270
+ ]);
1271
+ return [
1272
+ currentValue,
1273
+ setValue
1274
+ ];
1275
+ }
1276
+
1277
+ var defaultTranslations$4 = {
1278
+ checkIconTitle: "Check",
1279
+ };
1280
+ var VerticalSteps = React.forwardRef(function (_a, ref) {
1281
+ var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
1282
+ var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
1283
+ var t = __assign(__assign({}, defaultTranslations$4), translations);
1284
+ var steps = React.useMemo(function () {
1285
+ if (typeof stepsProp === "number") {
1286
+ return Array.from({ length: stepsProp }, function () { return ({}); });
1287
+ }
1288
+ return stepsProp;
1289
+ }, [stepsProp]);
1290
+ var colors = React.useMemo(function () {
1291
+ var _a;
1292
+ var colorMappings = {
1293
+ primary: [
1294
+ "[--step-color:hsl(var(--heroui-primary))]",
1295
+ "[--step-fg-color:hsl(var(--heroui-primary-foreground))]",
1296
+ ],
1297
+ secondary: [
1298
+ "[--step-color:hsl(var(--heroui-secondary))]",
1299
+ "[--step-fg-color:hsl(var(--heroui-secondary-foreground))]",
1300
+ ],
1301
+ success: [
1302
+ "[--step-color:hsl(var(--heroui-success))]",
1303
+ "[--step-fg-color:hsl(var(--heroui-success-foreground))]",
1304
+ ],
1305
+ warning: [
1306
+ "[--step-color:hsl(var(--heroui-warning))]",
1307
+ "[--step-fg-color:hsl(var(--heroui-warning-foreground))]",
1308
+ ],
1309
+ danger: [
1310
+ "[--step-color:hsl(var(--heroui-danger))]",
1311
+ "[--step-fg-color:hsl(var(--heroui-danger-foreground))]",
1312
+ ],
1313
+ default: [
1314
+ "[--step-color:hsl(var(--heroui-default))]",
1315
+ "[--step-fg-color:hsl(var(--heroui-default-foreground))]",
1316
+ ],
1317
+ };
1318
+ var _b = (_a = colorMappings[color]) !== null && _a !== void 0 ? _a : colorMappings.primary, userColor = _b[0], fgColor = _b[1];
1319
+ var colorsVars = [
1320
+ "[--active-fg-color:var(--step-fg-color)]",
1321
+ "[--active-border-color:var(--step-color)]",
1322
+ "[--active-color:var(--step-color)]",
1323
+ "[--complete-background-color:var(--step-color)]",
1324
+ "[--complete-border-color:var(--step-color)]",
1325
+ "[--inactive-border-color:hsl(var(--heroui-default-300))]",
1326
+ "[--inactive-color:hsl(var(--heroui-default-300))]",
1327
+ ];
1328
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-fg-color"))) {
1329
+ colorsVars.unshift(fgColor);
1330
+ }
1331
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-color"))) {
1332
+ colorsVars.unshift(userColor);
1333
+ }
1334
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--inactive-bar-color"))) {
1335
+ colorsVars.push("[--inactive-bar-color:hsl(var(--heroui-default-300))]");
1336
+ }
1337
+ return colorsVars;
1338
+ }, [color, className]);
1339
+ return (jsxRuntime.jsx("nav", { "aria-label": "Progress", className: "max-w-fit", children: jsxRuntime.jsx("ol", { className: react.cn("flex flex-col gap-y-3", colors, className), children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
1340
+ var status = currentStep === stepIdx
1341
+ ? "active"
1342
+ : currentStep < stepIdx
1343
+ ? "inactive"
1344
+ : "complete";
1345
+ return (
1346
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
1347
+ jsxRuntime.jsxs("li", { className: "relative", children: [jsxRuntime.jsx("div", { className: "flex w-full max-w-full items-center", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer items-center justify-center gap-4 px-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsxRuntime.jsx("div", { className: "flex h-full items-center", children: jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx("div", { className: "relative", children: jsxRuntime.jsx(framerMotion.m.div, { animate: status, className: react.cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
1348
+ "shadow-lg": status === "complete",
1349
+ }), "data-status": status, initial: false, transition: { duration: 0.25 }, variants: {
1350
+ inactive: {
1351
+ backgroundColor: "transparent",
1352
+ borderColor: "var(--inactive-border-color)",
1353
+ color: "var(--inactive-color)",
1354
+ },
1355
+ active: {
1356
+ backgroundColor: "transparent",
1357
+ borderColor: "var(--active-border-color)",
1358
+ color: "var(--active-color)",
1359
+ },
1360
+ complete: {
1361
+ backgroundColor: "var(--complete-background-color)",
1362
+ borderColor: "var(--complete-border-color)",
1363
+ },
1364
+ }, children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), jsxRuntime.jsx("div", { className: "flex-1 text-left", children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: react.cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
1365
+ "text-default-300": status === "inactive",
1366
+ }), children: step.title }), jsxRuntime.jsx("div", { className: react.cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
1367
+ "text-default-300": status === "inactive",
1368
+ }), children: step.description })] }) })] }), stepIdx) }), stepIdx < steps.length - 1 && !hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: react.cn("pointer-events-none absolute top-[calc(64px*var(--idx)+1)] left-3 flex h-1/2 -translate-y-1/3 items-center px-4"), style: {
1369
+ // @ts-ignore
1370
+ "--idx": stepIdx,
1371
+ }, children: jsxRuntime.jsx("div", { className: react.cn("relative h-full w-0.5 bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-0 after:w-full after:bg-[var(--active-border-color)] after:transition-[height] after:duration-300 after:content-['']", {
1372
+ "after:h-full": stepIdx < currentStep,
1373
+ }) }) }))] }, stepIdx));
1374
+ }) }) }));
1375
+ });
1376
+ VerticalSteps.displayName = "VerticalSteps";
1377
+
1378
+ var stepperClasses = react.cn(
1379
+ // light
1380
+ "[--step-color:hsl(var(--heroui-primary-400))]", "[--active-color:hsl(var(--heroui-primary-400))]", "[--inactive-border-color:hsl(var(--heroui-primary-200))]", "[--inactive-bar-color:hsl(var(--heroui-primary-200))]", "[--inactive-color:hsl(var(--heroui-primary-300))]",
1381
+ // dark
1382
+ "dark:[--step-color:rgba(255,255,255,0.1)]", "dark:[--active-color:hsl(var(--heroui-foreground-600))]", "dark:[--active-border-color:rgba(255,255,255,0.5)]", "dark:[--inactive-border-color:rgba(255,255,255,0.1)]", "dark:[--inactive-bar-color:rgba(255,255,255,0.1)]", "dark:[--inactive-color:rgba(255,255,255,0.2)]");
1383
+ var MultiStepSidebar = React.forwardRef(function (_a, ref) {
1384
+ var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onChangePage", "steps", "goBackTranslation", "onClose"]);
1385
+ var handleOverlayClick = function (e) {
1386
+ if (e.target === e.currentTarget) {
1387
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1388
+ }
1389
+ };
1390
+ return (jsxRuntime.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-content3/50 backdrop-blur-sm", onClick: handleOverlayClick, children: jsxRuntime.jsxs("div", __assign({ ref: ref, className: react.cn("flex h-full w-full max-w-4xl rounded-lg bg-background shadow-lg lg:h-auto", className) }, props, { children: [jsxRuntime.jsx("div", { className: "hidden w-1/3 flex-col items-center justify-center gap-y-8 p-8 md:flex", children: jsxRuntime.jsx(VerticalSteps, { className: stepperClasses, color: "primary", currentStep: currentPage, steps: steps, onStepChange: onChangePage }) }), jsxRuntime.jsxs("div", { className: "relative flex h-auto justify-between w-full flex-col items-center gap-4 md:p-4 lg:w-2/3", children: [jsxRuntime.jsx(Button, { isIconOnly: true, className: "absolute right-4 top-4", size: "sm", variant: "light", color: "default", onPress: onClose, startContent: jsxRuntime.jsx(IconComponent, { className: "text-foreground", icon: "material-symbols:close-rounded", size: "lg" }) }), jsxRuntime.jsx("div", { className: "pt-9 w-10/12 md:hidden", children: jsxRuntime.jsx("div", { className: "flex w-full justify-center", children: jsxRuntime.jsx(StepIndicator, { className: react.cn(stepperClasses), currentStep: currentPage + 1, totalSteps: steps.length }) }) }), jsxRuntime.jsx("div", { className: " flex flex-col h-full w-full justify-between p-4 sm:max-w-md md:max-w-lg", children: children })] })] })) }));
1391
+ });
1392
+ MultiStepSidebar.displayName = "MultiStepSidebar";
1393
+
1394
+ var MultistepNavigationButtons = function (_a) {
1395
+ var nextButtonProps = _a.nextButtonProps, cancelButtonProps = _a.cancelButtonProps, className = _a.className;
1396
+ // const { children: backButtonChildren, ...restBackButtonProps } =
1397
+ // backButtonProps || {};
1398
+ var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest(_b, ["children"]);
1399
+ var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest(_c, ["children"]);
1400
+ return (jsxRuntime.jsx("div", { className: react.cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsxRuntime.jsx(react.Button, __assign({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsxRuntime.jsx(react.Button, __assign({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1401
+ };
1402
+
1403
+ var variants = {
1404
+ enter: function (direction) { return ({
1405
+ y: direction > 0 ? 30 : -30,
1406
+ opacity: 0,
1407
+ }); },
1408
+ center: {
1409
+ zIndex: 1,
1410
+ y: 0,
1411
+ opacity: 1,
1412
+ },
1413
+ exit: function (direction) { return ({
1414
+ zIndex: 0,
1415
+ y: direction < 0 ? 30 : -30,
1416
+ opacity: 0,
1417
+ }); },
1418
+ };
1419
+ var MultiStepWizard = function (_a) {
1420
+ var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText;
1421
+ var _b = React.useState([0, 0]), _c = _b[0], page = _c[0], direction = _c[1], setPage = _b[1];
1422
+ React.useEffect(function () {
1423
+ if (isOpen) {
1424
+ setPage([0, 0]);
1425
+ }
1426
+ }, [isOpen]);
1427
+ var t = __assign({
1428
+ continue: "Continue",
1429
+ goBack: "Back",
1430
+ cancel: "Cancel",
1431
+ next: "Next",
1432
+ complete: "Complete",
1433
+ }, translations);
1434
+ var paginate = React.useCallback(function (newDirection) {
1435
+ setPage(function (prev) {
1436
+ var nextPage = prev[0] + newDirection;
1437
+ if (nextPage < 0 || nextPage > steps.length - 1) {
1438
+ return prev;
1439
+ }
1440
+ return [nextPage, newDirection];
1441
+ });
1442
+ }, [steps]);
1443
+ var onChangePage = React.useCallback(function (newPage) {
1444
+ setPage(function (prev) {
1445
+ if (newPage < 0 || newPage > steps.length - 1) {
1446
+ return prev;
1447
+ }
1448
+ var currentPage = prev[0];
1449
+ return [newPage, newPage > currentPage ? 1 : -1];
1450
+ });
1451
+ }, [steps]);
1452
+ var onBack = React.useCallback(function () {
1453
+ paginate(-1);
1454
+ }, [paginate]);
1455
+ var onNext = React.useCallback(function () {
1456
+ paginate(1);
1457
+ }, [paginate]);
1458
+ // Determinar el texto del botón según el paso
1459
+ var getButtonText = function () {
1460
+ if (page === 0) {
1461
+ return t.next;
1462
+ }
1463
+ if (page === steps.length - 1) {
1464
+ return completeButtonText || t.complete;
1465
+ }
1466
+ return t.continue;
1467
+ };
1468
+ // Determinar la acción del botón según el paso
1469
+ var handleNextAction = function () {
1470
+ if (page === steps.length - 1) {
1471
+ // Último paso: ejecutar acción de completado
1472
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete();
1473
+ }
1474
+ else {
1475
+ // Otros pasos: continuar al siguiente
1476
+ onNext();
1477
+ }
1478
+ };
1479
+ var content = React.useMemo(function () {
1480
+ return (jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx(framerMotion.m.div, { animate: "center", className: "col-span-12", custom: direction, exit: "exit", initial: "exit", transition: {
1481
+ y: {
1482
+ ease: "backOut",
1483
+ duration: 0.35,
1484
+ },
1485
+ opacity: { duration: 0.4 },
1486
+ }, variants: variants, children: steps[page].content }, page) }));
1487
+ }, [page, steps, direction]);
1488
+ if (!isOpen) {
1489
+ return null;
1490
+ }
1491
+ return (jsxRuntime.jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsxRuntime.jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsxRuntime.jsx(MultistepNavigationButtons, { backButtonProps: {
1492
+ isDisabled: page === 0,
1493
+ onPress: onBack,
1494
+ children: t.goBack,
1495
+ }, cancelButtonProps: {
1496
+ onPress: onClose,
1497
+ children: t.cancel,
1498
+ }, nextButtonProps: {
1499
+ children: getButtonText(),
1500
+ onPress: handleNextAction,
1501
+ isDisabled: steps[page].isStepValid === false,
1502
+ } })] }));
1503
+ };
1504
+
1505
+ var Pagination = function (_a) {
1506
+ _a.size; var props = __rest(_a, ["size"]);
1507
+ return jsxRuntime.jsx(react.Pagination, __assign({ showControls: true, isCompact: true }, props));
1508
+ };
1509
+
1510
+ // Lista simple de países con bandera emoji y código
1511
+ var countries = [
1512
+ { code: "+57", name: "Colombia", flag: "🇨🇴" },
1513
+ { code: "+54", name: "Argentina", flag: "🇦🇷" },
1514
+ { code: "+55", name: "Brazil", flag: "🇧🇷" },
1515
+ { code: "+52", name: "Mexico", flag: "🇲🇽" },
1516
+ { code: "+503", name: "El Salvador", flag: "🇸🇻" },
1517
+ { code: "+51", name: "Peru", flag: "🇵🇪" },
1518
+ { code: "+56", name: "Chile", flag: "🇨🇱" },
1519
+ { code: "+1", name: "United States", flag: "🇺🇸" },
1520
+ { code: "+7", name: "Russia", flag: "🇷🇺" },
1521
+ { code: "+20", name: "Egypt", flag: "🇪🇬" },
1522
+ { code: "+27", name: "South Africa", flag: "🇿🇦" },
1523
+ { code: "+33", name: "France", flag: "🇫🇷" },
1524
+ { code: "+34", name: "Spain", flag: "🇪🇸" },
1525
+ { code: "+39", name: "Italy", flag: "🇮🇹" },
1526
+ { code: "+44", name: "United Kingdom", flag: "🇬🇧" },
1527
+ { code: "+49", name: "Germany", flag: "🇩🇪" },
1528
+ { code: "+51", name: "Peru", flag: "🇵🇪" },
1529
+ { code: "+52", name: "Mexico", flag: "🇲🇽" },
1530
+ { code: "+54", name: "Argentina", flag: "🇦🇷" },
1531
+ { code: "+55", name: "Brazil", flag: "🇧🇷" },
1532
+ { code: "+56", name: "Chile", flag: "🇨🇱" },
1533
+ { code: "+57", name: "Colombia", flag: "🇨🇴" },
1534
+ { code: "+60", name: "Malaysia", flag: "🇲🇾" },
1535
+ { code: "+61", name: "Australia", flag: "🇦🇺" },
1536
+ { code: "+62", name: "Indonesia", flag: "🇮🇩" },
1537
+ { code: "+64", name: "New Zealand", flag: "🇳🇿" },
1538
+ { code: "+65", name: "Singapore", flag: "🇸🇬" },
1539
+ { code: "+66", name: "Thailand", flag: "🇹🇭" },
1540
+ { code: "+81", name: "Japan", flag: "🇯🇵" },
1541
+ { code: "+82", name: "South Korea", flag: "🇰🇷" },
1542
+ { code: "+84", name: "Vietnam", flag: "🇻🇳" },
1543
+ { code: "+86", name: "China", flag: "🇨🇳" },
1544
+ { code: "+91", name: "India", flag: "🇮🇳" },
1545
+ { code: "+351", name: "Portugal", flag: "🇵🇹" },
1546
+ { code: "+503", name: "El Salvador", flag: "🇸🇻" },
1547
+ { code: "+966", name: "Saudi Arabia", flag: "🇸🇦" },
1548
+ { code: "+971", name: "UAE", flag: "🇦🇪" },
1549
+ ];
1550
+ var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
1551
+ // Traducciones por defecto
1552
+ var defaultTranslations$3 = {
1553
+ label: "Teléfono",
1554
+ placeholder: "Número de teléfono",
1555
+ searchPlaceholder: "Buscar país...",
1556
+ selectCountryAriaLabel: "Seleccionar país",
1557
+ expandListAriaLabel: "Desplegar lista de países",
1558
+ noCountriesFound: "No se encontraron países",
1559
+ };
1560
+
1561
+ var Phone = function (_a) {
1562
+ var id = _a.id, label = _a.label, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.errorText, errorText = _d === void 0 ? "" : _d, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.name, name = _f === void 0 ? "phone" : _f, _g = _a.translations, translations = _g === void 0 ? {} : _g;
1563
+ var _h = React.useState(false), isDropdownOpen = _h[0], setIsDropdownOpen = _h[1];
1564
+ var _j = React.useState(uniqueCountries[0]), selectedCountry = _j[0], setSelectedCountry = _j[1];
1565
+ var _k = React.useState(""), inputValue = _k[0], setInputValue = _k[1];
1566
+ var dropdownRef = React.useRef(null);
1567
+ var portalDropdownRef = React.useRef(null);
1568
+ var _l = React.useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
1569
+ var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
1570
+ var t = __assign(__assign({}, defaultTranslations$3), translations);
1571
+ var finalLabel = label || t.label;
1572
+ React.useEffect(function () {
1573
+ if (value) {
1574
+ var found = uniqueCountries.find(function (c) { return c.code === value.countryCode; });
1575
+ if (found) {
1576
+ setSelectedCountry(found);
1577
+ }
1578
+ setInputValue(value.phoneNumber);
1579
+ }
1580
+ }, [value]);
1581
+ React.useEffect(function () {
1582
+ if (isDropdownOpen) {
1583
+ setFilteredCountries(uniqueCountries);
1584
+ }
1585
+ }, [isDropdownOpen]);
1586
+ React.useLayoutEffect(function () {
1587
+ if (isDropdownOpen && dropdownRef.current) {
1588
+ var rect = dropdownRef.current.getBoundingClientRect();
1589
+ setDropdownPosition({
1590
+ position: "absolute",
1591
+ top: "".concat(rect.bottom + window.scrollY + 4, "px"),
1592
+ left: "".concat(rect.left + window.scrollX, "px"),
1593
+ width: "15rem",
1594
+ zIndex: 50,
1595
+ });
1596
+ }
1597
+ }, [isDropdownOpen]);
1598
+ React.useEffect(function () {
1599
+ var handleClickOutside = function (event) {
1600
+ if (dropdownRef.current &&
1601
+ !dropdownRef.current.contains(event.target) &&
1602
+ portalDropdownRef.current &&
1603
+ !portalDropdownRef.current.contains(event.target)) {
1604
+ setIsDropdownOpen(false);
1605
+ }
1606
+ };
1607
+ if (isDropdownOpen) {
1608
+ document.addEventListener("mousedown", handleClickOutside);
1609
+ }
1610
+ return function () {
1611
+ document.removeEventListener("mousedown", handleClickOutside);
1612
+ };
1613
+ }, [isDropdownOpen]);
1614
+ var handleCountrySelect = function (country) {
1615
+ setSelectedCountry(country);
1616
+ setIsDropdownOpen(false);
1617
+ if (onChange) {
1618
+ onChange({ countryCode: country.code, phoneNumber: inputValue });
1619
+ }
1620
+ };
1621
+ var handleInputChange = function (e) {
1622
+ var val = e.target.value.replace(/\D/g, "");
1623
+ setInputValue(val);
1624
+ if (onChange) {
1625
+ onChange({ countryCode: selectedCountry.code, phoneNumber: val });
1626
+ }
1627
+ };
1628
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: " text-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
1629
+ reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
1630
+ var searchTerm = e.target.value.toLowerCase();
1631
+ var filtered = uniqueCountries.filter(function (country) {
1632
+ return country.name.toLowerCase().includes(searchTerm) ||
1633
+ country.code.toLowerCase().includes(searchTerm);
1634
+ });
1635
+ setFilteredCountries(filtered);
1636
+ } }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.code === selectedCountry.code
1637
+ ? "bg-primary-50"
1638
+ : ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3 text-lg", children: country.flag }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: country.code })] }, country.code)); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
1639
+ };
1640
+
1641
+ var defaultTranslations$2 = {
1642
+ message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
1643
+ buttonText: "Explore",
1644
+ closeButtonLabel: "Close Banner",
1645
+ };
1646
+ /**
1647
+ * PromotionalBanner genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
1648
+ */
1649
+ var PromotionalBanner = function (_a) {
1650
+ var message = _a.message, buttonText = _a.buttonText, _b = _a.messageHref, messageHref = _b === void 0 ? "#" : _b, _c = _a.buttonHref, buttonHref = _c === void 0 ? "#" : _c, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? true : _d, _e = _a.isVisible, isVisible = _e === void 0 ? true : _e, _f = _a.gradientColors, gradientColors = _f === void 0 ? ["default-100", "danger-100", "secondary-100"] : _f, _g = _a.buttonGradientColors, buttonGradientColors = _g === void 0 ? ["#F871A0", "#9353D3"] : _g, onClose = _a.onClose, onMessageClick = _a.onMessageClick, onButtonClick = _a.onButtonClick, _h = _a.messageLinkProps, messageLinkProps = _h === void 0 ? {} : _h, _j = _a.buttonProps, buttonProps = _j === void 0 ? {} : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k;
1651
+ var t = __assign(__assign({}, defaultTranslations$2), translations);
1652
+ var finalMessage = message || t.message;
1653
+ var finalButtonText = buttonText || t.buttonText;
1654
+ var handleClose = function () {
1655
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1656
+ };
1657
+ var handleMessageClick = function () {
1658
+ onMessageClick === null || onMessageClick === void 0 ? void 0 : onMessageClick();
1659
+ };
1660
+ var handleButtonClick = function () {
1661
+ onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick();
1662
+ };
1663
+ if (!isVisible) {
1664
+ return null;
1665
+ }
1666
+ var fromColor = gradientColors[0], viaColor = gradientColors[1], toColor = gradientColors[2];
1667
+ var buttonGradient1 = buttonGradientColors[0], buttonGradient2 = buttonGradientColors[1];
1668
+ return (jsxRuntime.jsxs("div", { className: "border-divider flex w-full items-center gap-x-3 border-b-1 bg-gradient-to-r from-".concat(fromColor, " via-").concat(viaColor, " to-").concat(toColor, " px-6 py-2 sm:px-3.5 sm:before:flex-1"), children: [jsxRuntime.jsx("p", { className: "text-small text-foreground", children: jsxRuntime.jsxs(react.Link, __assign({ className: "text-inherit", href: messageHref, onClick: handleMessageClick }, messageLinkProps, { children: [finalMessage, "\u00A0"] })) }), jsxRuntime.jsx(react.Button, __assign({ as: react.Link, className: "group text-small relative h-9 overflow-hidden bg-transparent font-normal", color: "default", endContent: jsxRuntime.jsx(IconComponent, { className: "flex-none transition-transform outline-hidden group-data-[hover=true]:translate-x-0.5 [&>path]:stroke-2", icon: "solar:arrow-right-linear", size: "sm" }), href: buttonHref, style: {
1669
+ border: "solid 2px transparent",
1670
+ backgroundImage: "linear-gradient(hsl(var(--heroui-danger-50)), hsl(var(--heroui-danger-50))), linear-gradient(to right, ".concat(buttonGradient1, ", ").concat(buttonGradient2, ")"),
1671
+ backgroundOrigin: "border-box",
1672
+ backgroundClip: "padding-box, border-box",
1673
+ }, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: jsxRuntime.jsx(react.Button, { isIconOnly: true, "aria-label": t.closeButtonLabel, className: "-m-1", size: "lg", variant: "bordered", onClick: handleClose, children: jsxRuntime.jsx(IconComponent, { "aria-hidden": "true", className: "text-default-500", icon: "lucide:x", size: "md" }) }) }))] }));
1674
+ };
1675
+
1676
+ var RowSteps = React.forwardRef(function (_a, ref) {
1677
+ var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className; _a.translations; var props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
1678
+ var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
1679
+ var steps = React.useMemo(function () {
1680
+ if (typeof stepsProp === "number") {
1681
+ return Array.from({ length: stepsProp }, function () { return ({}); });
1682
+ }
1683
+ return stepsProp;
1684
+ }, [stepsProp]);
1685
+ var colors = React.useMemo(function () {
1686
+ var _a;
1687
+ var colorMappings = {
1688
+ primary: [
1689
+ "[--step-color:hsl(var(--heroui-primary))]",
1690
+ "[--step-fg-color:hsl(var(--heroui-primary-foreground))]",
1691
+ ],
1692
+ secondary: [
1693
+ "[--step-color:hsl(var(--heroui-secondary))]",
1694
+ "[--step-fg-color:hsl(var(--heroui-secondary-foreground))]",
1695
+ ],
1696
+ success: [
1697
+ "[--step-color:hsl(var(--heroui-success))]",
1698
+ "[--step-fg-color:hsl(var(--heroui-success-foreground))]",
1699
+ ],
1700
+ warning: [
1701
+ "[--step-color:hsl(var(--heroui-warning))]",
1702
+ "[--step-fg-color:hsl(var(--heroui-warning-foreground))]",
1703
+ ],
1704
+ danger: [
1705
+ "[--step-color:hsl(var(--heroui-danger))]",
1706
+ "[--step-fg-color:hsl(var(--heroui-danger-foreground))]",
1707
+ ],
1708
+ default: [
1709
+ "[--step-color:hsl(var(--heroui-default))]",
1710
+ "[--step-fg-color:hsl(var(--heroui-default-foreground))]",
1711
+ ],
1712
+ };
1713
+ var _b = (_a = colorMappings[color]) !== null && _a !== void 0 ? _a : colorMappings.primary, userColor = _b[0], fgColor = _b[1];
1714
+ var colorsVars = [
1715
+ "[--active-fg-color:var(--step-fg-color)]",
1716
+ "[--active-border-color:var(--step-color)]",
1717
+ "[--active-color:var(--step-color)]",
1718
+ "[--complete-background-color:var(--step-color)]",
1719
+ "[--complete-border-color:var(--step-color)]",
1720
+ "[--inactive-border-color:hsl(var(--heroui-default-300))]",
1721
+ "[--inactive-color:hsl(var(--heroui-default-300))]",
1722
+ ];
1723
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-fg-color"))) {
1724
+ colorsVars.unshift(fgColor);
1725
+ }
1726
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-color"))) {
1727
+ colorsVars.unshift(userColor);
1728
+ }
1729
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--inactive-bar-color"))) {
1730
+ colorsVars.push("[--inactive-bar-color:hsl(var(--heroui-default-300))]");
1731
+ }
1732
+ return colorsVars;
1733
+ }, [color, className]);
1734
+ return (jsxRuntime.jsx("nav", { "aria-label": "Progress", className: "-my-4 max-w-fit overflow-x-auto py-4", children: jsxRuntime.jsx("ol", { className: react.cn("flex flex-row flex-nowrap gap-x-3", colors, className), children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
1735
+ var status = currentStep === stepIdx
1736
+ ? "active"
1737
+ : currentStep < stepIdx
1738
+ ? "inactive"
1739
+ : "complete";
1740
+ return (jsxRuntime.jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsxRuntime.jsx("div", { className: "h-ful relative flex items-center", children: jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx(framerMotion.m.div, { animate: status, className: "relative", children: jsxRuntime.jsx(framerMotion.m.div, { className: react.cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
1741
+ "shadow-lg": status === "complete",
1742
+ }), initial: false, transition: { duration: 0.25 }, variants: {
1743
+ inactive: {
1744
+ backgroundColor: "transparent",
1745
+ borderColor: "var(--inactive-border-color)",
1746
+ color: "var(--inactive-color)",
1747
+ },
1748
+ active: {
1749
+ backgroundColor: "transparent",
1750
+ borderColor: "var(--active-border-color)",
1751
+ color: "var(--active-color)",
1752
+ },
1753
+ complete: {
1754
+ backgroundColor: "var(--complete-background-color)",
1755
+ borderColor: "var(--complete-border-color)",
1756
+ },
1757
+ }, children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded" })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), step.title && (jsxRuntime.jsx("div", { className: "max-w-full flex-1 text-start", children: jsxRuntime.jsx("div", { className: react.cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
1758
+ "text-default-300": status === "inactive",
1759
+ }), children: step.title }) })), stepIdx < steps.length - 1 && !hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
1760
+ // @ts-ignore
1761
+ "--idx": stepIdx,
1762
+ }, children: jsxRuntime.jsx("div", { className: react.cn("relative h-0.5 w-full bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-full after:w-0 after:bg-[var(--active-border-color)] after:transition-[width] after:duration-300 after:content-['']", {
1763
+ "after:w-full": stepIdx < currentStep,
1764
+ }) }) }))] }), stepIdx) }, stepIdx));
1765
+ }) }) }));
1766
+ });
1767
+ RowSteps.displayName = "RowSteps";
1768
+
1769
+ function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
1770
+ return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
1771
+ }
1772
+ function $14e0f24ef4ac5c92$var$timeToMs(a) {
1773
+ return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
1774
+ }
1775
+
1776
+ function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
1777
+ let inverseDuration = {};
1778
+ for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
1779
+ return inverseDuration;
1780
+ }
1781
+ function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
1782
+ let mutableValue = value.copy();
1783
+ if (fields.hour != null) mutableValue.hour = fields.hour;
1784
+ if (fields.minute != null) mutableValue.minute = fields.minute;
1785
+ if (fields.second != null) mutableValue.second = fields.second;
1786
+ if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
1787
+ $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
1788
+ return mutableValue;
1789
+ }
1790
+ function $735220c2d4774dd3$var$balanceTime(time) {
1791
+ time.second += Math.floor(time.millisecond / 1000);
1792
+ time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
1793
+ time.minute += Math.floor(time.second / 60);
1794
+ time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
1795
+ time.hour += Math.floor(time.minute / 60);
1796
+ time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
1797
+ let days = Math.floor(time.hour / 24);
1798
+ time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
1799
+ return days;
1800
+ }
1801
+ function $735220c2d4774dd3$export$7555de1e070510cb(time) {
1802
+ time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
1803
+ time.second = Math.max(0, Math.min(time.second, 59));
1804
+ time.minute = Math.max(0, Math.min(time.minute, 59));
1805
+ time.hour = Math.max(0, Math.min(time.hour, 23));
1806
+ }
1807
+ function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
1808
+ let result = a % b;
1809
+ if (result < 0) result += b;
1810
+ return result;
1811
+ }
1812
+ function $735220c2d4774dd3$var$addTimeFields(time, duration) {
1813
+ time.hour += duration.hours || 0;
1814
+ time.minute += duration.minutes || 0;
1815
+ time.second += duration.seconds || 0;
1816
+ time.millisecond += duration.milliseconds || 0;
1817
+ return $735220c2d4774dd3$var$balanceTime(time);
1818
+ }
1819
+ function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
1820
+ let res = time.copy();
1821
+ $735220c2d4774dd3$var$addTimeFields(res, duration);
1822
+ return res;
1823
+ }
1824
+ function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
1825
+ return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
1826
+ }
1827
+ function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
1828
+ let mutable = value.copy();
1829
+ switch(field){
1830
+ case 'hour':
1831
+ {
1832
+ let hours = value.hour;
1833
+ let min = 0;
1834
+ let max = 23;
1835
+ if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
1836
+ let isPM = hours >= 12;
1837
+ min = isPM ? 12 : 0;
1838
+ max = isPM ? 23 : 11;
1839
+ }
1840
+ mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
1841
+ break;
1842
+ }
1843
+ case 'minute':
1844
+ mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
1845
+ break;
1846
+ case 'second':
1847
+ mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
1848
+ break;
1849
+ case 'millisecond':
1850
+ mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
1851
+ break;
1852
+ default:
1853
+ throw new Error('Unsupported field ' + field);
1854
+ }
1855
+ return mutable;
1856
+ }
1857
+ function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
1858
+ if (round) {
1859
+ value += Math.sign(amount);
1860
+ if (value < min) value = max;
1861
+ let div = Math.abs(amount);
1862
+ if (amount > 0) value = Math.ceil(value / div) * div;
1863
+ else value = Math.floor(value / div) * div;
1864
+ if (value > max) value = min;
1865
+ } else {
1866
+ value += amount;
1867
+ if (value < min) value = max - (min - value - 1);
1868
+ else if (value > max) value = min + (value - max - 1);
1869
+ }
1870
+ return value;
1871
+ }
1872
+
1873
+ function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
1874
+ return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
1875
+ }
1876
+
1877
+ function _check_private_redeclaration(obj, privateCollection) {
1878
+ if (privateCollection.has(obj)) {
1879
+ throw new TypeError("Cannot initialize the same private elements twice on an object");
1880
+ }
1881
+ }
1882
+
1883
+ function _class_private_field_init(obj, privateMap, value) {
1884
+ _check_private_redeclaration(obj, privateMap);
1885
+ privateMap.set(obj, value);
1886
+ }
1887
+
1888
+ var // This prevents TypeScript from allowing other types with the same fields to match.
1889
+ // @ts-ignore
1890
+ $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
1891
+ class $35ea8db9cb2ccb90$export$680ea196effce5f {
1892
+ /** Returns a copy of this time. */ copy() {
1893
+ return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
1894
+ }
1895
+ /** Returns a new `Time` with the given duration added to it. */ add(duration) {
1896
+ return ($735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
1897
+ }
1898
+ /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
1899
+ return ($735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
1900
+ }
1901
+ /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1902
+ return ($735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
1903
+ }
1904
+ /**
1905
+ * Returns a new `Time` with the given field adjusted by a specified amount.
1906
+ * When the resulting value reaches the limits of the field, it wraps around.
1907
+ */ cycle(field, amount, options) {
1908
+ return ($735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
1909
+ }
1910
+ /** Converts the time to an ISO 8601 formatted string. */ toString() {
1911
+ return ($fae977aafc393c5c$export$f59dee82248f5ad4)(this);
1912
+ }
1913
+ /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
1914
+ return ($14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
1915
+ }
1916
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
1917
+ (_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type1, {
1918
+ writable: true,
1919
+ value: void 0
1920
+ });
1921
+ this.hour = hour;
1922
+ this.minute = minute;
1923
+ this.second = second;
1924
+ this.millisecond = millisecond;
1925
+ ($735220c2d4774dd3$export$7555de1e070510cb)(this);
1926
+ }
1927
+ }
1928
+
1929
+ var Switch = function (_a) {
1930
+ var id = _a.id, props = __rest(_a, ["id"]);
1931
+ var generatedId = React.useId();
1932
+ var autoId = id || generatedId;
1933
+ return jsxRuntime.jsx(react.Switch, __assign({}, props, { id: autoId }));
1934
+ };
1935
+
1936
+ /**
1937
+ * TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
1938
+ */
1939
+ var TimeInput = function (_a) {
1940
+ var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "bordered" : _d, props = __rest(_a, ["label", "id", "size", "radius", "variant"]);
1941
+ var generatedId = React.useId();
1942
+ var autoId = id || generatedId;
1943
+ return (jsxRuntime.jsx(react.TimeInput, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
1944
+ label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
1945
+ inputWrapper: "focus-within:!border-primary-500",
1946
+ } })));
1947
+ };
1948
+
1949
+ /**
1950
+ * @component ScheduleRow
1951
+ * @description A React component for managing the schedule of a single day.
1952
+ * It allows users to open or close the schedule, add or remove time slots,
1953
+ * and modify the start and end times of each slot. The component is fully
1954
+ * controlled and reports changes to the parent via the `onChange` callback.
1955
+ *
1956
+ * @param {ScheduleRowProps} props - The props for the component.
1957
+ * @returns {React.ReactElement} The rendered ScheduleRow component.
1958
+ */
1959
+ var ScheduleRow = function (_a) {
1960
+ var day = _a.day, daySchedule = _a.daySchedule, translations = _a.translations, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
1961
+ /**
1962
+ * @function validateTimeSlots
1963
+ * @description Validates all time slots to ensure the "from" time is not after the "to" time.
1964
+ * @param {TimeSlot[]} timeSlots - The array of time slots to validate.
1965
+ * @returns {TimeSlot[]} The updated array of time slots with error messages if any.
1966
+ */
1967
+ var validateTimeSlots = function (timeSlots) {
1968
+ return timeSlots.map(function (slot) {
1969
+ if (slot.from && slot.to) {
1970
+ var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
1971
+ var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
1972
+ if (fromTime.compare(toTime) > 0) {
1973
+ return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
1974
+ }
1975
+ }
1976
+ return __assign(__assign({}, slot), { error: null });
1977
+ });
1978
+ };
1979
+ /**
1980
+ * @function toTimeValue
1981
+ * @description Converts a time string (e.g., "09:00") to a `TimeValue` object
1982
+ * required by the `TimeInput` component.
1983
+ * @param {string} time - The time string to convert.
1984
+ * @returns {TimeValue | null} The corresponding `TimeValue` object, or `null` if the input is empty.
1985
+ */
1986
+ var toTimeValue = function (time) {
1987
+ if (!time) {
1988
+ return null;
1989
+ }
1990
+ var _a = time.split(":").map(Number), hour = _a[0], minute = _a[1];
1991
+ return new $35ea8db9cb2ccb90$export$680ea196effce5f(hour, minute);
1992
+ };
1993
+ /**
1994
+ * @function fromTimeValue
1995
+ * @description Converts a `TimeValue` object back to a formatted time string (e.g., "09:00").
1996
+ * @param {TimeValue | null} time - The `TimeValue` object to convert.
1997
+ * @returns {string} The formatted time string.
1998
+ */
1999
+ var fromTimeValue = function (time) {
2000
+ if (!time) {
2001
+ return "";
2002
+ }
2003
+ return "".concat(String(time.hour).padStart(2, "0"), ":").concat(String(time.minute).padStart(2, "0"));
2004
+ };
2005
+ /**
2006
+ * @function handleToggleDay
2007
+ * @description Toggles the `isOpen` status of the schedule for the day.
2008
+ */
2009
+ var handleToggleDay = function () {
2010
+ onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
2011
+ };
2012
+ /**
2013
+ * @function handleTimeChange
2014
+ * @description Updates the time for a specific time slot.
2015
+ * @param {number} index - The index of the time slot to modify.
2016
+ * @param {"from" | "to"} field - The field to update ("from" or "to").
2017
+ * @param {TimeValue | null} value - The new time value from the `TimeInput` component.
2018
+ */
2019
+ var handleTimeChange = function (index, field, value) {
2020
+ var _a;
2021
+ var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
2022
+ newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
2023
+ var validatedSlots = validateTimeSlots(newTimeSlots);
2024
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
2025
+ };
2026
+ /**
2027
+ * @function handleAddTimeSlot
2028
+ * @description Adds a new, empty time slot to the schedule.
2029
+ */
2030
+ var handleAddTimeSlot = function () {
2031
+ var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
2032
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
2033
+ };
2034
+ /**
2035
+ * @function handleRemoveTimeSlot
2036
+ * @description Removes a time slot from the schedule at the specified index.
2037
+ * @param {number} index - The index of the time slot to remove.
2038
+ */
2039
+ var handleRemoveTimeSlot = function (index) {
2040
+ var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
2041
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
2042
+ };
2043
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsxRuntime.jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsxRuntime.jsx(react.Chip, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? translations.open : translations.closed })] }), jsxRuntime.jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsxRuntime.jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsxRuntime.jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: translations.copyToAll })] })] }), daySchedule.isOpen && (jsxRuntime.jsxs("div", { className: "flex flex-col justify-around gap-y-3 ", children: [daySchedule.timeSlots.map(function (slot, index) { return (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxRuntime.jsx(TimeInput, { label: translations.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsxRuntime.jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), jsxRuntime.jsx(TimeInput, { label: translations.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: daySchedule.timeSlots.length === 1, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) })] }, "".concat(day, "-timeslot-").concat(slot.from, "-").concat(slot.to, "-").concat(index))); }), daySchedule.timeSlots.length < 2 && (jsxRuntime.jsx(Button, { size: "sm", variant: "flat", onPress: function () { return handleAddTimeSlot(); }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), children: translations.addTimeSlot }))] }))] }, day));
2044
+ };
2045
+
2046
+ /**
2047
+ * Select genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
2048
+ *
2049
+ * Reglas aplicadas:
2050
+ * - Variant: Bordered (por defecto)
2051
+ * - Radius: md (por defecto)
2052
+ * - labelPlacement: Outside
2053
+ * - Size: sm, md, lg (configurable)
2054
+ */
2055
+ var Select = function (_a) {
2056
+ var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
2057
+ var generatedId = React.useId();
2058
+ var selectId = id || generatedId;
2059
+ return (jsxRuntime.jsx("div", { className: "group", children: jsxRuntime.jsx(react.Select, __assign({}, props, { id: selectId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
2060
+ label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
2061
+ trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
2062
+ popoverContent: "[&_[data-focus-visible=true]]:!outline-none [&_[data-selectable=true]:focus]:!bg-primary-50 [&_li]:!text-default-500 [&_li[data-hover=true]]:!text-default-600",
2063
+ } })) }));
2064
+ };
2065
+
2066
+ function AuraTable(_a) {
2067
+ var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
2068
+ return (jsxRuntime.jsxs(react.Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsxRuntime.jsx(react.TableHeader, { columns: columns, children: function (column) { return jsxRuntime.jsx(react.TableColumn, { children: column.label }, column.key); } }), jsxRuntime.jsx(react.TableBody, { items: items, children: function (item) { return (jsxRuntime.jsx(react.TableRow, { children: function (columnKey) { return (jsxRuntime.jsx(react.TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
2069
+ }
2070
+
2071
+ /**
2072
+ * Textarea component that wraps the HeroUI TextArea component.
2073
+ */
2074
+ var Textarea = function (_a) {
2075
+ var id = _a.id, label = _a.label, placeholder = _a.placeholder, description = _a.description, errorMessage = _a.errorMessage, _b = _a.variant, variant = _b === void 0 ? "bordered" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.size, size = _d === void 0 ? "md" : _d; _a.labelPlacement; var props = __rest(_a, ["id", "label", "placeholder", "description", "errorMessage", "variant", "radius", "size", "labelPlacement"]);
2076
+ var generatedId = React.useId();
2077
+ var autoId = id || generatedId;
2078
+ return (jsxRuntime.jsx(react.Textarea, __assign({}, props, { id: autoId, label: label, variant: variant, radius: radius, size: size, labelPlacement: "outside", placeholder: placeholder, description: description, errorMessage: errorMessage, classNames: {
2079
+ label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
2080
+ inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
2081
+ } })));
2082
+ };
2083
+
2084
+ // Traducciones por defecto en español según las reglas de diseño
2085
+ var defaultTranslations$1 = {
2086
+ lightTheme: "Claro",
2087
+ darkTheme: "Oscuro",
2088
+ };
2089
+ /**
2090
+ * Selector de tema visual con preview interactivo siguiendo las reglas de diseño BeweOS.
2091
+ *
2092
+ * Reglas aplicadas:
2093
+ * - Soporte completo de traducciones mediante props
2094
+ * - Sin dependencias de sistemas i18n específicos
2095
+ * - Dark mode compatible
2096
+ * - Uso exclusivo de Tailwind CSS
2097
+ */
2098
+ var ThemePicker = function (_a) {
2099
+ var value = _a.value, onChange = _a.onChange, className = _a.className, _b = _a.translations, translations = _b === void 0 ? {} : _b;
2100
+ // Combinar traducciones por defecto con las proporcionadas
2101
+ var t = __assign(__assign({}, defaultTranslations$1), translations);
2102
+ var themes = [
2103
+ {
2104
+ key: "light",
2105
+ label: t.lightTheme,
2106
+ cardClass: "bg-white border border-[#E4E4E7] text-zinc-900",
2107
+ previewClass: "bg-[#F4F4F5] border border-[#E4E4E7]",
2108
+ labelClass: "font-medium text-[14px] leading-[20px] text-zinc-900",
2109
+ radioColor: "primary",
2110
+ previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#E4E4E7] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#E4E4E7] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#E4E4E7]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#E4E4E7]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#F4F4F5] rounded-lg mt-2" })] })),
1895
2111
  },
1896
- },
1897
- "green-dark": {
1898
- extend: "dark",
1899
- colors: {
1900
- primary: {
1901
- 50: "#EFFFEF",
1902
- 100: "#CFFCD1",
1903
- 200: "#A0F9AC",
1904
- 300: "#6FEE8D",
1905
- 400: "#49DE7B",
1906
- 500: "#16C964",
1907
- 600: "#10AC64",
1908
- 700: "#0B905F",
1909
- 800: "#077457",
1910
- 900: "#046051",
1911
- foreground: "#000",
1912
- DEFAULT: "#16C964",
1913
- },
1914
- secondary: {
1915
- "50": "#e3eaff",
1916
- "100": "#D7DFFE",
1917
- "200": "#AFBFFE",
1918
- "300": "#889DFD",
1919
- "400": "#6A82FB",
1920
- "500": "#3956F9",
1921
- "600": "#2941D6",
1922
- "700": "#1C2EB3",
1923
- "800": "#121F90",
1924
- "900": "#0A1477",
1925
- foreground: "#fff",
1926
- DEFAULT: "#3956F9",
1927
- },
1928
- success: {
1929
- "50": "#e7fde3",
1930
- "100": "#E8FCD3",
1931
- "200": "#CBFAA8",
1932
- "300": "#A4F17B",
1933
- "400": "#7EE358",
1934
- "500": "#49D127",
1935
- "600": "#2FB31C",
1936
- "700": "#1A9613",
1937
- "800": "#0C790E",
1938
- "900": "#076410",
1939
- foreground: "#000",
1940
- DEFAULT: "#49D127",
1941
- },
1942
- warning: {
1943
- "50": "#fff9da",
1944
- "100": "#FFF7CC",
1945
- "200": "#FFEE99",
1946
- "300": "#FFE266",
1947
- "400": "#FFD63F",
1948
- "500": "#FFC300",
1949
- "600": "#DBA200",
1950
- "700": "#B78300",
1951
- "800": "#936600",
1952
- "900": "#7A5100",
1953
- foreground: "#000",
1954
- DEFAULT: "#FFC300",
1955
- },
1956
- danger: {
1957
- "50": "#ffe2e5",
1958
- "100": "#FFE3D8",
1959
- "200": "#FFC1B2",
1960
- "300": "#FF988B",
1961
- "400": "#FF726F",
1962
- "500": "#FF3F4C",
1963
- "600": "#DB2E49",
1964
- "700": "#B71F45",
1965
- "800": "#93143F",
1966
- "900": "#7A0C3B",
1967
- foreground: "#fff",
1968
- DEFAULT: "#FF3F4C",
1969
- },
1970
- focus: "#66cc8a",
1971
- overlay: "#ffffff",
2112
+ {
2113
+ key: "dark",
2114
+ label: t.darkTheme,
2115
+ cardClass: "bg-black border border-[#3F3F46] text-white",
2116
+ previewClass: "bg-[#27272A] border border-[#3F3F46]",
2117
+ labelClass: "font-medium text-[14px] leading-[20px] text-white",
2118
+ radioColor: "primary",
2119
+ previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#3F3F46] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#3F3F46] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#3F3F46]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#3F3F46]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#27272A] rounded-lg mt-2" })] })),
1972
2120
  },
1973
- },
2121
+ ];
2122
+ return (jsxRuntime.jsx(react.RadioGroup, { value: value, onChange: function (e) { return onChange(e.target.value); }, className: "flex justify-center ".concat(className || ""), orientation: "horizontal", classNames: {
2123
+ wrapper: "gap-3",
2124
+ }, children: themes.map(function (theme) { return (jsxRuntime.jsxs("div", { className: "relative rounded-2xl ".concat(theme.cardClass, " p-4 flex-1 transition-all duration-200 flex flex-col justify-start"), children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsxRuntime.jsx("span", { className: theme.labelClass, children: theme.label }), jsxRuntime.jsx(react.Radio, { "aria-label": theme.label, color: theme.radioColor, size: "sm", value: theme.key })] }), theme.previewContent] }, theme.key)); }) }));
2125
+ };
2126
+
2127
+ var ToastContext = React.createContext(undefined);
2128
+ var useAuraToast = function () {
2129
+ var context = React.useContext(ToastContext);
2130
+ if (!context) {
2131
+ throw new Error("useAuraToast must be used within a AuraToastProvider");
2132
+ }
2133
+ return context;
2134
+ };
2135
+
2136
+ function GlobalToast() {
2137
+ var _a = useAuraToast(), toast = _a.toast, hideToast = _a.hideToast;
2138
+ if (!toast.isVisible) {
2139
+ return null;
2140
+ }
2141
+ return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-50 w-full max-w-sm", children: jsxRuntime.jsx(react.Alert, { hideIconWrapper: true, color: toast.color, variant: "flat", title: toast.title, description: toast.description, isClosable: true, onClose: hideToast }) }));
2142
+ }
2143
+
2144
+ // Traducciones por defecto en español
2145
+ var defaultTranslations = {
2146
+ uploadText: "Da clic y selecciona tus archivos",
2147
+ subText: "",
2148
+ dragText: "Suelta el archivo aquí",
2149
+ multipleFilesError: "Solo puedes subir un archivo",
2150
+ maxFilesError: "Puedes subir máximo {maxFiles} archivos",
2151
+ invalidFileTypeError: "Solo se aceptan archivos de tipo: {acceptedTypes}",
2152
+ maxFileSizeError: "El archivo excede el tamaño máximo permitido de {maxSize}",
2153
+ removeFileAriaLabel: "Remover archivo",
2154
+ uploadAreaAriaLabel: "Área de carga de archivos",
2155
+ cropModalTitle: "Recortar imagen",
2156
+ cropSaveButton: "Guardar",
2157
+ cropCancelButton: "Cancelar",
2158
+ cropZoomLabel: "Zoom",
2159
+ cropInstructions: "Arrastra para mover la imagen y usa el zoom para ajustar el tamaño",
2160
+ cropBackgroundLabel: "Color de fondo",
2161
+ cropBackgroundWhite: "Blanco",
2162
+ cropBackgroundBlack: "Negro",
2163
+ cropBackgroundTransparent: "Transparente",
2164
+ };
2165
+ /**
2166
+ * Formatea el tipo de archivo para mostrar
2167
+ */
2168
+ var formatFileType = function (type) {
2169
+ var _a;
2170
+ if (type.startsWith(".")) {
2171
+ return type.toUpperCase();
2172
+ }
2173
+ if (type.includes("/")) {
2174
+ var parts = type.split("/");
2175
+ return ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || type;
2176
+ }
2177
+ return type.toUpperCase();
2178
+ };
2179
+ /**
2180
+ * Formatea el tamaño del archivo de forma legible
2181
+ */
2182
+ var formatFileSize = function (bytes) {
2183
+ if (bytes === 0) {
2184
+ return "0 Bytes";
2185
+ }
2186
+ var k = 1024;
2187
+ var sizes = ["Bytes", "KB", "MB", "GB"];
2188
+ var i = Math.floor(Math.log(bytes) / Math.log(k));
2189
+ return "".concat(Math.round(bytes / Math.pow(k, i)), " ").concat(sizes[i]);
2190
+ };
2191
+ /**
2192
+ * Componente de recorte de imagen usando Canvas API
2193
+ */
2194
+ var ImageCropModal = function (_a) {
2195
+ var isOpen = _a.isOpen, imageUrl = _a.imageUrl, targetWidth = _a.targetWidth, targetHeight = _a.targetHeight, onSave = _a.onSave, onCancel = _a.onCancel, translations = _a.translations;
2196
+ var canvasRef = React.useRef(null);
2197
+ var _b = React.useState(null), imageElement = _b[0], setImageElement = _b[1];
2198
+ var _c = React.useState(0), zoomValue = _c[0], setZoomValue = _c[1]; // Valor del slider de -1 a 1
2199
+ var _d = React.useState({ x: 0, y: 0 }), position = _d[0], setPosition = _d[1];
2200
+ var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
2201
+ var _f = React.useState({ x: 0, y: 0 }), dragStart = _f[0], setDragStart = _f[1];
2202
+ var _g = React.useState(1), baseScale = _g[0], setBaseScale = _g[1]; // Escala base inicial
2203
+ var _h = React.useState({ width: 400, height: 300 }), canvasSize = _h[0], setCanvasSize = _h[1];
2204
+ var _j = React.useState("white"), backgroundColor = _j[0], setBackgroundColor = _j[1];
2205
+ // Función para convertir el valor del zoom slider a escala real
2206
+ var getScaleFromZoom = function (zoomValue) {
2207
+ if (zoomValue === 0) {
2208
+ return baseScale;
2209
+ }
2210
+ if (zoomValue > 0) {
2211
+ // Zoom in: de baseScale a baseScale * 3
2212
+ return baseScale + baseScale * 2 * zoomValue;
2213
+ }
2214
+ // Zoom out: de baseScale * 0.3 a baseScale
2215
+ return baseScale + baseScale * 0.7 * zoomValue;
2216
+ };
2217
+ var currentScale = getScaleFromZoom(zoomValue);
2218
+ // Cargar imagen cuando se abre el modal
2219
+ React.useEffect(function () {
2220
+ if (isOpen && imageUrl) {
2221
+ var img_1 = new Image();
2222
+ img_1.onload = function () {
2223
+ setImageElement(img_1);
2224
+ // Calcular escala inicial para que la imagen quepa en el área de crop
2225
+ var scaleX = targetWidth / img_1.width;
2226
+ var scaleY = targetHeight / img_1.height;
2227
+ var initialScale = Math.max(scaleX, scaleY);
2228
+ setBaseScale(initialScale);
2229
+ setZoomValue(0); // Empezar en el centro
2230
+ setPosition({ x: 0, y: 0 });
2231
+ setBackgroundColor("white"); // Reset color de fondo
2232
+ };
2233
+ img_1.src = imageUrl;
2234
+ }
2235
+ }, [isOpen, imageUrl, targetWidth, targetHeight]);
2236
+ // Dibujar en el canvas
2237
+ React.useEffect(function () {
2238
+ if (!(imageElement && canvasRef.current)) {
2239
+ return;
2240
+ }
2241
+ var canvas = canvasRef.current;
2242
+ var ctx = canvas.getContext("2d");
2243
+ if (!ctx) {
2244
+ return;
2245
+ }
2246
+ // Limpiar canvas
2247
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
2248
+ // Dibujar fondo gris del canvas
2249
+ ctx.fillStyle = "#f3f4f6";
2250
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
2251
+ // Calcular posición y tamaño de la imagen
2252
+ var imgWidth = imageElement.width * currentScale;
2253
+ var imgHeight = imageElement.height * currentScale;
2254
+ var imgX = (canvas.width - imgWidth) / 2 + position.x;
2255
+ var imgY = (canvas.height - imgHeight) / 2 + position.y;
2256
+ // Dibujar imagen
2257
+ ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
2258
+ // Dibujar overlay para mostrar área de recorte
2259
+ ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
2260
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
2261
+ // Limpiar área de recorte (centro)
2262
+ var cropX = (canvas.width - targetWidth) / 2;
2263
+ var cropY = (canvas.height - targetHeight) / 2;
2264
+ ctx.clearRect(cropX, cropY, targetWidth, targetHeight);
2265
+ // Dibujar color de fondo del área de recorte
2266
+ if (backgroundColor !== "transparent") {
2267
+ ctx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
2268
+ ctx.fillRect(cropX, cropY, targetWidth, targetHeight);
2269
+ }
2270
+ // Redibujar imagen solo en el área de recorte
2271
+ ctx.save();
2272
+ ctx.beginPath();
2273
+ ctx.rect(cropX, cropY, targetWidth, targetHeight);
2274
+ ctx.clip();
2275
+ ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
2276
+ ctx.restore();
2277
+ // Dibujar borde del área de recorte
2278
+ ctx.strokeStyle = "#3b82f6";
2279
+ ctx.lineWidth = 2;
2280
+ ctx.strokeRect(cropX, cropY, targetWidth, targetHeight);
2281
+ }, [
2282
+ imageElement,
2283
+ currentScale,
2284
+ position,
2285
+ targetWidth,
2286
+ targetHeight,
2287
+ backgroundColor,
2288
+ ]);
2289
+ var handleMouseDown = function (e) {
2290
+ var _a;
2291
+ e.preventDefault();
2292
+ setIsDragging(true);
2293
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2294
+ if (rect) {
2295
+ setDragStart({
2296
+ x: e.clientX - rect.left - position.x,
2297
+ y: e.clientY - rect.top - position.y,
2298
+ });
2299
+ }
2300
+ };
2301
+ var handleMouseMove = function (e) {
2302
+ var _a;
2303
+ if (!isDragging) {
2304
+ return;
2305
+ }
2306
+ e.preventDefault();
2307
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2308
+ if (rect) {
2309
+ setPosition({
2310
+ x: e.clientX - rect.left - dragStart.x,
2311
+ y: e.clientY - rect.top - dragStart.y,
2312
+ });
2313
+ }
2314
+ };
2315
+ var handleMouseUp = function () {
2316
+ setIsDragging(false);
2317
+ };
2318
+ // Eventos táctiles para dispositivos móviles
2319
+ var handleTouchStart = function (e) {
2320
+ var _a;
2321
+ e.preventDefault();
2322
+ if (e.touches.length === 1) {
2323
+ setIsDragging(true);
2324
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2325
+ if (rect) {
2326
+ var touch = e.touches[0];
2327
+ setDragStart({
2328
+ x: touch.clientX - rect.left - position.x,
2329
+ y: touch.clientY - rect.top - position.y,
2330
+ });
2331
+ }
2332
+ }
2333
+ };
2334
+ var handleTouchMove = function (e) {
2335
+ var _a;
2336
+ if (!isDragging || e.touches.length !== 1) {
2337
+ return;
2338
+ }
2339
+ e.preventDefault();
2340
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2341
+ if (rect) {
2342
+ var touch = e.touches[0];
2343
+ setPosition({
2344
+ x: touch.clientX - rect.left - dragStart.x,
2345
+ y: touch.clientY - rect.top - dragStart.y,
2346
+ });
2347
+ }
2348
+ };
2349
+ var handleTouchEnd = function () {
2350
+ setIsDragging(false);
2351
+ };
2352
+ var handleSave = function () {
2353
+ if (!(imageElement && canvasRef.current)) {
2354
+ return;
2355
+ }
2356
+ // Crear canvas temporal para el recorte
2357
+ var tempCanvas = document.createElement("canvas");
2358
+ tempCanvas.width = targetWidth;
2359
+ tempCanvas.height = targetHeight;
2360
+ var tempCtx = tempCanvas.getContext("2d");
2361
+ if (!tempCtx) {
2362
+ return;
2363
+ }
2364
+ // Dibujar color de fondo si no es transparente
2365
+ if (backgroundColor !== "transparent") {
2366
+ tempCtx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
2367
+ tempCtx.fillRect(0, 0, targetWidth, targetHeight);
2368
+ }
2369
+ // Calcular parámetros de recorte
2370
+ var canvas = canvasRef.current;
2371
+ var imgWidth = imageElement.width * currentScale;
2372
+ var imgHeight = imageElement.height * currentScale;
2373
+ var imgX = (canvas.width - imgWidth) / 2 + position.x;
2374
+ var imgY = (canvas.height - imgHeight) / 2 + position.y;
2375
+ var cropX = (canvas.width - targetWidth) / 2;
2376
+ var cropY = (canvas.height - targetHeight) / 2;
2377
+ // Calcular área fuente en la imagen original
2378
+ var sourceX = (cropX - imgX) / currentScale;
2379
+ var sourceY = (cropY - imgY) / currentScale;
2380
+ var sourceWidth = targetWidth / currentScale;
2381
+ var sourceHeight = targetHeight / currentScale;
2382
+ // Dibujar recorte sobre el fondo
2383
+ tempCtx.drawImage(imageElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, targetWidth, targetHeight);
2384
+ // Convertir a blob y crear archivo
2385
+ var fileType = backgroundColor === "transparent" ? "image/png" : "image/png";
2386
+ tempCanvas.toBlob(function (blob) {
2387
+ if (blob) {
2388
+ var timestamp = new Date().getTime();
2389
+ var file = new File([blob], "cropped-image-".concat(timestamp, ".png"), {
2390
+ type: fileType,
2391
+ });
2392
+ onSave(file, imageElement.src);
2393
+ }
2394
+ }, fileType);
2395
+ };
2396
+ // Calcular dimensiones responsive del canvas
2397
+ var updateCanvasSize = React.useCallback(function () {
2398
+ var minCanvasWidth = Math.min(350, window.innerWidth - 40);
2399
+ var minCanvasHeight = Math.min(250, window.innerHeight - 300);
2400
+ var newCanvasWidth = Math.max(minCanvasWidth, targetWidth + 60);
2401
+ var newCanvasHeight = Math.max(minCanvasHeight, targetHeight + 60);
2402
+ setCanvasSize({ width: newCanvasWidth, height: newCanvasHeight });
2403
+ }, [targetWidth, targetHeight]);
2404
+ // Actualizar tamaño del canvas al cambiar el tamaño de la ventana
2405
+ React.useEffect(function () {
2406
+ if (!isOpen) {
2407
+ return;
2408
+ }
2409
+ updateCanvasSize();
2410
+ var handleResize = function () {
2411
+ updateCanvasSize();
2412
+ };
2413
+ window.addEventListener("resize", handleResize);
2414
+ return function () {
2415
+ window.removeEventListener("resize", handleResize);
2416
+ };
2417
+ }, [isOpen, updateCanvasSize]);
2418
+ return (jsxRuntime.jsx(react.Modal, { isOpen: isOpen, onClose: onCancel, size: "5xl", className: "sm:max-w-4xl", scrollBehavior: "inside", backdrop: "blur", classNames: {
2419
+ backdrop: "bg-black/80",
2420
+ wrapper: "p-0 sm:p-4",
2421
+ base: "m-0 sm:m-4 max-h-screen sm:max-h-[90vh] w-full sm:w-auto",
2422
+ }, children: jsxRuntime.jsxs(react.ModalContent, { className: "m-0 sm:m-0 h-screen sm:h-auto sm:max-h-[90vh] sm:rounded-lg", children: [jsxRuntime.jsxs(react.ModalHeader, { className: "flex flex-col gap-1 px-4 sm:px-6", children: [translations.cropModalTitle, jsxRuntime.jsx("p", { className: "text-xs sm:text-sm text-gray-500 font-normal", children: translations.cropInstructions })] }), jsxRuntime.jsx(react.ModalBody, { className: "px-4 sm:px-6 py-4", children: jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [jsxRuntime.jsx("div", { className: "flex justify-center overflow-hidden", children: jsxRuntime.jsx("canvas", { ref: canvasRef, width: canvasSize.width, height: canvasSize.height, className: "border border-gray-300 cursor-move select-none max-w-full max-h-[50vh] sm:max-h-[60vh]", onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { touchAction: "none" } }) }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("label", { htmlFor: "zoom-slider", className: "text-sm font-medium", children: translations.cropZoomLabel }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 w-full", children: [jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "-" }), jsxRuntime.jsx(react.Slider, { id: "zoom-slider", size: "sm", step: 0.1, minValue: -1, maxValue: 1, value: zoomValue, onChange: function (value) { return setZoomValue(value); }, className: "flex-1", marks: [
2423
+ { value: -1, label: "Out" },
2424
+ { value: 0, label: "0" },
2425
+ { value: 1, label: "In" },
2426
+ ] }), jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "+" })] })] }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "text-sm font-medium", children: translations.cropBackgroundLabel }), jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-3 sm:gap-4", children: [jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "white", checked: backgroundColor === "white", onChange: function (e) {
2427
+ return setBackgroundColor(e.target.value);
2428
+ }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-white border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundWhite })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "black", checked: backgroundColor === "black", onChange: function (e) {
2429
+ return setBackgroundColor(e.target.value);
2430
+ }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-black border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundBlack })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "transparent", checked: backgroundColor === "transparent", onChange: function (e) {
2431
+ return setBackgroundColor(e.target.value);
2432
+ }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-gray-200 border border-gray-300 rounded", style: {
2433
+ backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
2434
+ backgroundSize: "8px 8px",
2435
+ backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
2436
+ } }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxRuntime.jsxs(react.ModalFooter, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsxRuntime.jsx(react.Button, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsxRuntime.jsx(react.Button, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
1974
2437
  };
1975
-
1976
- var ColorSelector = function (_a) {
1977
- var selectedColor = _a.selectedColor, onColorChange = _a.onColorChange;
1978
- var mode = useThemeContext().mode;
1979
- /**
1980
- * Filters and maps the available theme colors to the current theme mode (light/dark).
1981
- * Each color option contains:
1982
- * - value: the theme name (e.g., "blue-light")
1983
- * - label: the base color name (e.g., "blue")
1984
- * - color: the primary color hex value
1985
- */
1986
- var colorOptions = Object.entries(themeColors)
1987
- .filter(function (_a) {
1988
- var themeData = _a[1];
1989
- var themeMode = themeData.extend;
1990
- return mode === "light" ? themeMode === "light" : themeMode === "dark";
1991
- })
1992
- .map(function (_a) {
1993
- var themeName = _a[0], theme = _a[1];
1994
- return ({
1995
- value: themeName,
1996
- label: themeName.split("-")[0],
1997
- color: theme.colors.primary.DEFAULT,
2438
+ /**
2439
+ * Componente de previsualización de archivo
2440
+ */
2441
+ var FilePreview = function (_a) {
2442
+ var file = _a.file, onRemove = _a.onRemove, removeAriaLabel = _a.removeAriaLabel;
2443
+ var _b = React.useState(""), previewUrl = _b[0], setPreviewUrl = _b[1];
2444
+ React.useEffect(function () {
2445
+ if (file === null || file === void 0 ? void 0 : file.type.startsWith("image/")) {
2446
+ var url_1 = URL.createObjectURL(file);
2447
+ setPreviewUrl(url_1);
2448
+ return function () { return URL.revokeObjectURL(url_1); };
2449
+ }
2450
+ }, [file]);
2451
+ if (!(file === null || file === void 0 ? void 0 : file.type.startsWith("image/"))) {
2452
+ return null;
2453
+ }
2454
+ return (jsxRuntime.jsxs("div", { className: "absolute inset-0 overflow-hidden z-10", children: [jsxRuntime.jsx("img", { src: previewUrl, alt: file.name, className: "w-full h-full object-cover" }), jsxRuntime.jsx(react.Button, { isIconOnly: true, size: "sm", color: "danger", variant: "solid", className: "absolute top-2 right-2 sm:top-3 sm:right-3 z-20 bg-red-100 hover:bg-red-200 text-red-600 min-w-8 h-8 sm:min-w-10 sm:h-10", onPress: onRemove, "aria-label": removeAriaLabel, children: jsxRuntime.jsx(IconComponent, { icon: "heroicons:trash", size: "sm" }) })] }));
2455
+ };
2456
+ /**
2457
+ * Componente UploadDocument basado en Hero UI con funcionalidad mejorada
2458
+ *
2459
+ * @example
2460
+ * ```tsx
2461
+ * <UploadDocument
2462
+ * onUpload={(files) => console.log(files)}
2463
+ * acceptedFiles="image/*,.pdf"
2464
+ * multiple={false}
2465
+ * translations={{
2466
+ * uploadText: "Upload your files",
2467
+ * dragText: "Drop files here"
2468
+ * }}
2469
+ * />
2470
+ * ```
2471
+ */
2472
+ var UploadFile = function (_a) {
2473
+ var text = _a.text, textColor = _a.textColor, subText = _a.subText,
2474
+ // borderColor, // TODO: Implementar colores personalizados
2475
+ iconColor = _a.iconColor,
2476
+ // backgroundColor, // TODO: Implementar colores personalizados
2477
+ _b = _a.width,
2478
+ // backgroundColor, // TODO: Implementar colores personalizados
2479
+ width = _b === void 0 ? "100%" : _b, _c = _a.height, height = _c === void 0 ? "auto" : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.maxFiles, maxFiles = _e === void 0 ? 1 : _e, maxFileSize = _a.maxFileSize, _f = _a.acceptedFiles, acceptedFiles = _f === void 0 ? ".pdf" : _f, _g = _a.icon, icon = _g === void 0 ? "heroicons:arrow-up-on-square" : _g, onUpload = _a.onUpload, onError = _a.onError, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.success, success = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, errorText = _a.errorText, cropConfig = _a.cropConfig, image = _a.image, _l = _a.className, className = _l === void 0 ? "" : _l, _m = _a.translations, translations = _m === void 0 ? {} : _m;
2480
+ var inputRef = React.useRef(null);
2481
+ var uploadImageRef = React.useRef(image || null);
2482
+ var _o = React.useState(false), isDragging = _o[0], setIsDragging = _o[1];
2483
+ // Estados para el modal de crop
2484
+ var _p = React.useState(false), showCropModal = _p[0], setShowCropModal = _p[1];
2485
+ var _q = React.useState(""), selectedImageUrl = _q[0], setSelectedImageUrl = _q[1];
2486
+ var _r = React.useState(null); _r[0]; var setOriginalFile = _r[1];
2487
+ // Combinar traducciones por defecto con las proporcionadas
2488
+ var t = React.useMemo(function () { return (__assign(__assign({}, defaultTranslations), translations)); }, [translations]);
2489
+ // Actualizar texto si se pasa como prop (retrocompatibilidad)
2490
+ var finalText = text || t.uploadText;
2491
+ var finalSubText = subText || t.subText;
2492
+ var handleClick = function () {
2493
+ var _a;
2494
+ if (!(disabled || uploadImageRef.current)) {
2495
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
2496
+ }
2497
+ };
2498
+ var validateFiles = React.useCallback(function (files) {
2499
+ var filesArray = Array.from(files);
2500
+ if (!multiple && filesArray.length > 1) {
2501
+ onError === null || onError === void 0 ? void 0 : onError(t.multipleFilesError);
2502
+ return [];
2503
+ }
2504
+ if (filesArray.length > maxFiles) {
2505
+ onError === null || onError === void 0 ? void 0 : onError(t.maxFilesError.replace("{maxFiles}", maxFiles.toString()));
2506
+ return [];
2507
+ }
2508
+ // Validar tamaño de archivo
2509
+ if (maxFileSize) {
2510
+ var oversizedFiles = filesArray.filter(function (file) { return file.size > maxFileSize; });
2511
+ if (oversizedFiles.length > 0) {
2512
+ var maxSizeFormatted = formatFileSize(maxFileSize);
2513
+ onError === null || onError === void 0 ? void 0 : onError(t.maxFileSizeError.replace("{maxSize}", maxSizeFormatted));
2514
+ return [];
2515
+ }
2516
+ }
2517
+ // Validar tipos de archivo
2518
+ var acceptedExtensions = Array.isArray(acceptedFiles)
2519
+ ? acceptedFiles.map(function (ext) { return ext.trim().toLowerCase(); })
2520
+ : acceptedFiles.split(",").map(function (ext) { return ext.trim().toLowerCase(); });
2521
+ var validFiles = filesArray.filter(function (file) {
2522
+ var _a;
2523
+ if (acceptedFiles.includes("image/*") &&
2524
+ file.type.startsWith("image/")) {
2525
+ return true;
2526
+ }
2527
+ if (acceptedExtensions.some(function (ext) { return ext.includes("/"); })) {
2528
+ return acceptedExtensions.some(function (type) { return file.type === type; });
2529
+ }
2530
+ var fileExtension = ".".concat((_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
2531
+ return acceptedExtensions.some(function (ext) { return ext === fileExtension || ext === "*"; });
1998
2532
  });
1999
- });
2000
- return (jsxRuntime.jsx(react.RadioGroup, { value: selectedColor, onValueChange: onColorChange, orientation: "horizontal", className: "flex flex-wrap !gap-2", classNames: {
2001
- base: "flex flex-wrap !gap-2",
2002
- wrapper: "flex flex-wrap !gap-2",
2003
- }, children: colorOptions.map(function (color) { return (jsxRuntime.jsx(react.Radio, { value: color.label, className: "p-0 m-0", classNames: {
2004
- base: "p-0 m-0",
2005
- wrapper: "hidden",
2006
- labelWrapper: "p-0 m-0",
2007
- }, children: jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full border-2 cursor-pointer transition-all ".concat(selectedColor === color.label
2008
- ? "border-black border-opacity-20 scale-110"
2009
- : "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
2533
+ if (validFiles.length === 0) {
2534
+ var formattedTypes = acceptedExtensions
2535
+ .map(formatFileType)
2536
+ .join(", ");
2537
+ onError === null || onError === void 0 ? void 0 : onError(t.invalidFileTypeError.replace("{acceptedTypes}", formattedTypes));
2538
+ return [];
2539
+ }
2540
+ return validFiles;
2541
+ }, [multiple, maxFiles, maxFileSize, acceptedFiles, t, onError]);
2542
+ var handleFileUpload = React.useCallback(function (files) {
2543
+ var validFiles = validateFiles(files);
2544
+ if (validFiles.length > 0) {
2545
+ var file_1 = validFiles[0];
2546
+ // Si es imagen y hay configuración de crop, abrir modal
2547
+ if (file_1.type.startsWith("image/") && cropConfig) {
2548
+ var reader_1 = new FileReader();
2549
+ reader_1.onload = function () {
2550
+ setSelectedImageUrl(reader_1.result);
2551
+ setOriginalFile(file_1);
2552
+ setShowCropModal(true);
2553
+ };
2554
+ reader_1.readAsDataURL(file_1);
2555
+ }
2556
+ else {
2557
+ // Procesar directamente si no necesita crop
2558
+ uploadImageRef.current = file_1;
2559
+ onUpload(validFiles);
2560
+ }
2561
+ }
2562
+ }, [onUpload, validateFiles, cropConfig]);
2563
+ // Manejar guardado de imagen recortada
2564
+ var handleCropSave = React.useCallback(function (croppedFile) {
2565
+ uploadImageRef.current = croppedFile;
2566
+ setShowCropModal(false);
2567
+ setSelectedImageUrl("");
2568
+ setOriginalFile(null);
2569
+ onUpload([croppedFile]);
2570
+ }, [onUpload]);
2571
+ // Manejar cancelación de crop
2572
+ var handleCropCancel = React.useCallback(function () {
2573
+ setShowCropModal(false);
2574
+ setSelectedImageUrl("");
2575
+ setOriginalFile(null);
2576
+ }, []);
2577
+ var handleChange = function (event) {
2578
+ var files = event.target.files;
2579
+ if (files && files.length > 0) {
2580
+ handleFileUpload(files);
2581
+ }
2582
+ // Limpiar el input
2583
+ if (inputRef.current) {
2584
+ inputRef.current.value = "";
2585
+ }
2586
+ };
2587
+ var handleDragEnter = React.useCallback(function (e) {
2588
+ e.preventDefault();
2589
+ e.stopPropagation();
2590
+ if (!disabled) {
2591
+ setIsDragging(true);
2592
+ }
2593
+ }, [disabled]);
2594
+ var handleDragLeave = React.useCallback(function (e) {
2595
+ e.preventDefault();
2596
+ e.stopPropagation();
2597
+ setIsDragging(false);
2598
+ }, []);
2599
+ var handleDragOver = React.useCallback(function (e) {
2600
+ e.preventDefault();
2601
+ e.stopPropagation();
2602
+ }, []);
2603
+ var handleDrop = React.useCallback(function (e) {
2604
+ e.preventDefault();
2605
+ e.stopPropagation();
2606
+ setIsDragging(false);
2607
+ if (disabled) {
2608
+ return;
2609
+ }
2610
+ var droppedFiles = e.dataTransfer.files;
2611
+ if (droppedFiles.length > 0) {
2612
+ handleFileUpload(droppedFiles);
2613
+ }
2614
+ }, [disabled, handleFileUpload]);
2615
+ var handleRemoveImage = function () {
2616
+ uploadImageRef.current = null;
2617
+ onUpload([]);
2618
+ };
2619
+ // Clases CSS dinámicas usando Tailwind
2620
+ var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-3 transition-all duration-300 bg-red-500\n\t\t".concat(width !== "100%" ? "w-[".concat(width, "]") : "w-full", "\n\t\t").concat(height !== "auto" ? "h-[".concat(height, "]") : "min-h-28", "\n\t\t").concat(isDragging
2621
+ ? "border-primary-500 bg-primary-50 dark:bg-primary-900"
2622
+ : error
2623
+ ? "border-danger-500 bg-danger-50 dark:bg-danger-950"
2624
+ : success
2625
+ ? "border-success-500 bg-success-50 dark:bg-success-950"
2626
+ : disabled
2627
+ ? "border-gray-300 bg-gray-100 dark:bg-gray-800"
2628
+ : "border-gray-300 hover:border-gray-400 bg-primary-50 dark:bg-gray-900", "\n\t\t").concat(!(disabled || uploadImageRef.current) ? "cursor-pointer" : "cursor-default", "\n\t\t").concat(className, "\n\t")
2629
+ .trim()
2630
+ .replace(/\s+/g, " ");
2631
+ var textClasses = "\n\t\ttext-centertext-base ont-medium\n\t\t".concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
2632
+ var subTextClasses = "\n\t\ttext-tiny text-center\n\t\t".concat(disabled ? "text-default-400" : "text-default-500 dark:text-default-400", "\n\t");
2633
+ return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(react.Card, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxRuntime.jsxs(react.CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative overflow-hidden", onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [uploadImageRef.current && (jsxRuntime.jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsxRuntime.jsx("div", { className: uploadImageRef.current
2634
+ ? "opacity-0"
2635
+ : "opacity-100 transition-opacity", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsxRuntime.jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxRuntime.jsxs("div", { className: "text-center px-2", children: [jsxRuntime.jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsxRuntime.jsx("p", { className: subTextClasses, children: finalSubText }))] })] }) }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
2636
+ ? acceptedFiles.join(",")
2637
+ : acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsxRuntime.jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsxRuntime.jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
2010
2638
  };
2639
+ UploadFile.displayName = "UploadFile";
2011
2640
 
2012
2641
  var Modal = function (props) {
2013
2642
  return (jsxRuntime.jsx(react.Modal, __assign({ shouldBlockScroll: true, radius: "lg", className: "py-9 px-6" }, props)));
@@ -2155,6 +2784,7 @@ var AuraToastProvider = function (_a) {
2155
2784
  };
2156
2785
 
2157
2786
  exports.AddHolidayForm = AddHolidayForm;
2787
+ exports.AnalyticsCard = AnalyticsCard;
2158
2788
  exports.AuraTable = AuraTable;
2159
2789
  exports.AuraToastProvider = AuraToastProvider;
2160
2790
  exports.AutoComplete = AutoComplete;
@@ -2163,7 +2793,9 @@ exports.Card = Card;
2163
2793
  exports.ColorSelector = ColorSelector;
2164
2794
  exports.DatePicker = DatePicker;
2165
2795
  exports.DateRangePicker = DateRangePicker;
2796
+ exports.DateSelector = DateSelector;
2166
2797
  exports.GlobalToast = GlobalToast;
2798
+ exports.H1 = H1;
2167
2799
  exports.H2 = H2;
2168
2800
  exports.H3 = H3;
2169
2801
  exports.H4 = H4;
@@ -2176,11 +2808,15 @@ exports.ModalBody = ModalBody;
2176
2808
  exports.ModalContent = ModalContent;
2177
2809
  exports.ModalFooter = ModalFooter;
2178
2810
  exports.ModalHeader = ModalHeader;
2811
+ exports.MultiStepWizard = MultiStepWizard;
2179
2812
  exports.P = P;
2180
2813
  exports.Pagination = Pagination;
2181
2814
  exports.Phone = Phone;
2815
+ exports.PromotionalBanner = PromotionalBanner;
2816
+ exports.RowSteps = RowSteps;
2182
2817
  exports.ScheduleRow = ScheduleRow;
2183
2818
  exports.Select = Select;
2819
+ exports.StepIndicator = StepIndicator;
2184
2820
  exports.SwitchComponent = Switch;
2185
2821
  exports.Textarea = Textarea;
2186
2822
  exports.ThemeContext = ThemeContext;
@@ -2189,6 +2825,7 @@ exports.ThemeProvider = ThemeProvider;
2189
2825
  exports.TimeInputComponent = TimeInput;
2190
2826
  exports.ToastContext = ToastContext;
2191
2827
  exports.UploadFile = UploadFile;
2828
+ exports.VerticalSteps = VerticalSteps;
2192
2829
  exports.sizeMap = sizeMap;
2193
2830
  exports.themeColors = themeColors;
2194
2831
  exports.useAuraToast = useAuraToast;