@cnc-ti/layout-basic 8.4.0 → 8.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,4 @@
1
-
2
- if (typeof window !== 'undefined') {
3
- "use client";
4
- }
5
-
1
+ "use client";
6
2
  "use strict";
7
3
  var __create = Object.create;
8
4
  var __defProp = Object.defineProperty;
@@ -37,6 +33,7 @@ var src_exports = {};
37
33
  __export(src_exports, {
38
34
  AplicationsHeader: () => AplicationsHeader,
39
35
  AppsMenu: () => AppsMenu,
36
+ Avatar: () => Avatar,
40
37
  Badge: () => Badge,
41
38
  Button: () => Button,
42
39
  Card: () => Card,
@@ -59,6 +56,9 @@ __export(src_exports, {
59
56
  CommandList: () => CommandList,
60
57
  CommandSeparator: () => CommandSeparator,
61
58
  CommandShortcut: () => CommandShortcut,
59
+ ConfirmDialog: () => ConfirmDialog,
60
+ DIAS_SEMANA_PT_BR: () => DIAS_SEMANA_PT_BR,
61
+ DateTimeRangeList: () => DateTimeRangeList,
62
62
  Dialog: () => Dialog,
63
63
  DialogClose: () => DialogClose,
64
64
  DialogContent: () => DialogContent,
@@ -69,6 +69,19 @@ __export(src_exports, {
69
69
  DialogPortal: () => DialogPortal,
70
70
  DialogTitle: () => DialogTitle,
71
71
  DialogTrigger: () => DialogTrigger,
72
+ Drawer: () => Drawer,
73
+ DrawerBody: () => DrawerBody,
74
+ DrawerClose: () => DrawerClose,
75
+ DrawerContent: () => DrawerContent,
76
+ DrawerContext: () => DrawerContext,
77
+ DrawerDescription: () => DrawerDescription,
78
+ DrawerFooter: () => DrawerFooter,
79
+ DrawerHeader: () => DrawerHeader,
80
+ DrawerOverlay: () => DrawerOverlay,
81
+ DrawerPortal: () => DrawerPortal,
82
+ DrawerProvider: () => DrawerProvider,
83
+ DrawerTitle: () => DrawerTitle,
84
+ DrawerTrigger: () => DrawerTrigger,
72
85
  DropdownMenu: () => DropdownMenu,
73
86
  DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
74
87
  DropdownMenuContent: () => DropdownMenuContent,
@@ -84,22 +97,35 @@ __export(src_exports, {
84
97
  DropdownMenuSubContent: () => DropdownMenuSubContent,
85
98
  DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
86
99
  DropdownMenuTrigger: () => DropdownMenuTrigger,
100
+ EmptyState: () => EmptyState,
101
+ ErroNotificacoes: () => ErroNotificacoes,
102
+ FileList: () => FileList,
103
+ FileUpload: () => FileUpload,
87
104
  Filter: () => Filter,
88
105
  Header: () => Header,
89
106
  HeaderContainer: () => HeaderContainer,
107
+ HeaderNotifications: () => HeaderNotifications,
90
108
  HeaderProfileHeader: () => HeaderProfileHeader,
91
109
  HeaderProfileItem: () => HeaderProfileItem,
92
110
  Input: () => Input,
111
+ LabelValue: () => LabelValue,
112
+ MESES_PT_BR: () => MESES_PT_BR,
113
+ MESES_PT_BR_ABREV: () => MESES_PT_BR_ABREV,
114
+ MiniMonthCalendar: () => MiniMonthCalendar,
93
115
  Modal: () => Modal,
94
116
  ModalEntidade: () => ModalEntidade,
95
117
  ModalMudancaEntidade: () => ModalMudancaEntidade,
118
+ MonthYearPicker: () => MonthYearPicker,
119
+ MultiSelect: () => MultiSelect,
96
120
  PageHeader: () => PageHeader,
97
121
  PageHeaderActionsContainer: () => PageHeaderActionsContainer,
98
122
  PageHeaderTitle: () => PageHeaderTitle,
99
123
  PageHeaderTitleContent: () => PageHeaderTitleContent,
124
+ PeriodRangeList: () => PeriodRangeList,
100
125
  Popover: () => Popover,
101
126
  PopoverContent: () => PopoverContent,
102
127
  PopoverTrigger: () => PopoverTrigger,
128
+ ResultMetadata: () => ResultMetadata,
103
129
  Select: () => Select,
104
130
  SelectContent: () => SelectContent,
105
131
  SelectGroup: () => SelectGroup,
@@ -122,9 +148,22 @@ __export(src_exports, {
122
148
  TabsContent: () => TabsContent,
123
149
  TabsList: () => TabsList,
124
150
  TabsTrigger: () => TabsTrigger,
151
+ Textarea: () => Textarea,
125
152
  Title: () => Title2,
153
+ Tooltip: () => Tooltip,
154
+ URL_PADRAO_NOTIFICACOES: () => URL_PADRAO_NOTIFICACOES,
126
155
  availableApps: () => availableApps,
127
- buttonVariants: () => buttonVariants
156
+ buildMonthDays: () => buildMonthDays,
157
+ buttonVariants: () => buttonVariants,
158
+ formatDayAriaLabel: () => formatDayAriaLabel,
159
+ formatFileSize: () => formatFileSize,
160
+ formatMonthYear: () => formatMonthYear,
161
+ isSameDay: () => isSameDay,
162
+ isToday: () => isToday,
163
+ toDateKey: () => toDateKey,
164
+ toLocalNoon: () => toLocalNoon,
165
+ useDrawer: () => useDrawer,
166
+ validateFiles: () => validateFiles
128
167
  });
129
168
  module.exports = __toCommonJS(src_exports);
130
169
 
@@ -259,6 +298,28 @@ var createLucideIcon = (iconName, iconNode) => {
259
298
  return Component;
260
299
  };
261
300
 
301
+ // ../../node_modules/lucide-react/dist/esm/icons/bell-off.js
302
+ var BellOff = createLucideIcon("BellOff", [
303
+ ["path", { d: "M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5", key: "o7mx20" }],
304
+ ["path", { d: "M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7", key: "16f1lm" }],
305
+ ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }],
306
+ ["path", { d: "m2 2 20 20", key: "1ooewy" }]
307
+ ]);
308
+
309
+ // ../../node_modules/lucide-react/dist/esm/icons/bell-ring.js
310
+ var BellRing = createLucideIcon("BellRing", [
311
+ ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
312
+ ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }],
313
+ ["path", { d: "M4 2C2.8 3.7 2 5.7 2 8", key: "tap9e0" }],
314
+ ["path", { d: "M22 8c0-2.3-.8-4.3-2-6", key: "5bb3ad" }]
315
+ ]);
316
+
317
+ // ../../node_modules/lucide-react/dist/esm/icons/bell.js
318
+ var Bell = createLucideIcon("Bell", [
319
+ ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
320
+ ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
321
+ ]);
322
+
262
323
  // ../../node_modules/lucide-react/dist/esm/icons/check.js
263
324
  var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
264
325
 
@@ -267,6 +328,11 @@ var ChevronDown = createLucideIcon("ChevronDown", [
267
328
  ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
268
329
  ]);
269
330
 
331
+ // ../../node_modules/lucide-react/dist/esm/icons/chevron-left.js
332
+ var ChevronLeft = createLucideIcon("ChevronLeft", [
333
+ ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
334
+ ]);
335
+
270
336
  // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
271
337
  var ChevronRight = createLucideIcon("ChevronRight", [
272
338
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
@@ -286,6 +352,29 @@ var Circle = createLucideIcon("Circle", [
286
352
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
287
353
  ]);
288
354
 
355
+ // ../../node_modules/lucide-react/dist/esm/icons/download.js
356
+ var Download = createLucideIcon("Download", [
357
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
358
+ ["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
359
+ ["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
360
+ ]);
361
+
362
+ // ../../node_modules/lucide-react/dist/esm/icons/external-link.js
363
+ var ExternalLink = createLucideIcon("ExternalLink", [
364
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
365
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
366
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
367
+ ]);
368
+
369
+ // ../../node_modules/lucide-react/dist/esm/icons/file-text.js
370
+ var FileText = createLucideIcon("FileText", [
371
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
372
+ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
373
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
374
+ ["path", { d: "M16 13H8", key: "t4e002" }],
375
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
376
+ ]);
377
+
289
378
  // ../../node_modules/lucide-react/dist/esm/icons/filter-x.js
290
379
  var FilterX = createLucideIcon("FilterX", [
291
380
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
@@ -316,12 +405,62 @@ var LoaderCircle = createLucideIcon("LoaderCircle", [
316
405
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
317
406
  ]);
318
407
 
408
+ // ../../node_modules/lucide-react/dist/esm/icons/mail-open.js
409
+ var MailOpen = createLucideIcon("MailOpen", [
410
+ [
411
+ "path",
412
+ {
413
+ d: "M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",
414
+ key: "1jhwl8"
415
+ }
416
+ ],
417
+ ["path", { d: "m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10", key: "1qfld7" }]
418
+ ]);
419
+
420
+ // ../../node_modules/lucide-react/dist/esm/icons/mail.js
421
+ var Mail = createLucideIcon("Mail", [
422
+ ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
423
+ ["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }]
424
+ ]);
425
+
426
+ // ../../node_modules/lucide-react/dist/esm/icons/paperclip.js
427
+ var Paperclip = createLucideIcon("Paperclip", [
428
+ [
429
+ "path",
430
+ {
431
+ d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",
432
+ key: "1u3ebp"
433
+ }
434
+ ]
435
+ ]);
436
+
437
+ // ../../node_modules/lucide-react/dist/esm/icons/plus.js
438
+ var Plus = createLucideIcon("Plus", [
439
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
440
+ ["path", { d: "M12 5v14", key: "s699le" }]
441
+ ]);
442
+
319
443
  // ../../node_modules/lucide-react/dist/esm/icons/search.js
320
444
  var Search = createLucideIcon("Search", [
321
445
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
322
446
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
323
447
  ]);
324
448
 
449
+ // ../../node_modules/lucide-react/dist/esm/icons/trash-2.js
450
+ var Trash2 = createLucideIcon("Trash2", [
451
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
452
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
453
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
454
+ ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
455
+ ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
456
+ ]);
457
+
458
+ // ../../node_modules/lucide-react/dist/esm/icons/user.js
459
+ var User = createLucideIcon("User", [
460
+ ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
461
+ ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
462
+ ]);
463
+
325
464
  // ../../node_modules/lucide-react/dist/esm/icons/x.js
326
465
  var X = createLucideIcon("X", [
327
466
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
@@ -3051,6 +3190,7 @@ var HeaderContainer = ({
3051
3190
  container = false,
3052
3191
  logo,
3053
3192
  logoLink,
3193
+ notifications,
3054
3194
  children,
3055
3195
  ...props
3056
3196
  }) => {
@@ -3100,7 +3240,10 @@ var HeaderContainer = ({
3100
3240
  )
3101
3241
  }
3102
3242
  ) : !hasSidebar && renderLogo() }),
3103
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cnc-flex", children })
3243
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cnc-flex", children: [
3244
+ notifications && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cnc-flex cnc-items-center cnc-pr-3", children: notifications }),
3245
+ children
3246
+ ] })
3104
3247
  ]
3105
3248
  }
3106
3249
  );
@@ -3905,15 +4048,53 @@ var Input = React9.forwardRef(
3905
4048
  );
3906
4049
  Input.displayName = "Input";
3907
4050
 
3908
- // src/components/atoms/forms/checkbox.tsx
4051
+ // src/components/atoms/forms/textarea.tsx
3909
4052
  var React10 = __toESM(require("react"));
3910
4053
  var import_jsx_runtime14 = require("react/jsx-runtime");
3911
- var Checkbox = React10.forwardRef(
4054
+ var Textarea = React10.forwardRef(
4055
+ ({ className, id, label, required, ...props }, ref) => {
4056
+ const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
4057
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "cnc-w-full", children: [
4058
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4059
+ "label",
4060
+ {
4061
+ htmlFor: idGenerate,
4062
+ className: "cnc-block cnc-text-sm cnc-mb-1 cnc-font-medium cnc-text-brand-gray-600",
4063
+ children: [
4064
+ label,
4065
+ required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-red-500", children: " *" })
4066
+ ]
4067
+ }
4068
+ ),
4069
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4070
+ "textarea",
4071
+ {
4072
+ id: idGenerate,
4073
+ className: cn(
4074
+ "cnc-flex cnc-min-h-[96px] cnc-w-full cnc-rounded-md cnc-border cnc-border-input cnc-bg-transparent cnc-px-3 cnc-py-2 cnc-text-base cnc-shadow-sm cnc-transition-colors",
4075
+ "placeholder:cnc-text-muted-foreground focus-visible:cnc-outline-none",
4076
+ "focus-visible:cnc-ring-2 focus-visible:cnc-ring-brand-gray-500/50 disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50 md:cnc-text-sm",
4077
+ "not-disabled:hover:cnc-border-brand-gray-500",
4078
+ className
4079
+ ),
4080
+ ref,
4081
+ ...props
4082
+ }
4083
+ )
4084
+ ] });
4085
+ }
4086
+ );
4087
+ Textarea.displayName = "Textarea";
4088
+
4089
+ // src/components/atoms/forms/checkbox.tsx
4090
+ var React11 = __toESM(require("react"));
4091
+ var import_jsx_runtime15 = require("react/jsx-runtime");
4092
+ var Checkbox = React11.forwardRef(
3912
4093
  ({ className, id, label, ...props }, ref) => {
3913
4094
  console.log();
3914
4095
  const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
3915
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "cnc-w-full cnc-flex cnc-flex-row", children: [
3916
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4096
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "cnc-w-full cnc-flex cnc-flex-row", children: [
4097
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3917
4098
  "input",
3918
4099
  {
3919
4100
  type: "checkbox",
@@ -3923,7 +4104,7 @@ var Checkbox = React10.forwardRef(
3923
4104
  ...props
3924
4105
  }
3925
4106
  ),
3926
- label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4107
+ label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3927
4108
  "label",
3928
4109
  {
3929
4110
  htmlFor: idGenerate,
@@ -3937,9 +4118,9 @@ var Checkbox = React10.forwardRef(
3937
4118
  Checkbox.displayName = "Checkbox";
3938
4119
 
3939
4120
  // src/components/atoms/forms/switch.tsx
3940
- var React11 = __toESM(require("react"));
3941
- var import_jsx_runtime15 = require("react/jsx-runtime");
3942
- var Switch = React11.forwardRef(
4121
+ var React12 = __toESM(require("react"));
4122
+ var import_jsx_runtime16 = require("react/jsx-runtime");
4123
+ var Switch = React12.forwardRef(
3943
4124
  ({
3944
4125
  className,
3945
4126
  id,
@@ -3953,12 +4134,12 @@ var Switch = React11.forwardRef(
3953
4134
  name,
3954
4135
  "aria-label": ariaLabel
3955
4136
  }, ref) => {
3956
- const [internalChecked, setInternalChecked] = React11.useState(
4137
+ const [internalChecked, setInternalChecked] = React12.useState(
3957
4138
  defaultChecked ?? false
3958
4139
  );
3959
4140
  const isControlled = checked !== void 0;
3960
4141
  const isChecked = isControlled ? checked : internalChecked;
3961
- const reactId = React11.useId();
4142
+ const reactId = React12.useId();
3962
4143
  const fieldId = id || reactId;
3963
4144
  const handleToggle = () => {
3964
4145
  if (disabled) return;
@@ -3968,8 +4149,8 @@ var Switch = React11.forwardRef(
3968
4149
  }
3969
4150
  onChange?.(newValue);
3970
4151
  };
3971
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("cnc-flex cnc-items-center cnc-gap-2", className), children: [
3972
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4152
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("cnc-flex cnc-items-center cnc-gap-2", className), children: [
4153
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3973
4154
  "input",
3974
4155
  {
3975
4156
  type: "checkbox",
@@ -3981,7 +4162,7 @@ var Switch = React11.forwardRef(
3981
4162
  "aria-hidden": "true"
3982
4163
  }
3983
4164
  ),
3984
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4165
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3985
4166
  "button",
3986
4167
  {
3987
4168
  ref,
@@ -3999,7 +4180,7 @@ var Switch = React11.forwardRef(
3999
4180
  "disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50",
4000
4181
  isChecked ? "cnc-bg-brand-blue-400 cnc-border-brand-blue-500" : "cnc-bg-brand-gray-20 cnc-border-brand-gray-100"
4001
4182
  ),
4002
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4183
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4003
4184
  "span",
4004
4185
  {
4005
4186
  className: cn(
@@ -4010,14 +4191,14 @@ var Switch = React11.forwardRef(
4010
4191
  )
4011
4192
  }
4012
4193
  ),
4013
- label && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4194
+ label && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
4014
4195
  "label",
4015
4196
  {
4016
4197
  htmlFor: fieldId,
4017
4198
  className: "cnc-text-sm cnc-font-medium cnc-text-brand-gray-600 cnc-cursor-pointer",
4018
4199
  children: [
4019
4200
  label,
4020
- required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "cnc-text-red-500", children: " *" })
4201
+ required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "cnc-text-red-500", children: " *" })
4021
4202
  ]
4022
4203
  }
4023
4204
  )
@@ -4027,7 +4208,7 @@ var Switch = React11.forwardRef(
4027
4208
  Switch.displayName = "Switch";
4028
4209
 
4029
4210
  // src/components/atoms/display/badge.tsx
4030
- var import_jsx_runtime16 = require("react/jsx-runtime");
4211
+ var import_jsx_runtime17 = require("react/jsx-runtime");
4031
4212
  var Badge = ({
4032
4213
  variant = "default",
4033
4214
  rounded = true,
@@ -4049,7 +4230,7 @@ var Badge = ({
4049
4230
  md: "cnc-text-sm cnc-px-3 cnc-py-1",
4050
4231
  lg: "cnc-text-base cnc-px-4 cnc-py-2"
4051
4232
  };
4052
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4233
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4053
4234
  "span",
4054
4235
  {
4055
4236
  className: cn(
@@ -4064,13 +4245,73 @@ var Badge = ({
4064
4245
  );
4065
4246
  };
4066
4247
 
4248
+ // src/components/atoms/display/avatar.tsx
4249
+ var React13 = __toESM(require("react"));
4250
+ var import_jsx_runtime18 = require("react/jsx-runtime");
4251
+ var avatarSizeClasses = {
4252
+ sm: "cnc-size-8 cnc-text-[10px]",
4253
+ md: "cnc-size-12 cnc-text-xs",
4254
+ lg: "cnc-size-16 cnc-text-sm",
4255
+ xl: "cnc-size-24 cnc-text-xl"
4256
+ };
4257
+ var avatarSizeIcon = {
4258
+ sm: 16,
4259
+ md: 20,
4260
+ lg: 28,
4261
+ xl: 40
4262
+ };
4263
+ function Avatar({
4264
+ src,
4265
+ alt,
4266
+ fallback,
4267
+ size = "md",
4268
+ isLoading = false,
4269
+ className,
4270
+ ...props
4271
+ }) {
4272
+ const [hasError, setHasError] = React13.useState(false);
4273
+ const baseClasses = cn(
4274
+ "cnc-flex cnc-shrink-0 cnc-items-center cnc-justify-center cnc-overflow-hidden cnc-rounded-full cnc-border-2 cnc-border-brand-gray-50 cnc-bg-brand-gray-10 cnc-text-brand-gray-200",
4275
+ avatarSizeClasses[size],
4276
+ className
4277
+ );
4278
+ if (isLoading) {
4279
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4280
+ "span",
4281
+ {
4282
+ className: cn(baseClasses, "cnc-animate-pulse cnc-bg-brand-gray-50"),
4283
+ role: "status",
4284
+ "aria-label": "Carregando avatar",
4285
+ ...props
4286
+ }
4287
+ );
4288
+ }
4289
+ const showImage = src && !hasError;
4290
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: baseClasses, ...props, children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4291
+ "img",
4292
+ {
4293
+ src,
4294
+ alt: alt ?? "Avatar",
4295
+ className: "cnc-h-full cnc-w-full cnc-object-cover",
4296
+ onError: () => setHasError(true)
4297
+ }
4298
+ ) : fallback ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "cnc-font-bold", children: fallback }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4299
+ User,
4300
+ {
4301
+ className: "cnc-shrink-0",
4302
+ size: avatarSizeIcon[size],
4303
+ "aria-hidden": "true"
4304
+ }
4305
+ ) });
4306
+ }
4307
+
4067
4308
  // src/components/molecules/card.tsx
4068
- var import_jsx_runtime17 = require("react/jsx-runtime");
4309
+ var import_jsx_runtime19 = require("react/jsx-runtime");
4069
4310
  function Card({
4070
4311
  className,
4071
4312
  ...rest
4072
4313
  }) {
4073
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4314
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4074
4315
  "div",
4075
4316
  {
4076
4317
  className: cn(
@@ -4085,7 +4326,7 @@ function CardHeader({
4085
4326
  className,
4086
4327
  ...rest
4087
4328
  }) {
4088
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "cnc-px-6 cnc-pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4329
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "cnc-px-6 cnc-pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4089
4330
  "div",
4090
4331
  {
4091
4332
  className: cn(
@@ -4100,13 +4341,13 @@ function CardContent({
4100
4341
  className,
4101
4342
  ...rest
4102
4343
  }) {
4103
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: cn("cnc-px-6 cnc-py-2", className), ...rest });
4344
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("cnc-px-6 cnc-py-2", className), ...rest });
4104
4345
  }
4105
4346
  function CardFooter({
4106
4347
  className,
4107
4348
  ...rest
4108
4349
  }) {
4109
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4350
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4110
4351
  "div",
4111
4352
  {
4112
4353
  className: cn(
@@ -4121,7 +4362,7 @@ function CardFooterItem({
4121
4362
  className,
4122
4363
  ...rest
4123
4364
  }) {
4124
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4365
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4125
4366
  "div",
4126
4367
  {
4127
4368
  className: cn(
@@ -4135,7 +4376,7 @@ function CardFooterItem({
4135
4376
 
4136
4377
  // src/components/molecules/collapsible.tsx
4137
4378
  var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
4138
- var import_jsx_runtime18 = require("react/jsx-runtime");
4379
+ var import_jsx_runtime20 = require("react/jsx-runtime");
4139
4380
  var Collapsible = CollapsiblePrimitive.Root;
4140
4381
  var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
4141
4382
  var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
@@ -4143,16 +4384,16 @@ var AnimatedCollapsibleContent = ({
4143
4384
  className,
4144
4385
  ...rest
4145
4386
  }) => {
4146
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CollapsibleContent2, { className: "cnc-collapsible-content", ...rest });
4387
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollapsibleContent2, { className: "cnc-collapsible-content", ...rest });
4147
4388
  };
4148
4389
 
4149
4390
  // src/components/molecules/display/page-header.tsx
4150
- var import_jsx_runtime19 = require("react/jsx-runtime");
4391
+ var import_jsx_runtime21 = require("react/jsx-runtime");
4151
4392
  function PageHeader({
4152
4393
  children,
4153
4394
  className
4154
4395
  }) {
4155
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4396
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4156
4397
  "header",
4157
4398
  {
4158
4399
  className: cn(
@@ -4167,7 +4408,7 @@ function PageHeaderTitleContent({
4167
4408
  children,
4168
4409
  className
4169
4410
  }) {
4170
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4411
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4171
4412
  "div",
4172
4413
  {
4173
4414
  className: cn(
@@ -4184,16 +4425,16 @@ function PageHeaderTitle({
4184
4425
  titleAs = "h1"
4185
4426
  }) {
4186
4427
  const ComponentTitle = titleAs;
4187
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
4188
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ComponentTitle, { className: "cnc-text-2xl cnc-font-semibold cnc-text-brand-blue-600", children: title }),
4189
- description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "cnc-text-sm cnc-text-brand-gray-500", children: description })
4428
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
4429
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ComponentTitle, { className: "cnc-text-2xl cnc-font-semibold cnc-text-brand-blue-600", children: title }),
4430
+ description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "cnc-text-sm cnc-text-brand-gray-500", children: description })
4190
4431
  ] });
4191
4432
  }
4192
4433
  function PageHeaderActionsContainer({
4193
4434
  children,
4194
4435
  className
4195
4436
  }) {
4196
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4437
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4197
4438
  "div",
4198
4439
  {
4199
4440
  className: cn(
@@ -4205,17 +4446,151 @@ function PageHeaderActionsContainer({
4205
4446
  );
4206
4447
  }
4207
4448
  function Title2({ title, as: Component = "h1" }) {
4208
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Component, { className: "cnc-text-[24px] cnc-text-[#1F2C4D] cnc-font-bold cnc-mt-2 cnc-mb-4 text-center md:cnc-text-[28px] md:cnc-text-left", children: title });
4449
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Component, { className: "cnc-text-[24px] cnc-text-[#1F2C4D] cnc-font-bold cnc-mt-2 cnc-mb-4 text-center md:cnc-text-[28px] md:cnc-text-left", children: title });
4450
+ }
4451
+
4452
+ // src/components/molecules/display/empty-state.tsx
4453
+ var import_jsx_runtime22 = require("react/jsx-runtime");
4454
+ function EmptyState({
4455
+ icon,
4456
+ title,
4457
+ description,
4458
+ action,
4459
+ minHeight = "cnc-min-h-48",
4460
+ className,
4461
+ ...props
4462
+ }) {
4463
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4464
+ "div",
4465
+ {
4466
+ className: cn(
4467
+ "cnc-flex cnc-flex-col cnc-items-center cnc-justify-center cnc-rounded-md cnc-border cnc-border-dashed cnc-border-brand-gray-50 cnc-bg-brand-blue-50 cnc-px-4 cnc-py-8 cnc-text-center",
4468
+ minHeight,
4469
+ className
4470
+ ),
4471
+ ...props,
4472
+ children: [
4473
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "cnc-mb-3 cnc-text-brand-gray-200", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FolderOpen, { className: "cnc-h-10 cnc-w-10" }) }),
4474
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "cnc-text-sm cnc-font-medium cnc-text-brand-blue-600", children: title }),
4475
+ description ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "cnc-mt-1 cnc-max-w-md cnc-text-sm cnc-text-brand-gray-200", children: description }) : null,
4476
+ action ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "cnc-mt-4", children: action }) : null
4477
+ ]
4478
+ }
4479
+ );
4480
+ }
4481
+
4482
+ // src/components/molecules/display/result-metadata.tsx
4483
+ var import_jsx_runtime23 = require("react/jsx-runtime");
4484
+ function encontradosSuffix(resourceName, forceWordGender) {
4485
+ if (forceWordGender === "masc") return "o";
4486
+ if (forceWordGender === "fem") return "a";
4487
+ return resourceName.endsWith("a") ? "a" : "o";
4488
+ }
4489
+ function ResultMetadata({
4490
+ resourceName,
4491
+ total,
4492
+ displayed,
4493
+ isLoading = false,
4494
+ forceWordGender,
4495
+ truncationThreshold = 30,
4496
+ className,
4497
+ ...props
4498
+ }) {
4499
+ const encontradVogal = encontradosSuffix(resourceName, forceWordGender);
4500
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
4501
+ "div",
4502
+ {
4503
+ className: cn("cnc-mt-4 cnc-mb-4", className),
4504
+ role: "status",
4505
+ "aria-live": "polite",
4506
+ ...props,
4507
+ children: [
4508
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "cnc-text-base cnc-font-bold cnc-text-brand-blue-100", children: `${resourceName} encontrad${encontradVogal}s | ${isLoading ? "carregando ..." : total?.toLocaleString("pt-BR")}` }),
4509
+ displayed >= truncationThreshold && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
4510
+ "Exibindo os ",
4511
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "cnc-font-bold", children: displayed }),
4512
+ " primeiros registros. Utilize os filtros para refinar sua busca."
4513
+ ] })
4514
+ ]
4515
+ }
4516
+ );
4517
+ }
4518
+
4519
+ // src/components/molecules/display/label-value.tsx
4520
+ var import_jsx_runtime24 = require("react/jsx-runtime");
4521
+ function LabelValue({
4522
+ label,
4523
+ value,
4524
+ href,
4525
+ className,
4526
+ valueClassName
4527
+ }) {
4528
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className, children: [
4529
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "cnc-mb-2 cnc-text-sm cnc-font-bold cnc-leading-4 cnc-text-primary", children: label }),
4530
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4531
+ "div",
4532
+ {
4533
+ className: cn(
4534
+ "cnc-flex cnc-flex-row cnc-items-center cnc-justify-start cnc-gap-2 cnc-text-sm cnc-font-medium cnc-text-brand-gray-600",
4535
+ valueClassName
4536
+ ),
4537
+ children: [
4538
+ value ?? "-",
4539
+ href && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4540
+ "a",
4541
+ {
4542
+ href,
4543
+ target: "_blank",
4544
+ rel: "noopener noreferrer",
4545
+ className: "cnc-inline-flex cnc-items-center cnc-text-brand-blue-500 hover:cnc-opacity-80",
4546
+ "aria-label": `Abrir link externo de ${label}`,
4547
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ExternalLink, { className: "cnc-size-4" })
4548
+ }
4549
+ )
4550
+ ]
4551
+ }
4552
+ )
4553
+ ] });
4209
4554
  }
