analytica-frontend-lib 1.2.25 → 1.2.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/dist/Accordation/index.d.ts +4 -5
  2. package/dist/Accordation/index.d.ts.map +1 -0
  3. package/dist/ActivityDetails/index.css +19293 -0
  4. package/dist/ActivityDetails/index.css.map +1 -0
  5. package/dist/ActivityDetails/index.d.ts +31 -0
  6. package/dist/ActivityDetails/index.d.ts.map +1 -0
  7. package/dist/ActivityDetails/index.js +7389 -0
  8. package/dist/ActivityDetails/index.js.map +1 -0
  9. package/dist/ActivityDetails/index.mjs +7438 -0
  10. package/dist/ActivityDetails/index.mjs.map +1 -0
  11. package/dist/ActivityFilters/index.css +112 -0
  12. package/dist/ActivityFilters/index.css.map +1 -1
  13. package/dist/ActivityFilters/index.d.ts +44 -5
  14. package/dist/ActivityFilters/index.d.ts.map +1 -0
  15. package/dist/ActivityFilters/index.js +67 -33
  16. package/dist/ActivityFilters/index.js.map +1 -1
  17. package/dist/ActivityFilters/index.mjs +89 -55
  18. package/dist/ActivityFilters/index.mjs.map +1 -1
  19. package/dist/Alert/index.d.ts +3 -5
  20. package/dist/Alert/index.d.ts.map +1 -0
  21. package/dist/AlertDialog/index.d.ts +2 -4
  22. package/dist/AlertDialog/index.d.ts.map +1 -0
  23. package/dist/AlertManager/index.css +112 -0
  24. package/dist/AlertManager/index.css.map +1 -1
  25. package/dist/AlertManager/index.d.ts +4 -8
  26. package/dist/AlertManager/index.d.ts.map +1 -0
  27. package/dist/AlertManager/index.js +56 -22
  28. package/dist/AlertManager/index.js.map +1 -1
  29. package/dist/AlertManager/index.mjs +78 -44
  30. package/dist/AlertManager/index.mjs.map +1 -1
  31. package/dist/AlertManagerView/index.d.ts +6 -10
  32. package/dist/AlertManagerView/index.d.ts.map +1 -0
  33. package/dist/Alternative/index.d.ts +6 -9
  34. package/dist/Alternative/index.d.ts.map +1 -0
  35. package/dist/Auth/AuthProvider/index.d.ts +324 -3
  36. package/dist/Auth/AuthProvider/index.d.ts.map +1 -0
  37. package/dist/Auth/ProtectedRoute/index.d.ts +324 -3
  38. package/dist/Auth/ProtectedRoute/index.d.ts.map +1 -0
  39. package/dist/Auth/PublicRoute/index.d.ts +324 -3
  40. package/dist/Auth/PublicRoute/index.d.ts.map +1 -0
  41. package/dist/Auth/getRootDomain/index.d.ts +324 -3
  42. package/dist/Auth/getRootDomain/index.d.ts.map +1 -0
  43. package/dist/Auth/index.d.ts +24 -26
  44. package/dist/Auth/index.d.ts.map +1 -0
  45. package/dist/Auth/useApiConfig/index.d.ts +3 -3
  46. package/dist/Auth/useApiConfig/index.d.ts.map +1 -0
  47. package/dist/Auth/useAuth/index.d.ts +324 -3
  48. package/dist/Auth/useAuth/index.d.ts.map +1 -0
  49. package/dist/Auth/useAuthGuard/index.d.ts +324 -3
  50. package/dist/Auth/useAuthGuard/index.d.ts.map +1 -0
  51. package/dist/Auth/useRouteAuth/index.d.ts +324 -3
  52. package/dist/Auth/useRouteAuth/index.d.ts.map +1 -0
  53. package/dist/Auth/useUrlAuthentication/index.d.ts +3 -4
  54. package/dist/Auth/useUrlAuthentication/index.d.ts.map +1 -0
  55. package/dist/Auth/withAuth/index.d.ts +324 -3
  56. package/dist/Auth/withAuth/index.d.ts.map +1 -0
  57. package/dist/Auth/zustandAuthAdapter/index.d.ts +2 -3
  58. package/dist/Auth/zustandAuthAdapter/index.d.ts.map +1 -0
  59. package/dist/Badge/index.d.ts +4 -6
  60. package/dist/Badge/index.d.ts.map +1 -0
  61. package/dist/BreadcrumbMenu/breadcrumbStore/index.d.ts +5 -7
  62. package/dist/BreadcrumbMenu/breadcrumbStore/index.d.ts.map +1 -0
  63. package/dist/BreadcrumbMenu/index.d.ts +4 -8
  64. package/dist/BreadcrumbMenu/index.d.ts.map +1 -0
  65. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.d.ts +7 -10
  66. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.d.ts.map +1 -0
  67. package/dist/BreadcrumbMenu/useUrlParams/index.d.ts +3 -4
  68. package/dist/BreadcrumbMenu/useUrlParams/index.d.ts.map +1 -0
  69. package/dist/Button/index.d.ts +4 -6
  70. package/dist/Button/index.d.ts.map +1 -0
  71. package/dist/Calendar/index.d.ts +9 -11
  72. package/dist/Calendar/index.d.ts.map +1 -0
  73. package/dist/Card/index.d.ts +17 -19
  74. package/dist/Card/index.d.ts.map +1 -0
  75. package/dist/CheckBox/index.d.ts +6 -8
  76. package/dist/CheckBox/index.d.ts.map +1 -0
  77. package/dist/Chips/index.d.ts +4 -6
  78. package/dist/Chips/index.d.ts.map +1 -0
  79. package/dist/CorrectActivityModal/index.d.ts +39 -0
  80. package/dist/CorrectActivityModal/index.d.ts.map +1 -0
  81. package/dist/CorrectActivityModal/index.js +3674 -0
  82. package/dist/CorrectActivityModal/index.js.map +1 -0
  83. package/dist/CorrectActivityModal/index.mjs +3689 -0
  84. package/dist/CorrectActivityModal/index.mjs.map +1 -0
  85. package/dist/Divider/index.d.ts +3 -5
  86. package/dist/Divider/index.d.ts.map +1 -0
  87. package/dist/DownloadButton/index.d.ts +5 -7
  88. package/dist/DownloadButton/index.d.ts.map +1 -0
  89. package/dist/DropdownMenu/index.d.ts +26 -28
  90. package/dist/DropdownMenu/index.d.ts.map +1 -0
  91. package/dist/EmptyState/index.d.ts +5 -7
  92. package/dist/EmptyState/index.d.ts.map +1 -0
  93. package/dist/FileAttachment/index.d.ts +72 -0
  94. package/dist/FileAttachment/index.d.ts.map +1 -0
  95. package/dist/FileAttachment/index.js +239 -0
  96. package/dist/FileAttachment/index.js.map +1 -0
  97. package/dist/FileAttachment/index.mjs +213 -0
  98. package/dist/FileAttachment/index.mjs.map +1 -0
  99. package/dist/IconButton/index.d.ts +6 -8
  100. package/dist/IconButton/index.d.ts.map +1 -0
  101. package/dist/IconRender/index.d.ts +5 -6
  102. package/dist/IconRender/index.d.ts.map +1 -0
  103. package/dist/IconRoundedButton/index.d.ts +4 -6
  104. package/dist/IconRoundedButton/index.d.ts.map +1 -0
  105. package/dist/Input/index.d.ts +5 -7
  106. package/dist/Input/index.d.ts.map +1 -0
  107. package/dist/LatexRenderer/index.d.ts +5 -6
  108. package/dist/LatexRenderer/index.d.ts.map +1 -0
  109. package/dist/LoadingModal/index.d.ts +3 -5
  110. package/dist/LoadingModal/index.d.ts.map +1 -0
  111. package/dist/Menu/index.d.ts +12 -14
  112. package/dist/Menu/index.d.ts.map +1 -0
  113. package/dist/Modal/index.d.ts +3 -5
  114. package/dist/Modal/index.d.ts.map +1 -0
  115. package/dist/Modal/utils/videoUtils/index.d.ts +4 -5
  116. package/dist/Modal/utils/videoUtils/index.d.ts.map +1 -0
  117. package/dist/MultipleChoice/index.d.ts +2 -4
  118. package/dist/MultipleChoice/index.d.ts.map +1 -0
  119. package/dist/NavButton/index.d.ts +5 -7
  120. package/dist/NavButton/index.d.ts.map +1 -0
  121. package/dist/NoSearchResult/index.d.ts +4 -6
  122. package/dist/NoSearchResult/index.d.ts.map +1 -0
  123. package/dist/NotFound/index.d.ts +4 -6
  124. package/dist/NotFound/index.d.ts.map +1 -0
  125. package/dist/NotificationCard/index.d.ts +218 -3
  126. package/dist/NotificationCard/index.d.ts.map +1 -0
  127. package/dist/ProgressBar/index.d.ts +4 -6
  128. package/dist/ProgressBar/index.d.ts.map +1 -0
  129. package/dist/ProgressCircle/index.d.ts +4 -6
  130. package/dist/ProgressCircle/index.d.ts.map +1 -0
  131. package/dist/Quiz/index.d.ts +19 -23
  132. package/dist/Quiz/index.d.ts.map +1 -0
  133. package/dist/Quiz/useQuizStore/index.d.ts +14 -17
  134. package/dist/Quiz/useQuizStore/index.d.ts.map +1 -0
  135. package/dist/Radio/index.d.ts +14 -15
  136. package/dist/Radio/index.d.ts.map +1 -0
  137. package/dist/Search/index.d.ts +4 -6
  138. package/dist/Search/index.d.ts.map +1 -0
  139. package/dist/Select/index.d.ts +12 -14
  140. package/dist/Select/index.d.ts.map +1 -0
  141. package/dist/SelectionButton/index.d.ts +5 -7
  142. package/dist/SelectionButton/index.d.ts.map +1 -0
  143. package/dist/Skeleton/index.d.ts +10 -12
  144. package/dist/Skeleton/index.d.ts.map +1 -0
  145. package/dist/StatisticsCard/index.d.ts +3 -5
  146. package/dist/StatisticsCard/index.d.ts.map +1 -0
  147. package/dist/Stepper/index.d.ts +6 -8
  148. package/dist/Stepper/index.d.ts.map +1 -0
  149. package/dist/SubjectInfo/index.d.ts +17 -2
  150. package/dist/SubjectInfo/index.d.ts.map +1 -0
  151. package/dist/Support/TicketModal/index.d.ts +14 -0
  152. package/dist/Support/TicketModal/index.d.ts.map +1 -0
  153. package/dist/Support/TicketModal/index.js +1279 -0
  154. package/dist/Support/TicketModal/index.js.map +1 -0
  155. package/dist/Support/TicketModal/index.mjs +1248 -0
  156. package/dist/Support/TicketModal/index.mjs.map +1 -0
  157. package/dist/Support/index.d.ts +8 -0
  158. package/dist/Support/index.d.ts.map +1 -0
  159. package/dist/Support/index.js +2686 -0
  160. package/dist/Support/index.js.map +1 -0
  161. package/dist/Support/index.mjs +2676 -0
  162. package/dist/Support/index.mjs.map +1 -0
  163. package/dist/Table/TablePagination/index.d.ts +4 -6
  164. package/dist/Table/TablePagination/index.d.ts.map +1 -0
  165. package/dist/Table/index.d.ts +18 -19
  166. package/dist/Table/index.d.ts.map +1 -0
  167. package/dist/TableProvider/index.css +112 -0
  168. package/dist/TableProvider/index.css.map +1 -1
  169. package/dist/TableProvider/index.d.ts +198 -4
  170. package/dist/TableProvider/index.d.ts.map +1 -0
  171. package/dist/TableProvider/index.js +56 -22
  172. package/dist/TableProvider/index.js.map +1 -1
  173. package/dist/TableProvider/index.mjs +78 -44
  174. package/dist/TableProvider/index.mjs.map +1 -1
  175. package/dist/Text/index.d.ts +4 -6
  176. package/dist/Text/index.d.ts.map +1 -0
  177. package/dist/TextArea/index.d.ts +6 -8
  178. package/dist/TextArea/index.d.ts.map +1 -0
  179. package/dist/ThemeToggle/index.d.ts +4 -8
  180. package/dist/ThemeToggle/index.d.ts.map +1 -0
  181. package/dist/Toast/ToastStore/index.d.ts +3 -5
  182. package/dist/Toast/ToastStore/index.d.ts.map +1 -0
  183. package/dist/Toast/Toaster/index.d.ts +4 -6
  184. package/dist/Toast/Toaster/index.d.ts.map +1 -0
  185. package/dist/Toast/index.d.ts +3 -5
  186. package/dist/Toast/index.d.ts.map +1 -0
  187. package/dist/VideoPlayer/index.d.ts +4 -6
  188. package/dist/VideoPlayer/index.d.ts.map +1 -0
  189. package/dist/Whiteboard/index.d.ts +5 -7
  190. package/dist/Whiteboard/index.d.ts.map +1 -0
  191. package/dist/assets/icons/subjects/BookOpenText.d.ts +5 -0
  192. package/dist/assets/icons/subjects/BookOpenText.d.ts.map +1 -0
  193. package/dist/assets/icons/subjects/ChatEN.d.ts +5 -0
  194. package/dist/assets/icons/subjects/ChatEN.d.ts.map +1 -0
  195. package/dist/assets/icons/subjects/ChatES.d.ts +5 -0
  196. package/dist/assets/icons/subjects/ChatES.d.ts.map +1 -0
  197. package/dist/assets/icons/subjects/ChatPT.d.ts +5 -0
  198. package/dist/assets/icons/subjects/ChatPT.d.ts.map +1 -0
  199. package/dist/assets/icons/subjects/HeadCircuit.d.ts +5 -0
  200. package/dist/assets/icons/subjects/HeadCircuit.d.ts.map +1 -0
  201. package/dist/assets/icons/subjects/Microscope.d.ts +5 -0
  202. package/dist/assets/icons/subjects/Microscope.d.ts.map +1 -0
  203. package/dist/enums/SubjectEnum.d.ts +19 -0
  204. package/dist/enums/SubjectEnum.d.ts.map +1 -0
  205. package/dist/hooks/useAppContent.d.ts +55 -0
  206. package/dist/hooks/useAppContent.d.ts.map +1 -0
  207. package/dist/hooks/useAppInitialization.d.ts +21 -0
  208. package/dist/hooks/useAppInitialization.d.ts.map +1 -0
  209. package/dist/hooks/useInstitution.d.ts +2 -0
  210. package/dist/hooks/useInstitution.d.ts.map +1 -0
  211. package/dist/hooks/useMobile/index.d.ts +4 -5
  212. package/dist/hooks/useMobile/index.d.ts.map +1 -0
  213. package/dist/hooks/useNotificationStore.d.ts +34 -0
  214. package/dist/hooks/useNotificationStore.d.ts.map +1 -0
  215. package/dist/hooks/useNotifications.d.ts +129 -0
  216. package/dist/hooks/useNotifications.d.ts.map +1 -0
  217. package/dist/hooks/useScreen.d.ts +38 -0
  218. package/dist/hooks/useScreen.d.ts.map +1 -0
  219. package/dist/hooks/useTheme/index.d.ts +4 -7
  220. package/dist/hooks/useTheme/index.d.ts.map +1 -0
  221. package/dist/index.css +112 -0
  222. package/dist/index.css.map +1 -1
  223. package/dist/index.d.ts +127 -789
  224. package/dist/index.d.ts.map +1 -0
  225. package/dist/index.js +9031 -7012
  226. package/dist/index.js.map +1 -1
  227. package/dist/index.mjs +9093 -7085
  228. package/dist/index.mjs.map +1 -1
  229. package/dist/store/appStore.d.ts +27 -0
  230. package/dist/store/appStore.d.ts.map +1 -0
  231. package/dist/store/authStore.d.ts +75 -0
  232. package/dist/store/authStore.d.ts.map +1 -0
  233. package/dist/store/notificationStore.d.ts +89 -0
  234. package/dist/store/notificationStore.d.ts.map +1 -0
  235. package/dist/{themeStore-P2X64zC-.d.ts → store/themeStore.d.ts} +8 -12
  236. package/dist/store/themeStore.d.ts.map +1 -0
  237. package/dist/styles.css +112 -0
  238. package/dist/styles.css.map +1 -1
  239. package/dist/suporthistory-W5LBGAUP.png +0 -0
  240. package/dist/types/activityDetails.d.ts +127 -0
  241. package/dist/types/activityDetails.d.ts.map +1 -0
  242. package/dist/types/activityFilters.d.ts +51 -0
  243. package/dist/types/activityFilters.d.ts.map +1 -0
  244. package/dist/types/auth.d.ts +53 -0
  245. package/dist/types/auth.d.ts.map +1 -0
  246. package/dist/types/notifications.d.ts +199 -0
  247. package/dist/types/notifications.d.ts.map +1 -0
  248. package/dist/types/questionTypes.d.ts +6 -0
  249. package/dist/types/questionTypes.d.ts.map +1 -0
  250. package/dist/types/studentActivityCorrection.d.ts +57 -0
  251. package/dist/types/studentActivityCorrection.d.ts.map +1 -0
  252. package/dist/types/support/index.d.ts +111 -0
  253. package/dist/types/support/index.d.ts.map +1 -0
  254. package/dist/types/support/index.js +115 -0
  255. package/dist/types/support/index.js.map +1 -0
  256. package/dist/types/support/index.mjs +84 -0
  257. package/dist/types/support/index.mjs.map +1 -0
  258. package/dist/utils/activityFilters.d.ts +23 -0
  259. package/dist/utils/activityFilters.d.ts.map +1 -0
  260. package/dist/utils/dropdown.d.ts +12 -0
  261. package/dist/utils/dropdown.d.ts.map +1 -0
  262. package/dist/utils/index.d.ts +6 -43
  263. package/dist/utils/index.d.ts.map +1 -0
  264. package/dist/utils/keys.d.ts +24 -0
  265. package/dist/utils/keys.d.ts.map +1 -0
  266. package/package.json +20 -4
  267. package/dist/Accordation/index.d.mts +0 -15
  268. package/dist/ActivityFilters/index.d.mts +0 -5
  269. package/dist/ActivityFilters-Cs3TpGAY.d.ts +0 -97
  270. package/dist/ActivityFilters-CsX8y41f.d.mts +0 -97
  271. package/dist/Alert/index.d.mts +0 -13
  272. package/dist/AlertDialog/index.d.mts +0 -36
  273. package/dist/AlertManager/index.d.mts +0 -17
  274. package/dist/AlertManagerView/index.d.mts +0 -31
  275. package/dist/Alternative/index.d.mts +0 -81
  276. package/dist/Auth/AuthProvider/index.d.mts +0 -3
  277. package/dist/Auth/ProtectedRoute/index.d.mts +0 -3
  278. package/dist/Auth/PublicRoute/index.d.mts +0 -3
  279. package/dist/Auth/getRootDomain/index.d.mts +0 -3
  280. package/dist/Auth/index.d.mts +0 -326
  281. package/dist/Auth/useApiConfig/index.d.mts +0 -43
  282. package/dist/Auth/useAuth/index.d.mts +0 -3
  283. package/dist/Auth/useAuthGuard/index.d.mts +0 -3
  284. package/dist/Auth/useRouteAuth/index.d.mts +0 -3
  285. package/dist/Auth/useUrlAuthentication/index.d.mts +0 -69
  286. package/dist/Auth/withAuth/index.d.mts +0 -3
  287. package/dist/Auth/zustandAuthAdapter/index.d.mts +0 -75
  288. package/dist/Badge/index.d.mts +0 -46
  289. package/dist/BreadcrumbMenu/breadcrumbStore/index.d.mts +0 -77
  290. package/dist/BreadcrumbMenu/index.d.mts +0 -31
  291. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.d.mts +0 -48
  292. package/dist/BreadcrumbMenu/useUrlParams/index.d.mts +0 -28
  293. package/dist/Button/index.d.mts +0 -45
  294. package/dist/Calendar/index.d.mts +0 -60
  295. package/dist/Card/index.d.mts +0 -150
  296. package/dist/CheckBox/index.d.mts +0 -74
  297. package/dist/CheckBoxGroup-9n5C0OH4.d.mts +0 -24
  298. package/dist/CheckBoxGroup-9n5C0OH4.d.ts +0 -24
  299. package/dist/Chips/index.d.mts +0 -41
  300. package/dist/Divider/index.d.mts +0 -32
  301. package/dist/DownloadButton/index.d.mts +0 -46
  302. package/dist/DropdownMenu/index.d.mts +0 -82
  303. package/dist/EmptyState/index.d.mts +0 -65
  304. package/dist/IconButton/index.d.mts +0 -76
  305. package/dist/IconRender/index.d.mts +0 -36
  306. package/dist/IconRoundedButton/index.d.mts +0 -34
  307. package/dist/Input/index.d.mts +0 -27
  308. package/dist/LatexRenderer/index.d.mts +0 -50
  309. package/dist/LoadingModal/index.d.mts +0 -11
  310. package/dist/Menu/index.d.mts +0 -48
  311. package/dist/Modal/index.d.mts +0 -76
  312. package/dist/Modal/utils/videoUtils/index.d.mts +0 -28
  313. package/dist/MultipleChoice/index.d.mts +0 -20
  314. package/dist/NavButton/index.d.mts +0 -57
  315. package/dist/NoSearchResult/index.d.mts +0 -37
  316. package/dist/NotFound/index.d.mts +0 -58
  317. package/dist/NotificationCard/index.d.mts +0 -3
  318. package/dist/NotificationCard-4GgB0Nsf.d.mts +0 -417
  319. package/dist/NotificationCard-4GgB0Nsf.d.ts +0 -417
  320. package/dist/ProgressBar/index.d.mts +0 -95
  321. package/dist/ProgressCircle/index.d.mts +0 -60
  322. package/dist/Quiz/index.d.mts +0 -55
  323. package/dist/Quiz/useQuizStore/index.d.mts +0 -258
  324. package/dist/Radio/index.d.mts +0 -203
  325. package/dist/Search/index.d.mts +0 -27
  326. package/dist/Select/index.d.mts +0 -59
  327. package/dist/SelectionButton/index.d.mts +0 -57
  328. package/dist/Skeleton/index.d.mts +0 -40
  329. package/dist/StatisticsCard/index.d.mts +0 -79
  330. package/dist/Stepper/index.d.mts +0 -169
  331. package/dist/SubjectInfo/index.d.mts +0 -2
  332. package/dist/SubjectInfo-Dvt0OodP.d.mts +0 -37
  333. package/dist/SubjectInfo-Dvt0OodP.d.ts +0 -37
  334. package/dist/Table/TablePagination/index.d.mts +0 -64
  335. package/dist/Table/index.d.mts +0 -93
  336. package/dist/TableProvider/index.d.mts +0 -4
  337. package/dist/TableProvider-BnAnv3OV.d.mts +0 -239
  338. package/dist/TableProvider-GfPlLqzg.d.ts +0 -239
  339. package/dist/Text/index.d.mts +0 -58
  340. package/dist/TextArea/index.d.mts +0 -74
  341. package/dist/ThemeToggle/index.d.mts +0 -12
  342. package/dist/Toast/ToastStore/index.d.mts +0 -19
  343. package/dist/Toast/Toaster/index.d.mts +0 -16
  344. package/dist/Toast/index.d.mts +0 -17
  345. package/dist/VideoPlayer/index.d.mts +0 -52
  346. package/dist/Whiteboard/index.d.mts +0 -34
  347. package/dist/hooks/useMobile/index.d.mts +0 -29
  348. package/dist/hooks/useTheme/index.d.mts +0 -17
  349. package/dist/index.d.mts +0 -789
  350. package/dist/styles.d.mts +0 -2
  351. package/dist/styles.d.ts +0 -2
  352. package/dist/themeStore-P2X64zC-.d.mts +0 -79
  353. package/dist/types-DqZRjqxh.d.ts +0 -67
  354. package/dist/types-pd3QVhSu.d.mts +0 -67
  355. package/dist/utils/index.d.mts +0 -51