4210
4555
 
4211
4556
  // src/components/molecules/forms/combobox.tsx
4212
- var React14 = __toESM(require("react"));
4557
+ var React16 = __toESM(require("react"));
4558
+
4559
+ // src/components/molecules/forms/combobox-footer.tsx
4560
+ var import_jsx_runtime25 = require("react/jsx-runtime");
4561
+ function ComboboxDropdownFooter({
4562
+ footerAction,
4563
+ renderFooter,
4564
+ close,
4565
+ hidden = false
4566
+ }) {
4567
+ if (hidden) return null;
4568
+ if (renderFooter) {
4569
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "cnc-border-t cnc-border-brand-gray-50 cnc-p-2", children: renderFooter({ close }) });
4570
+ }
4571
+ if (!footerAction) return null;
4572
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "cnc-border-t cnc-border-brand-gray-50 cnc-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4573
+ Button,
4574
+ {
4575
+ type: "button",
4576
+ variant: footerAction.variant ?? "create",
4577
+ className: "cnc-w-full",
4578
+ disabled: footerAction.disabled,
4579
+ onClick: (event) => {
4580
+ event.preventDefault();
4581
+ event.stopPropagation();
4582
+ footerAction.onClick(event);
4583
+ },
4584
+ children: footerAction.label
4585
+ }
4586
+ ) });
4587
+ }
4213
4588
 
4214
4589
  // src/components/molecules/overlay/command.tsx
4215
- var React12 = __toESM(require("react"));
4590
+ var React14 = __toESM(require("react"));
4216
4591
  var import_cmdk = require("cmdk");
4217
- var import_jsx_runtime20 = require("react/jsx-runtime");
4218
- var Command = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4592
+ var import_jsx_runtime26 = require("react/jsx-runtime");
4593
+ var Command = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4219
4594
  import_cmdk.Command,
4220
4595
  {
4221
4596
  ref,
@@ -4228,16 +4603,16 @@ var Command = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__
4228
4603
  ));
4229
4604
  Command.displayName = import_cmdk.Command.displayName;
4230
4605
  var CommandDialog = ({ children, ...props }) => {
4231
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Dialog, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogContent, { className: "cnc-overflow-hidden cnc-p-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Command, { className: "cnc-[&_cmdk-group-heading]:cnc-px-2 cnc-[&_cmdk-group-heading]:cnc-font-medium cnc-[&_cmdk-group-heading]:cnc-text-muted-foreground cnc-[&_cmdk-group]:not([hidden])~[cmdk-group]:cnc-pt-0 cnc-[&_cmdk-group]:cnc-px-2 cnc-[&_cmdk-input-wrapper]_svg:cnc-h-5 cnc-[&_cmdk-input-wrapper]_svg:cnc-w-5 cnc-[&_cmdk-input]:cnc-h-12 cnc-[&_cmdk-item]:cnc-px-2 cnc-[&_cmdk-item]:cnc-py-3 cnc-[&_cmdk-item]_svg:cnc-h-5 cnc-[&_cmdk-item]_svg:cnc-w-5", children }) }) });
4606
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Dialog, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DialogContent, { className: "cnc-overflow-hidden cnc-p-0", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Command, { className: "cnc-[&_cmdk-group-heading]:cnc-px-2 cnc-[&_cmdk-group-heading]:cnc-font-medium cnc-[&_cmdk-group-heading]:cnc-text-muted-foreground cnc-[&_cmdk-group]:not([hidden])~[cmdk-group]:cnc-pt-0 cnc-[&_cmdk-group]:cnc-px-2 cnc-[&_cmdk-input-wrapper]_svg:cnc-h-5 cnc-[&_cmdk-input-wrapper]_svg:cnc-w-5 cnc-[&_cmdk-input]:cnc-h-12 cnc-[&_cmdk-item]:cnc-px-2 cnc-[&_cmdk-item]:cnc-py-3 cnc-[&_cmdk-item]_svg:cnc-h-5 cnc-[&_cmdk-item]_svg:cnc-w-5", children }) }) });
4232
4607
  };
4233
- var CommandInput = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
4608
+ var CommandInput = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4234
4609
  "div",
4235
4610
  {
4236
4611
  className: "cnc-flex cnc-items-center cnc-border-b cnc-px-3",
4237
4612
  "cmdk-input-wrapper": "",
4238
4613
  children: [
4239
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Search, { className: "cnc-mr-2 cnc-h-4 cnc-w-4 cnc-shrink-0 cnc-opacity-50" }),
4240
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4614
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Search, { className: "cnc-mr-2 cnc-h-4 cnc-w-4 cnc-shrink-0 cnc-opacity-50" }),
4615
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4241
4616
  import_cmdk.Command.Input,
4242
4617
  {
4243
4618
  ref,
@@ -4252,7 +4627,7 @@ var CommandInput = React12.forwardRef(({ className, ...props }, ref) => /* @__PU
4252
4627
  }
4253
4628
  ));
4254
4629
  CommandInput.displayName = import_cmdk.Command.Input.displayName;
4255
- var CommandList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4630
+ var CommandList = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4256
4631
  import_cmdk.Command.List,
4257
4632
  {
4258
4633
  ref,
@@ -4264,7 +4639,7 @@ var CommandList = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
4264
4639
  }
4265
4640
  ));
4266
4641
  CommandList.displayName = import_cmdk.Command.List.displayName;
4267
- var CommandEmpty = React12.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4642
+ var CommandEmpty = React14.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4268
4643
  import_cmdk.Command.Empty,
4269
4644
  {
4270
4645
  ref,
@@ -4273,7 +4648,7 @@ var CommandEmpty = React12.forwardRef((props, ref) => /* @__PURE__ */ (0, import
4273
4648
  }
4274
4649
  ));
4275
4650
  CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
4276
- var CommandGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4651
+ var CommandGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4277
4652
  import_cmdk.Command.Group,
4278
4653
  {
4279
4654
  ref,
@@ -4285,7 +4660,7 @@ var CommandGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PU
4285
4660
  }
4286
4661
  ));
4287
4662
  CommandGroup.displayName = import_cmdk.Command.Group.displayName;
4288
- var CommandSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4663
+ var CommandSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4289
4664
  import_cmdk.Command.Separator,
4290
4665
  {
4291
4666
  ref,
@@ -4294,7 +4669,7 @@ var CommandSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @
4294
4669
  }
4295
4670
  ));
4296
4671
  CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
4297
- var CommandItem = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4672
+ var CommandItem = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4298
4673
  import_cmdk.Command.Item,
4299
4674
  {
4300
4675
  ref,
@@ -4310,7 +4685,7 @@ var CommandShortcut = ({
4310
4685
  className,
4311
4686
  ...props
4312
4687
  }) => {
4313
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4688
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4314
4689
  "span",
4315
4690
  {
4316
4691
  className: cn(
@@ -4324,12 +4699,12 @@ var CommandShortcut = ({
4324
4699
  CommandShortcut.displayName = "CommandShortcut";
4325
4700
 
4326
4701
  // src/components/molecules/overlay/popover.tsx
4327
- var React13 = __toESM(require("react"));
4702
+ var React15 = __toESM(require("react"));
4328
4703
  var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
4329
- var import_jsx_runtime21 = require("react/jsx-runtime");
4704
+ var import_jsx_runtime27 = require("react/jsx-runtime");
4330
4705
  var Popover2 = PopoverPrimitive2.Root;
4331
4706
  var PopoverTrigger2 = PopoverPrimitive2.Trigger;
4332
- var PopoverContent2 = React13.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4707
+ var PopoverContent2 = React15.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4333
4708
  PopoverPrimitive2.Content,
4334
4709
  {
4335
4710
  ref,
@@ -4345,7 +4720,7 @@ var PopoverContent2 = React13.forwardRef(({ className, align = "center", sideOff
4345
4720
  PopoverContent2.displayName = PopoverPrimitive2.Content.displayName;
4346
4721
 
4347
4722
  // src/components/molecules/forms/combobox.tsx
4348
- var import_jsx_runtime22 = require("react/jsx-runtime");
4723
+ var import_jsx_runtime28 = require("react/jsx-runtime");
4349
4724
  function Combobox({
4350
4725
  options,
4351
4726
  placeholder = "",
@@ -4356,128 +4731,363 @@ function Combobox({
4356
4731
  modal = false,
4357
4732
  popoverClassName,
4358
4733
  buttonClassName,
4359
- disabled = false
4734
+ disabled = false,
4735
+ footerAction,
4736
+ renderFooter
4360
4737
  }) {
4361
- const [open, setOpen] = React14.useState(false);
4362
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Popover2, { open, onOpenChange: setOpen, modal, children: [
4363
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4738
+ const [open, setOpen] = React16.useState(false);
4739
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Popover2, { open, onOpenChange: setOpen, modal, children: [
4740
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4364
4741
  Button,
4365
4742
  {
4366
4743
  variant: "outline",
4367
4744
  role: "combobox",
4368
4745
  "aria-expanded": open,
4369
- className: cn("cnc-w-full cnc-justify-between cnc-truncate ", buttonClassName),
4746
+ className: cn(
4747
+ "cnc-w-full cnc-justify-between cnc-truncate ",
4748
+ buttonClassName
4749
+ ),
4370
4750
  disabled,
4371
4751
  children: [
4372
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: value ? options?.find((framework) => framework.value === value)?.label : placeholder }),
4373
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronsUpDown, { className: "cnc-ml-2 cnc-h-4 cnc-w-4 cnc-shrink-0 cnc-opacity-50" })
4752
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: value ? options?.find((framework) => framework.value === value)?.label : placeholder }),
4753
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronsUpDown, { className: "cnc-ml-2 cnc-h-4 cnc-w-4 cnc-shrink-0 cnc-opacity-50" })
4374
4754
  ]
4375
4755
  }
4376
4756
  ) }),
4377
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4757
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4378
4758
  PopoverContent2,
4379
4759
  {
4380
4760
  align: "start",
4381
- className: cn("cnc-w-[--radix-popover-trigger-width] cnc-p-0", popoverClassName),
4382
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Command, { children: [
4383
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4384
- CommandInput,
4385
- {
4386
- placeholder: command?.placeholder,
4387
- onInput: (e) => onInput && onInput(e.target?.value)
4388
- }
4389
- ),
4390
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CommandList, { children: [
4391
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandEmpty, { children: command?.emptyMessage ?? "Nenhum item encontrado" }),
4392
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandGroup, { children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4393
- CommandItem,
4761
+ className: cn(
4762
+ "cnc-w-[--radix-popover-trigger-width] cnc-p-0",
4763
+ popoverClassName
4764
+ ),
4765
+ children: [
4766
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Command, { children: [
4767
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4768
+ CommandInput,
4394
4769
  {
4395
- value: option.value,
4396
- onSelect: (currentValue) => {
4397
- if (onChange)
4398
- onChange(currentValue === value ? "" : currentValue);
4399
- setOpen(false);
4770
+ placeholder: command?.placeholder,
4771
+ onInput: (e) => onInput && onInput(e.target?.value)
4772
+ }
4773
+ ),
4774
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(CommandList, { children: [
4775
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandEmpty, { children: command?.emptyMessage ?? "Nenhum item encontrado" }),
4776
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CommandGroup, { children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4777
+ CommandItem,
4778
+ {
4779
+ value: option.value,
4780
+ onSelect: (currentValue) => {
4781
+ if (onChange)
4782
+ onChange(currentValue === value ? "" : currentValue);
4783
+ setOpen(false);
4784
+ },
4785
+ keywords: [option.value, option.label],
4786
+ disabled: option.disabled,
4787
+ children: [
4788
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4789
+ Check,
4790
+ {
4791
+ className: cn(
4792
+ "cnc-mr-2 cnc-h-4 cnc-w-4",
4793
+ value === option.value ? "cnc-opacity-100" : "cnc-opacity-0"
4794
+ )
4795
+ }
4796
+ ),
4797
+ option.label
4798
+ ]
4400
4799
  },
4401
- keywords: [option.value, option.label],
4402
- disabled: option.disabled,
4403
- children: [
4404
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4405
- Check,
4406
- {
4407
- className: cn(
4408
- "cnc-mr-2 cnc-h-4 cnc-w-4",
4409
- value === option.value ? "cnc-opacity-100" : "cnc-opacity-0"
4410
- )
4411
- }
4412
- ),
4413
- option.label
4414
- ]
4415
- },
4416
- option.value
4417
- )) })
4418
- ] })
4419
- ] })
4800
+ option.value
4801
+ )) })
4802
+ ] })
4803
+ ] }),
4804
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4805
+ ComboboxDropdownFooter,
4806
+ {
4807
+ footerAction,
4808
+ renderFooter,
4809
+ close: () => setOpen(false),
4810
+ hidden: disabled
4811
+ }
4812
+ )
4813
+ ]
4420
4814
  }
4421
4815
  )
4422
4816
  ] });
4423
4817
  }
4424
4818
 
4425
- // src/components/organisms/filter/index.tsx
4426
- var React15 = __toESM(require("react"));
4427
- var import_react_hook_form = require("react-hook-form");
4428
- var import_jsx_runtime23 = require("react/jsx-runtime");
4429
- var INPUT_BASE_CLASSES = [
4430
- "cnc-flex cnc-h-10 cnc-w-full cnc-rounded-md cnc-border cnc-bg-transparent cnc-px-3 cnc-py-1 cnc-text-base cnc-shadow-sm cnc-transition-colors",
4431
- "placeholder:cnc-text-muted-foreground focus-visible:cnc-outline-none",
4432
- "focus-visible:cnc-ring-2 focus-visible:cnc-ring-brand-gray-500/50 md:cnc-text-sm",
4433
- "not-disabled:hover:cnc-border-brand-gray-500",
4434
- "disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50"
4435
- ].join(" ");
4436
- function buildDefaultValues(fields) {
4437
- const defaults = {};
4438
- for (const field of fields) {
4439
- defaults[field.name] = field.defaultValue ?? (field.type === "switch" ? false : "");
4440
- }
4441
- return defaults;
4442
- }
4443
- function buildValidationRules(field) {
4444
- if (!field.required) return void 0;
4445
- return {
4446
- required: field.errorMessage || "Campo obrigat\xF3rio",
4447
- validate: (value) => {
4448
- if (field.type === "switch") return true;
4449
- if (value === "" || value === null || value === void 0) {
4450
- return field.errorMessage || "Campo obrigat\xF3rio";
4451
- }
4452
- return true;
4819
+ // src/components/molecules/forms/multi-select.tsx
4820
+ var React17 = __toESM(require("react"));
4821
+ var import_jsx_runtime29 = require("react/jsx-runtime");
4822
+ function MultiSelect({
4823
+ options,
4824
+ value = [],
4825
+ onChange,
4826
+ placeholder = "Selecione...",
4827
+ disabled = false,
4828
+ modal = false,
4829
+ className,
4830
+ buttonClassName,
4831
+ popoverClassName,
4832
+ command,
4833
+ selectedCountText = (count) => `${count} selecionados`,
4834
+ footerAction,
4835
+ renderFooter
4836
+ }) {
4837
+ const [open, setOpen] = React17.useState(false);
4838
+ const buttonText = (() => {
4839
+ if (value.length === 0) return placeholder;
4840
+ if (value.length === 1) {
4841
+ return options?.find((option) => option.value === value[0])?.label ?? selectedCountText(1);
4453
4842
  }
4843
+ return selectedCountText(value.length);
4844
+ })();
4845
+ const toggleOption = (optionValue) => {
4846
+ if (!onChange) return;
4847
+ onChange(
4848
+ value.includes(optionValue) ? value.filter((item) => item !== optionValue) : [...value, optionValue]
4849
+ );
4454
4850
  };
4455
- }
4456
- var FilterFieldItem = React15.memo(function FilterFieldItem2({
4457
- field,
4458
- register,
4459
- control,
4851
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Popover2, { open, onOpenChange: setOpen, modal, children: [
4852
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4853
+ Button,
4854
+ {
4855
+ type: "button",
4856
+ variant: "outline",
4857
+ role: "combobox",
4858
+ "aria-expanded": open,
4859
+ disabled,
4860
+ className: cn(
4861
+ "cnc-w-full cnc-justify-between cnc-truncate",
4862
+ buttonClassName,
4863
+ className
4864
+ ),
4865
+ children: [
4866
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "cnc-truncate", children: buttonText }),
4867
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronsUpDown, { className: "cnc-ml-2 cnc-h-4 cnc-w-4 cnc-shrink-0 cnc-opacity-50" })
4868
+ ]
4869
+ }
4870
+ ) }),
4871
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4872
+ PopoverContent2,
4873
+ {
4874
+ align: "start",
4875
+ className: cn(
4876
+ "cnc-w-[--radix-popover-trigger-width] cnc-p-0",
4877
+ popoverClassName
4878
+ ),
4879
+ children: [
4880
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Command, { children: [
4881
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CommandInput, { placeholder: command?.placeholder }),
4882
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(CommandList, { children: [
4883
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CommandEmpty, { children: command?.emptyMessage ?? "Nenhum item encontrado" }),
4884
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CommandGroup, { children: options?.map((option) => {
4885
+ const isSelected = value.includes(option.value);
4886
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4887
+ CommandItem,
4888
+ {
4889
+ value: option.value,
4890
+ onSelect: () => toggleOption(option.value),
4891
+ keywords: [option.value, option.label],
4892
+ disabled: option.disabled,
4893
+ children: [
4894
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4895
+ Check,
4896
+ {
4897
+ className: cn(
4898
+ "cnc-mr-2 cnc-h-4 cnc-w-4",
4899
+ isSelected ? "cnc-opacity-100" : "cnc-opacity-0"
4900
+ )
4901
+ }
4902
+ ),
4903
+ option.label
4904
+ ]
4905
+ },
4906
+ option.value
4907
+ );
4908
+ }) })
4909
+ ] })
4910
+ ] }),
4911
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4912
+ ComboboxDropdownFooter,
4913
+ {
4914
+ footerAction,
4915
+ renderFooter,
4916
+ close: () => setOpen(false),
4917
+ hidden: disabled
4918
+ }
4919
+ )
4920
+ ]
4921
+ }
4922
+ )
4923
+ ] });
4924
+ }
4925
+
4926
+ // src/components/molecules/overlay/confirm-dialog.tsx
4927
+ var React18 = __toESM(require("react"));
4928
+ var import_jsx_runtime30 = require("react/jsx-runtime");
4929
+ function ConfirmDialog({
4930
+ open,
4931
+ onOpenChange,
4932
+ title,
4933
+ description,
4934
+ confirmLabel = "Confirmar",
4935
+ cancelLabel = "Cancelar",
4936
+ loadingLabel = "Aguarde...",
4937
+ onConfirm,
4938
+ icon,
4939
+ showIconBackground = true,
4940
+ footerAlign = "center",
4941
+ confirmVariant = "danger",
4942
+ children,
4943
+ isLoading,
4944
+ className
4945
+ }) {
4946
+ const [localLoading, setLocalLoading] = React18.useState(false);
4947
+ const isBusy = isLoading ?? localLoading;
4948
+ const handleConfirm = async () => {
4949
+ if (isLoading !== void 0) {
4950
+ await onConfirm?.();
4951
+ return;
4952
+ }
4953
+ setLocalLoading(true);
4954
+ try {
4955
+ await onConfirm?.();
4956
+ } finally {
4957
+ setLocalLoading(false);
4958
+ }
4959
+ };
4960
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogContent, { className: cn("cnc-max-w-md cnc-text-center", className), children: [
4961
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogHeader, { children: [
4962
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4963
+ "div",
4964
+ {
4965
+ className: cn(
4966
+ "cnc-mx-auto cnc-mb-2 cnc-flex cnc-items-center cnc-justify-center",
4967
+ showIconBackground && "cnc-size-16 cnc-rounded-full cnc-bg-red-100",
4968
+ showIconBackground && confirmVariant === "confirm" && "cnc-bg-brand-green-100/20"
4969
+ ),
4970
+ children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Trash2, { className: cn("cnc-size-8 cnc-text-red-600", confirmVariant === "confirm" && "cnc-text-brand-green-300") })
4971
+ }
4972
+ ),
4973
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogTitle, { className: "cnc-text-center", children: title }),
4974
+ description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogDescription, { className: "cnc-text-center", children: description })
4975
+ ] }),
4976
+ children,
4977
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4978
+ DialogFooter,
4979
+ {
4980
+ className: cn(
4981
+ "cnc-flex cnc-gap-2",
4982
+ footerAlign === "end" ? "cnc-justify-end sm:cnc-justify-end" : "cnc-justify-center sm:cnc-justify-center"
4983
+ ),
4984
+ children: [
4985
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4986
+ Button,
4987
+ {
4988
+ type: "button",
4989
+ variant: "outline",
4990
+ onClick: () => onOpenChange(false),
4991
+ disabled: isBusy,
4992
+ children: cancelLabel
4993
+ }
4994
+ ),
4995
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4996
+ Button,
4997
+ {
4998
+ type: "button",
4999
+ variant: confirmVariant,
5000
+ isLoading: isBusy,
5001
+ onClick: handleConfirm,
5002
+ children: isBusy ? loadingLabel : confirmLabel
5003
+ }
5004
+ )
5005
+ ]
5006
+ }
5007
+ )
5008
+ ] }) });
5009
+ }
5010
+
5011
+ // src/components/molecules/overlay/tooltip.tsx
5012
+ var import_jsx_runtime31 = require("react/jsx-runtime");
5013
+ function Tooltip({
5014
+ text,
5015
+ children,
5016
+ className,
5017
+ contentClassName
5018
+ }) {
5019
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("cnc-relative cnc-inline-flex cnc-group", className), children: [
5020
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5021
+ "div",
5022
+ {
5023
+ role: "tooltip",
5024
+ className: cn(
5025
+ "cnc-pointer-events-none cnc-absolute cnc-bottom-full cnc-left-1/2 cnc-z-50 cnc-mb-2 cnc-w-max cnc-max-w-xs cnc--translate-x-1/2 cnc-rounded cnc-bg-black cnc-px-2 cnc-py-1 cnc-text-xs cnc-text-white cnc-opacity-0 cnc-shadow-md cnc-transition-opacity cnc-duration-200 group-hover:cnc-opacity-100 group-focus-within:cnc-opacity-100",
5026
+ contentClassName
5027
+ ),
5028
+ children: text
5029
+ }
5030
+ ),
5031
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "cnc-cursor-pointer", children })
5032
+ ] });
5033
+ }
5034
+
5035
+ // src/components/organisms/filter/index.tsx
5036
+ var React19 = __toESM(require("react"));
5037
+ var import_react_hook_form = require("react-hook-form");
5038
+ var import_jsx_runtime32 = require("react/jsx-runtime");
5039
+ var INPUT_BASE_CLASSES = [
5040
+ "cnc-flex cnc-h-10 cnc-w-full cnc-rounded-md cnc-border cnc-bg-transparent cnc-px-3 cnc-py-1 cnc-text-base cnc-shadow-sm cnc-transition-colors",
5041
+ "placeholder:cnc-text-muted-foreground focus-visible:cnc-outline-none",
5042
+ "focus-visible:cnc-ring-2 focus-visible:cnc-ring-brand-gray-500/50 md:cnc-text-sm",
5043
+ "not-disabled:hover:cnc-border-brand-gray-500",
5044
+ "disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50"
5045
+ ].join(" ");
5046
+ function buildDefaultValues(fields) {
5047
+ const defaults = {};
5048
+ for (const field of fields) {
5049
+ defaults[field.name] = field.defaultValue ?? (field.type === "switch" ? false : "");
5050
+ }
5051
+ return defaults;
5052
+ }
5053
+ function buildValidationRules(field) {
5054
+ if (!field.required) return void 0;
5055
+ return {
5056
+ required: field.errorMessage || "Campo obrigat\xF3rio",
5057
+ validate: (value) => {
5058
+ if (field.type === "switch") return true;
5059
+ if (value === "" || value === null || value === void 0) {
5060
+ return field.errorMessage || "Campo obrigat\xF3rio";
5061
+ }
5062
+ return true;
5063
+ }
5064
+ };
5065
+ }
5066
+ var FilterFieldItem = React19.memo(function FilterFieldItem2({
5067
+ field,
5068
+ register,
5069
+ control,
4460
5070
  error
4461
5071
  }) {
4462
5072
  const fieldId = field.id || `filter-field-${field.name}`;
4463
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5073
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4464
5074
  "div",
4465
5075
  {
4466
5076
  className: "cnc-filter-field cnc-px-2 cnc-mb-3",
4467
5077
  style: { "--cnc-filter-field-w": field.width || "25%" },
4468
5078
  children: [
4469
- field.label && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5079
+ field.label && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4470
5080
  "label",
4471
5081
  {
4472
5082
  htmlFor: fieldId,
4473
5083
  className: "cnc-block cnc-text-sm cnc-mb-1 cnc-font-medium cnc-text-brand-gray-600",
4474
5084
  children: [
4475
5085
  field.label,
4476
- field.required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "cnc-text-red-500", children: " *" })
5086
+ field.required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "cnc-text-red-500", children: " *" })
4477
5087
  ]
4478
5088
  }
4479
5089
  ),
4480
- (field.type === "text" || field.type === "date") && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5090
+ (field.type === "text" || field.type === "date") && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4481
5091
  "input",
4482
5092
  {
4483
5093
  id: fieldId,
@@ -4491,13 +5101,13 @@ var FilterFieldItem = React15.memo(function FilterFieldItem2({
4491
5101
  )
4492
5102
  }
4493
5103
  ),
4494
- field.type === "combobox" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5104
+ field.type === "combobox" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4495
5105
  import_react_hook_form.Controller,
4496
5106
  {
4497
5107
  name: field.name,
4498
5108
  control,
4499
5109
  rules: buildValidationRules(field),
4500
- render: ({ field: rhfField }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5110
+ render: ({ field: rhfField }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4501
5111
  Combobox,
4502
5112
  {
4503
5113
  value: rhfField.value || "",
@@ -4511,13 +5121,13 @@ var FilterFieldItem = React15.memo(function FilterFieldItem2({
4511
5121
  )
4512
5122
  }
4513
5123
  ),
4514
- field.type === "switch" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5124
+ field.type === "switch" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4515
5125
  import_react_hook_form.Controller,
4516
5126
  {
4517
5127
  name: field.name,
4518
5128
  control,
4519
5129
  rules: buildValidationRules(field),
4520
- render: ({ field: rhfField }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5130
+ render: ({ field: rhfField }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4521
5131
  Switch,
4522
5132
  {
4523
5133
  checked: !!rhfField.value,
@@ -4528,14 +5138,14 @@ var FilterFieldItem = React15.memo(function FilterFieldItem2({
4528
5138
  )
4529
5139
  }
4530
5140
  ),
4531
- error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "cnc-block cnc-text-xs cnc-text-red-500 cnc-mt-1", children: error.message })
5141
+ error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "cnc-block cnc-text-xs cnc-text-red-500 cnc-mt-1", children: error.message })
4532
5142
  ]
4533
5143
  }
4534
5144
  );
4535
5145
  });