@@ -0,0 +1,2686 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/components/Support/index.ts
31
+ var Support_exports = {};
32
+ __export(Support_exports, {
33
+ Support: () => Support_default,
34
+ TicketModal: () => TicketModal,
35
+ getCategoryIcon: () => getCategoryIcon,
36
+ supportSchema: () => supportSchema
37
+ });
38
+ module.exports = __toCommonJS(Support_exports);
39
+
40
+ // src/components/Support/Support.tsx
41
+ var import_react10 = require("react");
42
+ var import_react_hook_form = require("react-hook-form");
43
+ var import_zod2 = require("@hookform/resolvers/zod");
44
+ var import_react11 = require("@phosphor-icons/react");
45
+ var import_dayjs2 = __toESM(require("dayjs"));
46
+
47
+ // src/utils/utils.ts
48
+ var import_clsx = require("clsx");
49
+ var import_tailwind_merge = require("tailwind-merge");
50
+ function cn(...inputs) {
51
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
52
+ }
53
+
54
+ // src/components/Text/Text.tsx
55
+ var import_jsx_runtime = require("react/jsx-runtime");
56
+ var Text = ({
57
+ children,
58
+ size = "md",
59
+ weight = "normal",
60
+ color = "text-text-950",
61
+ as,
62
+ className = "",
63
+ ...props
64
+ }) => {
65
+ let sizeClasses = "";
66
+ let weightClasses = "";
67
+ const sizeClassMap = {
68
+ "2xs": "text-2xs",
69
+ xs: "text-xs",
70
+ sm: "text-sm",
71
+ md: "text-md",
72
+ lg: "text-lg",
73
+ xl: "text-xl",
74
+ "2xl": "text-2xl",
75
+ "3xl": "text-3xl",
76
+ "4xl": "text-4xl",
77
+ "5xl": "text-5xl",
78
+ "6xl": "text-6xl"
79
+ };
80
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
81
+ const weightClassMap = {
82
+ hairline: "font-hairline",
83
+ light: "font-light",
84
+ normal: "font-normal",
85
+ medium: "font-medium",
86
+ semibold: "font-semibold",
87
+ bold: "font-bold",
88
+ extrabold: "font-extrabold",
89
+ black: "font-black"
90
+ };
91
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
92
+ const baseClasses = "font-primary";
93
+ const Component = as ?? "p";
94
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ Component,
96
+ {
97
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
98
+ ...props,
99
+ children
100
+ }
101
+ );
102
+ };
103
+ var Text_default = Text;
104
+
105
+ // src/components/SelectionButton/SelectionButton.tsx
106
+ var import_react = require("react");
107
+ var import_jsx_runtime2 = require("react/jsx-runtime");
108
+ var SelectionButton = (0, import_react.forwardRef)(
109
+ ({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
110
+ const baseClasses = [
111
+ "inline-flex",
112
+ "items-center",
113
+ "justify-start",
114
+ "gap-2",
115
+ "p-4",
116
+ "rounded-xl",
117
+ "cursor-pointer",
118
+ "border",
119
+ "border-border-50",
120
+ "bg-background",
121
+ "text-sm",
122
+ "text-text-700",
123
+ "font-bold",
124
+ "shadow-soft-shadow-1",
125
+ "hover:bg-background-100",
126
+ "focus-visible:outline-none",
127
+ "focus-visible:ring-2",
128
+ "focus-visible:ring-indicator-info",
129
+ "focus-visible:ring-offset-0",
130
+ "focus-visible:shadow-none",
131
+ "active:ring-2",
132
+ "active:ring-primary-950",
133
+ "active:ring-offset-0",
134
+ "active:shadow-none",
135
+ "disabled:opacity-50",
136
+ "disabled:cursor-not-allowed"
137
+ ];
138
+ const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
139
+ const allClasses = [...baseClasses, ...stateClasses].join(" ");
140
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
141
+ "button",
142
+ {
143
+ ref,
144
+ type: "button",
145
+ className: cn(allClasses, className),
146
+ disabled,
147
+ "aria-pressed": selected,
148
+ ...props,
149
+ children: [
150
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
151
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: label })
152
+ ]
153
+ }
154
+ );
155
+ }
156
+ );
157
+ SelectionButton.displayName = "SelectionButton";
158
+ var SelectionButton_default = SelectionButton;
159
+
160
+ // src/components/Input/Input.tsx
161
+ var import_phosphor_react = require("phosphor-react");
162
+ var import_react2 = require("react");
163
+ var import_jsx_runtime3 = require("react/jsx-runtime");
164
+ var SIZE_CLASSES = {
165
+ small: "text-sm",
166
+ medium: "text-md",
167
+ large: "text-lg",
168
+ "extra-large": "text-xl"
169
+ };
170
+ var STATE_CLASSES = {
171
+ default: "border-border-300 placeholder:text-text-600 hover:border-border-400",
172
+ error: "border-2 border-indicator-error placeholder:text-text-600",
173
+ disabled: "border-border-300 placeholder:text-text-600 cursor-not-allowed opacity-40",
174
+ "read-only": "border-transparent !text-text-600 cursor-default focus:outline-none bg-transparent"
175
+ };
176
+ var VARIANT_CLASSES = {
177
+ outlined: "border rounded-lg",
178
+ underlined: "border-0 border-b rounded-none bg-transparent focus:outline-none focus:border-primary-950 focus:border-b-2",
179
+ rounded: "border rounded-full"
180
+ };
181
+ var getActualState = (disabled, readOnly, errorMessage, state) => {
182
+ if (disabled) return "disabled";
183
+ if (readOnly) return "read-only";
184
+ if (errorMessage) return "error";
185
+ return state || "default";
186
+ };
187
+ var getIconSize = (size) => {
188
+ const iconSizeClasses = {
189
+ small: "w-4 h-4",
190
+ medium: "w-5 h-5",
191
+ large: "w-6 h-6",
192
+ "extra-large": "w-7 h-7"
193
+ };
194
+ return iconSizeClasses[size] || iconSizeClasses.medium;
195
+ };
196
+ var getPasswordToggleConfig = (type, disabled, readOnly, showPassword, iconRight) => {
197
+ const isPasswordType = type === "password";
198
+ const shouldShowPasswordToggle = isPasswordType && !disabled && !readOnly;
199
+ let actualIconRight = iconRight;
200
+ let ariaLabel;
201
+ if (shouldShowPasswordToggle) {
202
+ actualIconRight = showPassword ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_phosphor_react.EyeSlash, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_phosphor_react.Eye, {});
203
+ ariaLabel = showPassword ? "Ocultar senha" : "Mostrar senha";
204
+ }
205
+ return { shouldShowPasswordToggle, actualIconRight, ariaLabel };
206
+ };
207
+ var getCombinedClasses = (actualState, variant) => {
208
+ const stateClasses = STATE_CLASSES[actualState];
209
+ const variantClasses = VARIANT_CLASSES[variant];
210
+ if (actualState === "error" && variant === "underlined") {
211
+ return "border-0 border-b-2 border-indicator-error rounded-none bg-transparent focus:outline-none focus:border-primary-950 placeholder:text-text-600";
212
+ }
213
+ if (actualState === "read-only" && variant === "underlined") {
214
+ return "border-0 border-b-0 rounded-none bg-transparent focus:outline-none !text-text-900 cursor-default";
215
+ }
216
+ return `${stateClasses} ${variantClasses}`;
217
+ };
218
+ var Input = (0, import_react2.forwardRef)(
219
+ ({
220
+ label,
221
+ helperText,
222
+ errorMessage,
223
+ size = "medium",
224
+ variant = "outlined",
225
+ state = "default",
226
+ iconLeft,
227
+ iconRight,
228
+ className = "",
229
+ containerClassName = "",
230
+ disabled,
231
+ readOnly,
232
+ required,
233
+ id,
234
+ type = "text",
235
+ ...props
236
+ }, ref) => {
237
+ const [showPassword, setShowPassword] = (0, import_react2.useState)(false);
238
+ const isPasswordType = type === "password";
239
+ const actualType = isPasswordType && showPassword ? "text" : type;
240
+ const actualState = getActualState(disabled, readOnly, errorMessage, state);
241
+ const sizeClasses = SIZE_CLASSES[size];
242
+ const combinedClasses = (0, import_react2.useMemo)(
243
+ () => getCombinedClasses(actualState, variant),
244
+ [actualState, variant]
245
+ );
246
+ const iconSize = getIconSize(size);
247
+ const baseClasses = `bg-background w-full py-2 ${actualState === "read-only" ? "px-0" : "px-3"} font-normal text-text-900 focus:outline-primary-950`;
248
+ const generatedId = (0, import_react2.useId)();
249
+ const inputId = id ?? `input-${generatedId}`;
250
+ const togglePasswordVisibility = () => setShowPassword(!showPassword);
251
+ const { shouldShowPasswordToggle, actualIconRight, ariaLabel } = getPasswordToggleConfig(
252
+ type,
253
+ disabled,
254
+ readOnly,
255
+ showPassword,
256
+ iconRight
257
+ );
258
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `${containerClassName}`, children: [
259
+ label && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
260
+ "label",
261
+ {
262
+ htmlFor: inputId,
263
+ className: `block font-bold text-text-900 mb-1.5 ${sizeClasses}`,
264
+ children: [
265
+ label,
266
+ " ",
267
+ required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-indicator-error", children: "*" })
268
+ ]
269
+ }
270
+ ),
271
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative", children: [
272
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
273
+ "span",
274
+ {
275
+ className: `${iconSize} text-text-400 flex items-center justify-center`,
276
+ children: iconLeft
277
+ }
278
+ ) }),
279
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
280
+ "input",
281
+ {
282
+ ref,
283
+ id: inputId,
284
+ type: actualType,
285
+ className: `${baseClasses} ${sizeClasses} ${combinedClasses} ${iconLeft ? "pl-10" : ""} ${actualIconRight ? "pr-10" : ""} ${className}`,
286
+ disabled,
287
+ readOnly,
288
+ required,
289
+ "aria-invalid": actualState === "error" ? "true" : void 0,
290
+ ...props
291
+ }
292
+ ),
293
+ actualIconRight && (shouldShowPasswordToggle ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
294
+ "button",
295
+ {
296
+ type: "button",
297
+ className: "absolute right-3 top-1/2 transform -translate-y-1/2 cursor-pointer border-0 bg-transparent p-0",
298
+ onClick: togglePasswordVisibility,
299
+ "aria-label": ariaLabel,
300
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
301
+ "span",
302
+ {
303
+ className: `${iconSize} text-text-400 flex items-center justify-center hover:text-text-600 transition-colors`,
304
+ children: actualIconRight
305
+ }
306
+ )
307
+ }
308
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
309
+ "span",
310
+ {
311
+ className: `${iconSize} text-text-400 flex items-center justify-center`,
312
+ children: actualIconRight
313
+ }
314
+ ) }))
315
+ ] }),
316
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
317
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
318
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
319
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_phosphor_react.WarningCircle, { size: 16 }),
320
+ " ",
321
+ errorMessage
322
+ ] })
323
+ ] })
324
+ ] });
325
+ }
326
+ );
327
+ var Input_default = Input;
328
+
329
+ // src/components/TextArea/TextArea.tsx
330
+ var import_react3 = require("react");
331
+ var import_phosphor_react2 = require("phosphor-react");
332
+ var import_jsx_runtime4 = require("react/jsx-runtime");
333
+ var SIZE_CLASSES2 = {
334
+ small: {
335
+ textarea: "h-24 text-sm",
336
+ // 96px height, 14px font
337
+ textSize: "sm"
338
+ },
339
+ medium: {
340
+ textarea: "h-24 text-base",
341
+ // 96px height, 16px font
342
+ textSize: "md"
343
+ },
344
+ large: {
345
+ textarea: "h-24 text-lg",
346
+ // 96px height, 18px font
347
+ textSize: "lg"
348
+ },
349
+ extraLarge: {
350
+ textarea: "h-24 text-xl",
351
+ // 96px height, 20px font
352
+ textSize: "xl"
353
+ }
354
+ };
355
+ var BASE_TEXTAREA_CLASSES = "w-full box-border p-3 bg-background border border-solid rounded-[4px] resize-none focus:outline-none font-roboto font-normal leading-[150%] placeholder:text-text-600 transition-all duration-200";
356
+ var STATE_CLASSES2 = {
357
+ default: {
358
+ base: "border-border-300 bg-background text-text-600",
359
+ hover: "hover:border-border-400",
360
+ focus: "focus:border-border-500"
361
+ },
362
+ hovered: {
363
+ base: "border-border-400 bg-background text-text-600",
364
+ hover: "",
365
+ focus: "focus:border-border-500"
366
+ },
367
+ focused: {
368
+ base: "border-2 border-primary-950 bg-background text-text-900",
369
+ hover: "",
370
+ focus: ""
371
+ },
372
+ invalid: {
373
+ base: "border-2 border-red-700 bg-white text-gray-800",
374
+ hover: "hover:border-red-700",
375
+ focus: "focus:border-red-700"
376
+ },
377
+ disabled: {
378
+ base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
379
+ hover: "",
380
+ focus: ""
381
+ }
382
+ };
383
+ var TextArea = (0, import_react3.forwardRef)(
384
+ ({
385
+ label,
386
+ size = "medium",
387
+ state = "default",
388
+ errorMessage,
389
+ helperMessage,
390
+ className = "",
391
+ labelClassName = "",
392
+ disabled,
393
+ id,
394
+ onChange,
395
+ placeholder,
396
+ required,
397
+ showCharacterCount = false,
398
+ maxLength,
399
+ value,
400
+ ...props
401
+ }, ref) => {
402
+ const generatedId = (0, import_react3.useId)();
403
+ const inputId = id ?? `textarea-${generatedId}`;
404
+ const [isFocused, setIsFocused] = (0, import_react3.useState)(false);
405
+ const currentLength = typeof value === "string" ? value.length : 0;
406
+ const isNearLimit = maxLength && currentLength >= maxLength * 0.8;
407
+ const handleChange = (event) => {
408
+ onChange?.(event);
409
+ };
410
+ const handleFocus = (event) => {
411
+ setIsFocused(true);
412
+ props.onFocus?.(event);
413
+ };
414
+ const handleBlur = (event) => {
415
+ setIsFocused(false);
416
+ props.onBlur?.(event);
417
+ };
418
+ let currentState = disabled ? "disabled" : state;
419
+ if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
420
+ currentState = "focused";
421
+ }
422
+ const sizeClasses = SIZE_CLASSES2[size];
423
+ const stateClasses = STATE_CLASSES2[currentState];
424
+ const textareaClasses = cn(
425
+ BASE_TEXTAREA_CLASSES,
426
+ sizeClasses.textarea,
427
+ stateClasses.base,
428
+ stateClasses.hover,
429
+ stateClasses.focus,
430
+ className
431
+ );
432
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `flex flex-col`, children: [
433
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
434
+ Text_default,
435
+ {
436
+ as: "label",
437
+ htmlFor: inputId,
438
+ size: sizeClasses.textSize,
439
+ weight: "medium",
440
+ color: "text-text-950",
441
+ className: cn("mb-1.5", labelClassName),
442
+ children: [
443
+ label,
444
+ " ",
445
+ required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-indicator-error", children: "*" })
446
+ ]
447
+ }
448
+ ),
449
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
450
+ "textarea",
451
+ {
452
+ ref,
453
+ id: inputId,
454
+ disabled,
455
+ onChange: handleChange,
456
+ onFocus: handleFocus,
457
+ onBlur: handleBlur,
458
+ className: textareaClasses,
459
+ placeholder,
460
+ required,
461
+ maxLength,
462
+ value,
463
+ ...props
464
+ }
465
+ ),
466
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error mt-1.5", children: [
467
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.WarningCircle, { size: 16 }),
468
+ " ",
469
+ errorMessage
470
+ ] }),
471
+ !errorMessage && showCharacterCount && maxLength && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
472
+ Text_default,
473
+ {
474
+ size: "sm",
475
+ weight: "normal",
476
+ className: `mt-1.5 ${isNearLimit ? "text-indicator-warning" : "text-text-500"}`,
477
+ children: [
478
+ currentLength,
479
+ "/",
480
+ maxLength,
481
+ " caracteres"
482
+ ]
483
+ }
484
+ ),
485
+ !errorMessage && helperMessage && !(showCharacterCount && maxLength) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text_default, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
486
+ ] });
487
+ }
488
+ );
489
+ TextArea.displayName = "TextArea";
490
+ var TextArea_default = TextArea;
491
+
492
+ // src/components/Button/Button.tsx
493
+ var import_jsx_runtime5 = require("react/jsx-runtime");
494
+ var VARIANT_ACTION_CLASSES = {
495
+ solid: {
496
+ primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
497
+ positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
498
+ negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
499
+ },
500
+ outline: {
501
+ primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
502
+ positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
503
+ negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
504
+ },
505
+ link: {
506
+ primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
507
+ positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
508
+ negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
509
+ }
510
+ };
511
+ var SIZE_CLASSES3 = {
512
+ "extra-small": "text-xs px-3.5 py-2",
513
+ small: "text-sm px-4 py-2.5",
514
+ medium: "text-md px-5 py-2.5",
515
+ large: "text-lg px-6 py-3",
516
+ "extra-large": "text-lg px-7 py-3.5"
517
+ };
518
+ var Button = ({
519
+ children,
520
+ iconLeft,
521
+ iconRight,
522
+ size = "medium",
523
+ variant = "solid",
524
+ action = "primary",
525
+ className = "",
526
+ disabled,
527
+ type = "button",
528
+ ...props
529
+ }) => {
530
+ const sizeClasses = SIZE_CLASSES3[size];
531
+ const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
532
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
533
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
534
+ "button",
535
+ {
536
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
537
+ disabled,
538
+ type,
539
+ ...props,
540
+ children: [
541
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
542
+ children,
543
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
544
+ ]
545
+ }
546
+ );
547
+ };
548
+ var Button_default = Button;
549
+
550
+ // src/components/Select/Select.tsx
551
+ var import_zustand = require("zustand");
552
+ var import_react4 = require("react");
553
+ var import_phosphor_react3 = require("phosphor-react");
554
+ var import_jsx_runtime6 = require("react/jsx-runtime");
555
+ var VARIANT_CLASSES2 = {
556
+ outlined: "border-2 rounded-lg focus:border-primary-950",
557
+ underlined: "border-b-2 focus:border-primary-950",
558
+ rounded: "border-2 rounded-full focus:border-primary-950"
559
+ };
560
+ var SIZE_CLASSES4 = {
561
+ small: "text-sm",
562
+ medium: "text-md",
563
+ large: "text-lg",
564
+ "extra-large": "text-lg"
565
+ };
566
+ var HEIGHT_CLASSES = {
567
+ small: "h-8",
568
+ medium: "h-9",
569
+ large: "h-10",
570
+ "extra-large": "h-12"
571
+ };
572
+ var PADDING_CLASSES = {
573
+ small: "px-2 py-1",
574
+ medium: "px-3 py-2",
575
+ large: "px-4 py-3",
576
+ "extra-large": "px-5 py-4"
577
+ };
578
+ var SIDE_CLASSES = {
579
+ top: "bottom-full -translate-y-1",
580
+ right: "top-full translate-y-1",
581
+ bottom: "top-full translate-y-1",
582
+ left: "top-full translate-y-1"
583
+ };
584
+ var ALIGN_CLASSES = {
585
+ start: "left-0",
586
+ center: "left-1/2 -translate-x-1/2",
587
+ end: "right-0"
588
+ };
589
+ function createSelectStore(onValueChange) {
590
+ return (0, import_zustand.create)((set) => ({
591
+ open: false,
592
+ setOpen: (open) => set({ open }),
593
+ value: "",
594
+ setValue: (value) => set({ value }),
595
+ selectedLabel: "",
596
+ setSelectedLabel: (label) => set({ selectedLabel: label }),
597
+ onValueChange
598
+ }));
599
+ }
600
+ var useSelectStore = (externalStore) => {
601
+ if (!externalStore) {
602
+ throw new Error(
603
+ "Component must be used within a Select (store is missing)"
604
+ );
605
+ }
606
+ return externalStore;
607
+ };
608
+ function getLabelAsNode(children) {
609
+ if (typeof children === "string" || typeof children === "number") {
610
+ return children;
611
+ }
612
+ const flattened = import_react4.Children.toArray(children);
613
+ if (flattened.length === 1) return flattened[0];
614
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: flattened });
615
+ }
616
+ var injectStore = (children, store, size, selectId) => {
617
+ return import_react4.Children.map(children, (child) => {
618
+ if ((0, import_react4.isValidElement)(child)) {
619
+ const typedChild = child;
620
+ const newProps = {
621
+ store
622
+ };
623
+ if (typedChild.type === SelectTrigger) {
624
+ newProps.size = size;
625
+ newProps.selectId = selectId;
626
+ }
627
+ if (typedChild.props.children) {
628
+ newProps.children = injectStore(
629
+ typedChild.props.children,
630
+ store,
631
+ size,
632
+ selectId
633
+ );
634
+ }
635
+ return (0, import_react4.cloneElement)(typedChild, newProps);
636
+ }
637
+ return child;
638
+ });
639
+ };
640
+ var Select = ({
641
+ children,
642
+ defaultValue = "",
643
+ className,
644
+ value: propValue,
645
+ onValueChange,
646
+ size = "small",
647
+ label,
648
+ helperText,
649
+ errorMessage,
650
+ id
651
+ }) => {
652
+ const storeRef = (0, import_react4.useRef)(null);
653
+ storeRef.current ??= createSelectStore(onValueChange);
654
+ const store = storeRef.current;
655
+ const selectRef = (0, import_react4.useRef)(null);
656
+ const { open, setOpen, setValue, selectedLabel } = (0, import_zustand.useStore)(store, (s) => s);
657
+ const generatedId = (0, import_react4.useId)();
658
+ const selectId = id ?? `select-${generatedId}`;
659
+ const findLabelForValue = (children2, targetValue) => {
660
+ let found = null;
661
+ const search = (nodes) => {
662
+ import_react4.Children.forEach(nodes, (child) => {
663
+ if (!(0, import_react4.isValidElement)(child)) return;
664
+ const typedChild = child;
665
+ if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
666
+ if (typeof typedChild.props.children === "string")
667
+ found = typedChild.props.children;
668
+ }
669
+ if (typedChild.props.children && !found)
670
+ search(typedChild.props.children);
671
+ });
672
+ };
673
+ search(children2);
674
+ return found;
675
+ };
676
+ (0, import_react4.useEffect)(() => {
677
+ if (!selectedLabel && defaultValue) {
678
+ const label2 = findLabelForValue(children, defaultValue);
679
+ if (label2) store.setState({ selectedLabel: label2 });
680
+ }
681
+ }, [children, defaultValue, selectedLabel]);
682
+ (0, import_react4.useEffect)(() => {
683
+ const handleClickOutside = (event) => {
684
+ if (selectRef.current && !selectRef.current.contains(event.target)) {
685
+ setOpen(false);
686
+ }
687
+ };
688
+ const handleArrowKeys = (event) => {
689
+ const selectContent = selectRef.current?.querySelector('[role="menu"]');
690
+ if (selectContent) {
691
+ event.preventDefault();
692
+ const items = Array.from(
693
+ selectContent.querySelectorAll(
694
+ '[role="menuitem"]:not([aria-disabled="true"])'
695
+ )
696
+ ).filter((el) => el instanceof HTMLElement);
697
+ const focused = document.activeElement;
698
+ const currentIndex = items.findIndex((item) => item === focused);
699
+ let nextIndex = 0;
700
+ if (event.key === "ArrowDown") {
701
+ nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
702
+ } else {
703
+ nextIndex = currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length;
704
+ }
705
+ items[nextIndex]?.focus();
706
+ }
707
+ };
708
+ if (open) {
709
+ document.addEventListener("mousedown", handleClickOutside);
710
+ document.addEventListener("keydown", handleArrowKeys);
711
+ }
712
+ return () => {
713
+ document.removeEventListener("mousedown", handleClickOutside);
714
+ document.removeEventListener("keydown", handleArrowKeys);
715
+ };
716
+ }, [open]);
717
+ (0, import_react4.useEffect)(() => {
718
+ if (propValue) {
719
+ setValue(propValue);
720
+ const label2 = findLabelForValue(children, propValue);
721
+ if (label2) store.setState({ selectedLabel: label2 });
722
+ }
723
+ }, [propValue]);
724
+ const sizeClasses = SIZE_CLASSES4[size];
725
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("w-full", className), children: [
726
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
727
+ "label",
728
+ {
729
+ htmlFor: selectId,
730
+ className: cn("block font-bold text-text-900 mb-1.5", sizeClasses),
731
+ children: label
732
+ }
733
+ ),
734
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore(children, store, size, selectId) }),
735
+ (helperText || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
736
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
737
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
738
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react3.WarningCircle, { size: 16 }),
739
+ " ",
740
+ errorMessage
741
+ ] })
742
+ ] })
743
+ ] });
744
+ };
745
+ var SelectValue = ({
746
+ placeholder,
747
+ store: externalStore
748
+ }) => {
749
+ const store = useSelectStore(externalStore);
750
+ const selectedLabel = (0, import_zustand.useStore)(store, (s) => s.selectedLabel);
751
+ const value = (0, import_zustand.useStore)(store, (s) => s.value);
752
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
753
+ };
754
+ var SelectTrigger = (0, import_react4.forwardRef)(
755
+ ({
756
+ className,
757
+ invalid = false,
758
+ variant = "outlined",
759
+ store: externalStore,
760
+ disabled,
761
+ size = "medium",
762
+ selectId,
763
+ ...props
764
+ }, ref) => {
765
+ const store = useSelectStore(externalStore);
766
+ const open = (0, import_zustand.useStore)(store, (s) => s.open);
767
+ const toggleOpen = () => store.setState({ open: !open });
768
+ const variantClasses = VARIANT_CLASSES2[variant];
769
+ const heightClasses = HEIGHT_CLASSES[size];
770
+ const paddingClasses = PADDING_CLASSES[size];
771
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
772
+ "button",
773
+ {
774
+ ref,
775
+ id: selectId,
776
+ className: cn(
777
+ "flex w-full items-center justify-between border-border-300",
778
+ heightClasses,
779
+ paddingClasses,
780
+ invalid && `${variant == "underlined" ? "border-b-2" : "border-2"} border-indicator-error text-text-600`,
781
+ disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground",
782
+ !invalid && !disabled ? "text-text-700" : "",
783
+ variantClasses,
784
+ className
785
+ ),
786
+ onClick: toggleOpen,
787
+ "aria-expanded": open,
788
+ "aria-haspopup": "listbox",
789
+ "aria-controls": open ? "select-content" : void 0,
790
+ ...props,
791
+ children: [
792
+ props.children,
793
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
794
+ import_phosphor_react3.CaretDown,
795
+ {
796
+ className: cn(
797
+ "h-[1em] w-[1em] opacity-50 transition-transform",
798
+ open ? "rotate-180" : ""
799
+ )
800
+ }
801
+ )
802
+ ]
803
+ }
804
+ );
805
+ }
806
+ );
807
+ SelectTrigger.displayName = "SelectTrigger";
808
+ var SelectContent = (0, import_react4.forwardRef)(
809
+ ({
810
+ children,
811
+ className,
812
+ align = "start",
813
+ side = "bottom",
814
+ store: externalStore,
815
+ ...props
816
+ }, ref) => {
817
+ const store = useSelectStore(externalStore);
818
+ const open = (0, import_zustand.useStore)(store, (s) => s.open);
819
+ if (!open) return null;
820
+ const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES[side]} ${ALIGN_CLASSES[align]}`;
821
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
822
+ "div",
823
+ {
824
+ role: "menu",
825
+ ref,
826
+ className: cn(
827
+ "bg-secondary z-50 min-w-[210px] max-h-[300px] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md border-border-100",
828
+ getPositionClasses(),
829
+ className
830
+ ),
831
+ ...props,
832
+ children
833
+ }
834
+ );
835
+ }
836
+ );
837
+ SelectContent.displayName = "SelectContent";
838
+ var SelectItem = (0, import_react4.forwardRef)(
839
+ ({
840
+ className,
841
+ children,
842
+ value,
843
+ disabled = false,
844
+ store: externalStore,
845
+ ...props
846
+ }, ref) => {
847
+ const store = useSelectStore(externalStore);
848
+ const {
849
+ value: selectedValue,
850
+ setValue,
851
+ setOpen,
852
+ setSelectedLabel,
853
+ onValueChange
854
+ } = (0, import_zustand.useStore)(store, (s) => s);
855
+ const handleClick = (e) => {
856
+ const labelNode = getLabelAsNode(children);
857
+ if (!disabled) {
858
+ setValue(value);
859
+ setSelectedLabel(labelNode);
860
+ setOpen(false);
861
+ onValueChange?.(value);
862
+ }
863
+ props.onClick?.(e);
864
+ };
865
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
866
+ "div",
867
+ {
868
+ role: "menuitem",
869
+ "aria-disabled": disabled,
870
+ ref,
871
+ className: `
872
+ bg-secondary focus-visible:bg-background-50
873
+ relative flex select-none items-center gap-2 rounded-sm p-3 outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0
874
+ ${className}
875
+ ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
876
+ ${selectedValue === value && "bg-background-50"}
877
+ `,
878
+ onClick: handleClick,
879
+ onKeyDown: (e) => {
880
+ if (e.key === "Enter" || e.key === " ") handleClick(e);
881
+ },
882
+ tabIndex: disabled ? -1 : 0,
883
+ ...props,
884
+ children: [
885
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react3.Check, { className: "" }) }),
886
+ children
887
+ ]
888
+ }
889
+ );
890
+ }
891
+ );
892
+ SelectItem.displayName = "SelectItem";
893
+ var Select_default = Select;
894
+
895
+ // src/components/Badge/Badge.tsx
896
+ var import_phosphor_react4 = require("phosphor-react");
897
+ var import_jsx_runtime7 = require("react/jsx-runtime");
898
+ var VARIANT_ACTION_CLASSES2 = {
899
+ solid: {
900
+ error: "bg-error-background text-error-700 focus-visible:outline-none",
901
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
902
+ success: "bg-success text-success-800 focus-visible:outline-none",
903
+ info: "bg-info text-info-800 focus-visible:outline-none",
904
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
905
+ },
906
+ outlined: {
907
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
908
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
909
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
910
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
911
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
912
+ },
913
+ exams: {
914
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
915
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
916
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
917
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
918
+ },
919
+ examsOutlined: {
920
+ exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
921
+ exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
922
+ exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
923
+ exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
924
+ },
925
+ resultStatus: {
926
+ negative: "bg-error text-error-800 focus-visible:outline-none",
927
+ positive: "bg-success text-success-800 focus-visible:outline-none"
928
+ },
929
+ notification: "text-primary"
930
+ };
931
+ var SIZE_CLASSES5 = {
932
+ small: "text-2xs px-2 py-1",
933
+ medium: "text-xs px-2 py-1",
934
+ large: "text-sm px-2 py-1"
935
+ };
936
+ var SIZE_CLASSES_ICON = {
937
+ small: "size-3",
938
+ medium: "size-3.5",
939
+ large: "size-4"
940
+ };
941
+ var Badge = ({
942
+ children,
943
+ iconLeft,
944
+ iconRight,
945
+ size = "medium",
946
+ variant = "solid",
947
+ action = "error",
948
+ className = "",
949
+ notificationActive = false,
950
+ ...props
951
+ }) => {
952
+ const sizeClasses = SIZE_CLASSES5[size];
953
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
954
+ const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
955
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
956
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
957
+ const baseClassesIcon = "flex items-center";
958
+ if (variant === "notification") {
959
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
960
+ "div",
961
+ {
962
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
963
+ ...props,
964
+ children: [
965
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react4.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
966
+ notificationActive && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
967
+ "span",
968
+ {
969
+ "data-testid": "notification-dot",
970
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
971
+ }
972
+ )
973
+ ]
974
+ }
975
+ );
976
+ }
977
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
978
+ "div",
979
+ {
980
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
981
+ ...props,
982
+ children: [
983
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
984
+ children,
985
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
986
+ ]
987
+ }
988
+ );
989
+ };
990
+ var Badge_default = Badge;
991
+
992
+ // src/components/Skeleton/Skeleton.tsx
993
+ var import_react5 = require("react");
994
+ var import_jsx_runtime8 = require("react/jsx-runtime");
995
+ var SKELETON_ANIMATION_CLASSES = {
996
+ pulse: "animate-pulse",
997
+ none: ""
998
+ };
999
+ var SKELETON_VARIANT_CLASSES = {
1000
+ text: "h-4 bg-background-200 rounded",
1001
+ circular: "bg-background-200 rounded-full",
1002
+ rectangular: "bg-background-200",
1003
+ rounded: "bg-background-200 rounded-lg"
1004
+ };
1005
+ var SPACING_CLASSES = {
1006
+ none: "",
1007
+ small: "space-y-1",
1008
+ medium: "space-y-2",
1009
+ large: "space-y-3"
1010
+ };
1011
+ var Skeleton = (0, import_react5.forwardRef)(
1012
+ ({
1013
+ variant = "text",
1014
+ width,
1015
+ height,
1016
+ animation = "pulse",
1017
+ lines = 1,
1018
+ spacing = "none",
1019
+ className = "",
1020
+ children,
1021
+ ...props
1022
+ }, ref) => {
1023
+ const animationClass = SKELETON_ANIMATION_CLASSES[animation];
1024
+ const variantClass = SKELETON_VARIANT_CLASSES[variant];
1025
+ const spacingClass = SPACING_CLASSES[spacing];
1026
+ const style = {
1027
+ width: typeof width === "number" ? `${width}px` : width,
1028
+ height: typeof height === "number" ? `${height}px` : height
1029
+ };
1030
+ if (variant === "text" && lines > 1) {
1031
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1032
+ "div",
1033
+ {
1034
+ ref,
1035
+ className: cn("flex flex-col", spacingClass, className),
1036
+ ...props,
1037
+ children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1038
+ "div",
1039
+ {
1040
+ className: cn(variantClass, animationClass),
1041
+ style: index === lines - 1 ? { width: "60%" } : void 0
1042
+ },
1043
+ index
1044
+ ))
1045
+ }
1046
+ );
1047
+ }
1048
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1049
+ "div",
1050
+ {
1051
+ ref,
1052
+ className: cn(variantClass, animationClass, className),
1053
+ style,
1054
+ ...props,
1055
+ children
1056
+ }
1057
+ );
1058
+ }
1059
+ );
1060
+ var SkeletonText = (0, import_react5.forwardRef)(
1061
+ (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { ref, variant: "text", ...props })
1062
+ );
1063
+ var SkeletonCircle = (0, import_react5.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { ref, variant: "circular", ...props }));
1064
+ var SkeletonRectangle = (0, import_react5.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
1065
+ var SkeletonRounded = (0, import_react5.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
1066
+ var SkeletonCard = (0, import_react5.forwardRef)(
1067
+ ({
1068
+ showAvatar = true,
1069
+ showTitle = true,
1070
+ showDescription = true,
1071
+ showActions = true,
1072
+ lines = 2,
1073
+ className = "",
1074
+ ...props
1075
+ }, ref) => {
1076
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1077
+ "div",
1078
+ {
1079
+ ref,
1080
+ className: cn(
1081
+ "w-full p-4 bg-background border border-border-200 rounded-lg",
1082
+ className
1083
+ ),
1084
+ ...props,
1085
+ children: [
1086
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-start space-x-3", children: [
1087
+ showAvatar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonCircle, { width: 40, height: 40 }),
1088
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex-1 space-y-2", children: [
1089
+ showTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonText, { width: "60%", height: 20 }),
1090
+ showDescription && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonText, { lines, spacing: "small" })
1091
+ ] })
1092
+ ] }),
1093
+ showActions && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex justify-end space-x-2 mt-4", children: [
1094
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonRectangle, { width: 80, height: 32 }),
1095
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonRectangle, { width: 80, height: 32 })
1096
+ ] })
1097
+ ]
1098
+ }
1099
+ );
1100
+ }
1101
+ );
1102
+ var SkeletonList = (0, import_react5.forwardRef)(
1103
+ ({
1104
+ items = 3,
1105
+ showAvatar = true,
1106
+ showTitle = true,
1107
+ showDescription = true,
1108
+ lines = 1,
1109
+ className = "",
1110
+ ...props
1111
+ }, ref) => {
1112
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-start space-x-3 p-3", children: [
1113
+ showAvatar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonCircle, { width: 32, height: 32 }),
1114
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex-1 space-y-2", children: [
1115
+ showTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonText, { width: "40%", height: 16 }),
1116
+ showDescription && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonText, { lines, spacing: "small" })
1117
+ ] })
1118
+ ] }, index)) });
1119
+ }
1120
+ );
1121
+ var SkeletonTable = (0, import_react5.forwardRef)(
1122
+ ({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
1123
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref, className: cn("w-full", className), ...props, children: [
1124
+ showHeader && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1125
+ SkeletonText,
1126
+ {
1127
+ width: `${100 / columns}%`,
1128
+ height: 20
1129
+ },
1130
+ index
1131
+ )) }),
1132
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1133
+ SkeletonText,
1134
+ {
1135
+ width: `${100 / columns}%`,
1136
+ height: 16
1137
+ },
1138
+ colIndex
1139
+ )) }, rowIndex)) })
1140
+ ] });
1141
+ }
1142
+ );
1143
+
1144
+ // src/components/Toast/Toast.tsx
1145
+ var import_phosphor_react5 = require("phosphor-react");
1146
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1147
+ var VARIANT_ACTION_CLASSES3 = {
1148
+ solid: {
1149
+ warning: "bg-warning text-warning-600 border-none focus-visible:outline-none",
1150
+ success: "bg-success text-success-800 border-none focus-visible:outline-none",
1151
+ info: "bg-info text-info-600 border-none focus-visible:outline-none"
1152
+ },
1153
+ outlined: {
1154
+ warning: "bg-warning text-warning-600 border border-warning-300 focus-visible:outline-none",
1155
+ success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
1156
+ info: "bg-info text-info-600 border border-info-600 focus-visible:outline-none"
1157
+ }
1158
+ };
1159
+ var iconMap = {
1160
+ success: import_phosphor_react5.CheckCircle,
1161
+ info: import_phosphor_react5.Info,
1162
+ warning: import_phosphor_react5.WarningCircle
1163
+ };
1164
+ var Toast = ({
1165
+ variant = "outlined",
1166
+ action = "success",
1167
+ className = "",
1168
+ onClose,
1169
+ title,
1170
+ description,
1171
+ position = "default",
1172
+ ...props
1173
+ }) => {
1174
+ const variantClasses = VARIANT_ACTION_CLASSES3[variant][action];
1175
+ const positionClasses = {
1176
+ "top-left": "fixed top-4 left-4",
1177
+ "top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
1178
+ "top-right": "fixed top-4 right-4",
1179
+ "bottom-left": "fixed bottom-4 left-4",
1180
+ "bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
1181
+ "bottom-right": "fixed bottom-4 right-4",
1182
+ default: ""
1183
+ };
1184
+ const IconAction = iconMap[action] || iconMap["success"];
1185
+ const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
1186
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1187
+ "div",
1188
+ {
1189
+ role: "alert",
1190
+ "aria-live": "assertive",
1191
+ "aria-atomic": "true",
1192
+ className: cn(
1193
+ baseClasses,
1194
+ positionClasses[position],
1195
+ variantClasses,
1196
+ className
1197
+ ),
1198
+ ...props,
1199
+ children: [
1200
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-row items-start gap-3", children: [
1201
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconAction, {}) }),
1202
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-start justify-start", children: [
1203
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "font-semibold text-md", children: title }),
1204
+ description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-md text-text-900", children: description })
1205
+ ] })
1206
+ ] }),
1207
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1208
+ "button",
1209
+ {
1210
+ onClick: onClose,
1211
+ "aria-label": "Dismiss notification",
1212
+ className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
1213
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_phosphor_react5.X, {})
1214
+ }
1215
+ )
1216
+ ]
1217
+ }
1218
+ );
1219
+ };
1220
+ var Toast_default = Toast;
1221
+
1222
+ // src/components/Menu/Menu.tsx
1223
+ var import_zustand2 = require("zustand");
1224
+ var import_react6 = require("react");
1225
+ var import_phosphor_react6 = require("phosphor-react");
1226
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1227
+ var createMenuStore = (onValueChange) => (0, import_zustand2.create)((set) => ({
1228
+ value: "",
1229
+ setValue: (value) => {
1230
+ set({ value });
1231
+ onValueChange?.(value);
1232
+ },
1233
+ onValueChange
1234
+ }));
1235
+ var useMenuStore = (externalStore) => {
1236
+ if (!externalStore) throw new Error("MenuItem must be inside Menu");
1237
+ return externalStore;
1238
+ };
1239
+ var VARIANT_CLASSES3 = {
1240
+ menu: "bg-background shadow-soft-shadow-1 px-6",
1241
+ menu2: "",
1242
+ "menu-overflow": "",
1243
+ breadcrumb: "bg-transparent shadow-none !px-0"
1244
+ };
1245
+ var Menu = (0, import_react6.forwardRef)(
1246
+ ({
1247
+ className,
1248
+ children,
1249
+ defaultValue,
1250
+ value: propValue,
1251
+ variant = "menu",
1252
+ onValueChange,
1253
+ ...props
1254
+ }, ref) => {
1255
+ const storeRef = (0, import_react6.useRef)(null);
1256
+ storeRef.current ??= createMenuStore(onValueChange);
1257
+ const store = storeRef.current;
1258
+ const { setValue } = (0, import_zustand2.useStore)(store, (s) => s);
1259
+ (0, import_react6.useEffect)(() => {
1260
+ setValue(propValue ?? defaultValue);
1261
+ }, [defaultValue, propValue, setValue]);
1262
+ const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
1263
+ const variantClasses = VARIANT_CLASSES3[variant];
1264
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1265
+ "div",
1266
+ {
1267
+ ref,
1268
+ className: `
1269
+ ${baseClasses}
1270
+ ${variantClasses}
1271
+ ${className ?? ""}
1272
+ `,
1273
+ ...props,
1274
+ children: injectStore2(children, store)
1275
+ }
1276
+ );
1277
+ }
1278
+ );
1279
+ Menu.displayName = "Menu";
1280
+ var MenuContent = (0, import_react6.forwardRef)(
1281
+ ({ className, children, variant = "menu", ...props }, ref) => {
1282
+ const baseClasses = "w-full flex flex-row items-center gap-2";
1283
+ const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
1284
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1285
+ "ul",
1286
+ {
1287
+ ref,
1288
+ className: `
1289
+ ${baseClasses}
1290
+ ${variantClasses}
1291
+ ${variant == "breadcrumb" ? "flex-wrap" : ""}
1292
+ ${className ?? ""}
1293
+ `,
1294
+ style: variant === "menu2" || variant === "menu-overflow" ? { scrollbarWidth: "none", msOverflowStyle: "none" } : void 0,
1295
+ ...props,
1296
+ children
1297
+ }
1298
+ );
1299
+ }
1300
+ );
1301
+ MenuContent.displayName = "MenuContent";
1302
+ var MenuItem = (0, import_react6.forwardRef)(
1303
+ ({
1304
+ className,
1305
+ children,
1306
+ value,
1307
+ disabled = false,
1308
+ store: externalStore,
1309
+ variant = "menu",
1310
+ separator = false,
1311
+ ...props
1312
+ }, ref) => {
1313
+ const store = useMenuStore(externalStore);
1314
+ const { value: selectedValue, setValue } = (0, import_zustand2.useStore)(store, (s) => s);
1315
+ const handleClick = (e) => {
1316
+ if (!disabled) {
1317
+ setValue(value);
1318
+ }
1319
+ props.onClick?.(e);
1320
+ };
1321
+ const commonProps = {
1322
+ role: "menuitem",
1323
+ "aria-disabled": disabled,
1324
+ ref,
1325
+ onClick: handleClick,
1326
+ onKeyDown: (e) => {
1327
+ if (["Enter", " "].includes(e.key)) handleClick(e);
1328
+ },
1329
+ tabIndex: disabled ? -1 : 0,
1330
+ onMouseDown: (e) => {
1331
+ e.preventDefault();
1332
+ },
1333
+ ...props
1334
+ };
1335
+ const variants = {
1336
+ menu: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1337
+ "li",
1338
+ {
1339
+ "data-variant": "menu",
1340
+ className: `
1341
+ w-full flex flex-col items-center justify-center gap-0.5 py-1 px-2 rounded-sm font-medium text-xs
1342
+ [&>svg]:size-6 cursor-pointer hover:bg-primary-600 hover:text-text
1343
+ focus:outline-none focus:border-indicator-info focus:border-2
1344
+ ${selectedValue === value ? "bg-primary-50 text-primary-950" : "text-text-950"}
1345
+ ${className ?? ""}
1346
+ `,
1347
+ ...commonProps,
1348
+ children
1349
+ }
1350
+ ),
1351
+ menu2: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1352
+ "li",
1353
+ {
1354
+ "data-variant": "menu2",
1355
+ className: `
1356
+ w-full flex flex-col items-center px-2 pt-4 gap-3 cursor-pointer focus:rounded-sm justify-center hover:bg-background-100 rounded-lg
1357
+ focus:outline-none focus:border-indicator-info focus:border-2
1358
+ ${selectedValue === value ? "" : "pb-4"}
1359
+ `,
1360
+ ...commonProps,
1361
+ children: [
1362
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1363
+ "span",
1364
+ {
1365
+ className: cn(
1366
+ "flex flex-row items-center gap-2 px-4 text-text-950 text-xs font-bold",
1367
+ className
1368
+ ),
1369
+ children
1370
+ }
1371
+ ),
1372
+ selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
1373
+ ]
1374
+ }
1375
+ ),
1376
+ "menu-overflow": /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1377
+ "li",
1378
+ {
1379
+ "data-variant": "menu-overflow",
1380
+ className: `
1381
+ w-fit flex flex-col items-center px-2 pt-4 gap-3 cursor-pointer focus:rounded-sm justify-center hover:bg-background-100 rounded-lg
1382
+ focus:outline-none focus:border-indicator-info focus:border-2
1383
+ ${selectedValue === value ? "" : "pb-4"}
1384
+ `,
1385
+ ...commonProps,
1386
+ children: [
1387
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1388
+ "span",
1389
+ {
1390
+ className: cn(
1391
+ "flex flex-row items-center gap-2 px-4 text-text-950 text-xs font-bold",
1392
+ className
1393
+ ),
1394
+ children
1395
+ }
1396
+ ),
1397
+ selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
1398
+ ]
1399
+ }
1400
+ ),
1401
+ breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1402
+ "li",
1403
+ {
1404
+ "data-variant": "breadcrumb",
1405
+ className: `
1406
+ flex flex-row gap-2 items-center w-fit p-2 rounded-lg hover:text-primary-600 cursor-pointer font-bold text-xs
1407
+ focus:outline-none focus:border-indicator-info focus:border-2
1408
+ ${selectedValue === value ? "text-text-950" : "text-text-600"}
1409
+ ${className ?? ""}
1410
+ `,
1411
+ ...commonProps,
1412
+ children: [
1413
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1414
+ "span",
1415
+ {
1416
+ className: cn(
1417
+ "border-b border-text-600 hover:border-primary-600 text-inherit text-xs",
1418
+ selectedValue === value ? "border-b-0 font-bold" : "border-b-text-600"
1419
+ ),
1420
+ children
1421
+ }
1422
+ ),
1423
+ separator && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1424
+ import_phosphor_react6.CaretRight,
1425
+ {
1426
+ size: 16,
1427
+ className: "text-text-600",
1428
+ "data-testid": "separator"
1429
+ }
1430
+ )
1431
+ ]
1432
+ }
1433
+ )
1434
+ };
1435
+ return variants[variant] ?? variants["menu"];
1436
+ }
1437
+ );
1438
+ MenuItem.displayName = "MenuItem";
1439
+ var injectStore2 = (children, store) => import_react6.Children.map(children, (child) => {
1440
+ if (!(0, import_react6.isValidElement)(child)) return child;
1441
+ const typedChild = child;
1442
+ const shouldInject = typedChild.type === MenuItem;
1443
+ return (0, import_react6.cloneElement)(typedChild, {
1444
+ ...shouldInject ? { store } : {},
1445
+ ...typedChild.props.children ? { children: injectStore2(typedChild.props.children, store) } : {}
1446
+ });
1447
+ });
1448
+ var Menu_default = Menu;
1449
+
1450
+ // src/components/Support/schema/index.ts
1451
+ var import_zod = require("zod");
1452
+ var supportSchema = import_zod.z.object({
1453
+ // Tipo de problema selecionado
1454
+ problemType: import_zod.z.enum(["tecnico", "acesso", "outros"], {
1455
+ // istanbul ignore next - errorMap é testado em runtime pelo zod real
1456
+ errorMap: (
1457
+ /* istanbul ignore next */
1458
+ () => ({
1459
+ message: "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar."
1460
+ })
1461
+ )
1462
+ }),
1463
+ // Título do problema
1464
+ title: import_zod.z.string().min(1, "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar.").min(5, "T\xEDtulo deve ter pelo menos 5 caracteres").max(100, "T\xEDtulo deve ter no m\xE1ximo 100 caracteres").trim(),
1465
+ // Descrição do problema
1466
+ description: import_zod.z.string().min(1, "Campo obrigat\xF3rio! Por favor, preencha este campo para continuar.").min(10, "Descri\xE7\xE3o deve ter pelo menos 10 caracteres").max(1e3, "Descri\xE7\xE3o deve ter no m\xE1ximo 1000 caracteres").trim()
1467
+ });
1468
+
1469
+ // src/components/Support/components/TicketModal.tsx
1470
+ var import_react9 = require("react");
1471
+ var import_dayjs = __toESM(require("dayjs"));
1472
+ var import_pt_br = require("dayjs/locale/pt-br");
1473
+
1474
+ // src/components/Divider/Divider.tsx
1475
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1476
+ var Divider = ({
1477
+ orientation = "horizontal",
1478
+ className = "",
1479
+ ...props
1480
+ }) => {
1481
+ const baseClasses = "bg-border-200 border-0";
1482
+ const orientationClasses = {
1483
+ horizontal: "w-full h-px",
1484
+ vertical: "h-full w-px"
1485
+ };
1486
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1487
+ "hr",
1488
+ {
1489
+ className: cn(baseClasses, orientationClasses[orientation], className),
1490
+ "aria-orientation": orientation,
1491
+ ...props
1492
+ }
1493
+ );
1494
+ };
1495
+ var Divider_default = Divider;
1496
+
1497
+ // src/components/Modal/Modal.tsx
1498
+ var import_react7 = require("react");
1499
+ var import_phosphor_react7 = require("phosphor-react");
1500
+
1501
+ // src/components/Modal/utils/videoUtils.ts
1502
+ var isYouTubeUrl = (url) => {
1503
+ const youtubeRegex = /^(https?:\/\/)?((www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/.+/i;
1504
+ return youtubeRegex.test(url);
1505
+ };
1506
+ var isValidYouTubeHost = (host) => {
1507
+ if (host === "youtu.be") return "youtu.be";
1508
+ const isValidYouTubeCom = host === "youtube.com" || host.endsWith(".youtube.com") && /^(www|m|music)\.youtube\.com$/.test(host);
1509
+ if (isValidYouTubeCom) return "youtube";
1510
+ const isValidNoCookie = host === "youtube-nocookie.com" || host.endsWith(".youtube-nocookie.com") && /^(www|m|music)\.youtube-nocookie\.com$/.test(host);
1511
+ if (isValidNoCookie) return "nocookie";
1512
+ return null;
1513
+ };
1514
+ var extractYoutuBeId = (pathname) => {
1515
+ const firstSeg = pathname.split("/").filter(Boolean)[0];
1516
+ return firstSeg || null;
1517
+ };
1518
+ var extractYouTubeId = (pathname, searchParams) => {
1519
+ const parts = pathname.split("/").filter(Boolean);
1520
+ const [first, second] = parts;
1521
+ if (first === "embed" && second) return second;
1522
+ if (first === "shorts" && second) return second;
1523
+ if (first === "live" && second) return second;
1524
+ const v = searchParams.get("v");
1525
+ if (v) return v;
1526
+ return null;
1527
+ };
1528
+ var getYouTubeVideoId = (url) => {
1529
+ try {
1530
+ const u = new URL(url);
1531
+ const hostType = isValidYouTubeHost(u.hostname.toLowerCase());
1532
+ if (!hostType) return null;
1533
+ if (hostType === "youtu.be") {
1534
+ return extractYoutuBeId(u.pathname);
1535
+ }
1536
+ return extractYouTubeId(u.pathname, u.searchParams);
1537
+ } catch {
1538
+ return null;
1539
+ }
1540
+ };
1541
+ var getYouTubeEmbedUrl = (videoId) => {
1542
+ return `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0&modestbranding=1`;
1543
+ };
1544
+
1545
+ // src/components/Modal/Modal.tsx
1546
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1547
+ var SIZE_CLASSES6 = {
1548
+ xs: "max-w-[360px]",
1549
+ sm: "max-w-[420px]",
1550
+ md: "max-w-[510px]",
1551
+ lg: "max-w-[640px]",
1552
+ xl: "max-w-[970px]"
1553
+ };
1554
+ var Modal = ({
1555
+ isOpen,
1556
+ onClose,
1557
+ title,
1558
+ children,
1559
+ size = "md",
1560
+ className = "",
1561
+ closeOnEscape = true,
1562
+ footer,
1563
+ hideCloseButton = false,
1564
+ variant = "default",
1565
+ description,
1566
+ image,
1567
+ imageAlt,
1568
+ actionLink,
1569
+ actionLabel,
1570
+ contentClassName = ""
1571
+ }) => {
1572
+ const titleId = (0, import_react7.useId)();
1573
+ (0, import_react7.useEffect)(() => {
1574
+ if (!isOpen || !closeOnEscape) return;
1575
+ const handleEscape = (event) => {
1576
+ if (event.key === "Escape") {
1577
+ onClose();
1578
+ }
1579
+ };
1580
+ document.addEventListener("keydown", handleEscape);
1581
+ return () => document.removeEventListener("keydown", handleEscape);
1582
+ }, [isOpen, closeOnEscape, onClose]);
1583
+ (0, import_react7.useEffect)(() => {
1584
+ if (!isOpen) return;
1585
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
1586
+ const originalOverflow = document.body.style.overflow;
1587
+ const originalPaddingRight = document.body.style.paddingRight;
1588
+ document.body.style.overflow = "hidden";
1589
+ if (scrollbarWidth > 0) {
1590
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
1591
+ const overlay = document.createElement("div");
1592
+ overlay.id = "modal-scrollbar-overlay";
1593
+ overlay.style.cssText = `
1594
+ position: fixed;
1595
+ top: 0;
1596
+ right: 0;
1597
+ width: ${scrollbarWidth}px;
1598
+ height: 100vh;
1599
+ background-color: rgb(0 0 0 / 0.6);
1600
+ z-index: 40;
1601
+ pointer-events: none;
1602
+ `;
1603
+ document.body.appendChild(overlay);
1604
+ }
1605
+ return () => {
1606
+ document.body.style.overflow = originalOverflow;
1607
+ document.body.style.paddingRight = originalPaddingRight;
1608
+ const overlay = document.getElementById("modal-scrollbar-overlay");
1609
+ if (overlay) {
1610
+ overlay.remove();
1611
+ }
1612
+ };
1613
+ }, [isOpen]);
1614
+ if (!isOpen) return null;
1615
+ const sizeClasses = SIZE_CLASSES6[size];
1616
+ const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
1617
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
1618
+ const modalClasses = cn(
1619
+ baseClasses,
1620
+ sizeClasses,
1621
+ dialogResetClasses,
1622
+ className
1623
+ );
1624
+ const normalizeUrl = (href) => /^https?:\/\//i.test(href) ? href : `https://${href}`;
1625
+ const handleActionClick = () => {
1626
+ if (actionLink) {
1627
+ window.open(normalizeUrl(actionLink), "_blank", "noopener,noreferrer");
1628
+ }
1629
+ };
1630
+ if (variant === "activity") {
1631
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1632
+ "dialog",
1633
+ {
1634
+ className: modalClasses,
1635
+ "aria-labelledby": titleId,
1636
+ "aria-modal": "true",
1637
+ open: true,
1638
+ children: [
1639
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1640
+ "button",
1641
+ {
1642
+ onClick: onClose,
1643
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
1644
+ "aria-label": "Fechar modal",
1645
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react7.X, { size: 18 })
1646
+ }
1647
+ ) }),
1648
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
1649
+ image && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1650
+ "img",
1651
+ {
1652
+ src: image,
1653
+ alt: imageAlt ?? "",
1654
+ className: "w-[122px] h-[122px] object-contain"
1655
+ }
1656
+ ) }),
1657
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1658
+ "h2",
1659
+ {
1660
+ id: titleId,
1661
+ className: "text-lg font-semibold text-text-950 text-center",
1662
+ children: title
1663
+ }
1664
+ ),
1665
+ description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
1666
+ actionLink && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-full", children: [
1667
+ (() => {
1668
+ const normalized = normalizeUrl(actionLink);
1669
+ const isYT = isYouTubeUrl(normalized);
1670
+ if (!isYT) return null;
1671
+ const id = getYouTubeVideoId(normalized);
1672
+ if (!id) {
1673
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1674
+ Button_default,
1675
+ {
1676
+ variant: "solid",
1677
+ action: "primary",
1678
+ size: "large",
1679
+ className: "w-full",
1680
+ onClick: handleActionClick,
1681
+ children: actionLabel || "Iniciar Atividade"
1682
+ }
1683
+ );
1684
+ }
1685
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1686
+ "iframe",
1687
+ {
1688
+ src: getYouTubeEmbedUrl(id),
1689
+ className: "w-full aspect-video rounded-lg",
1690
+ allowFullScreen: true,
1691
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
1692
+ title: "V\xEDdeo YouTube"
1693
+ }
1694
+ );
1695
+ })(),
1696
+ !isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1697
+ Button_default,
1698
+ {
1699
+ variant: "solid",
1700
+ action: "primary",
1701
+ size: "large",
1702
+ className: "w-full",
1703
+ onClick: handleActionClick,
1704
+ children: actionLabel || "Iniciar Atividade"
1705
+ }
1706
+ )
1707
+ ] })
1708
+ ] })
1709
+ ]
1710
+ }
1711
+ ) });
1712
+ }
1713
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1714
+ "dialog",
1715
+ {
1716
+ className: modalClasses,
1717
+ "aria-labelledby": titleId,
1718
+ "aria-modal": "true",
1719
+ open: true,
1720
+ children: [
1721
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
1722
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
1723
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1724
+ "button",
1725
+ {
1726
+ onClick: onClose,
1727
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
1728
+ "aria-label": "Fechar modal",
1729
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react7.X, { size: 18 })
1730
+ }
1731
+ )
1732
+ ] }),
1733
+ children && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn("px-6 pb-6", contentClassName), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
1734
+ footer && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
1735
+ ]
1736
+ }
1737
+ ) });
1738
+ };
1739
+ var Modal_default = Modal;
1740
+
1741
+ // src/types/support.ts
1742
+ var getStatusBadgeAction = (status) => {
1743
+ switch (status) {
1744
+ case "aberto" /* ABERTO */:
1745
+ return "success";
1746
+ case "respondido" /* RESPONDIDO */:
1747
+ return "warning";
1748
+ case "encerrado" /* ENCERRADO */:
1749
+ return "info";
1750
+ default:
1751
+ return "info";
1752
+ }
1753
+ };
1754
+ var getStatusText = (status) => {
1755
+ switch (status) {
1756
+ case "aberto" /* ABERTO */:
1757
+ return "Aberto";
1758
+ case "respondido" /* RESPONDIDO */:
1759
+ return "Respondido";
1760
+ case "encerrado" /* ENCERRADO */:
1761
+ return "Encerrado";
1762
+ default:
1763
+ return status;
1764
+ }
1765
+ };
1766
+ var getCategoryText = (category) => {
1767
+ if (!category) return "";
1768
+ switch (category) {
1769
+ case "acesso" /* ACESSO */:
1770
+ return "Acesso";
1771
+ case "tecnico" /* TECNICO */:
1772
+ return "T\xE9cnico";
1773
+ case "outros" /* OUTROS */:
1774
+ return "Outros";
1775
+ default:
1776
+ return category;
1777
+ }
1778
+ };
1779
+ var mapApiStatusToInternal = (apiStatus) => {
1780
+ switch (apiStatus) {
1781
+ case "ABERTO":
1782
+ return "aberto" /* ABERTO */;
1783
+ case "PENDENTE":
1784
+ return "respondido" /* RESPONDIDO */;
1785
+ case "FECHADO":
1786
+ return "encerrado" /* ENCERRADO */;
1787
+ default:
1788
+ return "aberto" /* ABERTO */;
1789
+ }
1790
+ };
1791
+ var mapInternalStatusToApi = (internalStatus) => {
1792
+ switch (internalStatus) {
1793
+ case "aberto" /* ABERTO */:
1794
+ return "ABERTO";
1795
+ case "respondido" /* RESPONDIDO */:
1796
+ return "PENDENTE";
1797
+ case "encerrado" /* ENCERRADO */:
1798
+ return "FECHADO";
1799
+ default:
1800
+ return "ABERTO";
1801
+ }
1802
+ };
1803
+
1804
+ // src/components/Support/utils/supportUtils.tsx
1805
+ var import_react8 = require("@phosphor-icons/react");
1806
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1807
+ var getCategoryIcon = (category, size = 16) => {
1808
+ if (!category) return null;
1809
+ switch (category) {
1810
+ case "acesso" /* ACESSO */:
1811
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react8.KeyIcon, { size });
1812
+ case "tecnico" /* TECNICO */:
1813
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react8.BugIcon, { size });
1814
+ case "outros" /* OUTROS */:
1815
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react8.InfoIcon, { size });
1816
+ default:
1817
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react8.InfoIcon, { size });
1818
+ }
1819
+ };
1820
+
1821
+ // src/components/Support/components/TicketModal.tsx
1822
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1823
+ import_dayjs.default.locale("pt-br");
1824
+ var AnswerSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "bg-background p-4 space-y-6 rounded-xl", children: [
1825
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
1826
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkeletonText, { width: "80px", height: 16 }),
1827
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkeletonText, { width: "200px", height: 16 })
1828
+ ] }),
1829
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Divider_default, {}),
1830
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start space-x-6", children: [
1831
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkeletonText, { width: "80px", height: 16 }),
1832
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex-1 space-y-2", children: [
1833
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkeletonText, { width: "100%", height: 16 }),
1834
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkeletonText, { width: "80%", height: 16 }),
1835
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkeletonText, { width: "60%", height: 16 })
1836
+ ] })
1837
+ ] })
1838
+ ] });
1839
+ var TicketModal = ({
1840
+ ticket,
1841
+ isOpen,
1842
+ onClose,
1843
+ onTicketClose,
1844
+ apiClient,
1845
+ userId
1846
+ }) => {
1847
+ const [showCloseConfirmation, setShowCloseConfirmation] = (0, import_react9.useState)(false);
1848
+ const [responseText, setResponseText] = (0, import_react9.useState)("");
1849
+ const [answers, setAnswers] = (0, import_react9.useState)([]);
1850
+ const [isSubmittingAnswer, setIsSubmittingAnswer] = (0, import_react9.useState)(false);
1851
+ const [isLoadingAnswers, setIsLoadingAnswers] = (0, import_react9.useState)(false);
1852
+ const handleCloseTicket = () => {
1853
+ onTicketClose?.(ticket.id);
1854
+ setShowCloseConfirmation(false);
1855
+ onClose();
1856
+ };
1857
+ const fetchAnswers = (0, import_react9.useCallback)(async () => {
1858
+ if (!ticket.id || ticket.status !== "respondido" /* RESPONDIDO */) return;
1859
+ setIsLoadingAnswers(true);
1860
+ try {
1861
+ const response = await apiClient.get(
1862
+ `/support/answer/${ticket.id}`
1863
+ );
1864
+ setAnswers(response.data.data || []);
1865
+ } catch (error) {
1866
+ console.error("Erro ao buscar respostas:", error);
1867
+ setAnswers([]);
1868
+ } finally {
1869
+ setIsLoadingAnswers(false);
1870
+ }
1871
+ }, [ticket.id, ticket.status, apiClient]);
1872
+ const handleSubmitAnswer = async () => {
1873
+ if (!responseText.trim() || !userId || !ticket.id) {
1874
+ return;
1875
+ }
1876
+ setIsSubmittingAnswer(true);
1877
+ try {
1878
+ const requestData = {
1879
+ userId,
1880
+ supportId: ticket.id,
1881
+ answer: responseText.trim()
1882
+ };
1883
+ await apiClient.post(
1884
+ "/support/answer",
1885
+ requestData
1886
+ );
1887
+ setResponseText("");
1888
+ await fetchAnswers();
1889
+ } catch (error) {
1890
+ console.error("Erro ao enviar resposta:", error);
1891
+ } finally {
1892
+ setIsSubmittingAnswer(false);
1893
+ }
1894
+ };
1895
+ const canCloseTicket = ticket.status !== "encerrado" /* ENCERRADO */;
1896
+ (0, import_react9.useEffect)(() => {
1897
+ if (isOpen) {
1898
+ setResponseText("");
1899
+ (async () => {
1900
+ await fetchAnswers();
1901
+ })().catch((error) => {
1902
+ console.error("Erro ao carregar respostas:", error);
1903
+ });
1904
+ } else {
1905
+ setAnswers([]);
1906
+ }
1907
+ }, [isOpen, fetchAnswers]);
1908
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
1909
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1910
+ Modal_default,
1911
+ {
1912
+ isOpen,
1913
+ onClose,
1914
+ title: `Pedido: ${ticket.title}`,
1915
+ size: "lg",
1916
+ hideCloseButton: false,
1917
+ closeOnEscape: true,
1918
+ "data-testid": "ticket-modal",
1919
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col h-full max-h-[80vh]", children: [
1920
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex justify-between items-center mb-3", children: [
1921
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950", children: "Detalhes" }),
1922
+ canCloseTicket && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1923
+ Button_default,
1924
+ {
1925
+ variant: "outline",
1926
+ size: "small",
1927
+ action: "negative",
1928
+ onClick: () => setShowCloseConfirmation(true),
1929
+ children: "Encerrar Pedido"
1930
+ }
1931
+ )
1932
+ ] }),
1933
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex-1 overflow-y-auto pr-2 space-y-6", children: [
1934
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "bg-background p-4 space-y-6 rounded-xl", children: [
1935
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
1936
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1937
+ Text_default,
1938
+ {
1939
+ size: "md",
1940
+ weight: "semibold",
1941
+ className: "text-text-700 w-20",
1942
+ children: "ID"
1943
+ }
1944
+ ),
1945
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "normal", className: "text-text-600", children: ticket.id })
1946
+ ] }),
1947
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
1948
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1949
+ Text_default,
1950
+ {
1951
+ size: "md",
1952
+ weight: "semibold",
1953
+ className: "text-text-700 w-20",
1954
+ children: "Aberto em"
1955
+ }
1956
+ ),
1957
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "normal", className: "text-text-600", children: (0, import_dayjs.default)(ticket.createdAt).format("DD MMMM YYYY, [\xE0s] HH[h]") })
1958
+ ] }),
1959
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
1960
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1961
+ Text_default,
1962
+ {
1963
+ size: "md",
1964
+ weight: "semibold",
1965
+ className: "text-text-700 w-20",
1966
+ children: "Status"
1967
+ }
1968
+ ),
1969
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1970
+ Badge_default,
1971
+ {
1972
+ variant: "solid",
1973
+ size: "small",
1974
+ action: getStatusBadgeAction(ticket.status),
1975
+ className: "w-fit",
1976
+ children: getStatusText(ticket.status)
1977
+ }
1978
+ )
1979
+ ] }),
1980
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
1981
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1982
+ Text_default,
1983
+ {
1984
+ size: "md",
1985
+ weight: "semibold",
1986
+ className: "text-text-700 w-20",
1987
+ children: "Tipo"
1988
+ }
1989
+ ),
1990
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1991
+ Badge_default,
1992
+ {
1993
+ variant: "solid",
1994
+ size: "small",
1995
+ action: "muted",
1996
+ className: "w-fit",
1997
+ children: [
1998
+ getCategoryIcon(ticket.category),
1999
+ getCategoryText(ticket.category)
2000
+ ]
2001
+ }
2002
+ )
2003
+ ] }),
2004
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Divider_default, {}),
2005
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start space-x-6", children: [
2006
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2007
+ Text_default,
2008
+ {
2009
+ size: "md",
2010
+ weight: "semibold",
2011
+ className: "text-text-700 w-20",
2012
+ children: "Descri\xE7\xE3o"
2013
+ }
2014
+ ),
2015
+ ticket.description && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "normal", className: "text-text-600", children: ticket.description })
2016
+ ] })
2017
+ ] }),
2018
+ ticket.status === "respondido" /* RESPONDIDO */ && isLoadingAnswers && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2019
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950 my-6", children: "Resposta de Suporte T\xE9cnico" }),
2020
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AnswerSkeleton, {})
2021
+ ] }),
2022
+ !isLoadingAnswers && answers.some((answer) => answer.userId !== userId) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2023
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950 my-6", children: "Resposta de Suporte T\xE9cnico" }),
2024
+ answers.filter((answer) => answer.userId !== userId).sort(
2025
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
2026
+ ).slice(0, 1).map((answer) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2027
+ "div",
2028
+ {
2029
+ className: "bg-background p-4 space-y-6 rounded-xl",
2030
+ children: [
2031
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
2032
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2033
+ Text_default,
2034
+ {
2035
+ size: "md",
2036
+ weight: "semibold",
2037
+ className: "text-text-700 w-20",
2038
+ children: "Recebido"
2039
+ }
2040
+ ),
2041
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2042
+ Text_default,
2043
+ {
2044
+ size: "md",
2045
+ weight: "normal",
2046
+ className: "text-text-600",
2047
+ children: (0, import_dayjs.default)(answer.createdAt).format(
2048
+ "DD MMMM YYYY, [\xE0s] HH[h]"
2049
+ )
2050
+ }
2051
+ )
2052
+ ] }),
2053
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Divider_default, {}),
2054
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start space-x-6", children: [
2055
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2056
+ Text_default,
2057
+ {
2058
+ size: "md",
2059
+ weight: "semibold",
2060
+ className: "text-text-700 w-20",
2061
+ children: "Resposta"
2062
+ }
2063
+ ),
2064
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2065
+ Text_default,
2066
+ {
2067
+ size: "md",
2068
+ weight: "normal",
2069
+ className: "text-text-600",
2070
+ children: answer.answer
2071
+ }
2072
+ )
2073
+ ] })
2074
+ ]
2075
+ },
2076
+ answer.id
2077
+ ))
2078
+ ] }),
2079
+ !isLoadingAnswers && answers.some((answer) => answer.userId === userId) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2080
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-950 my-6", children: "Resposta enviada" }),
2081
+ answers.filter((answer) => answer.userId === userId).sort(
2082
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
2083
+ ).slice(0, 1).map((answer) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2084
+ "div",
2085
+ {
2086
+ className: "bg-background p-4 space-y-6 rounded-xl",
2087
+ children: [
2088
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center space-x-6", children: [
2089
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2090
+ Text_default,
2091
+ {
2092
+ size: "md",
2093
+ weight: "semibold",
2094
+ className: "text-text-700 w-20",
2095
+ children: "Enviada"
2096
+ }
2097
+ ),
2098
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2099
+ Text_default,
2100
+ {
2101
+ size: "md",
2102
+ weight: "normal",
2103
+ className: "text-text-600",
2104
+ children: (0, import_dayjs.default)(answer.createdAt).format(
2105
+ "DD MMMM YYYY, [\xE0s] HH[h]"
2106
+ )
2107
+ }
2108
+ )
2109
+ ] }),
2110
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Divider_default, {}),
2111
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start space-x-6", children: [
2112
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2113
+ Text_default,
2114
+ {
2115
+ size: "md",
2116
+ weight: "semibold",
2117
+ className: "text-text-700 w-20",
2118
+ children: "Resposta"
2119
+ }
2120
+ ),
2121
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2122
+ Text_default,
2123
+ {
2124
+ size: "md",
2125
+ weight: "normal",
2126
+ className: "text-text-600",
2127
+ children: answer.answer
2128
+ }
2129
+ )
2130
+ ] })
2131
+ ]
2132
+ },
2133
+ answer.id
2134
+ ))
2135
+ ] }),
2136
+ !isLoadingAnswers && answers.some((answer) => answer.userId !== userId) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2137
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 my-6", children: "Responder" }),
2138
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-4", children: [
2139
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2140
+ TextArea_default,
2141
+ {
2142
+ placeholder: "Detalhe o problema aqui.",
2143
+ rows: 4,
2144
+ className: "w-full",
2145
+ value: responseText,
2146
+ onChange: (e) => setResponseText(e.target.value)
2147
+ }
2148
+ ),
2149
+ responseText.trim().length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2150
+ Button_default,
2151
+ {
2152
+ variant: "solid",
2153
+ size: "medium",
2154
+ onClick: handleSubmitAnswer,
2155
+ disabled: isSubmittingAnswer,
2156
+ children: isSubmittingAnswer ? "Enviando..." : "Enviar"
2157
+ }
2158
+ ) })
2159
+ ] })
2160
+ ] })
2161
+ ] })
2162
+ ] })
2163
+ }
2164
+ ),
2165
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2166
+ Modal_default,
2167
+ {
2168
+ isOpen: showCloseConfirmation,
2169
+ onClose: () => setShowCloseConfirmation(false),
2170
+ title: "Encerrar pedido?",
2171
+ size: "md",
2172
+ hideCloseButton: false,
2173
+ closeOnEscape: true,
2174
+ "data-testid": "close-ticket-modal",
2175
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-6", children: [
2176
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "sm", weight: "normal", className: "text-text-700", children: "Ao encerrar este pedido, ele ser\xE1 fechado e n\xE3o poder\xE1 mais ser atualizado." }),
2177
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex gap-3 justify-end", children: [
2178
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2179
+ Button_default,
2180
+ {
2181
+ variant: "outline",
2182
+ size: "medium",
2183
+ onClick: () => setShowCloseConfirmation(false),
2184
+ children: "Cancelar"
2185
+ }
2186
+ ),
2187
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2188
+ Button_default,
2189
+ {
2190
+ variant: "solid",
2191
+ size: "medium",
2192
+ action: "negative",
2193
+ onClick: handleCloseTicket,
2194
+ children: "Encerrar"
2195
+ }
2196
+ )
2197
+ ] })
2198
+ ] })
2199
+ }
2200
+ )
2201
+ ] });
2202
+ };
2203
+
2204
+ // src/assets/img/suporthistory.png
2205
+ var suporthistory_default = "../suporthistory-W5LBGAUP.png";
2206
+
2207
+ // src/components/Support/Support.tsx
2208
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2209
+ var TicketCard = ({
2210
+ ticket,
2211
+ onTicketClick
2212
+ }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2213
+ "button",
2214
+ {
2215
+ type: "button",
2216
+ className: "flex items-center justify-between p-4 bg-background rounded-xl cursor-pointer w-full text-left hover:bg-background-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",
2217
+ onClick: () => onTicketClick(ticket),
2218
+ children: [
2219
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { size: "xs", weight: "bold", className: "text-text-900", children: ticket.title }) }),
2220
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-3", children: [
2221
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2222
+ Badge_default,
2223
+ {
2224
+ variant: "solid",
2225
+ className: "flex items-center gap-1",
2226
+ action: getStatusBadgeAction(ticket.status),
2227
+ children: getStatusText(ticket.status)
2228
+ }
2229
+ ),
2230
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Badge_default, { variant: "solid", className: "flex items-center gap-1", action: "muted", children: [
2231
+ getCategoryIcon(ticket.category, 18),
2232
+ getCategoryText(ticket.category)
2233
+ ] }),
2234
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.CaretRightIcon, { size: 24, className: "text-text-800" })
2235
+ ] })
2236
+ ]
2237
+ },
2238
+ ticket.id
2239
+ );
2240
+ var TicketGroup = ({
2241
+ date,
2242
+ tickets,
2243
+ onTicketClick
2244
+ }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
2245
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { size: "md", weight: "bold", className: "text-text-900", children: (0, import_dayjs2.default)(date).format("DD MMM YYYY") }),
2246
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-3", children: tickets.map((ticket) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2247
+ TicketCard,
2248
+ {
2249
+ ticket,
2250
+ onTicketClick
2251
+ },
2252
+ ticket.id
2253
+ )) })
2254
+ ] }, date);
2255
+ var EmptyState = ({ imageSrc }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-row justify-center items-center mt-48", children: [
2256
+ imageSrc && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: imageSrc, alt: "Imagem de suporte" }),
2257
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { size: "3xl", weight: "semibold", children: "Nenhum pedido encontrado." })
2258
+ ] });
2259
+ var TicketSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-6", children: [0, 1].map((groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
2260
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkeletonText, { width: "150px", height: 20 }),
2261
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-3", children: [0, 1].map((ticketIndex) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2262
+ SkeletonRounded,
2263
+ {
2264
+ width: "100%",
2265
+ height: 72,
2266
+ className: "p-4"
2267
+ },
2268
+ ticketIndex
2269
+ )) })
2270
+ ] }, groupIndex)) });
2271
+ var Support = ({
2272
+ apiClient,
2273
+ userId,
2274
+ emptyStateImage,
2275
+ title = "Suporte",
2276
+ onTicketCreated,
2277
+ onTicketClosed
2278
+ }) => {
2279
+ const [activeTab, setActiveTab] = (0, import_react10.useState)("criar-pedido");
2280
+ const [selectedProblem, setSelectedProblem] = (0, import_react10.useState)(null);
2281
+ const [statusFilter, setStatusFilter] = (0, import_react10.useState)("todos");
2282
+ const [categoryFilter, setCategoryFilter] = (0, import_react10.useState)("todos");
2283
+ const [selectedTicket, setSelectedTicket] = (0, import_react10.useState)(
2284
+ null
2285
+ );
2286
+ const [isModalOpen, setIsModalOpen] = (0, import_react10.useState)(false);
2287
+ const [submitError, setSubmitError] = (0, import_react10.useState)(null);
2288
+ const [showSuccessToast, setShowSuccessToast] = (0, import_react10.useState)(false);
2289
+ const [showCloseSuccessToast, setShowCloseSuccessToast] = (0, import_react10.useState)(false);
2290
+ const [showCloseErrorToast, setShowCloseErrorToast] = (0, import_react10.useState)(false);
2291
+ const [allTickets, setAllTickets] = (0, import_react10.useState)([]);
2292
+ const [loadingTickets, setLoadingTickets] = (0, import_react10.useState)(false);
2293
+ const [currentPage, setCurrentPage] = (0, import_react10.useState)(1);
2294
+ const ITEMS_PER_PAGE = 10;
2295
+ const handlePrevPage = () => {
2296
+ if (currentPage > 1) {
2297
+ setCurrentPage(currentPage - 1);
2298
+ }
2299
+ };
2300
+ const handleNextPage = () => {
2301
+ const totalPages2 = Math.ceil(filteredTickets.length / ITEMS_PER_PAGE);
2302
+ if (currentPage < totalPages2) {
2303
+ setCurrentPage(currentPage + 1);
2304
+ }
2305
+ };
2306
+ (0, import_react10.useEffect)(() => {
2307
+ if (activeTab === "historico") {
2308
+ fetchTickets(statusFilter);
2309
+ setCurrentPage(1);
2310
+ }
2311
+ }, [activeTab, statusFilter]);
2312
+ (0, import_react10.useEffect)(() => {
2313
+ setCurrentPage(1);
2314
+ }, [categoryFilter]);
2315
+ const convertApiTicketToComponent = (apiTicket) => {
2316
+ return {
2317
+ id: apiTicket.id,
2318
+ title: apiTicket.subject,
2319
+ status: mapApiStatusToInternal(apiTicket.status),
2320
+ createdAt: apiTicket.createdAt,
2321
+ category: apiTicket.type,
2322
+ description: apiTicket.description
2323
+ };
2324
+ };
2325
+ const filteredTickets = allTickets.map(convertApiTicketToComponent).filter((ticket) => {
2326
+ const categoryMatch = categoryFilter === "todos" || ticket.category === categoryFilter;
2327
+ return categoryMatch;
2328
+ }).sort(
2329
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
2330
+ );
2331
+ const totalPages = Math.ceil(filteredTickets.length / ITEMS_PER_PAGE);
2332
+ const startIndex = (currentPage - 1) * ITEMS_PER_PAGE;
2333
+ const endIndex = startIndex + ITEMS_PER_PAGE;
2334
+ const paginatedTickets = filteredTickets.slice(startIndex, endIndex);
2335
+ const groupedTickets = paginatedTickets.reduce(
2336
+ (groups, ticket) => {
2337
+ const date = (0, import_dayjs2.default)(ticket.createdAt).format("YYYY-MM-DD");
2338
+ if (!groups[date]) {
2339
+ groups[date] = [];
2340
+ }
2341
+ groups[date].push(ticket);
2342
+ return groups;
2343
+ },
2344
+ {}
2345
+ );
2346
+ const {
2347
+ register,
2348
+ handleSubmit,
2349
+ setValue,
2350
+ reset,
2351
+ formState: { errors, isSubmitting }
2352
+ } = (0, import_react_hook_form.useForm)({
2353
+ resolver: (0, import_zod2.zodResolver)(supportSchema),
2354
+ defaultValues: {
2355
+ problemType: void 0,
2356
+ title: "",
2357
+ description: ""
2358
+ }
2359
+ });
2360
+ const fetchTickets = async (status) => {
2361
+ setLoadingTickets(true);
2362
+ try {
2363
+ const params = new URLSearchParams({
2364
+ page: "1",
2365
+ limit: "100"
2366
+ // Buscar o máximo permitido pela API
2367
+ });
2368
+ if (status && status !== "todos") {
2369
+ const apiStatus = mapInternalStatusToApi(status);
2370
+ params.append("status", apiStatus);
2371
+ }
2372
+ const response = await apiClient.get(
2373
+ `/support?${params.toString()}`
2374
+ );
2375
+ setAllTickets(response.data.data.support);
2376
+ } catch (error) {
2377
+ console.error("Erro ao buscar tickets:", error);
2378
+ setAllTickets([]);
2379
+ } finally {
2380
+ setLoadingTickets(false);
2381
+ }
2382
+ };
2383
+ const handleProblemSelection = (type) => {
2384
+ setSelectedProblem(type);
2385
+ if (type) {
2386
+ setValue("problemType", type, { shouldValidate: true });
2387
+ }
2388
+ };
2389
+ const onSubmit = async (data) => {
2390
+ setSubmitError(null);
2391
+ try {
2392
+ const requestData = {
2393
+ subject: data.title,
2394
+ description: data.description,
2395
+ type: data.problemType
2396
+ };
2397
+ await apiClient.post(
2398
+ "/support",
2399
+ requestData
2400
+ );
2401
+ setShowSuccessToast(true);
2402
+ setTimeout(() => setShowSuccessToast(false), 4e3);
2403
+ setSelectedProblem(null);
2404
+ reset();
2405
+ setActiveTab("historico");
2406
+ fetchTickets(statusFilter);
2407
+ onTicketCreated?.();
2408
+ } catch (error) {
2409
+ console.error("Erro ao criar ticket de suporte:", error);
2410
+ setSubmitError("Erro ao criar ticket. Tente novamente.");
2411
+ }
2412
+ };
2413
+ const handleTicketClick = (ticket) => {
2414
+ setSelectedTicket(ticket);
2415
+ setIsModalOpen(true);
2416
+ };
2417
+ const handleModalClose = () => {
2418
+ setIsModalOpen(false);
2419
+ setSelectedTicket(null);
2420
+ };
2421
+ const handleTicketClose = async (ticketId) => {
2422
+ try {
2423
+ await apiClient.patch(`/support/${ticketId}`, {
2424
+ status: mapInternalStatusToApi("encerrado" /* ENCERRADO */)
2425
+ });
2426
+ setShowCloseSuccessToast(true);
2427
+ setTimeout(() => setShowCloseSuccessToast(false), 4e3);
2428
+ if (activeTab === "historico") {
2429
+ fetchTickets(statusFilter);
2430
+ }
2431
+ onTicketClosed?.();
2432
+ } catch (error) {
2433
+ console.error("Erro ao encerrar ticket:", error);
2434
+ setShowCloseErrorToast(true);
2435
+ setTimeout(() => setShowCloseErrorToast(false), 4e3);
2436
+ }
2437
+ };
2438
+ const problemTypes = [
2439
+ {
2440
+ id: "tecnico" /* TECNICO */,
2441
+ title: "T\xE9cnico",
2442
+ icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.BugIcon, { size: 24 })
2443
+ },
2444
+ {
2445
+ id: "acesso" /* ACESSO */,
2446
+ title: "Acesso",
2447
+ icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.KeyIcon, { size: 24 })
2448
+ },
2449
+ {
2450
+ id: "outros" /* OUTROS */,
2451
+ title: "Outros",
2452
+ icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.InfoIcon, { size: 24 })
2453
+ }
2454
+ ];
2455
+ const emptyImage = emptyStateImage || suporthistory_default;
2456
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col w-full h-full relative justify-start items-center mb-5 overflow-y-auto", children: [
2457
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col w-full h-full max-w-[992px] z-10 lg:px-0 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
2458
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex w-full mb-4 flex-row items-center justify-between not-lg:gap-4 lg:gap-6", children: [
2459
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { className: "font-bold leading-[28px] tracking-[0.2px] text-text-950 text-xl mt-4 sm:text-2xl sm:flex-1 sm:self-end sm:mt-0", children: title }),
2460
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sm:flex-shrink-0 sm:self-end", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2461
+ Menu_default,
2462
+ {
2463
+ value: activeTab,
2464
+ defaultValue: "criar-pedido",
2465
+ variant: "menu2",
2466
+ onValueChange: (value) => setActiveTab(value),
2467
+ className: "bg-transparent shadow-none px-0",
2468
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(MenuContent, { variant: "menu2", children: [
2469
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2470
+ MenuItem,
2471
+ {
2472
+ variant: "menu2",
2473
+ value: "criar-pedido",
2474
+ className: "whitespace-nowrap px-17 not-sm:px-5",
2475
+ children: "Criar Pedido"
2476
+ }
2477
+ ),
2478
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2479
+ MenuItem,
2480
+ {
2481
+ variant: "menu2",
2482
+ value: "historico",
2483
+ className: "whitespace-nowrap px-17 not-sm:px-5",
2484
+ children: "Hist\xF3rico"
2485
+ }
2486
+ )
2487
+ ] })
2488
+ }
2489
+ ) })
2490
+ ] }),
2491
+ activeTab === "criar-pedido" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-2", children: [
2492
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { as: "h2", size: "md", weight: "bold", className: "text-text-900", children: "Selecione o tipo de problema" }),
2493
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col sm:flex-row gap-2 sm:gap-4", children: problemTypes.map((type) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2494
+ SelectionButton_default,
2495
+ {
2496
+ icon: type.icon,
2497
+ label: type.title,
2498
+ selected: selectedProblem === type.id,
2499
+ onClick: () => handleProblemSelection(type.id),
2500
+ className: "w-full p-4"
2501
+ },
2502
+ type.id
2503
+ )) }),
2504
+ errors.problemType && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { size: "sm", className: "text-red-500 mt-1", children: errors.problemType.message })
2505
+ ] }),
2506
+ selectedProblem && activeTab === "criar-pedido" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
2507
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2508
+ Input_default,
2509
+ {
2510
+ size: "large",
2511
+ variant: "rounded",
2512
+ label: "T\xEDtulo",
2513
+ placeholder: "Digite o t\xEDtulo",
2514
+ ...register("title"),
2515
+ errorMessage: errors.title?.message
2516
+ }
2517
+ ) }),
2518
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2519
+ TextArea_default,
2520
+ {
2521
+ size: "large",
2522
+ label: "Descri\xE7\xE3o",
2523
+ placeholder: "Descreva o problema aqui",
2524
+ ...register("description"),
2525
+ errorMessage: errors.description?.message
2526
+ }
2527
+ ) }),
2528
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2529
+ Button_default,
2530
+ {
2531
+ size: "large",
2532
+ className: "float-end mt-10",
2533
+ type: "submit",
2534
+ disabled: isSubmitting,
2535
+ children: isSubmitting ? "Enviando..." : "Enviar Pedido"
2536
+ }
2537
+ ),
2538
+ submitError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-4 p-4 bg-red-100 border border-red-400 text-red-700 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { size: "sm", className: "text-red-700", children: submitError }) })
2539
+ ] }),
2540
+ activeTab === "historico" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-6", children: [
2541
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex gap-4", children: [
2542
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col flex-1/2 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2543
+ Select_default,
2544
+ {
2545
+ label: "Status",
2546
+ size: "large",
2547
+ value: statusFilter,
2548
+ onValueChange: setStatusFilter,
2549
+ children: [
2550
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectTrigger, { variant: "rounded", className: "", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectValue, { placeholder: "Todos" }) }),
2551
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectContent, { children: [
2552
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: "todos", children: "Todos" }),
2553
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: "aberto" /* ABERTO */, children: "Aberto" }),
2554
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: "respondido" /* RESPONDIDO */, children: "Respondido" }),
2555
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: "encerrado" /* ENCERRADO */, children: "Encerrado" })
2556
+ ] })
2557
+ ]
2558
+ }
2559
+ ) }),
2560
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col flex-1/2 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2561
+ Select_default,
2562
+ {
2563
+ label: "Tipo",
2564
+ size: "large",
2565
+ value: categoryFilter,
2566
+ onValueChange: setCategoryFilter,
2567
+ children: [
2568
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectTrigger, { variant: "rounded", className: "", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectValue, { placeholder: "Todos" }) }),
2569
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectContent, { children: [
2570
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: "todos", children: "Todos" }),
2571
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectItem, { value: "tecnico" /* TECNICO */, children: [
2572
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.BugIcon, { size: 16 }),
2573
+ " T\xE9cnico"
2574
+ ] }),
2575
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectItem, { value: "acesso" /* ACESSO */, children: [
2576
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.KeyIcon, { size: 16 }),
2577
+ " Acesso"
2578
+ ] }),
2579
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectItem, { value: "outros" /* OUTROS */, children: [
2580
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react11.InfoIcon, { size: 16 }),
2581
+ " Outros"
2582
+ ] })
2583
+ ] })
2584
+ ]
2585
+ }
2586
+ ) })
2587
+ ] }),
2588
+ (() => {
2589
+ if (loadingTickets) {
2590
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TicketSkeleton, {});
2591
+ }
2592
+ if (Object.keys(groupedTickets).length === 0) {
2593
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EmptyState, { imageSrc: emptyImage });
2594
+ }
2595
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-6", children: Object.entries(groupedTickets).sort(
2596
+ ([a], [b]) => new Date(b).getTime() - new Date(a).getTime()
2597
+ ).map(([date, tickets]) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2598
+ TicketGroup,
2599
+ {
2600
+ date,
2601
+ tickets,
2602
+ onTicketClick: handleTicketClick
2603
+ },
2604
+ date
2605
+ )) });
2606
+ })(),
2607
+ !loadingTickets && totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex justify-center items-center gap-4 mt-6", children: [
2608
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2609
+ Button_default,
2610
+ {
2611
+ variant: "outline",
2612
+ size: "small",
2613
+ onClick: handlePrevPage,
2614
+ disabled: currentPage === 1,
2615
+ children: "Anterior"
2616
+ }
2617
+ ),
2618
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text_default, { size: "sm", className: "text-text-600", children: [
2619
+ "P\xE1gina ",
2620
+ currentPage,
2621
+ " de ",
2622
+ totalPages
2623
+ ] }),
2624
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2625
+ Button_default,
2626
+ {
2627
+ variant: "outline",
2628
+ size: "small",
2629
+ onClick: handleNextPage,
2630
+ disabled: currentPage === totalPages,
2631
+ children: "Pr\xF3xima"
2632
+ }
2633
+ )
2634
+ ] })
2635
+ ] })
2636
+ ] }) }),
2637
+ selectedTicket && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2638
+ TicketModal,
2639
+ {
2640
+ ticket: selectedTicket,
2641
+ isOpen: isModalOpen,
2642
+ onClose: handleModalClose,
2643
+ onTicketClose: handleTicketClose,
2644
+ apiClient,
2645
+ userId
2646
+ }
2647
+ ),
2648
+ showSuccessToast && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "fixed top-4 left-1/2 transform -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2649
+ Toast_default,
2650
+ {
2651
+ title: "Pedido enviado!",
2652
+ description: "Agora voc\xEA pode acompanhar o andamento do seu pedido.",
2653
+ variant: "solid",
2654
+ onClose: () => setShowSuccessToast(false)
2655
+ }
2656
+ ) }),
2657
+ showCloseSuccessToast && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "fixed top-4 left-1/2 transform -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2658
+ Toast_default,
2659
+ {
2660
+ title: "Pedido encerrado!",
2661
+ description: "",
2662
+ variant: "solid",
2663
+ onClose: () => setShowCloseSuccessToast(false)
2664
+ }
2665
+ ) }),
2666
+ showCloseErrorToast && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "fixed top-4 left-1/2 transform -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2667
+ Toast_default,
2668
+ {
2669
+ title: "Erro ao encerrar pedido",
2670
+ description: "N\xE3o foi poss\xEDvel encerrar o pedido. Tente novamente.",
2671
+ variant: "solid",
2672
+ action: "warning",
2673
+ onClose: () => setShowCloseErrorToast(false)
2674
+ }
2675
+ ) })
2676
+ ] });
2677
+ };
2678
+ var Support_default = Support;
2679
+ // Annotate the CommonJS export names for ESM import in node:
2680
+ 0 && (module.exports = {
2681
+ Support,
2682
+ TicketModal,
2683
+ getCategoryIcon,
2684
+ supportSchema
2685
+ });
2686
+ //# sourceMappingURL=index.js.map