4536
5146
  function CleanButton({ control, onClean }) {
4537
5147
  const values = (0, import_react_hook_form.useWatch)({ control });
4538
- const hasActiveFilters = React15.useMemo(() => {
5148
+ const hasActiveFilters = React19.useMemo(() => {
4539
5149
  const keys = Object.keys(values);
4540
5150
  return keys.some((key) => {
4541
5151
  const val = values[key];
@@ -4544,7 +5154,7 @@ function CleanButton({ control, onClean }) {
4544
5154
  return val !== null && val !== void 0 && val !== "";
4545
5155
  });
4546
5156
  }, [values]);
4547
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5157
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4548
5158
  Button,
4549
5159
  {
4550
5160
  type: "button",
@@ -4553,13 +5163,13 @@ function CleanButton({ control, onClean }) {
4553
5163
  disabled: !hasActiveFilters,
4554
5164
  className: "cnc-shrink-0 cnc-gap-2",
4555
5165
  children: [
4556
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FilterX, { className: "cnc-h-4 cnc-w-4" }),
5166
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FilterX, { className: "cnc-h-4 cnc-w-4" }),
4557
5167
  "Limpar"
4558
5168
  ]
4559
5169
  }
4560
5170
  );
4561
5171
  }
4562
- var Filter = React15.forwardRef(
5172
+ var Filter = React19.forwardRef(
4563
5173
  function Filter2({
4564
5174
  fields,
4565
5175
  collapsibleFields,
@@ -4569,12 +5179,12 @@ var Filter = React15.forwardRef(
4569
5179
  isLoading = false,
4570
5180
  className
4571
5181
  }, ref) {
4572
- const [isCollapsibleOpen, setIsCollapsibleOpen] = React15.useState(false);
4573
- const allFields = React15.useMemo(
5182
+ const [isCollapsibleOpen, setIsCollapsibleOpen] = React19.useState(false);
5183
+ const allFields = React19.useMemo(
4574
5184
  () => [...fields, ...collapsibleFields || []],
4575
5185
  [fields, collapsibleFields]
4576
5186
  );
4577
- const defaultValues = React15.useMemo(
5187
+ const defaultValues = React19.useMemo(
4578
5188
  () => buildDefaultValues(allFields),
4579
5189
  [allFields]
4580
5190
  );
@@ -4585,7 +5195,7 @@ var Filter = React15.forwardRef(
4585
5195
  reset,
4586
5196
  formState: { errors }
4587
5197
  } = (0, import_react_hook_form.useForm)({ defaultValues });
4588
- React15.useEffect(() => {
5198
+ React19.useEffect(() => {
4589
5199
  if (collapsibleFields?.some((f) => errors[f.name])) {
4590
5200
  setIsCollapsibleOpen(true);
4591
5201
  }
@@ -4593,7 +5203,7 @@ var Filter = React15.forwardRef(
4593
5203
  const onSubmit = (data) => {
4594
5204
  onSearch(data);
4595
5205
  };
4596
- const handleClean = React15.useCallback(() => {
5206
+ const handleClean = React19.useCallback(() => {
4597
5207
  const emptyValues = {};
4598
5208
  for (const field of allFields) {
4599
5209
  emptyValues[field.name] = field.type === "switch" ? false : "";
@@ -4601,12 +5211,12 @@ var Filter = React15.forwardRef(
4601
5211
  reset(emptyValues);
4602
5212
  onClean?.();
4603
5213
  }, [allFields, reset, onClean]);
4604
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5214
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4605
5215
  Collapsible,
4606
5216
  {
4607
5217
  open: isCollapsibleOpen,
4608
5218
  onOpenChange: setIsCollapsibleOpen,
4609
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5219
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4610
5220
  "form",
4611
5221
  {
4612
5222
  ref,
@@ -4617,8 +5227,8 @@ var Filter = React15.forwardRef(
4617
5227
  ),
4618
5228
  style: { backgroundColor: "#F8FAFC" },
4619
5229
  children: [
4620
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "cnc-flex cnc-flex-wrap cnc-items-end", children: [
4621
- fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5230
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "cnc-flex cnc-flex-wrap cnc-items-end", children: [
5231
+ fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4622
5232
  FilterFieldItem,
4623
5233
  {
4624
5234
  field,
@@ -4628,18 +5238,18 @@ var Filter = React15.forwardRef(
4628
5238
  },
4629
5239
  field.name
4630
5240
  )),
4631
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "cnc-filter-actions cnc-flex cnc-items-center cnc-gap-2 cnc-px-2 cnc-mb-3 cnc-ml-auto cnc-h-10", children: [
4632
- collapsibleFields && collapsibleFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5241
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "cnc-filter-actions cnc-flex cnc-items-center cnc-gap-2 cnc-px-2 cnc-mb-3 cnc-ml-auto cnc-h-10", children: [
5242
+ collapsibleFields && collapsibleFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4633
5243
  Button,
4634
5244
  {
4635
5245
  type: "button",
4636
5246
  variant: "outline",
4637
5247
  size: "icon",
4638
5248
  className: "cnc-shrink-0",
4639
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ListFilter, { className: "cnc-h-4 cnc-w-4" })
5249
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ListFilter, { className: "cnc-h-4 cnc-w-4" })
4640
5250
  }
4641
5251
  ) }),
4642
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5252
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4643
5253
  Button,
4644
5254
  {
4645
5255
  type: "submit",
@@ -4647,15 +5257,15 @@ var Filter = React15.forwardRef(
4647
5257
  isLoading,
4648
5258
  className: "cnc-shrink-0 cnc-gap-2",
4649
5259
  children: [
4650
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Search, { className: "cnc-h-4 cnc-w-4" }),
5260
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Search, { className: "cnc-h-4 cnc-w-4" }),
4651
5261
  "Pesquisar"
4652
5262
  ]
4653
5263
  }
4654
5264
  ),
4655
- !hideCleanFilterButton && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CleanButton, { control, onClean: handleClean })
5265
+ !hideCleanFilterButton && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CleanButton, { control, onClean: handleClean })
4656
5266
  ] })
4657
5267
  ] }),
4658
- collapsibleFields && collapsibleFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AnimatedCollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "cnc-flex cnc-flex-wrap cnc-items-end cnc-pt-2", children: collapsibleFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5268
+ collapsibleFields && collapsibleFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AnimatedCollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "cnc-flex cnc-flex-wrap cnc-items-end cnc-pt-2", children: collapsibleFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4659
5269
  FilterFieldItem,
4660
5270
  {
4661
5271
  field,
@@ -4674,8 +5284,8 @@ var Filter = React15.forwardRef(
4674
5284
  );
4675
5285
 
4676
5286
  // src/components/organisms/card-list/index.tsx
4677
- var React16 = __toESM(require("react"));
4678
- var import_jsx_runtime24 = require("react/jsx-runtime");
5287
+ var React20 = __toESM(require("react"));
5288
+ var import_jsx_runtime33 = require("react/jsx-runtime");
4679
5289
  function CardList({
4680
5290
  items,
4681
5291
  renderCard,
@@ -4691,21 +5301,21 @@ function CardList({
4691
5301
  gridTemplateColumns: `repeat(auto-fill, minmax(min(100%, ${minItemWidth}), 1fr))`
4692
5302
  };
4693
5303
  if (isLoading) {
4694
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5304
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4695
5305
  "div",
4696
5306
  {
4697
5307
  className: cn("cnc-grid cnc-w-full", gap, className),
4698
5308
  style: gridStyle,
4699
5309
  "aria-busy": "true",
4700
- children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
5310
+ children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4701
5311
  "div",
4702
5312
  {
4703
5313
  className: "cnc-animate-pulse cnc-rounded-md cnc-border-2 cnc-border-brand-gray-50 cnc-bg-white cnc-shadow cnc-p-6",
4704
5314
  children: [
4705
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "cnc-h-4 cnc-w-1/2 cnc-bg-brand-gray-100 cnc-rounded cnc-mb-4" }),
4706
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "cnc-h-3 cnc-w-3/4 cnc-bg-brand-gray-100 cnc-rounded cnc-mb-2" }),
4707
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "cnc-h-3 cnc-w-2/3 cnc-bg-brand-gray-100 cnc-rounded cnc-mb-6" }),
4708
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "cnc-h-8 cnc-w-full cnc-bg-brand-gray-100 cnc-rounded" })
5315
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "cnc-h-4 cnc-w-1/2 cnc-bg-brand-gray-100 cnc-rounded cnc-mb-4" }),
5316
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "cnc-h-3 cnc-w-3/4 cnc-bg-brand-gray-100 cnc-rounded cnc-mb-2" }),
5317
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "cnc-h-3 cnc-w-2/3 cnc-bg-brand-gray-100 cnc-rounded cnc-mb-6" }),
5318
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "cnc-h-8 cnc-w-full cnc-bg-brand-gray-100 cnc-rounded" })
4709
5319
  ]
4710
5320
  },
4711
5321
  i
@@ -4714,7 +5324,7 @@ function CardList({
4714
5324
  );
4715
5325
  }
4716
5326
  if (!items || items.length === 0) {
4717
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
5327
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4718
5328
  "div",
4719
5329
  {
4720
5330
  className: cn(
@@ -4723,166 +5333,1833 @@ function CardList({
4723
5333
  ),
4724
5334
  style: { backgroundColor: "#F8FAFC", color: "#64748B" },
4725
5335
  children: [
4726
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FolderOpen, { className: "cnc-h-8 cnc-w-8 cnc-mb-2" }),
4727
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "cnc-text-sm", children: emptyMessage })
5336
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FolderOpen, { className: "cnc-h-8 cnc-w-8 cnc-mb-2" }),
5337
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "cnc-text-sm", children: emptyMessage })
4728
5338
  ]
4729
5339
  }
4730
5340
  );
4731
5341
  }
4732
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5342
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4733
5343
  "div",
4734
5344
  {
4735
5345
  className: cn("cnc-grid cnc-w-full", gap, className),
4736
5346
  style: gridStyle,
4737
- children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(React16.Fragment, { children: renderCard(item, index) }, getKey ? getKey(item, index) : index))
5347
+ children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(React20.Fragment, { children: renderCard(item, index) }, getKey ? getKey(item, index) : index))
4738
5348
  }
4739
5349
  );
4740
5350
  }
4741
- // Annotate the CommonJS export names for ESM import in node:
4742
- 0 && (module.exports = {
4743
- AplicationsHeader,
4744
- AppsMenu,
4745
- Badge,
4746
- Button,
4747
- Card,
4748
- CardContent,
4749
- CardFooter,
4750
- CardFooterItem,
4751
- CardHeader,
4752
- CardList,
4753
- Checkbox,
4754
- Collapsible,
4755
- CollapsibleContent,
4756
- CollapsibleTrigger,
4757
- Combobox,
4758
- Command,
4759
- CommandDialog,
4760
- CommandEmpty,
4761
- CommandGroup,
4762
- CommandInput,
4763
- CommandItem,
4764
- CommandList,
4765
- CommandSeparator,
4766
- CommandShortcut,
4767
- Dialog,
4768
- DialogClose,
4769
- DialogContent,
4770
- DialogDescription,
4771
- DialogFooter,
4772
- DialogHeader,
4773
- DialogOverlay,
4774
- DialogPortal,
4775
- DialogTitle,
4776
- DialogTrigger,
4777
- DropdownMenu,
4778
- DropdownMenuCheckboxItem,
4779
- DropdownMenuContent,
4780
- DropdownMenuGroup,
4781
- DropdownMenuItem,
4782
- DropdownMenuLabel,
4783
- DropdownMenuPortal,
4784
- DropdownMenuRadioGroup,
4785
- DropdownMenuRadioItem,
4786
- DropdownMenuSeparator,
4787
- DropdownMenuShortcut,
4788
- DropdownMenuSub,
4789
- DropdownMenuSubContent,
4790
- DropdownMenuSubTrigger,
4791
- DropdownMenuTrigger,
4792
- Filter,
4793
- Header,
4794
- HeaderContainer,
4795
- HeaderProfileHeader,
4796
- HeaderProfileItem,
4797
- Input,
4798
- Modal,
4799
- ModalEntidade,
4800
- ModalMudancaEntidade,
4801
- PageHeader,
4802
- PageHeaderActionsContainer,
4803
- PageHeaderTitle,
4804
- PageHeaderTitleContent,
4805
- Popover,
4806
- PopoverContent,
4807
- PopoverTrigger,
4808
- Select,
4809
- SelectContent,
4810
- SelectGroup,
4811
- SelectItem,
4812
- SelectLabel,
4813
- SelectPortal,
4814
- SelectScrollDownButton,
4815
- SelectScrollUpButton,
4816
- SelectSeparator,
4817
- SelectTrigger,
4818
- SelectValue,
4819
- SelectViewport,
4820
- Sidebar,
4821
- SidebarContainer,
4822
- SidebarImageBrand,
4823
- SidebarNavCollapse,
4824
- SidebarNavLink,
4825
- Switch,
4826
- Tabs,
4827
- TabsContent,
4828
- TabsList,
4829
- TabsTrigger,
4830
- Title,
4831
- availableApps,
4832
- buttonVariants
4833
- });
4834
- /*! Bundled license information:
4835
-
4836
- lucide-react/dist/esm/shared/src/utils.js:
4837
- (**
4838
- * @license lucide-react v0.453.0 - ISC
4839
- *
4840
- * This source code is licensed under the ISC license.
4841
- * See the LICENSE file in the root directory of this source tree.
4842
- *)
4843
-
4844
- lucide-react/dist/esm/defaultAttributes.js:
4845
- (**
4846
- * @license lucide-react v0.453.0 - ISC
4847
- *
4848
- * This source code is licensed under the ISC license.
4849
- * See the LICENSE file in the root directory of this source tree.
4850
- *)
4851
-
4852
- lucide-react/dist/esm/Icon.js:
4853
- (**
4854
- * @license lucide-react v0.453.0 - ISC
4855
- *
4856
- * This source code is licensed under the ISC license.
4857
- * See the LICENSE file in the root directory of this source tree.
4858
- *)
4859
-
4860
- lucide-react/dist/esm/createLucideIcon.js:
4861
- (**
4862
- * @license lucide-react v0.453.0 - ISC
4863
- *
4864
- * This source code is licensed under the ISC license.
4865
- * See the LICENSE file in the root directory of this source tree.
4866
- *)
4867
-
4868
- lucide-react/dist/esm/icons/check.js:
4869
- (**
4870
- * @license lucide-react v0.453.0 - ISC
4871
- *
4872
- * This source code is licensed under the ISC license.
4873
- * See the LICENSE file in the root directory of this source tree.
4874
- *)
4875
-
4876
- lucide-react/dist/esm/icons/chevron-down.js:
4877
- (**
4878
- * @license lucide-react v0.453.0 - ISC
4879
- *
4880
- * This source code is licensed under the ISC license.
4881
- * See the LICENSE file in the root directory of this source tree.
4882
- *)
4883
5351
 
4884
- lucide-react/dist/esm/icons/chevron-right.js:
4885
- (**
5352
+ // src/components/organisms/drawer/drawer.tsx
5353
+ var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
5354
+ var React21 = __toESM(require("react"));
5355
+ var import_jsx_runtime34 = require("react/jsx-runtime");
5356
+ var Drawer = DialogPrimitive2.Root;
5357
+ var DrawerTrigger = DialogPrimitive2.Trigger;
5358
+ var DrawerPortal = DialogPrimitive2.Portal;
5359
+ var DrawerClose = DialogPrimitive2.Close;
5360
+ var DrawerOverlay = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5361
+ DialogPrimitive2.Overlay,
5362
+ {
5363
+ ref,
5364
+ className: cn(
5365
+ "cnc-fixed cnc-inset-0 cnc-z-50 cnc-bg-black/80 data-[state=open]:cnc-animate-in data-[state=closed]:cnc-animate-out data-[state=closed]:cnc-fade-out-0 data-[state=open]:cnc-fade-in-0",
5366
+ className
5367
+ ),
5368
+ ...props
5369
+ }
5370
+ ));
5371
+ DrawerOverlay.displayName = DialogPrimitive2.Overlay.displayName;
5372
+ var drawerSizeToWidth = {
5373
+ sm: "24rem",
5374
+ md: "32rem",
5375
+ lg: "40rem",
5376
+ xl: "48rem",
5377
+ full: "100vw"
5378
+ };
5379
+ var DrawerContent = React21.forwardRef(
5380
+ ({
5381
+ className,
5382
+ children,
5383
+ side = "right",
5384
+ size = "md",
5385
+ width,
5386
+ closeButton = true,
5387
+ style,
5388
+ ...props
5389
+ }, ref) => {
5390
+ const resolvedWidth = width ?? drawerSizeToWidth[size];
5391
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DrawerPortal, { children: [
5392
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DrawerOverlay, {}),
5393
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
5394
+ DialogPrimitive2.Content,
5395
+ {
5396
+ ref,
5397
+ style: { "--drawer-width": resolvedWidth, ...style },
5398
+ className: cn(
5399
+ "cnc-fixed cnc-inset-y-0 cnc-z-50 cnc-flex cnc-w-full cnc-flex-col cnc-bg-background cnc-shadow-lg cnc-duration-200 data-[state=open]:cnc-animate-in data-[state=closed]:cnc-animate-out data-[state=closed]:cnc-fade-out-0 data-[state=open]:cnc-fade-in-0",
5400
+ "sm:cnc-w-[--drawer-width] sm:cnc-max-w-full",
5401
+ side === "right" && "cnc-right-0 cnc-border-l data-[state=closed]:cnc-slide-out-to-right-full data-[state=open]:cnc-slide-in-from-right-full",
5402
+ side === "left" && "cnc-left-0 cnc-border-r data-[state=closed]:cnc-slide-out-to-left-full data-[state=open]:cnc-slide-in-from-left-full",
5403
+ className
5404
+ ),
5405
+ ...props,
5406
+ children: [
5407
+ children,
5408
+ closeButton && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DialogPrimitive2.Close, { className: "cnc-absolute cnc-right-4 cnc-top-4 cnc-rounded-sm cnc-opacity-70 cnc-ring-offset-background cnc-transition-opacity hover:cnc-opacity-100 focus:cnc-outline-none focus:cnc-ring-2 focus:cnc-ring-ring focus:cnc-ring-offset-2 disabled:cnc-pointer-events-none data-[state=open]:cnc-bg-accent data-[state=open]:cnc-text-muted-foreground", children: [
5409
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(X, { className: "cnc-h-4 cnc-w-4" }),
5410
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "cnc-sr-only", children: "Fechar" })
5411
+ ] })
5412
+ ]
5413
+ }
5414
+ )
5415
+ ] });
5416
+ }
5417
+ );
5418
+ DrawerContent.displayName = DialogPrimitive2.Content.displayName;
5419
+ var DrawerHeader = ({
5420
+ className,
5421
+ ...props
5422
+ }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5423
+ "div",
5424
+ {
5425
+ className: cn(
5426
+ "cnc-flex cnc-flex-col cnc-space-y-1.5 cnc-border-b cnc-p-6",
5427
+ className
5428
+ ),
5429
+ ...props
5430
+ }
5431
+ );
5432
+ DrawerHeader.displayName = "DrawerHeader";
5433
+ var DrawerBody = ({
5434
+ className,
5435
+ ...props
5436
+ }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("cnc-flex-1 cnc-overflow-y-auto cnc-p-6", className), ...props });
5437
+ DrawerBody.displayName = "DrawerBody";
5438
+ var DrawerFooter = ({
5439
+ className,
5440
+ ...props
5441
+ }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("cnc-border-t cnc-p-6", className), ...props });
5442
+ DrawerFooter.displayName = "DrawerFooter";
5443
+ var DrawerTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5444
+ DialogPrimitive2.Title,
5445
+ {
5446
+ ref,
5447
+ className: cn(
5448
+ "cnc-text-lg cnc-font-semibold cnc-leading-none cnc-tracking-tight",
5449
+ className
5450
+ ),
5451
+ ...props
5452
+ }
5453
+ ));
5454
+ DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
5455
+ var DrawerDescription = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5456
+ DialogPrimitive2.Description,
5457
+ {
5458
+ ref,
5459
+ className: cn("cnc-text-sm cnc-text-muted-foreground", className),
5460
+ ...props
5461
+ }
5462
+ ));
5463
+ DrawerDescription.displayName = DialogPrimitive2.Description.displayName;
5464
+
5465
+ // src/components/organisms/drawer/drawer-context.tsx
5466
+ var React22 = __toESM(require("react"));
5467
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5468
+ var DrawerContext = React22.createContext(
5469
+ void 0
5470
+ );
5471
+ function DrawerProvider({ children }) {
5472
+ const [activeDrawer, setActiveDrawer] = React22.useState(null);
5473
+ const openDrawer = React22.useCallback((drawerId) => {
5474
+ setActiveDrawer(drawerId);
5475
+ }, []);
5476
+ const closeDrawer = React22.useCallback(() => {
5477
+ setActiveDrawer(null);
5478
+ }, []);
5479
+ const isOpen = React22.useCallback(
5480
+ (drawerId) => activeDrawer === drawerId,
5481
+ [activeDrawer]
5482
+ );
5483
+ const value = React22.useMemo(
5484
+ () => ({ activeDrawer, openDrawer, closeDrawer, isOpen }),
5485
+ [activeDrawer, openDrawer, closeDrawer, isOpen]
5486
+ );
5487
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DrawerContext.Provider, { value, children });
5488
+ }
5489
+
5490
+ // src/components/organisms/drawer/use-drawer.ts
5491
+ var React23 = __toESM(require("react"));
5492
+ function useDrawer() {
5493
+ const context = React23.useContext(DrawerContext);
5494
+ if (!context) {
5495
+ throw new Error("useDrawer deve ser usado dentro de um DrawerProvider");
5496
+ }
5497
+ return context;
5498
+ }
5499
+
5500
+ // src/components/organisms/upload/file-upload.tsx
5501
+ var React24 = __toESM(require("react"));
5502
+
5503
+ // src/components/organisms/upload/utils.ts
5504
+ function formatSizeLimit(bytes) {
5505
+ if (bytes < 1024 * 1024) {
5506
+ return `${Math.max(1, Math.round(bytes / 1024))} KB`;
5507
+ }
5508
+ return `${(bytes / (1024 * 1024)).toLocaleString("pt-BR", {
5509
+ maximumFractionDigits: 1,
5510
+ minimumFractionDigits: 0
5511
+ })} MB`;
5512
+ }
5513
+ function formatFileSize(bytes) {
5514
+ if (bytes < 1024 * 1024) {
5515
+ return `${Math.max(1, Math.round(bytes / 1024))} KB`;
5516
+ }
5517
+ return `${(bytes / (1024 * 1024)).toLocaleString("pt-BR", {
5518
+ maximumFractionDigits: 1,
5519
+ minimumFractionDigits: 0
5520
+ })} MB`;
5521
+ }
5522
+ function isDuplicateFile(file, files) {
5523
+ return files.some(
5524
+ (currentFile) => currentFile.name === file.name && currentFile.size === file.size
5525
+ );
5526
+ }
5527
+ function validateFiles({
5528
+ currentFiles = [],
5529
+ incomingFiles,
5530
+ allowedTypes,
5531
+ maxSize,
5532
+ multiple = true
5533
+ }) {
5534
+ const acceptedFiles = [];
5535
+ const rejectedFiles = [];
5536
+ const baseFiles = multiple ? currentFiles : [];
5537
+ for (const file of incomingFiles) {
5538
+ if (allowedTypes?.length && !allowedTypes.includes(file.type)) {
5539
+ rejectedFiles.push({
5540
+ file,
5541
+ reason: "type",
5542
+ message: `Tipo n\xE3o permitido: ${file.name}`
5543
+ });
5544
+ continue;
5545
+ }
5546
+ if (maxSize !== void 0 && file.size > maxSize) {
5547
+ rejectedFiles.push({
5548
+ file,
5549
+ reason: "size",
5550
+ message: `Arquivo maior que ${formatSizeLimit(maxSize)}: ${file.name}`
5551
+ });
5552
+ continue;
5553
+ }
5554
+ if (isDuplicateFile(file, [...baseFiles, ...acceptedFiles])) {
5555
+ rejectedFiles.push({
5556
+ file,
5557
+ reason: "duplicate",
5558
+ message: `Arquivo j\xE1 adicionado: ${file.name}`
5559
+ });
5560
+ continue;
5561
+ }
5562
+ if (!multiple) {
5563
+ acceptedFiles.splice(0, acceptedFiles.length, file);
5564
+ continue;
5565
+ }
5566
+ acceptedFiles.push(file);
5567
+ }
5568
+ return { acceptedFiles, rejectedFiles };
5569
+ }
5570
+
5571
+ // src/components/organisms/upload/file-list.tsx
5572
+ var import_jsx_runtime36 = require("react/jsx-runtime");
5573
+ function FileList({
5574
+ items,
5575
+ onRemove,
5576
+ onDownload,
5577
+ disabled = false,
5578
+ variant = "bordered",
5579
+ emptyState,
5580
+ removeLabel = "Remover",
5581
+ className,
5582
+ ...props
5583
+ }) {
5584
+ if (items.length === 0) {
5585
+ return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, { children: emptyState }) : null;
5586
+ }
5587
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5588
+ "ul",
5589
+ {
5590
+ className: cn(
5591
+ "cnc-divide-y",
5592
+ variant === "bordered" ? "cnc-rounded-md cnc-border cnc-border-slate-200 cnc-bg-white cnc-divide-slate-200" : "cnc-bg-transparent cnc-divide-slate-100",
5593
+ className
5594
+ ),
5595
+ ...props,
5596
+ children: items.map((item, index) => {
5597
+ const canRemove = !!onRemove;
5598
+ const canDownload = !!onDownload;
5599
+ const isDisabled = disabled || item.disabled;
5600
+ const isPending = item.status === "pending";
5601
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5602
+ "li",
5603
+ {
5604
+ className: cn(
5605
+ "cnc-flex cnc-flex-col cnc-gap-2",
5606
+ variant === "bordered" ? "cnc-px-4 cnc-py-3 sm:cnc-flex-row sm:cnc-items-center sm:cnc-justify-between" : "cnc-px-0 cnc-py-4 first:cnc-pt-0 last:cnc-pb-0 sm:cnc-flex-row sm:cnc-items-center sm:cnc-justify-between"
5607
+ ),
5608
+ children: [
5609
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "cnc-flex cnc-min-w-0 cnc-flex-1 cnc-items-start cnc-gap-2", children: [
5610
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FileText, { className: "cnc-mt-0.5 cnc-size-4 cnc-shrink-0 cnc-text-slate-500" }),
5611
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "cnc-min-w-0", children: [
5612
+ canDownload ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5613
+ "button",
5614
+ {
5615
+ type: "button",
5616
+ onClick: () => onDownload(item, index),
5617
+ disabled: isDisabled,
5618
+ className: "cnc-inline-flex cnc-items-center cnc-gap-1 cnc-text-left cnc-text-sm cnc-font-medium cnc-text-[#002f87] hover:cnc-underline disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50",
5619
+ children: [
5620
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "cnc-min-w-0 cnc-truncate", children: item.name }),
5621
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Download, { className: "cnc-size-3.5 cnc-shrink-0" })
5622
+ ]
5623
+ }
5624
+ ) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "cnc-text-sm cnc-font-medium cnc-text-slate-800", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "cnc-break-all", children: item.name }) }),
5625
+ (item.meta || item.size !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "cnc-mt-0.5 cnc-flex cnc-flex-wrap cnc-gap-x-2 cnc-gap-y-1 cnc-text-xs cnc-text-slate-500", children: [
5626
+ item.meta,
5627
+ item.meta && item.size !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: "\xB7" }) : null,
5628
+ item.size !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: formatFileSize(item.size) }) : null
5629
+ ] }),
5630
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "cnc-mt-1 cnc-line-clamp-2 cnc-text-xs cnc-text-slate-600", children: item.description }) : null
5631
+ ] })
5632
+ ] }),
5633
+ canRemove ? isPending ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5634
+ "button",
5635
+ {
5636
+ type: "button",
5637
+ onClick: () => onRemove(item, index),
5638
+ disabled: isDisabled,
5639
+ className: "cnc-inline-flex cnc-shrink-0 cnc-items-center cnc-justify-center cnc-rounded-md cnc-p-1.5 cnc-text-slate-500 cnc-transition hover:cnc-bg-slate-100 hover:cnc-text-slate-800 disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50",
5640
+ "aria-label": `Remover ${item.name}`,
5641
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(X, { className: "cnc-size-4" })
5642
+ }
5643
+ ) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5644
+ "button",
5645
+ {
5646
+ type: "button",
5647
+ onClick: () => onRemove(item, index),
5648
+ disabled: isDisabled,
5649
+ className: "cnc-inline-flex cnc-h-9 cnc-w-full cnc-shrink-0 cnc-items-center cnc-justify-center cnc-gap-2 cnc-rounded-md cnc-border cnc-border-red-200 cnc-px-3 cnc-text-sm cnc-font-semibold cnc-text-red-700 cnc-transition hover:cnc-bg-red-50 disabled:cnc-cursor-not-allowed disabled:cnc-opacity-60 sm:cnc-w-auto",
5650
+ "aria-label": `Remover ${item.name}`,
5651
+ children: [
5652
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Trash2, { className: "cnc-size-4" }),
5653
+ removeLabel
5654
+ ]
5655
+ }
5656
+ ) : null
5657
+ ]
5658
+ },
5659
+ item.id
5660
+ );
5661
+ })
5662
+ }
5663
+ );
5664
+ }
5665
+
5666
+ // src/components/organisms/upload/file-upload.tsx
5667
+ var import_jsx_runtime37 = require("react/jsx-runtime");
5668
+ function fileToListItem(file, index) {
5669
+ return {
5670
+ id: `${file.name}-${file.size}-${file.lastModified}-${index}`,
5671
+ name: file.name,
5672
+ size: file.size,
5673
+ status: "pending"
5674
+ };
5675
+ }
5676
+ var FileUpload = React24.forwardRef(
5677
+ ({
5678
+ value = [],
5679
+ onChange,
5680
+ multiple = true,
5681
+ accept,
5682
+ allowedTypes,
5683
+ maxSize,
5684
+ disabled = false,
5685
+ isLoading = false,
5686
+ buttonLabel = "Adicionar arquivos",
5687
+ hint,
5688
+ icon,
5689
+ onReject,
5690
+ showList = true,
5691
+ listTitle = (count) => `Arquivos selecionados (${count})`,
5692
+ className,
5693
+ buttonClassName,
5694
+ listClassName,
5695
+ ...props
5696
+ }, ref) => {
5697
+ const fileInputRef = React24.useRef(null);
5698
+ const hintId = React24.useId();
5699
+ React24.useImperativeHandle(ref, () => fileInputRef.current, []);
5700
+ const isBusy = disabled || isLoading;
5701
+ const items = value.map(fileToListItem);
5702
+ const clearInput = () => {
5703
+ if (fileInputRef.current) {
5704
+ fileInputRef.current.value = "";
5705
+ }
5706
+ };
5707
+ const handleFileSelection = (event) => {
5708
+ const selectedFiles = Array.from(event.target.files ?? []);
5709
+ if (!selectedFiles.length) {
5710
+ clearInput();
5711
+ return;
5712
+ }
5713
+ const { acceptedFiles, rejectedFiles } = validateFiles({
5714
+ currentFiles: value,
5715
+ incomingFiles: selectedFiles,
5716
+ allowedTypes,
5717
+ maxSize,
5718
+ multiple
5719
+ });
5720
+ if (acceptedFiles.length > 0) {
5721
+ onChange?.(multiple ? [...value, ...acceptedFiles] : acceptedFiles.slice(0, 1));
5722
+ }
5723
+ if (rejectedFiles.length > 0) {
5724
+ onReject?.(rejectedFiles);
5725
+ }
5726
+ clearInput();
5727
+ };
5728
+ const handleRemove = (_item, index) => {
5729
+ onChange?.(value.filter((_, currentIndex) => currentIndex !== index));
5730
+ };
5731
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("cnc-flex cnc-min-w-0 cnc-flex-col cnc-gap-3", className), ...props, children: [
5732
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5733
+ "input",
5734
+ {
5735
+ ref: fileInputRef,
5736
+ type: "file",
5737
+ multiple,
5738
+ accept,
5739
+ className: "cnc-sr-only",
5740
+ tabIndex: -1,
5741
+ disabled: isBusy,
5742
+ "aria-describedby": hint ? hintId : void 0,
5743
+ onChange: handleFileSelection
5744
+ }
5745
+ ),
5746
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "cnc-flex cnc-flex-col cnc-gap-2 sm:cnc-flex-row sm:cnc-flex-wrap sm:cnc-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
5747
+ Button,
5748
+ {
5749
+ type: "button",
5750
+ variant: "outline",
5751
+ disabled: isBusy,
5752
+ className: buttonClassName,
5753
+ onClick: () => fileInputRef.current?.click(),
5754
+ children: [
5755
+ icon ?? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Paperclip, { className: "cnc-mr-2 cnc-size-4" }),
5756
+ buttonLabel
5757
+ ]
5758
+ }
5759
+ ) }),
5760
+ hint ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { id: hintId, className: "cnc-text-sm cnc-text-slate-600", children: hint }) : null,
5761
+ showList && items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "cnc-flex cnc-flex-col cnc-gap-2", children: [
5762
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { role: "status", className: "cnc-text-sm cnc-font-medium cnc-text-slate-700", children: listTitle(items.length) }),
5763
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5764
+ FileList,
5765
+ {
5766
+ items,
5767
+ onRemove: handleRemove,
5768
+ disabled: isBusy,
5769
+ className: listClassName
5770
+ }
5771
+ )
5772
+ ] }) : null
5773
+ ] });
5774
+ }
5775
+ );
5776
+ FileUpload.displayName = "FileUpload";
5777
+
5778
+ // src/components/organisms/calendar/calendar-utils.ts
5779
+ var MESES_PT_BR = [
5780
+ "Janeiro",
5781
+ "Fevereiro",
5782
+ "Mar\xE7o",
5783
+ "Abril",
5784
+ "Maio",
5785
+ "Junho",
5786
+ "Julho",
5787
+ "Agosto",
5788
+ "Setembro",
5789
+ "Outubro",
5790
+ "Novembro",
5791
+ "Dezembro"
5792
+ ];
5793
+ var MESES_PT_BR_ABREV = [
5794
+ "JAN",
5795
+ "FEV",
5796
+ "MAR",
5797
+ "ABR",
5798
+ "MAI",
5799
+ "JUN",
5800
+ "JUL",
5801
+ "AGO",
5802
+ "SET",
5803
+ "OUT",
5804
+ "NOV",
5805
+ "DEZ"
5806
+ ];
5807
+ var DIAS_SEMANA_PT_BR = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "S\xC1B"];
5808
+ function toDateKey(date) {
5809
+ const ano = date.getFullYear();
5810
+ const mes = String(date.getMonth() + 1).padStart(2, "0");
5811
+ const dia = String(date.getDate()).padStart(2, "0");
5812
+ return `${ano}-${mes}-${dia}`;
5813
+ }
5814
+ function toLocalNoon(date) {
5815
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0, 0);
5816
+ }
5817
+ function isSameDay(a, b) {
5818
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
5819
+ }
5820
+ function isToday(date) {
5821
+ return isSameDay(date, /* @__PURE__ */ new Date());
5822
+ }
5823
+ function buildMonthDays(month, selectedDate, hasItems) {
5824
+ const year = month.getFullYear();
5825
+ const monthIndex = month.getMonth();
5826
+ const totalDays = new Date(year, monthIndex + 1, 0).getDate();
5827
+ const startOffset = new Date(year, monthIndex, 1).getDay();
5828
+ const cells = [];
5829
+ for (let i = 0; i < startOffset; i++) {
5830
+ cells.push(null);
5831
+ }
5832
+ for (let day = 1; day <= totalDays; day++) {
5833
+ const date = new Date(year, monthIndex, day, 12, 0, 0, 0);
5834
+ cells.push({
5835
+ date,
5836
+ number: day,
5837
+ dateKey: toDateKey(date),
5838
+ isToday: isToday(date),
5839
+ isSelected: selectedDate ? isSameDay(date, selectedDate) : false,
5840
+ hasItems: hasItems?.(date) ?? false
5841
+ });
5842
+ }
5843
+ return cells;
5844
+ }
5845
+ function formatMonthYear(date) {
5846
+ return `${MESES_PT_BR[date.getMonth()]} ${date.getFullYear()}`;
5847
+ }
5848
+ function formatDayAriaLabel(date) {
5849
+ return date.toLocaleDateString("pt-BR", {
5850
+ weekday: "long",
5851
+ day: "numeric",
5852
+ month: "long",
5853
+ year: "numeric"
5854
+ });
5855
+ }
5856
+
5857
+ // src/components/organisms/calendar/mini-month-calendar.tsx
5858
+ var React25 = __toESM(require("react"));
5859
+ var import_jsx_runtime38 = require("react/jsx-runtime");
5860
+ function MiniMonthCalendar({
5861
+ month: monthProp,
5862
+ onMonthChange,
5863
+ selectedDate,
5864
+ onSelectDate,
5865
+ hasItems,
5866
+ renderDay,
5867
+ weekDays = DIAS_SEMANA_PT_BR,
5868
+ monthLabel = formatMonthYear,
5869
+ previousLabel = "M\xEAs anterior",
5870
+ nextLabel = "Pr\xF3ximo m\xEAs",
5871
+ className
5872
+ }) {
5873
+ const month = React25.useMemo(() => toLocalNoon(monthProp ?? /* @__PURE__ */ new Date()), [monthProp]);
5874
+ const cells = React25.useMemo(
5875
+ () => buildMonthDays(month, selectedDate, hasItems),
5876
+ [month, selectedDate, hasItems]
5877
+ );
5878
+ const goToMonth = (offset) => {
5879
+ onMonthChange?.(
5880
+ new Date(month.getFullYear(), month.getMonth() + offset, 1, 12, 0, 0, 0)
5881
+ );
5882
+ };
5883
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("cnc-w-full", className), children: [
5884
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "cnc-mb-4 cnc-flex cnc-items-center cnc-justify-between cnc-px-1", children: [
5885
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5886
+ "button",
5887
+ {
5888
+ type: "button",
5889
+ onClick: () => goToMonth(-1),
5890
+ "aria-label": previousLabel,
5891
+ className: "cnc-rounded cnc-p-1 cnc-text-brand-gray-200 cnc-transition-colors hover:cnc-bg-brand-blue-50 hover:cnc-text-brand-blue-600",
5892
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronLeft, { className: "cnc-size-4" })
5893
+ }
5894
+ ),
5895
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "cnc-text-sm cnc-font-bold cnc-text-primary", children: monthLabel(month) }),
5896
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5897
+ "button",
5898
+ {
5899
+ type: "button",
5900
+ onClick: () => goToMonth(1),
5901
+ "aria-label": nextLabel,
5902
+ className: "cnc-rounded cnc-p-1 cnc-text-brand-gray-200 cnc-transition-colors hover:cnc-bg-brand-blue-50 hover:cnc-text-brand-blue-600",
5903
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronRight, { className: "cnc-size-4" })
5904
+ }
5905
+ )
5906
+ ] }),
5907
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "cnc-grid cnc-grid-cols-7 cnc-gap-y-3 cnc-text-center cnc-text-xs", children: [
5908
+ weekDays.map((dayName) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5909
+ "span",
5910
+ {
5911
+ className: "cnc-text-[11px] cnc-font-medium cnc-text-brand-gray-200",
5912
+ children: dayName
5913
+ },
5914
+ dayName
5915
+ )),
5916
+ cells.map((cell, index) => {
5917
+ if (!cell) {
5918
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", {}, `vazio-${index}`);
5919
+ }
5920
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5921
+ "button",
5922
+ {
5923
+ type: "button",
5924
+ onClick: () => onSelectDate?.(cell.date),
5925
+ "aria-label": formatDayAriaLabel(cell.date),
5926
+ "aria-pressed": cell.isSelected,
5927
+ className: cn(
5928
+ "cnc-group cnc-relative cnc-flex cnc-h-8 cnc-flex-col cnc-items-center cnc-justify-center cnc-rounded-full cnc-transition-colors",
5929
+ cell.isSelected ? "cnc-bg-primary cnc-text-white" : "cnc-text-brand-gray-600 hover:cnc-bg-brand-blue-50 hover:cnc-text-primary",
5930
+ cell.isToday && !cell.isSelected && "cnc-underline cnc-decoration-primary cnc-decoration-2 cnc-underline-offset-4"
5931
+ ),
5932
+ children: renderDay ? renderDay(cell) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
5933
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "cnc-text-xs cnc-font-semibold", children: cell.number }),
5934
+ cell.hasItems && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "cnc-absolute cnc-bottom-1 cnc-size-1 cnc-rounded-full cnc-bg-primary group-aria-pressed:cnc-bg-white" })
5935
+ ] })
5936
+ },
5937
+ cell.dateKey
5938
+ );
5939
+ })
5940
+ ] })
5941
+ ] });
5942
+ }
5943
+
5944
+ // src/components/organisms/calendar/month-year-picker.tsx
5945
+ var React26 = __toESM(require("react"));
5946
+ var import_jsx_runtime39 = require("react/jsx-runtime");
5947
+ function MonthYearPicker({
5948
+ value,
5949
+ onChange,
5950
+ disabled = false,
5951
+ triggerLabel = formatMonthYear,
5952
+ previousYearLabel = "Ano anterior",
5953
+ nextYearLabel = "Pr\xF3ximo ano",
5954
+ className,
5955
+ triggerClassName,
5956
+ contentClassName
5957
+ }) {
5958
+ const [open, setOpen] = React26.useState(false);
5959
+ const [viewYear, setViewYear] = React26.useState(() => value.getFullYear());
5960
+ React26.useEffect(() => {
5961
+ if (open) setViewYear(value.getFullYear());
5962
+ }, [open, value]);
5963
+ const isSelectedMonth = (monthIndex) => value.getFullYear() === viewYear && value.getMonth() === monthIndex;
5964
+ const handleMonthSelect = (monthIndex) => {
5965
+ const lastDay = new Date(viewYear, monthIndex + 1, 0).getDate();
5966
+ const day = Math.min(value.getDate(), lastDay);
5967
+ onChange(new Date(viewYear, monthIndex, day));
5968
+ setOpen(false);
5969
+ };
5970
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Popover2, { open, onOpenChange: setOpen, children: [
5971
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5972
+ Button,
5973
+ {
5974
+ type: "button",
5975
+ variant: "outline",
5976
+ disabled,
5977
+ "aria-expanded": open,
5978
+ className: cn(
5979
+ "cnc-justify-between cnc-gap-2 cnc-font-bold",
5980
+ triggerClassName
5981
+ ),
5982
+ children: [
5983
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "cnc-text-sm", children: triggerLabel(value) }),
5984
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5985
+ ChevronDown,
5986
+ {
5987
+ className: cn(
5988
+ "cnc-size-4 cnc-transition-transform",
5989
+ open && "cnc-rotate-180"
5990
+ )
5991
+ }
5992
+ )
5993
+ ]
5994
+ }
5995
+ ) }),
5996
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5997
+ PopoverContent2,
5998
+ {
5999
+ align: "start",
6000
+ className: cn("cnc-w-72 cnc-p-4", className, contentClassName),
6001
+ children: [
6002
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "cnc-mb-4 cnc-flex cnc-items-center cnc-justify-between", children: [
6003
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6004
+ "button",
6005
+ {
6006
+ type: "button",
6007
+ onClick: () => setViewYear((prev) => prev - 1),
6008
+ "aria-label": previousYearLabel,
6009
+ className: "cnc-rounded-full cnc-p-1 cnc-text-brand-gray-200 cnc-transition-colors hover:cnc-bg-brand-blue-50 hover:cnc-text-brand-blue-600",
6010
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChevronLeft, { className: "cnc-size-5" })
6011
+ }
6012
+ ),
6013
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "cnc-text-base cnc-font-bold cnc-text-primary", children: viewYear }),
6014
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6015
+ "button",
6016
+ {
6017
+ type: "button",
6018
+ onClick: () => setViewYear((prev) => prev + 1),
6019
+ "aria-label": nextYearLabel,
6020
+ className: "cnc-rounded-full cnc-p-1 cnc-text-brand-gray-200 cnc-transition-colors hover:cnc-bg-brand-blue-50 hover:cnc-text-brand-blue-600",
6021
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChevronRight, { className: "cnc-size-5" })
6022
+ }
6023
+ )
6024
+ ] }),
6025
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "cnc-grid cnc-grid-cols-3 cnc-gap-x-2 cnc-gap-y-1", children: MESES_PT_BR_ABREV.map((month, monthIndex) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6026
+ "button",
6027
+ {
6028
+ type: "button",
6029
+ onClick: () => handleMonthSelect(monthIndex),
6030
+ "aria-pressed": isSelectedMonth(monthIndex),
6031
+ className: cn(
6032
+ "cnc-rounded-lg cnc-py-2 cnc-text-[10px] cnc-font-bold cnc-uppercase cnc-transition-colors",
6033
+ isSelectedMonth(monthIndex) ? "cnc-bg-primary-800 cnc-text-white cnc-shadow-md" : "cnc-text-brand-gray-200 hover:cnc-bg-brand-blue-50 hover:cnc-text-primary"
6034
+ ),
6035
+ children: month
6036
+ },
6037
+ month
6038
+ )) })
6039
+ ]
6040
+ }
6041
+ )
6042
+ ] });
6043
+ }
6044
+
6045
+ // src/components/organisms/period-range-list/index.tsx
6046
+ var React27 = __toESM(require("react"));
6047
+ var import_jsx_runtime40 = require("react/jsx-runtime");
6048
+ var DEFAULT_LABELS = {
6049
+ start: "In\xEDcio",
6050
+ end: "Fim",
6051
+ add: "Adicionar",
6052
+ empty: "Nenhum per\xEDodo adicionado.",
6053
+ startColumn: "In\xEDcio",
6054
+ endColumn: "Fim",
6055
+ actionsColumn: "A\xE7\xF5es"
6056
+ };
6057
+ function createPeriodId() {
6058
+ return `period-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
6059
+ }
6060
+ function normalizePeriods(periods) {
6061
+ return periods.map((period) => ({
6062
+ ...period,
6063
+ id: period.id ?? createPeriodId()
6064
+ }));
6065
+ }
6066
+ function formatForDisplay(value, inputType) {
6067
+ if (!value) return "";
6068
+ if (inputType === "date") {
6069
+ const [year2, month2, day2] = value.split("-");
6070
+ if (year2 && month2 && day2) return `${day2}/${month2}/${year2}`;
6071
+ return value;
6072
+ }
6073
+ const normalized = value.slice(0, 16);
6074
+ const [datePart, timePart] = normalized.split("T");
6075
+ if (!datePart) return value;
6076
+ const [year, month, day] = datePart.split("-");
6077
+ const dateText = year && month && day ? `${day}/${month}/${year}` : datePart;
6078
+ return timePart ? `${dateText} ${timePart}` : dateText;
6079
+ }
6080
+ function splitDisplay(value, inputType) {
6081
+ const formatted = formatForDisplay(value, inputType);
6082
+ if (inputType === "date") {
6083
+ return { date: formatted, time: "" };
6084
+ }
6085
+ const parts = formatted.split(" ");
6086
+ if (parts.length <= 1) {
6087
+ return { date: formatted, time: "" };
6088
+ }
6089
+ const time = parts.pop() ?? "";
6090
+ return { date: parts.join(" "), time };
6091
+ }
6092
+ function PeriodRangeList({
6093
+ value = [],
6094
+ onChange,
6095
+ inputType = "datetime-local",
6096
+ labels: labelsProp,
6097
+ readOnly = false,
6098
+ disabled = false,
6099
+ required = false,
6100
+ error,
6101
+ validate,
6102
+ className
6103
+ }) {
6104
+ const labels = { ...DEFAULT_LABELS, ...labelsProp };
6105
+ const endAfterStart = validate?.endAfterStart ?? true;
6106
+ const noDuplicates = validate?.noDuplicates ?? true;
6107
+ const [startDraft, setStartDraft] = React27.useState("");
6108
+ const [endDraft, setEndDraft] = React27.useState("");
6109
+ const periods = React27.useMemo(() => normalizePeriods(value), [value]);
6110
+ const isInvalidRange = Boolean(startDraft && endDraft) && endAfterStart && startDraft >= endDraft;
6111
+ const isDuplicate = Boolean(startDraft && endDraft) && noDuplicates && periods.some(
6112
+ (period) => period.start === startDraft && period.end === endDraft
6113
+ );
6114
+ const canAdd = Boolean(startDraft && endDraft) && !isInvalidRange && !isDuplicate;
6115
+ const addTitle = isDuplicate ? "Este per\xEDodo j\xE1 foi adicionado" : isInvalidRange ? "A data final deve ser posterior \xE0 data inicial" : void 0;
6116
+ function emitChange(next) {
6117
+ onChange?.(normalizePeriods(next));
6118
+ }
6119
+ function handleAdd() {
6120
+ if (!canAdd || disabled || readOnly) return;
6121
+ emitChange([
6122
+ ...periods,
6123
+ {
6124
+ id: createPeriodId(),
6125
+ start: startDraft,
6126
+ end: endDraft
6127
+ }
6128
+ ]);
6129
+ setStartDraft("");
6130
+ setEndDraft("");
6131
+ }
6132
+ function handleRemove(id) {
6133
+ if (disabled || readOnly) return;
6134
+ emitChange(periods.filter((period) => period.id !== id));
6135
+ }
6136
+ const showRequiredOnInputs = required && periods.length === 0;
6137
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("cnc-w-full cnc-space-y-4", className), children: [
6138
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "cnc-grid cnc-grid-cols-1 md:cnc-grid-cols-12 cnc-gap-4 cnc-items-end", children: [
6139
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "md:cnc-col-span-5", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6140
+ Input,
6141
+ {
6142
+ type: inputType,
6143
+ label: labels.start,
6144
+ required: showRequiredOnInputs,
6145
+ value: startDraft,
6146
+ disabled,
6147
+ onChange: (event) => setStartDraft(event.target.value)
6148
+ }
6149
+ ) }),
6150
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "md:cnc-col-span-5", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6151
+ Input,
6152
+ {
6153
+ type: inputType,
6154
+ label: labels.end,
6155
+ required: showRequiredOnInputs,
6156
+ value: endDraft,
6157
+ min: startDraft || void 0,
6158
+ disabled,
6159
+ onChange: (event) => setEndDraft(event.target.value)
6160
+ }
6161
+ ) }),
6162
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "md:cnc-col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
6163
+ Button,
6164
+ {
6165
+ type: "button",
6166
+ variant: "outline",
6167
+ className: "cnc-w-full cnc-gap-2",
6168
+ disabled: !canAdd || disabled,
6169
+ title: addTitle,
6170
+ onClick: handleAdd,
6171
+ children: [
6172
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Plus, { className: "cnc-h-4 cnc-w-4" }),
6173
+ labels.add
6174
+ ]
6175
+ }
6176
+ ) })
6177
+ ] }),
6178
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "cnc-overflow-hidden cnc-rounded-lg cnc-border cnc-border-brand-gray-50 cnc-shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("table", { className: "cnc-min-w-full cnc-divide-y cnc-divide-brand-gray-50", children: [
6179
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { className: "cnc-bg-brand-gray-10", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("tr", { children: [
6180
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("th", { className: "cnc-px-6 cnc-py-3 cnc-text-left cnc-text-xs cnc-font-semibold cnc-uppercase cnc-tracking-wider cnc-text-brand-gray-600", children: labels.startColumn }),
6181
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("th", { className: "cnc-px-6 cnc-py-3 cnc-text-left cnc-text-xs cnc-font-semibold cnc-uppercase cnc-tracking-wider cnc-text-brand-gray-600", children: labels.endColumn }),
6182
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("th", { className: "cnc-px-6 cnc-py-3 cnc-text-right cnc-text-xs cnc-font-semibold cnc-uppercase cnc-tracking-wider cnc-text-brand-gray-600", children: labels.actionsColumn })
6183
+ ] }) }),
6184
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("tbody", { className: "cnc-divide-y cnc-divide-brand-gray-50 cnc-bg-white cnc-text-sm", children: [
6185
+ periods.map((period) => {
6186
+ const startDisplay = splitDisplay(period.start, inputType);
6187
+ const endDisplay = splitDisplay(period.end, inputType);
6188
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("tr", { className: "hover:cnc-bg-brand-gray-10/50", children: [
6189
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("td", { className: "cnc-px-6 cnc-py-4 cnc-text-brand-gray-600", children: [
6190
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "cnc-font-medium cnc-text-brand-gray-600", children: startDisplay.date }),
6191
+ startDisplay.time ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "cnc-ml-2 cnc-text-brand-gray-200", children: startDisplay.time }) : null
6192
+ ] }),
6193
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("td", { className: "cnc-px-6 cnc-py-4 cnc-text-brand-gray-600", children: [
6194
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "cnc-font-medium cnc-text-brand-gray-600", children: endDisplay.date }),
6195
+ endDisplay.time ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "cnc-ml-2 cnc-text-brand-gray-200", children: endDisplay.time }) : null
6196
+ ] }),
6197
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { className: "cnc-px-6 cnc-py-4 cnc-text-right", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6198
+ "button",
6199
+ {
6200
+ type: "button",
6201
+ className: "cnc-text-brand-gray-200 hover:cnc-text-brand-red-500 cnc-transition-colors disabled:cnc-opacity-50",
6202
+ disabled,
6203
+ "aria-label": "Remover per\xEDodo",
6204
+ onClick: () => handleRemove(period.id),
6205
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Trash2, { className: "cnc-h-5 cnc-w-5" })
6206
+ }
6207
+ ) })
6208
+ ] }, period.id);
6209
+ }),
6210
+ periods.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6211
+ "td",
6212
+ {
6213
+ colSpan: readOnly ? 2 : 3,
6214
+ className: "cnc-px-6 cnc-py-8 cnc-text-center cnc-text-brand-gray-200 cnc-italic",
6215
+ children: labels.empty
6216
+ }
6217
+ ) })
6218
+ ] })
6219
+ ] }) }),
6220
+ error ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "cnc-text-xs cnc-font-medium cnc-text-brand-red-500", children: error }) : null
6221
+ ] });
6222
+ }
6223
+ var DateTimeRangeList = PeriodRangeList;
6224
+
6225
+ // src/components/organisms/header-notifications/index.tsx
6226
+ var React29 = __toESM(require("react"));
6227
+
6228
+ // src/components/organisms/header-notifications/cliente.ts
6229
+ var URL_PADRAO_NOTIFICACOES = "https://dev-apinotificacoes-b5feekb4bdfyb7c2.eastus2-01.azurewebsites.net/v1";
6230
+ var ErroNotificacoes = class _ErroNotificacoes extends Error {
6231
+ status;
6232
+ constructor(mensagem, status) {
6233
+ super(mensagem);
6234
+ this.name = "ErroNotificacoes";
6235
+ this.status = status;
6236
+ Object.setPrototypeOf(this, _ErroNotificacoes.prototype);
6237
+ }
6238
+ };
6239
+ function normalizarBaseUrl(baseUrl) {
6240
+ return baseUrl.replace(/\/+$/, "");
6241
+ }
6242
+ function extrairLista(payload) {
6243
+ if (Array.isArray(payload)) return payload;
6244
+ if (payload && typeof payload === "object") {
6245
+ const registro = payload;
6246
+ const chaves = ["dados", "data", "notificacoes", "items", "content"];
6247
+ for (const chave of chaves) {
6248
+ if (Array.isArray(registro[chave])) return registro[chave];
6249
+ }
6250
+ }
6251
+ return [];
6252
+ }
6253
+ async function buscarNotificacoes({
6254
+ baseUrl,
6255
+ email,
6256
+ sistema,
6257
+ filtros,
6258
+ signal
6259
+ }) {
6260
+ const parametros = new URLSearchParams({ email, sistema });
6261
+ for (const [chave, valor] of Object.entries(filtros ?? {})) {
6262
+ if (valor !== void 0 && valor !== null) parametros.set(chave, String(valor));
6263
+ }
6264
+ const resposta = await fetch(
6265
+ `${normalizarBaseUrl(baseUrl)}/notificacoes?${parametros.toString()}`,
6266
+ { method: "GET", headers: { Accept: "application/json" }, signal }
6267
+ );
6268
+ if (!resposta.ok) {
6269
+ throw new ErroNotificacoes(
6270
+ `Falha ao buscar notifica\xE7\xF5es de ${sistema}`,
6271
+ resposta.status
6272
+ );
6273
+ }
6274
+ return extrairLista(await resposta.json());
6275
+ }
6276
+ async function definirStatusLeitura({ baseUrl, id, signal }, statusLeitura) {
6277
+ const resposta = await fetch(
6278
+ `${normalizarBaseUrl(baseUrl)}/notificacoes/${encodeURIComponent(String(id))}`,
6279
+ {
6280
+ method: "PUT",
6281
+ headers: { "Content-Type": "application/json" },
6282
+ body: JSON.stringify({ statusLeitura }),
6283
+ signal
6284
+ }
6285
+ );
6286
+ if (!resposta.ok) {
6287
+ throw new ErroNotificacoes(
6288
+ `Falha ao definir a notifica\xE7\xE3o ${id} como ${statusLeitura}`,
6289
+ resposta.status
6290
+ );
6291
+ }
6292
+ }
6293
+ function marcarComoLida(parametros) {
6294
+ return definirStatusLeitura(parametros, "LIDO");
6295
+ }
6296
+ function marcarComoNaoLida(parametros) {
6297
+ return definirStatusLeitura(parametros, "NAO_LIDO");
6298
+ }
6299
+ async function excluirNotificacao({
6300
+ baseUrl,
6301
+ id,
6302
+ signal
6303
+ }) {
6304
+ const resposta = await fetch(
6305
+ `${normalizarBaseUrl(baseUrl)}/notificacoes/${encodeURIComponent(String(id))}`,
6306
+ { method: "DELETE", signal }
6307
+ );
6308
+ if (!resposta.ok) {
6309
+ throw new ErroNotificacoes(
6310
+ `Falha ao excluir a notifica\xE7\xE3o ${id}`,
6311
+ resposta.status
6312
+ );
6313
+ }
6314
+ }
6315
+ function normalizarId(id) {
6316
+ if (typeof id === "number") return id;
6317
+ return /^\d+$/.test(id) ? Number(id) : id;
6318
+ }
6319
+ async function marcarVariasComoLidas({
6320
+ baseUrl,
6321
+ ids,
6322
+ signal
6323
+ }) {
6324
+ if (ids.length === 0) return;
6325
+ const resposta = await fetch(`${normalizarBaseUrl(baseUrl)}/notificacoes/lote`, {
6326
+ method: "PUT",
6327
+ headers: { "Content-Type": "application/json" },
6328
+ body: JSON.stringify({
6329
+ notificacoes: ids.map((id) => ({
6330
+ id: normalizarId(id),
6331
+ statusLeitura: "LIDO"
6332
+ }))
6333
+ }),
6334
+ signal
6335
+ });
6336
+ if (!resposta.ok) {
6337
+ throw new ErroNotificacoes(
6338
+ `Falha ao marcar ${ids.length} notifica\xE7\xF5es como lidas`,
6339
+ resposta.status
6340
+ );
6341
+ }
6342
+ }
6343
+
6344
+ // src/components/organisms/header-notifications/mapear.ts
6345
+ var UM_MINUTO = 6e4;
6346
+ var UMA_HORA = 60 * UM_MINUTO;
6347
+ var UM_DIA = 24 * UMA_HORA;
6348
+ var SETE_DIAS = 7 * UM_DIA;
6349
+ function formatarDataRelativa(valor, agora = Date.now()) {
6350
+ if (!valor) return void 0;
6351
+ const data = new Date(valor);
6352
+ const instante = data.getTime();
6353
+ if (Number.isNaN(instante)) return void 0;
6354
+ const diferenca = agora - instante;
6355
+ const modulo = Math.abs(diferenca);
6356
+ if (diferenca >= SETE_DIAS) {
6357
+ return new Intl.DateTimeFormat("pt-BR", {
6358
+ day: "2-digit",
6359
+ month: "2-digit",
6360
+ year: "2-digit"
6361
+ }).format(data);
6362
+ }
6363
+ if (modulo < UM_MINUTO) return "agora";
6364
+ const formatador = new Intl.RelativeTimeFormat("pt-BR", { numeric: "auto" });
6365
+ const sinal = diferenca < 0 ? 1 : -1;
6366
+ if (modulo < UMA_HORA) {
6367
+ return formatador.format(sinal * Math.trunc(modulo / UM_MINUTO), "minute");
6368
+ }
6369
+ if (modulo < UM_DIA) {
6370
+ return formatador.format(sinal * Math.trunc(modulo / UMA_HORA), "hour");
6371
+ }
6372
+ return formatador.format(sinal * Math.trunc(modulo / UM_DIA), "day");
6373
+ }
6374
+ function instanteDe(notificacao) {
6375
+ const bruto = notificacao.disparadoEm ?? notificacao.dataReferencia;
6376
+ const instante = bruto ? new Date(bruto).getTime() : Number.NaN;
6377
+ return Number.isNaN(instante) ? 0 : instante;
6378
+ }
6379
+ var STATUS_OCULTOS = ["CANCELADO", "FALHOU"];
6380
+ function jaAconteceu(notificacao, agora) {
6381
+ if (notificacao.disparadoEm) return true;
6382
+ const referencia = notificacao.dataReferencia ? new Date(notificacao.dataReferencia).getTime() : Number.NaN;
6383
+ return !Number.isNaN(referencia) && referencia <= agora;
6384
+ }
6385
+ function selecionarVisiveis(notificacoes, limite = Number.POSITIVE_INFINITY, agora = Date.now()) {
6386
+ return notificacoes.filter(
6387
+ (notificacao) => Boolean(notificacao) && jaAconteceu(notificacao, agora) && !STATUS_OCULTOS.includes(notificacao.status)
6388
+ ).sort((a, b) => instanteDe(b) - instanteDe(a)).slice(0, limite);
6389
+ }
6390
+ function selecionarLembretesVencidos(notificacoes, agora = Date.now()) {
6391
+ return notificacoes.filter((notificacao) => {
6392
+ if (!notificacao?.lembrarNoDia) return false;
6393
+ if (notificacao.statusLeitura === "LIDO") return false;
6394
+ if (STATUS_OCULTOS.includes(notificacao.status)) return false;
6395
+ const lembrete = notificacao.dataLembrete ? new Date(notificacao.dataLembrete).getTime() : Number.NaN;
6396
+ return !Number.isNaN(lembrete) && lembrete <= agora;
6397
+ }).sort(
6398
+ (a, b) => new Date(b.dataLembrete ?? 0).getTime() - new Date(a.dataLembrete ?? 0).getTime()
6399
+ );
6400
+ }
6401
+ function contarNaoLidas(notificacoes) {
6402
+ return notificacoes.filter(
6403
+ (notificacao) => notificacao.statusLeitura !== "LIDO"
6404
+ ).length;
6405
+ }
6406
+ function mapearParaItem(notificacao, getHref, agora) {
6407
+ return {
6408
+ id: notificacao.id,
6409
+ title: notificacao.titulo,
6410
+ message: notificacao.mensagem ?? void 0,
6411
+ date: formatarDataRelativa(
6412
+ notificacao.disparadoEm ?? notificacao.dataReferencia,
6413
+ agora
6414
+ ),
6415
+ read: notificacao.statusLeitura === "LIDO",
6416
+ href: getHref?.(notificacao)
6417
+ };
6418
+ }
6419
+
6420
+ // src/components/organisms/header-notifications/modal-lembretes.tsx
6421
+ var import_jsx_runtime41 = require("react/jsx-runtime");
6422
+ function ModalLembretes({
6423
+ lembretes,
6424
+ aberto,
6425
+ onDispensar,
6426
+ titulo,
6427
+ rotuloDispensar = "Entendi"
6428
+ }) {
6429
+ const visivel = aberto && lembretes.length > 0;
6430
+ const tituloExibido = titulo ?? (lembretes.length === 1 ? "Voc\xEA tem um lembrete" : "Voc\xEA tem lembretes");
6431
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6432
+ Dialog,
6433
+ {
6434
+ open: visivel,
6435
+ onOpenChange: (proximoEstado) => {
6436
+ if (!proximoEstado) onDispensar();
6437
+ },
6438
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
6439
+ DialogContent,
6440
+ {
6441
+ className: "cnc-max-w-[440px] cnc-rounded-lg cnc-bg-white cnc-p-0",
6442
+ onOpenAutoFocus: (evento) => evento.preventDefault(),
6443
+ children: [
6444
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "cnc-flex cnc-items-center cnc-gap-3 cnc-border-b cnc-border-brand-gray-50 cnc-px-5 cnc-py-4", children: [
6445
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "cnc-flex cnc-h-9 cnc-w-9 cnc-shrink-0 cnc-items-center cnc-justify-center cnc-rounded-full cnc-bg-brand-blue-60", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6446
+ BellRing,
6447
+ {
6448
+ className: "cnc-h-[18px] cnc-w-[18px] cnc-text-brand-blue-400",
6449
+ "aria-hidden": "true"
6450
+ }
6451
+ ) }),
6452
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DialogTitle, { className: "cnc-m-0 cnc-text-base cnc-font-extrabold cnc-text-brand-blue-900", children: tituloExibido })
6453
+ ] }),
6454
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("ul", { className: "cnc-m-0 cnc-max-h-[320px] cnc-list-none cnc-overflow-y-auto cnc-p-0", children: lembretes.map((lembrete) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
6455
+ "li",
6456
+ {
6457
+ className: "cnc-flex cnc-flex-col cnc-gap-1 cnc-border-b cnc-border-brand-gray-50 cnc-px-5 cnc-py-4 last:cnc-border-b-0",
6458
+ children: [
6459
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "cnc-flex cnc-items-baseline cnc-justify-between cnc-gap-3", children: [
6460
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "cnc-text-sm cnc-font-bold cnc-text-brand-blue-900", children: lembrete.titulo }),
6461
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "cnc-shrink-0 cnc-text-[11px] cnc-text-brand-gray-600", children: formatarDataRelativa(lembrete.dataLembrete) })
6462
+ ] }),
6463
+ lembrete.mensagem && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "cnc-text-xs cnc-leading-relaxed cnc-text-brand-gray-600", children: lembrete.mensagem })
6464
+ ]
6465
+ },
6466
+ lembrete.id
6467
+ )) }),
6468
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "cnc-flex cnc-flex-col cnc-gap-2 cnc-border-t cnc-border-brand-gray-50 cnc-px-5 cnc-py-4", children: [
6469
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { variant: "confirm", className: "cnc-w-full", onClick: onDispensar, children: rotuloDispensar }),
6470
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "cnc-m-0 cnc-text-center cnc-text-[11px] cnc-text-brand-gray-600", children: lembretes.length === 1 ? "Ao fechar, este lembrete \xE9 marcado como lido." : `Ao fechar, os ${lembretes.length} lembretes s\xE3o marcados como lidos.` })
6471
+ ] })
6472
+ ]
6473
+ }
6474
+ )
6475
+ }
6476
+ );
6477
+ }
6478
+
6479
+ // src/components/organisms/header-notifications/usar-notificacoes.ts
6480
+ var React28 = __toESM(require("react"));
6481
+ function foiAbortado(erro) {
6482
+ return erro?.name === "AbortError";
6483
+ }
6484
+ function usarNotificacoes({
6485
+ email,
6486
+ sistema,
6487
+ baseUrl,
6488
+ filtros,
6489
+ intervaloAtualizacao = 6e4,
6490
+ habilitado = true,
6491
+ onErro
6492
+ }) {
6493
+ const [notificacoes, setNotificacoes] = React28.useState([]);
6494
+ const [carregando, setCarregando] = React28.useState(habilitado);
6495
+ const notificacoesRef = React28.useRef(notificacoes);
6496
+ const controladorRef = React28.useRef(null);
6497
+ const jaCarregouRef = React28.useRef(false);
6498
+ const onErroRef = React28.useRef(onErro);
6499
+ React28.useEffect(() => {
6500
+ notificacoesRef.current = notificacoes;
6501
+ }, [notificacoes]);
6502
+ React28.useEffect(() => {
6503
+ onErroRef.current = onErro;
6504
+ }, [onErro]);
6505
+ const chaveFiltros = JSON.stringify(filtros ?? {});
6506
+ const atualizar = React28.useCallback(() => {
6507
+ if (!habilitado) return;
6508
+ controladorRef.current?.abort();
6509
+ const controlador = new AbortController();
6510
+ controladorRef.current = controlador;
6511
+ void (async () => {
6512
+ try {
6513
+ const lista = await buscarNotificacoes({
6514
+ baseUrl,
6515
+ email,
6516
+ sistema,
6517
+ filtros: JSON.parse(chaveFiltros),
6518
+ signal: controlador.signal
6519
+ });
6520
+ if (controlador.signal.aborted) return;
6521
+ setNotificacoes(lista);
6522
+ } catch (erro) {
6523
+ if (controlador.signal.aborted || foiAbortado(erro)) return;
6524
+ onErroRef.current?.(erro);
6525
+ } finally {
6526
+ if (!controlador.signal.aborted) {
6527
+ jaCarregouRef.current = true;
6528
+ setCarregando(false);
6529
+ }
6530
+ }
6531
+ })();
6532
+ }, [baseUrl, email, sistema, chaveFiltros, habilitado]);
6533
+ React28.useEffect(() => {
6534
+ if (!habilitado) {
6535
+ setCarregando(false);
6536
+ return;
6537
+ }
6538
+ if (!jaCarregouRef.current) setCarregando(true);
6539
+ atualizar();
6540
+ return () => controladorRef.current?.abort();
6541
+ }, [atualizar, habilitado]);
6542
+ React28.useEffect(() => {
6543
+ if (!habilitado || !intervaloAtualizacao) return;
6544
+ const temporizador = window.setInterval(() => {
6545
+ if (typeof document !== "undefined" && document.hidden) return;
6546
+ atualizar();
6547
+ }, intervaloAtualizacao);
6548
+ return () => window.clearInterval(temporizador);
6549
+ }, [atualizar, habilitado, intervaloAtualizacao]);
6550
+ const aplicarLeitura = React28.useCallback((ids) => {
6551
+ const alvos = new Set(ids.map(String));
6552
+ setNotificacoes(
6553
+ (atuais) => atuais.map(
6554
+ (notificacao) => alvos.has(String(notificacao.id)) ? { ...notificacao, statusLeitura: "LIDO" } : notificacao
6555
+ )
6556
+ );
6557
+ }, []);
6558
+ const reverterLeitura = React28.useCallback((anteriores) => {
6559
+ const original = new Map(
6560
+ anteriores.map((notificacao) => [String(notificacao.id), notificacao])
6561
+ );
6562
+ setNotificacoes(
6563
+ (atuais) => atuais.map((notificacao) => {
6564
+ const anterior = original.get(String(notificacao.id));
6565
+ return anterior ? {
6566
+ ...notificacao,
6567
+ statusLeitura: anterior.statusLeitura,
6568
+ lidoEm: anterior.lidoEm
6569
+ } : notificacao;
6570
+ })
6571
+ );
6572
+ }, []);
6573
+ const marcarUmaComoLida = React28.useCallback(
6574
+ (id) => {
6575
+ const alvo = notificacoesRef.current.find(
6576
+ (notificacao) => String(notificacao.id) === String(id)
6577
+ );
6578
+ if (!alvo || alvo.statusLeitura === "LIDO") return;
6579
+ aplicarLeitura([id]);
6580
+ void marcarComoLida({ baseUrl, id }).catch((erro) => {
6581
+ reverterLeitura([alvo]);
6582
+ onErroRef.current?.(erro);
6583
+ });
6584
+ },
6585
+ [baseUrl, aplicarLeitura, reverterLeitura]
6586
+ );
6587
+ const marcarComoLidas = React28.useCallback(
6588
+ (ids) => {
6589
+ const alvos = new Set(ids.map(String));
6590
+ const naoLidas = notificacoesRef.current.filter(
6591
+ (notificacao) => alvos.has(String(notificacao.id)) && notificacao.statusLeitura !== "LIDO"
6592
+ );
6593
+ if (naoLidas.length === 0) return;
6594
+ aplicarLeitura(naoLidas.map((notificacao) => notificacao.id));
6595
+ void marcarVariasComoLidas({
6596
+ baseUrl,
6597
+ ids: naoLidas.map((notificacao) => notificacao.id)
6598
+ }).catch((erro) => {
6599
+ reverterLeitura(naoLidas);
6600
+ onErroRef.current?.(erro);
6601
+ });
6602
+ },
6603
+ [baseUrl, aplicarLeitura, reverterLeitura]
6604
+ );
6605
+ const marcarTodasComoLidas = React28.useCallback(() => {
6606
+ marcarComoLidas(notificacoesRef.current.map((notificacao) => notificacao.id));
6607
+ }, [marcarComoLidas]);
6608
+ const marcarUmaComoNaoLida = React28.useCallback(
6609
+ (id) => {
6610
+ const alvo = notificacoesRef.current.find(
6611
+ (notificacao) => String(notificacao.id) === String(id)
6612
+ );
6613
+ if (!alvo || alvo.statusLeitura === "NAO_LIDO") return;
6614
+ setNotificacoes(
6615
+ (atuais) => atuais.map(
6616
+ (notificacao) => String(notificacao.id) === String(id) ? { ...notificacao, statusLeitura: "NAO_LIDO" } : notificacao
6617
+ )
6618
+ );
6619
+ void marcarComoNaoLida({ baseUrl, id }).catch((erro) => {
6620
+ reverterLeitura([alvo]);
6621
+ onErroRef.current?.(erro);
6622
+ });
6623
+ },
6624
+ [baseUrl, reverterLeitura]
6625
+ );
6626
+ const excluir = React28.useCallback(
6627
+ (id) => {
6628
+ const alvo = notificacoesRef.current.find(
6629
+ (notificacao) => String(notificacao.id) === String(id)
6630
+ );
6631
+ if (!alvo) return;
6632
+ setNotificacoes(
6633
+ (atuais) => atuais.filter((notificacao) => String(notificacao.id) !== String(id))
6634
+ );
6635
+ void excluirNotificacao({ baseUrl, id }).catch((erro) => {
6636
+ onErroRef.current?.(erro);
6637
+ atualizar();
6638
+ });
6639
+ },
6640
+ [baseUrl, atualizar]
6641
+ );
6642
+ return {
6643
+ notificacoes,
6644
+ carregando,
6645
+ atualizar,
6646
+ marcarUmaComoLida,
6647
+ marcarUmaComoNaoLida,
6648
+ marcarComoLidas,
6649
+ marcarTodasComoLidas,
6650
+ excluir
6651
+ };
6652
+ }
6653
+
6654
+ // src/components/organisms/header-notifications/index.tsx
6655
+ var import_jsx_runtime42 = require("react/jsx-runtime");
6656
+ function HeaderNotifications(props) {
6657
+ const {
6658
+ items = [],
6659
+ isLoading = false,
6660
+ skeletonCount = 3,
6661
+ title = "Notifica\xE7\xF5es",
6662
+ emptyMessage = "Nenhuma notifica\xE7\xE3o",
6663
+ unreadCount,
6664
+ maxCount = 9,
6665
+ onSelect,
6666
+ onMarkAsRead,
6667
+ onMarkAsUnread,
6668
+ onDelete,
6669
+ onMarkAllAsRead,
6670
+ onOpenChange,
6671
+ footer,
6672
+ align = "end",
6673
+ className,
6674
+ contentClassName,
6675
+ email,
6676
+ sistema,
6677
+ baseUrl = URL_PADRAO_NOTIFICACOES,
6678
+ getHref,
6679
+ filtros,
6680
+ intervaloAtualizacao,
6681
+ limite = 20,
6682
+ onErro,
6683
+ alertarLembretes = false,
6684
+ tituloLembretes,
6685
+ rotuloDispensarLembretes
6686
+ } = props;
6687
+ const [aberto, setAberto] = React29.useState(false);
6688
+ const [lembretesEmAlerta, setLembretesEmAlerta] = React29.useState(
6689
+ []
6690
+ );
6691
+ const avaliouLembretesRef = React29.useRef(false);
6692
+ const conectado = Boolean(email && sistema);
6693
+ const remoto = usarNotificacoes({
6694
+ email: email ?? "",
6695
+ sistema: sistema ?? "",
6696
+ baseUrl,
6697
+ filtros,
6698
+ intervaloAtualizacao,
6699
+ habilitado: conectado,
6700
+ onErro
6701
+ });
6702
+ const elegiveis = React29.useMemo(
6703
+ () => conectado ? selecionarVisiveis(remoto.notificacoes) : [],
6704
+ [conectado, remoto.notificacoes]
6705
+ );
6706
+ const itensRemotos = React29.useMemo(
6707
+ () => elegiveis.slice(0, limite).map((notificacao) => mapearParaItem(notificacao, getHref)),
6708
+ [elegiveis, limite, getHref]
6709
+ );
6710
+ const itens = conectado ? itensRemotos : items;
6711
+ const carregandoLista = conectado ? remoto.carregando : isLoading;
6712
+ React29.useEffect(() => {
6713
+ if (!conectado || !alertarLembretes) return;
6714
+ if (remoto.carregando || avaliouLembretesRef.current) return;
6715
+ avaliouLembretesRef.current = true;
6716
+ setLembretesEmAlerta(selecionarLembretesVencidos(remoto.notificacoes));
6717
+ }, [conectado, alertarLembretes, remoto.carregando, remoto.notificacoes]);
6718
+ const dispensarLembretes = () => {
6719
+ remoto.marcarComoLidas(lembretesEmAlerta.map((lembrete) => lembrete.id));
6720
+ setLembretesEmAlerta([]);
6721
+ };
6722
+ const naoLidas = conectado ? contarNaoLidas(elegiveis) : unreadCount ?? items.filter((item) => !item.read).length;
6723
+ const rotuloContagem = naoLidas > maxCount ? `${maxCount}+` : `${naoLidas}`;
6724
+ const alterarAbertura = (proximoEstado) => {
6725
+ setAberto(proximoEstado);
6726
+ if (proximoEstado && conectado) remoto.atualizar();
6727
+ onOpenChange?.(proximoEstado);
6728
+ };
6729
+ const selecionar = (item) => {
6730
+ if (!item.read) {
6731
+ if (conectado) remoto.marcarUmaComoLida(item.id);
6732
+ onMarkAsRead?.(item);
6733
+ }
6734
+ if (!onSelect) return;
6735
+ onSelect(item);
6736
+ alterarAbertura(false);
6737
+ };
6738
+ const marcarTodas = () => {
6739
+ if (conectado) remoto.marcarTodasComoLidas();
6740
+ onMarkAllAsRead?.();
6741
+ };
6742
+ const alternarLeitura = (item) => {
6743
+ if (item.read) {
6744
+ if (conectado) remoto.marcarUmaComoNaoLida(item.id);
6745
+ onMarkAsUnread?.(item);
6746
+ return;
6747
+ }
6748
+ if (conectado) remoto.marcarUmaComoLida(item.id);
6749
+ onMarkAsRead?.(item);
6750
+ };
6751
+ const excluirItem = (item) => {
6752
+ if (conectado) remoto.excluir(item.id);
6753
+ onDelete?.(item);
6754
+ };
6755
+ const podeMarcarTodas = conectado || Boolean(onMarkAllAsRead);
6756
+ const podeAlternarLeitura = conectado || Boolean(onMarkAsUnread);
6757
+ const podeExcluir = conectado || Boolean(onDelete);
6758
+ const alvoClicavel = conectado || Boolean(onSelect) || Boolean(onMarkAsRead);
6759
+ const anelDeFoco = "focus-visible:cnc-ring-2 focus-visible:cnc-ring-inset focus-visible:cnc-ring-brand-gray-500/50";
6760
+ const renderarConteudo = () => {
6761
+ if (carregandoLista) {
6762
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { "aria-busy": "true", children: Array.from({ length: skeletonCount }).map((_, indice) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6763
+ "div",
6764
+ {
6765
+ className: "cnc-flex cnc-border-b cnc-border-l-[3px] cnc-border-brand-gray-50 cnc-border-l-transparent cnc-py-3 cnc-pl-3 cnc-pr-4 last:cnc-border-b-0",
6766
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "cnc-flex cnc-w-full cnc-flex-col cnc-gap-2", children: [
6767
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "cnc-h-3 cnc-w-1/2 cnc-animate-pulse cnc-rounded cnc-bg-brand-gray-20" }),
6768
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "cnc-h-3 cnc-w-3/4 cnc-animate-pulse cnc-rounded cnc-bg-brand-gray-20" })
6769
+ ] })
6770
+ },
6771
+ indice
6772
+ )) });
6773
+ }
6774
+ if (itens.length === 0) {
6775
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "cnc-flex cnc-flex-col cnc-items-center cnc-justify-center cnc-px-4 cnc-py-12 cnc-text-brand-gray-200", children: [
6776
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(BellOff, { className: "cnc-mb-2 cnc-h-7 cnc-w-7", "aria-hidden": "true" }),
6777
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "cnc-text-sm", children: emptyMessage })
6778
+ ] });
6779
+ }
6780
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("ul", { className: "cnc-m-0 cnc-list-none cnc-p-0", children: itens.map((item) => {
6781
+ const conteudo = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "cnc-flex cnc-min-w-0 cnc-flex-1 cnc-flex-col cnc-gap-0.5", children: [
6782
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "cnc-flex cnc-items-baseline cnc-justify-between cnc-gap-2", children: [
6783
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6784
+ "span",
6785
+ {
6786
+ className: cn(
6787
+ "cnc-truncate cnc-text-sm cnc-text-brand-blue-900",
6788
+ item.read ? "cnc-font-medium" : "cnc-font-bold"
6789
+ ),
6790
+ children: item.title
6791
+ }
6792
+ ),
6793
+ item.date && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "cnc-shrink-0 cnc-text-[11px] cnc-text-brand-gray-600", children: item.date })
6794
+ ] }),
6795
+ item.message && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "cnc-line-clamp-2 cnc-text-xs cnc-text-brand-gray-600", children: item.message }),
6796
+ !item.read && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "cnc-sr-only", children: "N\xE3o lida" })
6797
+ ] });
6798
+ const classesLinha = cn(
6799
+ "cnc-flex cnc-w-full cnc-items-start cnc-border-l-[3px] cnc-transition cnc-duration-200",
6800
+ item.read ? "cnc-border-l-transparent hover:cnc-bg-brand-blue-50" : "cnc-border-l-brand-blue-400 cnc-bg-brand-blue-50 hover:cnc-bg-brand-blue-60"
6801
+ );
6802
+ const classesAlvo = cn(
6803
+ "cnc-flex cnc-min-w-0 cnc-flex-1 cnc-bg-transparent cnc-py-3 cnc-pl-3 cnc-pr-2 cnc-text-left cnc-no-underline cnc-outline-none",
6804
+ alvoClicavel && "cnc-cursor-pointer",
6805
+ anelDeFoco
6806
+ );
6807
+ const classesAcao = cn(
6808
+ "cnc-flex cnc-h-7 cnc-w-7 cnc-shrink-0 cnc-cursor-pointer cnc-items-center cnc-justify-center cnc-rounded cnc-border-0 cnc-bg-transparent cnc-p-0 cnc-text-brand-gray-200 cnc-outline-none cnc-transition cnc-duration-200 hover:cnc-bg-white",
6809
+ anelDeFoco
6810
+ );
6811
+ const renderarAlvo = () => alvoClicavel ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6812
+ "button",
6813
+ {
6814
+ type: "button",
6815
+ onClick: () => selecionar(item),
6816
+ className: classesAlvo,
6817
+ children: conteudo
6818
+ }
6819
+ ) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: classesAlvo, children: conteudo });
6820
+ const rotuloLeitura = item.read ? "Marcar como n\xE3o lida" : "Marcar como lida";
6821
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6822
+ "li",
6823
+ {
6824
+ className: "cnc-border-b cnc-border-brand-gray-50 last:cnc-border-b-0",
6825
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: classesLinha, children: [
6826
+ renderarAlvo(),
6827
+ (podeAlternarLeitura || podeExcluir) && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "cnc-flex cnc-shrink-0 cnc-items-center cnc-gap-1 cnc-py-3 cnc-pr-2", children: [
6828
+ podeAlternarLeitura && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6829
+ "button",
6830
+ {
6831
+ type: "button",
6832
+ "aria-label": rotuloLeitura,
6833
+ title: rotuloLeitura,
6834
+ onClick: () => alternarLeitura(item),
6835
+ className: cn(
6836
+ classesAcao,
6837
+ "hover:cnc-text-brand-blue-400"
6838
+ ),
6839
+ children: item.read ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Mail, { className: "cnc-h-4 cnc-w-4", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6840
+ MailOpen,
6841
+ {
6842
+ className: "cnc-h-4 cnc-w-4",
6843
+ "aria-hidden": "true"
6844
+ }
6845
+ )
6846
+ }
6847
+ ),
6848
+ podeExcluir && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6849
+ "button",
6850
+ {
6851
+ type: "button",
6852
+ "aria-label": "Excluir notifica\xE7\xE3o",
6853
+ title: "Excluir notifica\xE7\xE3o",
6854
+ onClick: () => excluirItem(item),
6855
+ className: cn(classesAcao, "hover:cnc-text-brand-red-600"),
6856
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Trash2, { className: "cnc-h-4 cnc-w-4", "aria-hidden": "true" })
6857
+ }
6858
+ )
6859
+ ] })
6860
+ ] })
6861
+ },
6862
+ item.id
6863
+ );
6864
+ }) });
6865
+ };
6866
+ const temRodapePadrao = podeMarcarTodas && naoLidas > 0;
6867
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
6868
+ alertarLembretes && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6869
+ ModalLembretes,
6870
+ {
6871
+ lembretes: lembretesEmAlerta,
6872
+ aberto: lembretesEmAlerta.length > 0,
6873
+ onDispensar: dispensarLembretes,
6874
+ titulo: tituloLembretes,
6875
+ rotuloDispensar: rotuloDispensarLembretes
6876
+ }
6877
+ ),
6878
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open: aberto, onOpenChange: alterarAbertura, children: [
6879
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
6880
+ "button",
6881
+ {
6882
+ type: "button",
6883
+ "aria-label": naoLidas > 0 ? `${title}, ${naoLidas} n\xE3o ${naoLidas === 1 ? "lida" : "lidas"}` : title,
6884
+ className: cn(
6885
+ "cnc-relative cnc-flex cnc-h-10 cnc-w-10 cnc-items-center cnc-justify-center cnc-rounded-full cnc-transition cnc-duration-300 cnc-ease-in-out hover:cnc-bg-brand-blue-60 data-[state=open]:cnc-bg-brand-blue-60 cnc-cursor-pointer cnc-outline-none cnc-header-item",
6886
+ anelDeFoco,
6887
+ className
6888
+ ),
6889
+ children: [
6890
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6891
+ Bell,
6892
+ {
6893
+ className: "cnc-h-5 cnc-w-5 cnc-text-brand-blue-900 cnc-header-item",
6894
+ "aria-hidden": "true"
6895
+ }
6896
+ ),
6897
+ naoLidas > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6898
+ "span",
6899
+ {
6900
+ "aria-hidden": "true",
6901
+ className: "cnc-absolute -cnc-right-0.5 -cnc-top-0.5 cnc-flex cnc-h-[18px] cnc-min-w-[18px] cnc-items-center cnc-justify-center cnc-rounded-full cnc-border-2 cnc-border-white cnc-bg-brand-red-500 cnc-px-1 cnc-text-[10px] cnc-font-bold cnc-leading-none cnc-text-white",
6902
+ children: rotuloContagem
6903
+ }
6904
+ )
6905
+ ]
6906
+ }
6907
+ ) }),
6908
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
6909
+ PopoverContent,
6910
+ {
6911
+ align,
6912
+ sideOffset: 20,
6913
+ "aria-label": title,
6914
+ style: { width: "min(380px, calc(100vw - 2rem))", padding: 0 },
6915
+ className: cn(
6916
+ "cnc-overflow-hidden cnc-rounded-lg cnc-border cnc-border-brand-gray-50 cnc-bg-white cnc-shadow-custom",
6917
+ contentClassName
6918
+ ),
6919
+ children: [
6920
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "cnc-flex cnc-items-center cnc-justify-between cnc-gap-2 cnc-border-b cnc-border-brand-gray-50 cnc-px-4 cnc-py-3", children: [
6921
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { className: "cnc-m-0 cnc-text-base cnc-font-extrabold cnc-text-brand-blue-900", children: title }),
6922
+ naoLidas > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "cnc-rounded-md cnc-bg-brand-blue-60 cnc-px-2 cnc-py-1 cnc-text-xs cnc-font-semibold cnc-text-brand-blue-400", children: naoLidas === 1 ? "1 nova" : `${naoLidas} novas` })
6923
+ ] }),
6924
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "cnc-max-h-[360px] cnc-overflow-y-auto", children: renderarConteudo() }),
6925
+ footer ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "cnc-border-t cnc-border-brand-gray-50 cnc-px-4 cnc-py-3", children: footer }) : temRodapePadrao && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "cnc-flex cnc-justify-end cnc-border-t cnc-border-brand-gray-50 cnc-px-4 cnc-py-3", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6926
+ "button",
6927
+ {
6928
+ type: "button",
6929
+ onClick: marcarTodas,
6930
+ className: cn(
6931
+ "cnc-cursor-pointer cnc-rounded cnc-bg-transparent cnc-p-0 cnc-text-xs cnc-font-semibold cnc-text-brand-blue-100 cnc-outline-none hover:cnc-underline",
6932
+ anelDeFoco
6933
+ ),
6934
+ children: "Marcar todas como lidas"
6935
+ }
6936
+ ) })
6937
+ ]
6938
+ }
6939
+ )
6940
+ ] })
6941
+ ] });
6942
+ }
6943
+ // Annotate the CommonJS export names for ESM import in node:
6944
+ 0 && (module.exports = {
6945
+ AplicationsHeader,
6946
+ AppsMenu,
6947
+ Avatar,
6948
+ Badge,
6949
+ Button,
6950
+ Card,
6951
+ CardContent,
6952
+ CardFooter,
6953
+ CardFooterItem,
6954
+ CardHeader,
6955
+ CardList,
6956
+ Checkbox,
6957
+ Collapsible,
6958
+ CollapsibleContent,
6959
+ CollapsibleTrigger,
6960
+ Combobox,
6961
+ Command,
6962
+ CommandDialog,
6963
+ CommandEmpty,
6964
+ CommandGroup,
6965
+ CommandInput,
6966
+ CommandItem,
6967
+ CommandList,
6968
+ CommandSeparator,
6969
+ CommandShortcut,
6970
+ ConfirmDialog,
6971
+ DIAS_SEMANA_PT_BR,
6972
+ DateTimeRangeList,
6973
+ Dialog,
6974
+ DialogClose,
6975
+ DialogContent,
6976
+ DialogDescription,
6977
+ DialogFooter,
6978
+ DialogHeader,
6979
+ DialogOverlay,
6980
+ DialogPortal,
6981
+ DialogTitle,
6982
+ DialogTrigger,
6983
+ Drawer,
6984
+ DrawerBody,
6985
+ DrawerClose,
6986
+ DrawerContent,
6987
+ DrawerContext,
6988
+ DrawerDescription,
6989
+ DrawerFooter,
6990
+ DrawerHeader,
6991
+ DrawerOverlay,
6992
+ DrawerPortal,
6993
+ DrawerProvider,
6994
+ DrawerTitle,
6995
+ DrawerTrigger,
6996
+ DropdownMenu,
6997
+ DropdownMenuCheckboxItem,
6998
+ DropdownMenuContent,
6999
+ DropdownMenuGroup,
7000
+ DropdownMenuItem,
7001
+ DropdownMenuLabel,
7002
+ DropdownMenuPortal,
7003
+ DropdownMenuRadioGroup,
7004
+ DropdownMenuRadioItem,
7005
+ DropdownMenuSeparator,
7006
+ DropdownMenuShortcut,
7007
+ DropdownMenuSub,
7008
+ DropdownMenuSubContent,
7009
+ DropdownMenuSubTrigger,
7010
+ DropdownMenuTrigger,
7011
+ EmptyState,
7012
+ ErroNotificacoes,
7013
+ FileList,
7014
+ FileUpload,
7015
+ Filter,
7016
+ Header,
7017
+ HeaderContainer,
7018
+ HeaderNotifications,
7019
+ HeaderProfileHeader,
7020
+ HeaderProfileItem,
7021
+ Input,
7022
+ LabelValue,
7023
+ MESES_PT_BR,
7024
+ MESES_PT_BR_ABREV,
7025
+ MiniMonthCalendar,
7026
+ Modal,
7027
+ ModalEntidade,
7028
+ ModalMudancaEntidade,
7029
+ MonthYearPicker,
7030
+ MultiSelect,
7031
+ PageHeader,
7032
+ PageHeaderActionsContainer,
7033
+ PageHeaderTitle,
7034
+ PageHeaderTitleContent,
7035
+ PeriodRangeList,
7036
+ Popover,
7037
+ PopoverContent,
7038
+ PopoverTrigger,
7039
+ ResultMetadata,
7040
+ Select,
7041
+ SelectContent,
7042
+ SelectGroup,
7043
+ SelectItem,
7044
+ SelectLabel,
7045
+ SelectPortal,
7046
+ SelectScrollDownButton,
7047
+ SelectScrollUpButton,
7048
+ SelectSeparator,
7049
+ SelectTrigger,
7050
+ SelectValue,
7051
+ SelectViewport,
7052
+ Sidebar,
7053
+ SidebarContainer,
7054
+ SidebarImageBrand,
7055
+ SidebarNavCollapse,
7056
+ SidebarNavLink,
7057
+ Switch,
7058
+ Tabs,
7059
+ TabsContent,
7060
+ TabsList,
7061
+ TabsTrigger,
7062
+ Textarea,
7063
+ Title,
7064
+ Tooltip,
7065
+ URL_PADRAO_NOTIFICACOES,
7066
+ availableApps,
7067
+ buildMonthDays,
7068
+ buttonVariants,
7069
+ formatDayAriaLabel,
7070
+ formatFileSize,
7071
+ formatMonthYear,
7072
+ isSameDay,
7073
+ isToday,
7074
+ toDateKey,
7075
+ toLocalNoon,
7076
+ useDrawer,
7077
+ validateFiles
7078
+ });
7079
+ /*! Bundled license information:
7080
+
7081
+ lucide-react/dist/esm/shared/src/utils.js:
7082
+ (**
7083
+ * @license lucide-react v0.453.0 - ISC
7084
+ *
7085
+ * This source code is licensed under the ISC license.
7086
+ * See the LICENSE file in the root directory of this source tree.
7087
+ *)
7088
+
7089
+ lucide-react/dist/esm/defaultAttributes.js:
7090
+ (**
7091
+ * @license lucide-react v0.453.0 - ISC
7092
+ *
7093
+ * This source code is licensed under the ISC license.
7094
+ * See the LICENSE file in the root directory of this source tree.
7095
+ *)
7096
+
7097
+ lucide-react/dist/esm/Icon.js:
7098
+ (**
7099
+ * @license lucide-react v0.453.0 - ISC
7100
+ *
7101
+ * This source code is licensed under the ISC license.
7102
+ * See the LICENSE file in the root directory of this source tree.
7103
+ *)
7104
+
7105
+ lucide-react/dist/esm/createLucideIcon.js:
7106
+ (**
7107
+ * @license lucide-react v0.453.0 - ISC
7108
+ *
7109
+ * This source code is licensed under the ISC license.
7110
+ * See the LICENSE file in the root directory of this source tree.
7111
+ *)
7112
+
7113
+ lucide-react/dist/esm/icons/bell-off.js:
7114
+ (**
7115
+ * @license lucide-react v0.453.0 - ISC
7116
+ *
7117
+ * This source code is licensed under the ISC license.
7118
+ * See the LICENSE file in the root directory of this source tree.
7119
+ *)
7120
+
7121
+ lucide-react/dist/esm/icons/bell-ring.js:
7122
+ (**
7123
+ * @license lucide-react v0.453.0 - ISC
7124
+ *
7125
+ * This source code is licensed under the ISC license.
7126
+ * See the LICENSE file in the root directory of this source tree.
7127
+ *)
7128
+
7129
+ lucide-react/dist/esm/icons/bell.js:
7130
+ (**
7131
+ * @license lucide-react v0.453.0 - ISC
7132
+ *
7133
+ * This source code is licensed under the ISC license.
7134
+ * See the LICENSE file in the root directory of this source tree.
7135
+ *)
7136
+
7137
+ lucide-react/dist/esm/icons/check.js:
7138
+ (**
7139
+ * @license lucide-react v0.453.0 - ISC
7140
+ *
7141
+ * This source code is licensed under the ISC license.
7142
+ * See the LICENSE file in the root directory of this source tree.
7143
+ *)
7144
+
7145
+ lucide-react/dist/esm/icons/chevron-down.js:
7146
+ (**
7147
+ * @license lucide-react v0.453.0 - ISC
7148
+ *
7149
+ * This source code is licensed under the ISC license.
7150
+ * See the LICENSE file in the root directory of this source tree.
7151
+ *)
7152
+
7153
+ lucide-react/dist/esm/icons/chevron-left.js:
7154
+ (**
7155
+ * @license lucide-react v0.453.0 - ISC
7156
+ *
7157
+ * This source code is licensed under the ISC license.
7158
+ * See the LICENSE file in the root directory of this source tree.
7159
+ *)
7160
+
7161
+ lucide-react/dist/esm/icons/chevron-right.js:
7162
+ (**
4886
7163
  * @license lucide-react v0.453.0 - ISC
4887
7164
  *
4888
7165
  * This source code is licensed under the ISC license.
@@ -4913,6 +7190,30 @@ lucide-react/dist/esm/icons/circle.js:
4913
7190
  * See the LICENSE file in the root directory of this source tree.
4914
7191
  *)
4915
7192
 
7193
+ lucide-react/dist/esm/icons/download.js:
7194
+ (**
7195
+ * @license lucide-react v0.453.0 - ISC
7196
+ *
7197
+ * This source code is licensed under the ISC license.
7198
+ * See the LICENSE file in the root directory of this source tree.
7199
+ *)
7200
+
7201
+ lucide-react/dist/esm/icons/external-link.js:
7202
+ (**
7203
+ * @license lucide-react v0.453.0 - ISC
7204
+ *
7205
+ * This source code is licensed under the ISC license.
7206
+ * See the LICENSE file in the root directory of this source tree.
7207
+ *)
7208
+
7209
+ lucide-react/dist/esm/icons/file-text.js:
7210
+ (**
7211
+ * @license lucide-react v0.453.0 - ISC
7212
+ *
7213
+ * This source code is licensed under the ISC license.
7214
+ * See the LICENSE file in the root directory of this source tree.
7215
+ *)
7216
+
4916
7217
  lucide-react/dist/esm/icons/filter-x.js:
4917
7218
  (**
4918
7219
  * @license lucide-react v0.453.0 - ISC
@@ -4945,6 +7246,38 @@ lucide-react/dist/esm/icons/loader-circle.js:
4945
7246
  * See the LICENSE file in the root directory of this source tree.
4946
7247
  *)
4947
7248
 
7249
+ lucide-react/dist/esm/icons/mail-open.js:
7250
+ (**
7251
+ * @license lucide-react v0.453.0 - ISC
7252
+ *
7253
+ * This source code is licensed under the ISC license.
7254
+ * See the LICENSE file in the root directory of this source tree.
7255
+ *)
7256
+
7257
+ lucide-react/dist/esm/icons/mail.js:
7258
+ (**
7259
+ * @license lucide-react v0.453.0 - ISC
7260
+ *
7261
+ * This source code is licensed under the ISC license.
7262
+ * See the LICENSE file in the root directory of this source tree.
7263
+ *)
7264
+
7265
+ lucide-react/dist/esm/icons/paperclip.js:
7266
+ (**
7267
+ * @license lucide-react v0.453.0 - ISC
7268
+ *
7269
+ * This source code is licensed under the ISC license.
7270
+ * See the LICENSE file in the root directory of this source tree.
7271
+ *)
7272
+
7273
+ lucide-react/dist/esm/icons/plus.js:
7274
+ (**
7275
+ * @license lucide-react v0.453.0 - ISC
7276
+ *
7277
+ * This source code is licensed under the ISC license.
7278
+ * See the LICENSE file in the root directory of this source tree.
7279
+ *)
7280
+
4948
7281
  lucide-react/dist/esm/icons/search.js:
4949
7282
  (**
4950
7283
  * @license lucide-react v0.453.0 - ISC
@@ -4953,6 +7286,22 @@ lucide-react/dist/esm/icons/search.js:
4953
7286
  * See the LICENSE file in the root directory of this source tree.
4954
7287
  *)
4955
7288
 
7289
+ lucide-react/dist/esm/icons/trash-2.js:
7290
+ (**
7291
+ * @license lucide-react v0.453.0 - ISC
7292
+ *
7293
+ * This source code is licensed under the ISC license.
7294
+ * See the LICENSE file in the root directory of this source tree.
7295
+ *)
7296
+
7297
+ lucide-react/dist/esm/icons/user.js:
7298
+ (**
7299
+ * @license lucide-react v0.453.0 - ISC
7300
+ *
7301
+ * This source code is licensed under the ISC license.
7302
+ * See the LICENSE file in the root directory of this source tree.
7303
+ *)
7304
+
4956
7305
  lucide-react/dist/esm/icons/x.js:
4957
7306
  (**
4958
7307
  * @license lucide-react v0.453.0 - ISC