@greatapps/common 1.1.428 → 1.1.429

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 (477) hide show
  1. package/package.json +1 -1
  2. package/dist/components/account/AccountModals.mjs +0 -18
  3. package/dist/components/account/AccountModals.mjs.map +0 -1
  4. package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -129
  5. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
  6. package/dist/components/account/ConfirmDeleteAccountModal.mjs +0 -45
  7. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +0 -1
  8. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +0 -45
  9. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +0 -1
  10. package/dist/components/account/DeleteAccountModal.mjs +0 -123
  11. package/dist/components/account/DeleteAccountModal.mjs.map +0 -1
  12. package/dist/components/account/DisableTwoFactorAuthModal.mjs +0 -67
  13. package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +0 -1
  14. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +0 -42
  15. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +0 -1
  16. package/dist/components/account/TwoFactorAuthModal.mjs +0 -182
  17. package/dist/components/account/TwoFactorAuthModal.mjs.map +0 -1
  18. package/dist/components/account/constants.mjs +0 -29
  19. package/dist/components/account/constants.mjs.map +0 -1
  20. package/dist/components/account/hooks/useChangeEmailForm.mjs +0 -53
  21. package/dist/components/account/hooks/useChangeEmailForm.mjs.map +0 -1
  22. package/dist/components/account/hooks/useChangePasswordForm.mjs +0 -47
  23. package/dist/components/account/hooks/useChangePasswordForm.mjs.map +0 -1
  24. package/dist/components/account/hooks/useChangePhoneForm.mjs +0 -91
  25. package/dist/components/account/hooks/useChangePhoneForm.mjs.map +0 -1
  26. package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -34
  27. package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
  28. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +0 -54
  29. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +0 -1
  30. package/dist/components/account/hooks/useOtpVerification.mjs +0 -94
  31. package/dist/components/account/hooks/useOtpVerification.mjs.map +0 -1
  32. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +0 -80
  33. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +0 -1
  34. package/dist/components/account/sections/ChangeEmailModal.mjs +0 -181
  35. package/dist/components/account/sections/ChangeEmailModal.mjs.map +0 -1
  36. package/dist/components/account/sections/ChangePasswordSection.mjs +0 -64
  37. package/dist/components/account/sections/ChangePasswordSection.mjs.map +0 -1
  38. package/dist/components/account/sections/ChangePhoneModal.mjs +0 -192
  39. package/dist/components/account/sections/ChangePhoneModal.mjs.map +0 -1
  40. package/dist/components/account/sections/MyProfileSection.mjs +0 -317
  41. package/dist/components/account/sections/MyProfileSection.mjs.map +0 -1
  42. package/dist/components/account/sections/PreferencesSection.mjs +0 -227
  43. package/dist/components/account/sections/PreferencesSection.mjs.map +0 -1
  44. package/dist/components/account/sections/SecuritySection.mjs +0 -31
  45. package/dist/components/account/sections/SecuritySection.mjs.map +0 -1
  46. package/dist/components/embeds/CrispEmbed.mjs +0 -89
  47. package/dist/components/embeds/CrispEmbed.mjs.map +0 -1
  48. package/dist/components/embeds/FrillEmbed.mjs +0 -107
  49. package/dist/components/embeds/FrillEmbed.mjs.map +0 -1
  50. package/dist/components/handlers/SearchParamsHandler.mjs +0 -24
  51. package/dist/components/handlers/SearchParamsHandler.mjs.map +0 -1
  52. package/dist/components/layouts/AppMobileNavBar.mjs +0 -60
  53. package/dist/components/layouts/AppMobileNavBar.mjs.map +0 -1
  54. package/dist/components/layouts/AppNavBar.mjs +0 -37
  55. package/dist/components/layouts/AppNavBar.mjs.map +0 -1
  56. package/dist/components/layouts/CollapsibleSidebar.mjs +0 -65
  57. package/dist/components/layouts/CollapsibleSidebar.mjs.map +0 -1
  58. package/dist/components/layouts/MainLayout.mjs +0 -60
  59. package/dist/components/layouts/MainLayout.mjs.map +0 -1
  60. package/dist/components/layouts/MdSideBarNavigation.mjs +0 -54
  61. package/dist/components/layouts/MdSideBarNavigation.mjs.map +0 -1
  62. package/dist/components/layouts/NavBar.mjs +0 -152
  63. package/dist/components/layouts/NavBar.mjs.map +0 -1
  64. package/dist/components/layouts/NavBarItem.mjs +0 -23
  65. package/dist/components/layouts/NavBarItem.mjs.map +0 -1
  66. package/dist/components/layouts/NotificationsPopover.mjs +0 -97
  67. package/dist/components/layouts/NotificationsPopover.mjs.map +0 -1
  68. package/dist/components/layouts/ProfilePopover.mjs +0 -152
  69. package/dist/components/layouts/ProfilePopover.mjs.map +0 -1
  70. package/dist/components/layouts/SideBarNavigation.mjs +0 -63
  71. package/dist/components/layouts/SideBarNavigation.mjs.map +0 -1
  72. package/dist/components/layouts/UsersSelectorPopover.mjs +0 -210
  73. package/dist/components/layouts/UsersSelectorPopover.mjs.map +0 -1
  74. package/dist/components/layouts/WhitelabelCodes.mjs +0 -50
  75. package/dist/components/layouts/WhitelabelCodes.mjs.map +0 -1
  76. package/dist/components/modals/BuyCreditsModal.mjs +0 -281
  77. package/dist/components/modals/BuyCreditsModal.mjs.map +0 -1
  78. package/dist/components/modals/ModalManager.mjs +0 -19
  79. package/dist/components/modals/ModalManager.mjs.map +0 -1
  80. package/dist/components/modals/Modals.mjs +0 -20
  81. package/dist/components/modals/Modals.mjs.map +0 -1
  82. package/dist/components/modals/PaidPlanRequiredModal.mjs +0 -46
  83. package/dist/components/modals/PaidPlanRequiredModal.mjs.map +0 -1
  84. package/dist/components/modals/cards/AddCardModal.mjs +0 -215
  85. package/dist/components/modals/cards/AddCardModal.mjs.map +0 -1
  86. package/dist/components/modals/cards/CardFormFields.mjs +0 -268
  87. package/dist/components/modals/cards/CardFormFields.mjs.map +0 -1
  88. package/dist/components/navigation/AppNavigation.mjs +0 -33
  89. package/dist/components/navigation/AppNavigation.mjs.map +0 -1
  90. package/dist/components/navigation/AppNavigationContext.mjs +0 -13
  91. package/dist/components/navigation/AppNavigationContext.mjs.map +0 -1
  92. package/dist/components/navigation/CancelledSubscriptionBanner.mjs +0 -52
  93. package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +0 -1
  94. package/dist/components/navigation/NavItem.mjs +0 -41
  95. package/dist/components/navigation/NavItem.mjs.map +0 -1
  96. package/dist/components/navigation/NavItemsContext.mjs +0 -16
  97. package/dist/components/navigation/NavItemsContext.mjs.map +0 -1
  98. package/dist/components/navigation/ProjectSelectorPopover.mjs +0 -147
  99. package/dist/components/navigation/ProjectSelectorPopover.mjs.map +0 -1
  100. package/dist/components/navigation/shells/DesktopShell.mjs +0 -11
  101. package/dist/components/navigation/shells/DesktopShell.mjs.map +0 -1
  102. package/dist/components/navigation/shells/MdShell.mjs +0 -11
  103. package/dist/components/navigation/shells/MdShell.mjs.map +0 -1
  104. package/dist/components/navigation/shells/MobileShell.mjs +0 -27
  105. package/dist/components/navigation/shells/MobileShell.mjs.map +0 -1
  106. package/dist/components/navigation/shells/TabsMobileShell.mjs +0 -61
  107. package/dist/components/navigation/shells/TabsMobileShell.mjs.map +0 -1
  108. package/dist/components/navigation/subcomponents/BottomLinks.mjs +0 -35
  109. package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +0 -1
  110. package/dist/components/navigation/subcomponents/CreditsCard.mjs +0 -33
  111. package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +0 -1
  112. package/dist/components/navigation/subcomponents/NavItems.mjs +0 -25
  113. package/dist/components/navigation/subcomponents/NavItems.mjs.map +0 -1
  114. package/dist/components/navigation/subcomponents/PlanCard.mjs +0 -25
  115. package/dist/components/navigation/subcomponents/PlanCard.mjs.map +0 -1
  116. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +0 -145
  117. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +0 -1
  118. package/dist/components/navigation/types.mjs +0 -1
  119. package/dist/components/navigation/types.mjs.map +0 -1
  120. package/dist/components/pages/NotFoundPage.mjs +0 -47
  121. package/dist/components/pages/NotFoundPage.mjs.map +0 -1
  122. package/dist/components/pages/notifications/Notifications.mjs +0 -156
  123. package/dist/components/pages/notifications/Notifications.mjs.map +0 -1
  124. package/dist/components/ui/buttons/Button.mjs +0 -52
  125. package/dist/components/ui/buttons/Button.mjs.map +0 -1
  126. package/dist/components/ui/buttons/CancelButton.mjs +0 -17
  127. package/dist/components/ui/buttons/CancelButton.mjs.map +0 -1
  128. package/dist/components/ui/buttons/CopyButton.mjs +0 -42
  129. package/dist/components/ui/buttons/CopyButton.mjs.map +0 -1
  130. package/dist/components/ui/data-display/Accordion.mjs +0 -76
  131. package/dist/components/ui/data-display/Accordion.mjs.map +0 -1
  132. package/dist/components/ui/data-display/Badge.mjs +0 -42
  133. package/dist/components/ui/data-display/Badge.mjs.map +0 -1
  134. package/dist/components/ui/data-display/Card.mjs +0 -92
  135. package/dist/components/ui/data-display/Card.mjs.map +0 -1
  136. package/dist/components/ui/data-display/CardBrandIcons.mjs +0 -484
  137. package/dist/components/ui/data-display/CardBrandIcons.mjs.map +0 -1
  138. package/dist/components/ui/data-display/CardItem.mjs +0 -67
  139. package/dist/components/ui/data-display/CardItem.mjs.map +0 -1
  140. package/dist/components/ui/data-display/Pagination.mjs +0 -118
  141. package/dist/components/ui/data-display/Pagination.mjs.map +0 -1
  142. package/dist/components/ui/data-display/PaymentInfoCard.mjs +0 -161
  143. package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +0 -1
  144. package/dist/components/ui/data-display/ScrollArea.mjs +0 -62
  145. package/dist/components/ui/data-display/ScrollArea.mjs.map +0 -1
  146. package/dist/components/ui/data-display/Separator.mjs +0 -28
  147. package/dist/components/ui/data-display/Separator.mjs.map +0 -1
  148. package/dist/components/ui/data-display/Table.mjs +0 -116
  149. package/dist/components/ui/data-display/Table.mjs.map +0 -1
  150. package/dist/components/ui/data-display/Tabs.mjs +0 -69
  151. package/dist/components/ui/data-display/Tabs.mjs.map +0 -1
  152. package/dist/components/ui/data-display/UserAvatar.mjs +0 -49
  153. package/dist/components/ui/data-display/UserAvatar.mjs.map +0 -1
  154. package/dist/components/ui/feedback/CircularProgress.mjs +0 -71
  155. package/dist/components/ui/feedback/CircularProgress.mjs.map +0 -1
  156. package/dist/components/ui/feedback/DefaultCircularProgress.mjs +0 -63
  157. package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +0 -1
  158. package/dist/components/ui/feedback/LoadingOverlay.mjs +0 -19
  159. package/dist/components/ui/feedback/LoadingOverlay.mjs.map +0 -1
  160. package/dist/components/ui/feedback/Progress.mjs +0 -37
  161. package/dist/components/ui/feedback/Progress.mjs.map +0 -1
  162. package/dist/components/ui/feedback/Skeleton.mjs +0 -9
  163. package/dist/components/ui/feedback/Skeleton.mjs.map +0 -1
  164. package/dist/components/ui/feedback/Toast.mjs +0 -77
  165. package/dist/components/ui/feedback/Toast.mjs.map +0 -1
  166. package/dist/components/ui/form/Calendar.mjs +0 -204
  167. package/dist/components/ui/form/Calendar.mjs.map +0 -1
  168. package/dist/components/ui/form/Checkbox.mjs +0 -33
  169. package/dist/components/ui/form/Checkbox.mjs.map +0 -1
  170. package/dist/components/ui/form/ComboboxField.mjs +0 -130
  171. package/dist/components/ui/form/ComboboxField.mjs.map +0 -1
  172. package/dist/components/ui/form/DatePicker.mjs +0 -82
  173. package/dist/components/ui/form/DatePicker.mjs.map +0 -1
  174. package/dist/components/ui/form/DateRangePicker.mjs +0 -92
  175. package/dist/components/ui/form/DateRangePicker.mjs.map +0 -1
  176. package/dist/components/ui/form/FormField.mjs +0 -103
  177. package/dist/components/ui/form/FormField.mjs.map +0 -1
  178. package/dist/components/ui/form/Input.mjs +0 -21
  179. package/dist/components/ui/form/Input.mjs.map +0 -1
  180. package/dist/components/ui/form/InputOtp.mjs +0 -70
  181. package/dist/components/ui/form/InputOtp.mjs.map +0 -1
  182. package/dist/components/ui/form/PhoneInput.mjs +0 -176
  183. package/dist/components/ui/form/PhoneInput.mjs.map +0 -1
  184. package/dist/components/ui/form/RadioGroup.mjs +0 -37
  185. package/dist/components/ui/form/RadioGroup.mjs.map +0 -1
  186. package/dist/components/ui/form/Select.mjs +0 -179
  187. package/dist/components/ui/form/Select.mjs.map +0 -1
  188. package/dist/components/ui/form/SelectField.mjs +0 -80
  189. package/dist/components/ui/form/SelectField.mjs.map +0 -1
  190. package/dist/components/ui/form/Switch.mjs +0 -33
  191. package/dist/components/ui/form/Switch.mjs.map +0 -1
  192. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +0 -40
  193. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +0 -1
  194. package/dist/components/ui/form/TextAreaField.mjs +0 -56
  195. package/dist/components/ui/form/TextAreaField.mjs.map +0 -1
  196. package/dist/components/ui/form/Textarea.mjs +0 -20
  197. package/dist/components/ui/form/Textarea.mjs.map +0 -1
  198. package/dist/components/ui/overlay/Command.mjs +0 -178
  199. package/dist/components/ui/overlay/Command.mjs.map +0 -1
  200. package/dist/components/ui/overlay/Dialog.mjs +0 -142
  201. package/dist/components/ui/overlay/Dialog.mjs.map +0 -1
  202. package/dist/components/ui/overlay/Popover.mjs +0 -46
  203. package/dist/components/ui/overlay/Popover.mjs.map +0 -1
  204. package/dist/components/ui/overlay/Sheet.mjs +0 -149
  205. package/dist/components/ui/overlay/Sheet.mjs.map +0 -1
  206. package/dist/components/ui/overlay/Tooltip.mjs +0 -57
  207. package/dist/components/ui/overlay/Tooltip.mjs.map +0 -1
  208. package/dist/components/widgets/notifications/NotificationCard.mjs +0 -54
  209. package/dist/components/widgets/notifications/NotificationCard.mjs.map +0 -1
  210. package/dist/enums/AccountSectionType.mjs +0 -11
  211. package/dist/enums/AccountSectionType.mjs.map +0 -1
  212. package/dist/hooks/copy-to-clipboard.hook.mjs +0 -52
  213. package/dist/hooks/copy-to-clipboard.hook.mjs.map +0 -1
  214. package/dist/hooks/useCountdownTimer.mjs +0 -29
  215. package/dist/hooks/useCountdownTimer.mjs.map +0 -1
  216. package/dist/hooks/useDebounce.mjs +0 -19
  217. package/dist/hooks/useDebounce.mjs.map +0 -1
  218. package/dist/hooks/useDebounceState.mjs +0 -12
  219. package/dist/hooks/useDebounceState.mjs.map +0 -1
  220. package/dist/hooks/useDebouncedEffect.mjs +0 -44
  221. package/dist/hooks/useDebouncedEffect.mjs.map +0 -1
  222. package/dist/hooks/useIsMobile.mjs +0 -18
  223. package/dist/hooks/useIsMobile.mjs.map +0 -1
  224. package/dist/hooks/usePasswordVisibility.mjs +0 -13
  225. package/dist/hooks/usePasswordVisibility.mjs.map +0 -1
  226. package/dist/index.mjs +0 -528
  227. package/dist/index.mjs.map +0 -1
  228. package/dist/infra/api/client.mjs +0 -162
  229. package/dist/infra/api/client.mjs.map +0 -1
  230. package/dist/infra/api/types.mjs +0 -31
  231. package/dist/infra/api/types.mjs.map +0 -1
  232. package/dist/infra/utils/client-info.mjs +0 -27
  233. package/dist/infra/utils/client-info.mjs.map +0 -1
  234. package/dist/infra/utils/clsx.mjs +0 -9
  235. package/dist/infra/utils/clsx.mjs.map +0 -1
  236. package/dist/infra/utils/date.mjs +0 -11
  237. package/dist/infra/utils/date.mjs.map +0 -1
  238. package/dist/infra/utils/params.mjs +0 -21
  239. package/dist/infra/utils/params.mjs.map +0 -1
  240. package/dist/infra/utils/parser.mjs +0 -24
  241. package/dist/infra/utils/parser.mjs.map +0 -1
  242. package/dist/infra/utils/percentage.mjs +0 -20
  243. package/dist/infra/utils/percentage.mjs.map +0 -1
  244. package/dist/middleware.mjs +0 -10
  245. package/dist/middleware.mjs.map +0 -1
  246. package/dist/middlewares/chain.mjs +0 -37
  247. package/dist/middlewares/chain.mjs.map +0 -1
  248. package/dist/middlewares/create-auth-middleware.mjs +0 -32
  249. package/dist/middlewares/create-auth-middleware.mjs.map +0 -1
  250. package/dist/middlewares/types.mjs +0 -11
  251. package/dist/middlewares/types.mjs.map +0 -1
  252. package/dist/modules/accounts/actions/account-management.action.mjs +0 -98
  253. package/dist/modules/accounts/actions/account-management.action.mjs.map +0 -1
  254. package/dist/modules/accounts/actions/find-current-account.action.mjs +0 -10
  255. package/dist/modules/accounts/actions/find-current-account.action.mjs.map +0 -1
  256. package/dist/modules/accounts/actions/list-currencies.action.mjs +0 -10
  257. package/dist/modules/accounts/actions/list-currencies.action.mjs.map +0 -1
  258. package/dist/modules/accounts/actions/list-timezones.action.mjs +0 -10
  259. package/dist/modules/accounts/actions/list-timezones.action.mjs.map +0 -1
  260. package/dist/modules/accounts/hooks/current-account.hook.mjs +0 -24
  261. package/dist/modules/accounts/hooks/current-account.hook.mjs.map +0 -1
  262. package/dist/modules/accounts/hooks/useAccountManagement.mjs +0 -71
  263. package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +0 -1
  264. package/dist/modules/accounts/hooks/useCurrencies.mjs +0 -17
  265. package/dist/modules/accounts/hooks/useCurrencies.mjs.map +0 -1
  266. package/dist/modules/accounts/hooks/useTimezones.mjs +0 -17
  267. package/dist/modules/accounts/hooks/useTimezones.mjs.map +0 -1
  268. package/dist/modules/accounts/hooks/useViaCep.mjs +0 -19
  269. package/dist/modules/accounts/hooks/useViaCep.mjs.map +0 -1
  270. package/dist/modules/accounts/services/account.service.mjs +0 -182
  271. package/dist/modules/accounts/services/account.service.mjs.map +0 -1
  272. package/dist/modules/accounts/services/currency.service.mjs +0 -24
  273. package/dist/modules/accounts/services/currency.service.mjs.map +0 -1
  274. package/dist/modules/accounts/services/timezone.service.mjs +0 -65
  275. package/dist/modules/accounts/services/timezone.service.mjs.map +0 -1
  276. package/dist/modules/accounts/services/two-factor.service.mjs +0 -78
  277. package/dist/modules/accounts/services/two-factor.service.mjs.map +0 -1
  278. package/dist/modules/accounts/types.mjs +0 -1
  279. package/dist/modules/accounts/types.mjs.map +0 -1
  280. package/dist/modules/auth/actions/login.action.mjs +0 -14
  281. package/dist/modules/auth/actions/login.action.mjs.map +0 -1
  282. package/dist/modules/auth/actions/logout.action.mjs +0 -14
  283. package/dist/modules/auth/actions/logout.action.mjs.map +0 -1
  284. package/dist/modules/auth/actions/register.action.mjs +0 -14
  285. package/dist/modules/auth/actions/register.action.mjs.map +0 -1
  286. package/dist/modules/auth/actions/validate-session.action.mjs +0 -48
  287. package/dist/modules/auth/actions/validate-session.action.mjs.map +0 -1
  288. package/dist/modules/auth/actions/verify-two-factor.action.mjs +0 -17
  289. package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +0 -1
  290. package/dist/modules/auth/hooks/login.hook.mjs +0 -13
  291. package/dist/modules/auth/hooks/login.hook.mjs.map +0 -1
  292. package/dist/modules/auth/hooks/logout.hook.mjs +0 -13
  293. package/dist/modules/auth/hooks/logout.hook.mjs.map +0 -1
  294. package/dist/modules/auth/hooks/register.hook.mjs +0 -13
  295. package/dist/modules/auth/hooks/register.hook.mjs.map +0 -1
  296. package/dist/modules/auth/hooks/useManagementPermissions.mjs +0 -41
  297. package/dist/modules/auth/hooks/useManagementPermissions.mjs.map +0 -1
  298. package/dist/modules/auth/hooks/useUserQuery.mjs +0 -63
  299. package/dist/modules/auth/hooks/useUserQuery.mjs.map +0 -1
  300. package/dist/modules/auth/schema.mjs +0 -1
  301. package/dist/modules/auth/schema.mjs.map +0 -1
  302. package/dist/modules/auth/services/auth.service.mjs +0 -342
  303. package/dist/modules/auth/services/auth.service.mjs.map +0 -1
  304. package/dist/modules/auth/types/management-permission.type.mjs +0 -1
  305. package/dist/modules/auth/types/management-permission.type.mjs.map +0 -1
  306. package/dist/modules/auth/utils/assert-management-permission.mjs +0 -42
  307. package/dist/modules/auth/utils/assert-management-permission.mjs.map +0 -1
  308. package/dist/modules/auth/utils/assert-management-subscription.mjs +0 -33
  309. package/dist/modules/auth/utils/assert-management-subscription.mjs.map +0 -1
  310. package/dist/modules/auth/utils/assert-paid-subscription.mjs +0 -40
  311. package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +0 -1
  312. package/dist/modules/auth/utils/assert-subscription-addon.mjs +0 -35
  313. package/dist/modules/auth/utils/assert-subscription-addon.mjs.map +0 -1
  314. package/dist/modules/auth/utils/build-wl-override.mjs +0 -27
  315. package/dist/modules/auth/utils/build-wl-override.mjs.map +0 -1
  316. package/dist/modules/auth/utils/get-user-context.mjs +0 -25
  317. package/dist/modules/auth/utils/get-user-context.mjs.map +0 -1
  318. package/dist/modules/cards/actions/create-card.action.mjs +0 -10
  319. package/dist/modules/cards/actions/create-card.action.mjs.map +0 -1
  320. package/dist/modules/cards/actions/list-cards.action.mjs +0 -10
  321. package/dist/modules/cards/actions/list-cards.action.mjs.map +0 -1
  322. package/dist/modules/cards/hooks/cards.hook.mjs +0 -16
  323. package/dist/modules/cards/hooks/cards.hook.mjs.map +0 -1
  324. package/dist/modules/cards/hooks/create-card.hook.mjs +0 -18
  325. package/dist/modules/cards/hooks/create-card.hook.mjs.map +0 -1
  326. package/dist/modules/cards/services/cards.service.mjs +0 -44
  327. package/dist/modules/cards/services/cards.service.mjs.map +0 -1
  328. package/dist/modules/cards/types.mjs +0 -27
  329. package/dist/modules/cards/types.mjs.map +0 -1
  330. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +0 -10
  331. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +0 -1
  332. package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +0 -76
  333. package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +0 -1
  334. package/dist/modules/ia-credits/services/ia-credits.service.mjs +0 -31
  335. package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +0 -1
  336. package/dist/modules/ia-credits/types.mjs +0 -25
  337. package/dist/modules/ia-credits/types.mjs.map +0 -1
  338. package/dist/modules/plans/actions/find-plan-by-id.action.mjs +0 -10
  339. package/dist/modules/plans/actions/find-plan-by-id.action.mjs.map +0 -1
  340. package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs +0 -13
  341. package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs.map +0 -1
  342. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs +0 -15
  343. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +0 -1
  344. package/dist/modules/plans/services/plans.service.mjs +0 -34
  345. package/dist/modules/plans/services/plans.service.mjs.map +0 -1
  346. package/dist/modules/plans/types/plan.type.mjs +0 -20
  347. package/dist/modules/plans/types/plan.type.mjs.map +0 -1
  348. package/dist/modules/projects/actions/add-project-user.action.mjs +0 -10
  349. package/dist/modules/projects/actions/add-project-user.action.mjs.map +0 -1
  350. package/dist/modules/projects/actions/list-all-account-users.action.mjs +0 -10
  351. package/dist/modules/projects/actions/list-all-account-users.action.mjs.map +0 -1
  352. package/dist/modules/projects/actions/list-available-users.action.mjs +0 -10
  353. package/dist/modules/projects/actions/list-available-users.action.mjs.map +0 -1
  354. package/dist/modules/projects/actions/list-project-users.action.mjs +0 -10
  355. package/dist/modules/projects/actions/list-project-users.action.mjs.map +0 -1
  356. package/dist/modules/projects/actions/remove-project-user.action.mjs +0 -10
  357. package/dist/modules/projects/actions/remove-project-user.action.mjs.map +0 -1
  358. package/dist/modules/projects/hooks/add-project-user.hook.mjs +0 -61
  359. package/dist/modules/projects/hooks/add-project-user.hook.mjs.map +0 -1
  360. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +0 -35
  361. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +0 -1
  362. package/dist/modules/projects/hooks/list-available-users.hook.mjs +0 -34
  363. package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +0 -1
  364. package/dist/modules/projects/hooks/list-project-users.hook.mjs +0 -34
  365. package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +0 -1
  366. package/dist/modules/projects/hooks/remove-project-user.hook.mjs +0 -61
  367. package/dist/modules/projects/hooks/remove-project-user.hook.mjs.map +0 -1
  368. package/dist/modules/projects/services/project-users.service.mjs +0 -96
  369. package/dist/modules/projects/services/project-users.service.mjs.map +0 -1
  370. package/dist/modules/projects/types.mjs +0 -23
  371. package/dist/modules/projects/types.mjs.map +0 -1
  372. package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs +0 -10
  373. package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs.map +0 -1
  374. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +0 -10
  375. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +0 -1
  376. package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs +0 -12
  377. package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs.map +0 -1
  378. package/dist/modules/subscriptions/constants/addons.constants.mjs +0 -24
  379. package/dist/modules/subscriptions/constants/addons.constants.mjs.map +0 -1
  380. package/dist/modules/subscriptions/constants/query-keys.constants.mjs +0 -5
  381. package/dist/modules/subscriptions/constants/query-keys.constants.mjs.map +0 -1
  382. package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs +0 -13
  383. package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs.map +0 -1
  384. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +0 -17
  385. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +0 -1
  386. package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +0 -17
  387. package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +0 -1
  388. package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs +0 -22
  389. package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs.map +0 -1
  390. package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs +0 -37
  391. package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs.map +0 -1
  392. package/dist/modules/subscriptions/services/subscriptions.service.mjs +0 -75
  393. package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +0 -1
  394. package/dist/modules/subscriptions/types/billing-period.type.mjs +0 -1
  395. package/dist/modules/subscriptions/types/billing-period.type.mjs.map +0 -1
  396. package/dist/modules/subscriptions/types/calculate-subscription.type.mjs +0 -72
  397. package/dist/modules/subscriptions/types/calculate-subscription.type.mjs.map +0 -1
  398. package/dist/modules/subscriptions/types/subscription.type.mjs +0 -57
  399. package/dist/modules/subscriptions/types/subscription.type.mjs.map +0 -1
  400. package/dist/modules/subscriptions/utils/build-plan-extras.mjs +0 -37
  401. package/dist/modules/subscriptions/utils/build-plan-extras.mjs.map +0 -1
  402. package/dist/modules/subscriptions/utils/has-subscription-expired.mjs +0 -10
  403. package/dist/modules/subscriptions/utils/has-subscription-expired.mjs.map +0 -1
  404. package/dist/modules/subscriptions/utils/periodicity.mjs +0 -48
  405. package/dist/modules/subscriptions/utils/periodicity.mjs.map +0 -1
  406. package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs +0 -14
  407. package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs.map +0 -1
  408. package/dist/modules/users/action/find-user-by-id.action.mjs +0 -10
  409. package/dist/modules/users/action/find-user-by-id.action.mjs.map +0 -1
  410. package/dist/modules/users/action/list-messages.action.mjs +0 -13
  411. package/dist/modules/users/action/list-messages.action.mjs.map +0 -1
  412. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +0 -10
  413. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +0 -1
  414. package/dist/modules/users/action/mark-message-as-read.action.mjs +0 -10
  415. package/dist/modules/users/action/mark-message-as-read.action.mjs.map +0 -1
  416. package/dist/modules/users/hooks/messages.hook.mjs +0 -57
  417. package/dist/modules/users/hooks/messages.hook.mjs.map +0 -1
  418. package/dist/modules/users/schema/messages.schema.mjs +0 -21
  419. package/dist/modules/users/schema/messages.schema.mjs.map +0 -1
  420. package/dist/modules/users/schema.mjs +0 -11
  421. package/dist/modules/users/schema.mjs.map +0 -1
  422. package/dist/modules/users/services/messages.service.mjs +0 -35
  423. package/dist/modules/users/services/messages.service.mjs.map +0 -1
  424. package/dist/modules/users/services/user.service.mjs +0 -52
  425. package/dist/modules/users/services/user.service.mjs.map +0 -1
  426. package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +0 -21
  427. package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +0 -1
  428. package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs +0 -19
  429. package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs.map +0 -1
  430. package/dist/modules/whitelabel/schema.mjs +0 -1
  431. package/dist/modules/whitelabel/schema.mjs.map +0 -1
  432. package/dist/modules/whitelabel/services/whitelabel.service.mjs +0 -146
  433. package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +0 -1
  434. package/dist/modules/whitelabel/utils/normalize-hostname.mjs +0 -35
  435. package/dist/modules/whitelabel/utils/normalize-hostname.mjs.map +0 -1
  436. package/dist/providers/auth.provider.mjs +0 -114
  437. package/dist/providers/auth.provider.mjs.map +0 -1
  438. package/dist/providers/query.provider.mjs +0 -99
  439. package/dist/providers/query.provider.mjs.map +0 -1
  440. package/dist/providers/whitelabel.provider.mjs +0 -42
  441. package/dist/providers/whitelabel.provider.mjs.map +0 -1
  442. package/dist/server.mjs +0 -111
  443. package/dist/server.mjs.map +0 -1
  444. package/dist/store/useAccountModals.mjs +0 -18
  445. package/dist/store/useAccountModals.mjs.map +0 -1
  446. package/dist/store/useBuyCreditsModal.mjs +0 -16
  447. package/dist/store/useBuyCreditsModal.mjs.map +0 -1
  448. package/dist/store/useDesktopSidebarStore.mjs +0 -39
  449. package/dist/store/useDesktopSidebarStore.mjs.map +0 -1
  450. package/dist/store/useMdSidebarStore.mjs +0 -28
  451. package/dist/store/useMdSidebarStore.mjs.map +0 -1
  452. package/dist/store/useMobileNavbarSheet.mjs +0 -14
  453. package/dist/store/useMobileNavbarSheet.mjs.map +0 -1
  454. package/dist/store/useModalManager.mjs +0 -75
  455. package/dist/store/useModalManager.mjs.map +0 -1
  456. package/dist/store/usePaidPlanRequiredModal.mjs +0 -14
  457. package/dist/store/usePaidPlanRequiredModal.mjs.map +0 -1
  458. package/dist/utils/browser/clipboard.mjs +0 -36
  459. package/dist/utils/browser/clipboard.mjs.map +0 -1
  460. package/dist/utils/constants/br-states.mjs +0 -33
  461. package/dist/utils/constants/br-states.mjs.map +0 -1
  462. package/dist/utils/countries.mjs +0 -219
  463. package/dist/utils/countries.mjs.map +0 -1
  464. package/dist/utils/file/index.mjs +0 -9
  465. package/dist/utils/file/index.mjs.map +0 -1
  466. package/dist/utils/format/masks.mjs +0 -67
  467. package/dist/utils/format/masks.mjs.map +0 -1
  468. package/dist/utils/intl/locales.mjs +0 -12
  469. package/dist/utils/intl/locales.mjs.map +0 -1
  470. package/dist/utils/safeServerAction.mjs +0 -16
  471. package/dist/utils/safeServerAction.mjs.map +0 -1
  472. package/dist/utils/validators/account.mjs +0 -27
  473. package/dist/utils/validators/account.mjs.map +0 -1
  474. package/dist/utils/validators/common.mjs +0 -47
  475. package/dist/utils/validators/common.mjs.map +0 -1
  476. package/dist/utils/withAction.mjs +0 -13
  477. package/dist/utils/withAction.mjs.map +0 -1
@@ -1,281 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import {
4
- Dialog,
5
- DialogContent,
6
- DialogHeader,
7
- DialogTitle
8
- } from "../ui/overlay/Dialog";
9
- import { Button } from "../ui/buttons/Button";
10
- import { Separator } from "../ui/data-display/Separator";
11
- import { Toast } from "../ui/feedback/Toast";
12
- import { SelectField } from "../ui/form/SelectField";
13
- import { Skeleton } from "../ui/feedback/Skeleton";
14
- import { PaymentInfoCard } from "../ui/data-display/PaymentInfoCard";
15
- import { ADDON_IDS } from "../../modules/subscriptions/constants/addons.constants";
16
- import {
17
- AI_CREDIT_OPTIONS,
18
- AI_CREDIT_VALUES
19
- } from "../../modules/subscriptions/constants/addons.constants";
20
- import { useBuyCreditsModal } from "../../store/useBuyCreditsModal";
21
- import { useModalManager } from "../../store/useModalManager";
22
- import { useCards } from "../../modules/cards/hooks/cards.hook";
23
- import { useActiveSubscription } from "../../modules/subscriptions/hooks/find-active-subscription.hook";
24
- import { useCalculateSubscription } from "../../modules/subscriptions/hooks/calculate-subscription.hook";
25
- import { useUpdateSubscriptionPlan } from "../../modules/subscriptions/hooks/update-subscription-plan.hook";
26
- import { getPriceFromCalculatedData } from "../../modules/subscriptions/utils/periodicity";
27
- import { IconInfoCircle, IconX, IconLoader2 } from "@tabler/icons-react";
28
- import { useCallback, useEffect, useMemo, useRef } from "react";
29
- import { useForm } from "react-hook-form";
30
- import { zodResolver } from "@hookform/resolvers/zod";
31
- import z from "zod";
32
- import { toast } from "sonner";
33
- const buyCreditSchema = z.object({
34
- creditOption: z.number().refine((val) => AI_CREDIT_VALUES.has(val), {
35
- message: "Selecione uma op\xE7\xE3o de cr\xE9ditos"
36
- }),
37
- selectedCardId: z.string().min(1, "Selecione um cart\xE3o")
38
- });
39
- function BuyCreditsModal() {
40
- const { open, closeModal } = useBuyCreditsModal();
41
- const { openModal } = useModalManager();
42
- const { data: cardsData } = useCards();
43
- const { data: subscriptionData } = useActiveSubscription();
44
- const subscription = subscriptionData?.data?.[0] ?? null;
45
- const defaultCardId = cardsData?.data?.find((card) => card.is_default)?.id?.toString() ?? cardsData?.data?.[0]?.id?.toString() ?? "";
46
- const {
47
- mutate: calculate,
48
- isPending: isCalculatePending,
49
- data: calculateData
50
- } = useCalculateSubscription();
51
- const updatePlanMutation = useUpdateSubscriptionPlan();
52
- const aiItem = useMemo(
53
- () => subscription?.items?.find((item) => item.id_addon === ADDON_IDS.AI),
54
- [subscription]
55
- );
56
- const currentCredits = aiItem?.quantity ?? 0;
57
- const subscriptionId = subscription?.id;
58
- const planId = subscription?.id_plan;
59
- const form = useForm({
60
- resolver: zodResolver(buyCreditSchema),
61
- mode: "onChange",
62
- defaultValues: {
63
- creditOption: currentCredits,
64
- selectedCardId: defaultCardId
65
- }
66
- });
67
- const hasInitialized = useRef(false);
68
- useEffect(() => {
69
- if (!open) {
70
- hasInitialized.current = false;
71
- return;
72
- }
73
- if (hasInitialized.current || !subscription) return;
74
- hasInitialized.current = true;
75
- form.reset({
76
- creditOption: currentCredits,
77
- selectedCardId: defaultCardId
78
- });
79
- calculate({
80
- id_product: 1,
81
- ...planId != null && { id_plan: planId },
82
- ...subscriptionId != null && { id_subscription: subscriptionId },
83
- plan_extras: [
84
- { id_addon: ADDON_IDS.AI, quantity: currentCredits, currency: "BRL" }
85
- ]
86
- });
87
- }, [
88
- open,
89
- subscription,
90
- currentCredits,
91
- defaultCardId,
92
- form,
93
- calculate,
94
- planId,
95
- subscriptionId
96
- ]);
97
- useEffect(() => {
98
- if (open && defaultCardId && !form.getValues("selectedCardId")) {
99
- form.setValue("selectedCardId", defaultCardId, { shouldValidate: true });
100
- }
101
- }, [open, defaultCardId, form]);
102
- const creditOption = form.watch("creditOption");
103
- const selectedCardId = form.watch("selectedCardId");
104
- const { isDirty, isSubmitting, isValid } = form.formState;
105
- const handleCreditOptionChange = useCallback(
106
- (value) => {
107
- const credits = Number(value);
108
- form.setValue("creditOption", credits, {
109
- shouldValidate: true,
110
- shouldDirty: true
111
- });
112
- const option = AI_CREDIT_OPTIONS.find((opt) => opt.credits === credits);
113
- if (!option) return;
114
- calculate({
115
- id_product: 1,
116
- ...planId != null && { id_plan: planId },
117
- ...subscriptionId != null && { id_subscription: subscriptionId },
118
- plan_extras: [
119
- { id_addon: ADDON_IDS.AI, quantity: option.credits, currency: "BRL" }
120
- ]
121
- });
122
- },
123
- [form, subscriptionId, planId, calculate]
124
- );
125
- const calculatedData = calculateData?.data ?? null;
126
- const totalPrice = useMemo(() => {
127
- if (!calculatedData) return null;
128
- return getPriceFromCalculatedData(calculatedData, subscription?.periodicity);
129
- }, [calculatedData, subscription]);
130
- const formatPrice = useCallback((price) => {
131
- return price.toLocaleString("pt-BR", {
132
- style: "currency",
133
- currency: "BRL"
134
- });
135
- }, []);
136
- const isConfirmDisabled = !isDirty || !isValid || isCalculatePending || isSubmitting;
137
- const handleClose = useCallback(() => {
138
- form.reset();
139
- closeModal();
140
- }, [form, closeModal]);
141
- const handleOpenAddCardModal = useCallback(() => {
142
- openModal("addCardModal");
143
- }, [openModal]);
144
- const selectOptions = useMemo(() => {
145
- return AI_CREDIT_OPTIONS.map((opt) => ({
146
- value: opt.credits,
147
- label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 w-full", children: [
148
- /* @__PURE__ */ jsxs("span", { className: "paragraph-small-medium text-zinc-950 flex-1", children: [
149
- opt.credits.toLocaleString("pt-BR"),
150
- " cr\xE9ditos de IA"
151
- ] }),
152
- /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-500 opacity-70", children: opt.priceLabel })
153
- ] }),
154
- displayValue: `${opt.credits.toLocaleString("pt-BR")} cr\xE9ditos de IA`
155
- }));
156
- }, []);
157
- const onSubmit = useCallback(
158
- async (data) => {
159
- if (!subscriptionId) return;
160
- const option = AI_CREDIT_OPTIONS.find((opt) => opt.credits === data.creditOption);
161
- if (!option) return;
162
- await updatePlanMutation.mutateAsync({
163
- subscriptionId,
164
- data: {
165
- plan_extras: [
166
- {
167
- id_addon: ADDON_IDS.AI,
168
- quantity: option.credits
169
- }
170
- ]
171
- }
172
- });
173
- toast.custom((t) => /* @__PURE__ */ jsx(
174
- Toast,
175
- {
176
- variant: "success",
177
- message: `Cr\xE9ditos de IA alterados para ${data.creditOption.toLocaleString("pt-BR")}`,
178
- toastId: t
179
- }
180
- ));
181
- form.reset();
182
- closeModal();
183
- },
184
- [subscriptionId, updatePlanMutation, form, closeModal]
185
- );
186
- const renderPriceDisplay = useCallback(() => {
187
- if (isCalculatePending) {
188
- return /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-24" });
189
- }
190
- if (totalPrice !== null) {
191
- return /* @__PURE__ */ jsx("span", { className: "paragraph-xlarge-semibold text-zinc-950", children: totalPrice === 0 ? "Incluso" : formatPrice(totalPrice) });
192
- }
193
- return /* @__PURE__ */ jsx("span", { className: "paragraph-xlarge-semibold text-zinc-400", children: "--" });
194
- }, [isCalculatePending, totalPrice, formatPrice]);
195
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(
196
- DialogContent,
197
- {
198
- showCloseButton: false,
199
- className: "flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-[433px] lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-hidden lg:overflow-y-auto",
200
- children: [
201
- /* @__PURE__ */ jsxs(DialogHeader, { className: "px-4 py-3 border-b border-zinc-200 shrink-0 relative", children: [
202
- /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-zinc-950 text-center", children: "Comprar cr\xE9ditos de IA" }),
203
- /* @__PURE__ */ jsx(
204
- "button",
205
- {
206
- type: "button",
207
- onClick: handleClose,
208
- className: "absolute right-3 top-1/2 -translate-y-1/2 size-8 flex items-center justify-center rounded-lg cursor-pointer hover:bg-zinc-100 transition-colors",
209
- children: /* @__PURE__ */ jsx(IconX, { size: 18, className: "text-zinc-400" })
210
- }
211
- )
212
- ] }),
213
- /* @__PURE__ */ jsxs(
214
- "form",
215
- {
216
- onSubmit: form.handleSubmit(onSubmit),
217
- className: "flex flex-col flex-1 lg:flex-none overflow-hidden",
218
- children: [
219
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 lg:gap-8 p-4 lg:p-5 flex-1 lg:flex-none overflow-y-auto", children: [
220
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
221
- /* @__PURE__ */ jsx(
222
- SelectField,
223
- {
224
- options: selectOptions,
225
- value: creditOption,
226
- onChange: handleCreditOptionChange,
227
- className: "h-12!"
228
- }
229
- ),
230
- /* @__PURE__ */ jsx(
231
- PaymentInfoCard,
232
- {
233
- selectedCardId,
234
- onCardSelect: (cardId) => form.setValue("selectedCardId", cardId, { shouldValidate: true }),
235
- onOpenAddCard: handleOpenAddCardModal
236
- }
237
- ),
238
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-4 bg-cyan-50 rounded-lg", children: [
239
- /* @__PURE__ */ jsx(IconInfoCircle, { className: "size-4 text-zinc-950 shrink-0" }),
240
- /* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-950", children: "As altera\xE7\xF5es entrar\xE3o em vigor a partir da sua pr\xF3xima fatura." })
241
- ] })
242
- ] }),
243
- /* @__PURE__ */ jsx(Separator, { className: "bg-zinc-200 hidden lg:block" }),
244
- /* @__PURE__ */ jsxs("div", { className: "hidden lg:flex items-center justify-between", children: [
245
- /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-500", children: "Valor total do plano" }),
246
- renderPriceDisplay()
247
- ] }),
248
- /* @__PURE__ */ jsxs(
249
- Button,
250
- {
251
- type: "submit",
252
- disabled: isConfirmDisabled,
253
- className: "w-full hidden lg:inline-flex",
254
- children: [
255
- isSubmitting && /* @__PURE__ */ jsx(IconLoader2, { className: "size-4 animate-spin" }),
256
- "Confirmar e pagar"
257
- ]
258
- }
259
- )
260
- ] }),
261
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-4 border-t border-zinc-200 shrink-0 lg:hidden", children: [
262
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
263
- /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-500", children: "Valor total do plano" }),
264
- renderPriceDisplay()
265
- ] }),
266
- /* @__PURE__ */ jsxs(Button, { type: "submit", disabled: isConfirmDisabled, className: "w-full", children: [
267
- isSubmitting && /* @__PURE__ */ jsx(IconLoader2, { className: "size-4 animate-spin" }),
268
- "Confirmar e pagar"
269
- ] })
270
- ] })
271
- ]
272
- }
273
- )
274
- ]
275
- }
276
- ) });
277
- }
278
- export {
279
- BuyCreditsModal as default
280
- };
281
- //# sourceMappingURL=BuyCreditsModal.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/modals/BuyCreditsModal.tsx"],"sourcesContent":["'use client';\n\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n} from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { Separator } from '../ui/data-display/Separator';\nimport { Toast } from '../ui/feedback/Toast';\nimport { SelectField } from '../ui/form/SelectField';\nimport { Skeleton } from '../ui/feedback/Skeleton';\nimport { PaymentInfoCard } from '../ui/data-display/PaymentInfoCard';\nimport { ADDON_IDS } from '../../modules/subscriptions/constants/addons.constants';\nimport {\n AI_CREDIT_OPTIONS,\n AI_CREDIT_VALUES,\n} from '../../modules/subscriptions/constants/addons.constants';\nimport { useBuyCreditsModal } from '../../store/useBuyCreditsModal';\nimport { useModalManager } from '../../store/useModalManager';\nimport { useCards } from '../../modules/cards/hooks/cards.hook';\nimport { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';\nimport { useCalculateSubscription } from '../../modules/subscriptions/hooks/calculate-subscription.hook';\nimport { useUpdateSubscriptionPlan } from '../../modules/subscriptions/hooks/update-subscription-plan.hook';\nimport { getPriceFromCalculatedData } from '../../modules/subscriptions/utils/periodicity';\nimport { IconInfoCircle, IconX, IconLoader2 } from '@tabler/icons-react';\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport z from 'zod';\nimport { toast } from 'sonner';\n\nconst buyCreditSchema = z.object({\n creditOption: z.number().refine((val) => AI_CREDIT_VALUES.has(val), {\n message: 'Selecione uma opção de créditos',\n }),\n selectedCardId: z.string().min(1, 'Selecione um cartão'),\n});\n\ntype BuyCreditFormData = z.infer<typeof buyCreditSchema>;\n\nexport default function BuyCreditsModal() {\n const { open, closeModal } = useBuyCreditsModal();\n const { openModal } = useModalManager();\n const { data: cardsData } = useCards();\n const { data: subscriptionData } = useActiveSubscription();\n const subscription = subscriptionData?.data?.[0] ?? null;\n const defaultCardId =\n cardsData?.data?.find((card) => card.is_default)?.id?.toString() ??\n cardsData?.data?.[0]?.id?.toString() ??\n '';\n\n const {\n mutate: calculate,\n isPending: isCalculatePending,\n data: calculateData,\n } = useCalculateSubscription();\n const updatePlanMutation = useUpdateSubscriptionPlan();\n\n const aiItem = useMemo(\n () => subscription?.items?.find((item) => item.id_addon === ADDON_IDS.AI),\n [subscription]\n );\n\n const currentCredits = aiItem?.quantity ?? 0;\n const subscriptionId = subscription?.id;\n const planId = subscription?.id_plan;\n\n const form = useForm<BuyCreditFormData>({\n resolver: zodResolver(buyCreditSchema),\n mode: 'onChange',\n defaultValues: {\n creditOption: currentCredits,\n selectedCardId: defaultCardId,\n },\n });\n\n const hasInitialized = useRef(false);\n\n useEffect(() => {\n if (!open) {\n hasInitialized.current = false;\n return;\n }\n\n if (hasInitialized.current || !subscription) return;\n hasInitialized.current = true;\n\n form.reset({\n creditOption: currentCredits,\n selectedCardId: defaultCardId,\n });\n\n calculate({\n id_product: 1,\n ...(planId != null && { id_plan: planId }),\n ...(subscriptionId != null && { id_subscription: subscriptionId }),\n plan_extras: [\n { id_addon: ADDON_IDS.AI, quantity: currentCredits, currency: 'BRL' },\n ],\n });\n }, [\n open,\n subscription,\n currentCredits,\n defaultCardId,\n form,\n calculate,\n planId,\n subscriptionId,\n ]);\n\n // Sync selectedCardId when cards load after modal opened\n useEffect(() => {\n if (open && defaultCardId && !form.getValues('selectedCardId')) {\n form.setValue('selectedCardId', defaultCardId, { shouldValidate: true });\n }\n }, [open, defaultCardId, form]);\n\n const creditOption = form.watch('creditOption');\n const selectedCardId = form.watch('selectedCardId');\n const { isDirty, isSubmitting, isValid } = form.formState;\n\n const handleCreditOptionChange = useCallback(\n (value: string | number | boolean) => {\n const credits = Number(value);\n\n form.setValue('creditOption', credits, {\n shouldValidate: true,\n shouldDirty: true,\n });\n\n const option = AI_CREDIT_OPTIONS.find((opt) => opt.credits === credits);\n if (!option) return;\n\n calculate({\n id_product: 1,\n ...(planId != null && { id_plan: planId }),\n ...(subscriptionId != null && { id_subscription: subscriptionId }),\n plan_extras: [\n { id_addon: ADDON_IDS.AI, quantity: option.credits, currency: 'BRL' },\n ],\n });\n },\n [form, subscriptionId, planId, calculate]\n );\n\n const calculatedData = calculateData?.data ?? null;\n\n const totalPrice = useMemo(() => {\n if (!calculatedData) return null;\n return getPriceFromCalculatedData(calculatedData, subscription?.periodicity);\n }, [calculatedData, subscription]);\n\n const formatPrice = useCallback((price: number) => {\n return price.toLocaleString('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n });\n }, []);\n\n const isConfirmDisabled = !isDirty || !isValid || isCalculatePending || isSubmitting;\n\n const handleClose = useCallback(() => {\n form.reset();\n closeModal();\n }, [form, closeModal]);\n\n const handleOpenAddCardModal = useCallback(() => {\n openModal('addCardModal');\n }, [openModal]);\n\n const selectOptions = useMemo(() => {\n return AI_CREDIT_OPTIONS.map((opt) => ({\n value: opt.credits,\n label: (\n <div className=\"flex items-center justify-between gap-2 w-full\">\n <span className=\"paragraph-small-medium text-zinc-950 flex-1\">\n {opt.credits.toLocaleString('pt-BR')} créditos de IA\n </span>\n <span className=\"paragraph-small-medium text-zinc-500 opacity-70\">{opt.priceLabel}</span>\n </div>\n ),\n displayValue: `${opt.credits.toLocaleString('pt-BR')} créditos de IA`,\n }));\n }, []);\n\n const onSubmit = useCallback(\n async (data: BuyCreditFormData) => {\n if (!subscriptionId) return;\n\n const option = AI_CREDIT_OPTIONS.find((opt) => opt.credits === data.creditOption);\n if (!option) return;\n\n await updatePlanMutation.mutateAsync({\n subscriptionId,\n data: {\n plan_extras: [\n {\n id_addon: ADDON_IDS.AI,\n quantity: option.credits,\n },\n ],\n },\n });\n\n toast.custom((t) => (\n <Toast\n variant=\"success\"\n message={`Créditos de IA alterados para ${data.creditOption.toLocaleString('pt-BR')}`}\n toastId={t}\n />\n ));\n form.reset();\n closeModal();\n },\n [subscriptionId, updatePlanMutation, form, closeModal]\n );\n\n const renderPriceDisplay = useCallback(() => {\n if (isCalculatePending) {\n return <Skeleton className=\"h-7 w-24\" />;\n }\n if (totalPrice !== null) {\n return (\n <span className=\"paragraph-xlarge-semibold text-zinc-950\">\n {totalPrice === 0 ? 'Incluso' : formatPrice(totalPrice)}\n </span>\n );\n }\n return <span className=\"paragraph-xlarge-semibold text-zinc-400\">--</span>;\n }, [isCalculatePending, totalPrice, formatPrice]);\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent\n showCloseButton={false}\n className=\"flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-[433px] lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-hidden lg:overflow-y-auto\"\n >\n <DialogHeader className=\"px-4 py-3 border-b border-zinc-200 shrink-0 relative\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950 text-center\">\n Comprar créditos de IA\n </DialogTitle>\n <button\n type=\"button\"\n onClick={handleClose}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 size-8 flex items-center justify-center rounded-lg cursor-pointer hover:bg-zinc-100 transition-colors\"\n >\n <IconX size={18} className=\"text-zinc-400\" />\n </button>\n </DialogHeader>\n\n <form\n onSubmit={form.handleSubmit(onSubmit)}\n className=\"flex flex-col flex-1 lg:flex-none overflow-hidden\"\n >\n <div className=\"flex flex-col gap-6 lg:gap-8 p-4 lg:p-5 flex-1 lg:flex-none overflow-y-auto\">\n <div className=\"flex flex-col gap-4\">\n <SelectField\n options={selectOptions}\n value={creditOption}\n onChange={handleCreditOptionChange}\n className=\"h-12!\"\n />\n\n <PaymentInfoCard\n selectedCardId={selectedCardId}\n onCardSelect={(cardId) =>\n form.setValue('selectedCardId', cardId, { shouldValidate: true })\n }\n onOpenAddCard={handleOpenAddCardModal}\n />\n\n <div className=\"flex items-center gap-3 p-4 bg-cyan-50 rounded-lg\">\n <IconInfoCircle className=\"size-4 text-zinc-950 shrink-0\" />\n <span className=\"paragraph-small-regular text-zinc-950\">\n As alterações entrarão em vigor a partir da sua próxima fatura.\n </span>\n </div>\n </div>\n\n <Separator className=\"bg-zinc-200 hidden lg:block\" />\n\n <div className=\"hidden lg:flex items-center justify-between\">\n <span className=\"paragraph-small-medium text-zinc-500\">Valor total do plano</span>\n {renderPriceDisplay()}\n </div>\n\n <Button\n type=\"submit\"\n disabled={isConfirmDisabled}\n className=\"w-full hidden lg:inline-flex\"\n >\n {isSubmitting && <IconLoader2 className=\"size-4 animate-spin\" />}\n Confirmar e pagar\n </Button>\n </div>\n\n <div className=\"flex flex-col gap-4 p-4 border-t border-zinc-200 shrink-0 lg:hidden\">\n <div className=\"flex items-center justify-between\">\n <span className=\"paragraph-small-medium text-zinc-500\">Valor total do plano</span>\n {renderPriceDisplay()}\n </div>\n <Button type=\"submit\" disabled={isConfirmDisabled} className=\"w-full\">\n {isSubmitting && <IconLoader2 className=\"size-4 animate-spin\" />}\n Confirmar e pagar\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkLU,SAGA,KAHA;AAhLV;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,6BAA6B;AACtC,SAAS,gCAAgC;AACzC,SAAS,iCAAiC;AAC1C,SAAS,kCAAkC;AAC3C,SAAS,gBAAgB,OAAO,mBAAmB;AACnD,SAAS,aAAa,WAAW,SAAS,cAAc;AACxD,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,OAAO,OAAO;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sx-runtime";
3
- import { useModalManager } from "../../store/useModalManager";
4
- function ModalManager({ registry }) {
5
- const { modalStack } = useModalManager();
6
- if (modalStack.length === 0) return null;
7
- return /* @__PURE__ */ jsx(Fragment, { children: modalStack.map((modal) => {
8
- const ModalComponent = registry[modal.key];
9
- if (!ModalComponent) {
10
- console.warn(`Modal "${modal.key}" not found in registry`);
11
- return null;
12
- }
13
- return /* @__PURE__ */ jsx(ModalComponent, {}, modal.key);
14
- }) });
15
- }
16
- export {
17
- ModalManager
18
- };
19
- //# sourceMappingURL=ModalManager.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/modals/ModalManager.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentType } from 'react';\nimport { useModalManager } from '../../store/useModalManager';\n\ninterface ModalManagerProps {\n registry: Record<string, ComponentType>;\n}\n\nexport function ModalManager({ registry }: ModalManagerProps) {\n const { modalStack } = useModalManager();\n\n if (modalStack.length === 0) return null;\n\n return (\n <>\n {modalStack.map((modal) => {\n const ModalComponent = registry[modal.key];\n\n if (!ModalComponent) {\n console.warn(`Modal \"${modal.key}\" not found in registry`);\n return null;\n }\n\n return <ModalComponent key={modal.key} />;\n })}\n </>\n );\n}\n"],"mappings":";AAeI,mBASW,WATX;AAZJ,SAAS,uBAAuB;AAMzB,SAAS,aAAa,EAAE,SAAS,GAAsB;AAC5D,QAAM,EAAE,WAAW,IAAI,gBAAgB;AAEvC,MAAI,WAAW,WAAW,EAAG,QAAO;AAEpC,SACE,gCACG,qBAAW,IAAI,CAAC,UAAU;AACzB,UAAM,iBAAiB,SAAS,MAAM,GAAG;AAEzC,QAAI,CAAC,gBAAgB;AACnB,cAAQ,KAAK,UAAU,MAAM,GAAG,yBAAyB;AACzD,aAAO;AAAA,IACT;AAEA,WAAO,oBAAC,oBAAoB,MAAM,GAAK;AAAA,EACzC,CAAC,GACH;AAEJ;","names":[]}
@@ -1,20 +0,0 @@
1
- "use client";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useEffect } from "react";
4
- import AccountModals from "../account/AccountModals";
5
- import { ModalManager } from "./ModalManager";
6
- import { useAccountModals } from "../../store/useAccountModals";
7
- function Modals({ registry, hasActiveSubscription, onGoToSubscription }) {
8
- const { updateConfig } = useAccountModals();
9
- useEffect(() => {
10
- updateConfig({ hasActiveSubscription, onGoToSubscription });
11
- }, [hasActiveSubscription, onGoToSubscription, updateConfig]);
12
- return /* @__PURE__ */ jsxs(Fragment, { children: [
13
- /* @__PURE__ */ jsx(AccountModals, {}),
14
- /* @__PURE__ */ jsx(ModalManager, { registry })
15
- ] });
16
- }
17
- export {
18
- Modals
19
- };
20
- //# sourceMappingURL=Modals.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/modals/Modals.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentType, useEffect } from 'react';\nimport AccountModals from '../account/AccountModals';\nimport { ModalManager } from './ModalManager';\nimport { useAccountModals } from '../../store/useAccountModals';\ninterface ModalsProps {\n registry: Record<string, ComponentType>;\n hasActiveSubscription?: boolean;\n onGoToSubscription?: () => void;\n}\n\nexport function Modals({ registry, hasActiveSubscription, onGoToSubscription }: ModalsProps) {\n const { updateConfig } = useAccountModals();\n\n useEffect(() => {\n updateConfig({ hasActiveSubscription, onGoToSubscription });\n }, [hasActiveSubscription, onGoToSubscription, updateConfig]);\n\n return (\n <>\n <AccountModals />\n <ModalManager registry={registry} />\n </>\n );\n}\n"],"mappings":";AAoBI,mBACE,KADF;AAlBJ,SAAwB,iBAAiB;AACzC,OAAO,mBAAmB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAO1B,SAAS,OAAO,EAAE,UAAU,uBAAuB,mBAAmB,GAAgB;AAC3F,QAAM,EAAE,aAAa,IAAI,iBAAiB;AAE1C,YAAU,MAAM;AACd,iBAAa,EAAE,uBAAuB,mBAAmB,CAAC;AAAA,EAC5D,GAAG,CAAC,uBAAuB,oBAAoB,YAAY,CAAC;AAE5D,SACE,iCACE;AAAA,wBAAC,iBAAc;AAAA,IACf,oBAAC,gBAAa,UAAoB;AAAA,KACpC;AAEJ;","names":[]}
@@ -1,46 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { IconLock } from "@tabler/icons-react";
4
- import { Button } from "../ui/buttons/Button";
5
- import {
6
- Dialog,
7
- DialogContent,
8
- DialogDescription,
9
- DialogHeader,
10
- DialogTitle
11
- } from "../ui/overlay/Dialog";
12
- import { useWhitelabelUrls } from "../../providers/whitelabel.provider";
13
- import { useModalManager } from "../../store/useModalManager";
14
- function PaidPlanRequiredModal() {
15
- const { activeModal, modalData, closeModal } = useModalManager();
16
- const isOpen = activeModal === "paidPlanRequiredModal";
17
- const data = modalData;
18
- const { accountsUrl } = useWhitelabelUrls();
19
- const title = data.title ?? "Recurso dispon\xEDvel em planos pagos";
20
- const description = data.description ?? "Para acessar este recurso, fa\xE7a upgrade para um plano pago";
21
- const handleKnowPlans = () => {
22
- closeModal();
23
- window.open(`${accountsUrl}/subscriptions?tab=plans`, "_blank");
24
- };
25
- return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: () => closeModal(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 w-full md:w-[410px] lg:w-[410px]", children: [
26
- /* @__PURE__ */ jsxs(DialogHeader, { className: "gap-3 text-left p-5", children: [
27
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg", children: /* @__PURE__ */ jsx(IconLock, { size: 24, className: "text-zinc-950" }) }),
28
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
29
- /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-zinc-950", children: title }),
30
- /* @__PURE__ */ jsx(DialogDescription, { className: "paragraph-small-regular text-zinc-600", children: description })
31
- ] })
32
- ] }),
33
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 p-5 border-t border-zinc-200", children: /* @__PURE__ */ jsx(
34
- Button,
35
- {
36
- className: "w-fit h-10!",
37
- onClick: handleKnowPlans,
38
- children: "Conhecer planos"
39
- }
40
- ) })
41
- ] }) });
42
- }
43
- export {
44
- PaidPlanRequiredModal as default
45
- };
46
- //# sourceMappingURL=PaidPlanRequiredModal.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/modals/PaidPlanRequiredModal.tsx"],"sourcesContent":["\"use client\";\n\nimport { IconLock } from '@tabler/icons-react';\nimport { Button } from '../ui/buttons/Button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../ui/overlay/Dialog';\nimport { useWhitelabelUrls } from '../../providers/whitelabel.provider';\nimport { useModalManager } from '../../store/useModalManager';\nimport type { ModalData } from '../../store/useModalManager';\n\nexport default function PaidPlanRequiredModal() {\n const { activeModal, modalData, closeModal } = useModalManager();\n const isOpen = activeModal === 'paidPlanRequiredModal';\n const data = modalData as ModalData & { title?: string; description?: string };\n const { accountsUrl } = useWhitelabelUrls();\n\n const title = (data.title as string) ?? \"Recurso disponível em planos pagos\";\n const description = (data.description as string) ?? \"Para acessar este recurso, faça upgrade para um plano pago\";\n\n const handleKnowPlans = () => {\n closeModal();\n window.open(`${accountsUrl}/subscriptions?tab=plans`, '_blank');\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={() => closeModal()}>\n <DialogContent className=\"flex flex-col p-0 gap-0 w-full md:w-[410px] lg:w-[410px]\">\n <DialogHeader className=\"gap-3 text-left p-5\">\n <div className=\"flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg\">\n <IconLock size={24} className=\"text-zinc-950\" />\n </div>\n <div className=\"flex flex-col gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950\">\n {title}\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-zinc-600\">\n {description}\n </DialogDescription>\n </div>\n </DialogHeader>\n <div className=\"flex items-center gap-2 p-5 border-t border-zinc-200\">\n <Button\n className=\"w-fit h-10!\"\n onClick={handleKnowPlans}\n >\n Conhecer planos\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkCwB,cAEJ,YAFI;AAhCxB,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAGjB,SAAR,wBAAyC;AAC5C,QAAM,EAAE,aAAa,WAAW,WAAW,IAAI,gBAAgB;AAC/D,QAAM,SAAS,gBAAgB;AAC/B,QAAM,OAAO;AACb,QAAM,EAAE,YAAY,IAAI,kBAAkB;AAE1C,QAAM,QAAS,KAAK,SAAoB;AACxC,QAAM,cAAe,KAAK,eAA0B;AAEpD,QAAM,kBAAkB,MAAM;AAC1B,eAAW;AACX,WAAO,KAAK,GAAG,WAAW,4BAA4B,QAAQ;AAAA,EAClE;AAEA,SACI,oBAAC,UAAO,MAAM,QAAQ,cAAc,MAAM,WAAW,GACjD,+BAAC,iBAAc,WAAU,4DACrB;AAAA,yBAAC,gBAAa,WAAU,uBACpB;AAAA,0BAAC,SAAI,WAAU,oEACX,8BAAC,YAAS,MAAM,IAAI,WAAU,iBAAgB,GAClD;AAAA,MACA,qBAAC,SAAI,WAAU,uBACX;AAAA,4BAAC,eAAY,WAAU,2CAClB,iBACL;AAAA,QACA,oBAAC,qBAAkB,WAAU,yCACxB,uBACL;AAAA,SACJ;AAAA,OACJ;AAAA,IACA,oBAAC,SAAI,WAAU,wDACX;AAAA,MAAC;AAAA;AAAA,QACG,WAAU;AAAA,QACV,SAAS;AAAA,QACZ;AAAA;AAAA,IAED,GACJ;AAAA,KACJ,GACJ;AAER;","names":[]}
@@ -1,215 +0,0 @@
1
- "use client";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useCallback, useState } from "react";
4
- import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../ui/overlay/Dialog";
5
- import { Button } from "../../ui/buttons/Button";
6
- import { Toast } from "../../ui/feedback/Toast";
7
- import { useModalManager } from "../../../store/useModalManager";
8
- import { useCreateCard } from "../../../modules/cards/hooks/create-card.hook";
9
- import { useUpdateAccount } from "../../../modules/accounts/hooks/useAccountManagement";
10
- import { CardFormFields, BillingFormFields, cardFormSchema } from "./CardFormFields";
11
- import { IconX } from "@tabler/icons-react";
12
- import { useForm } from "react-hook-form";
13
- import { zodResolver } from "@hookform/resolvers/zod";
14
- import { CardNumberElement, useElements, useStripe } from "@stripe/react-stripe-js";
15
- import { toast } from "sonner";
16
- const INITIAL_STRIPE_STATUS = {
17
- cardNumber: false,
18
- cardExpiry: false,
19
- cardCvc: false
20
- };
21
- function AddCardModal() {
22
- const { activeModal, modalData, closeModal } = useModalManager();
23
- const isOpen = activeModal === "addCardModal";
24
- const [currentStep, setCurrentStep] = useState(1);
25
- const [stripeStatus, setStripeStatus] = useState(INITIAL_STRIPE_STATUS);
26
- const [stripeErrors, setStripeErrors] = useState({});
27
- const onCardAdded = modalData.onCardAdded;
28
- const createCardMutation = useCreateCard();
29
- const updateAccountMutation = useUpdateAccount();
30
- const elements = useElements();
31
- const stripe = useStripe();
32
- const form = useForm({
33
- resolver: zodResolver(cardFormSchema),
34
- mode: "onSubmit",
35
- reValidateMode: "onChange",
36
- defaultValues: {
37
- country: "BR",
38
- personType: "pf"
39
- }
40
- });
41
- const handleClose = useCallback(() => {
42
- form.reset();
43
- setCurrentStep(1);
44
- setStripeStatus(INITIAL_STRIPE_STATUS);
45
- setStripeErrors({});
46
- closeModal();
47
- }, [form, closeModal]);
48
- const handleStripeChange = useCallback(
49
- (field, complete) => {
50
- setStripeStatus((prev) => ({ ...prev, [field]: complete }));
51
- if (complete) {
52
- setStripeErrors((prev) => ({ ...prev, [field]: void 0 }));
53
- }
54
- },
55
- []
56
- );
57
- const handleContinue = useCallback(async () => {
58
- const rhfValid = await form.trigger(["name", "country", "personType", "cpf", "cnpj"]);
59
- const newStripeErrors = {};
60
- if (!stripeStatus.cardNumber) newStripeErrors.cardNumber = "N\xFAmero do cart\xE3o \xE9 obrigat\xF3rio";
61
- if (!stripeStatus.cardExpiry) newStripeErrors.cardExpiry = "Data de validade \xE9 obrigat\xF3ria";
62
- if (!stripeStatus.cardCvc) newStripeErrors.cardCvc = "C\xF3digo de seguran\xE7a \xE9 obrigat\xF3rio";
63
- setStripeErrors(newStripeErrors);
64
- const stripeValid = stripeStatus.cardNumber && stripeStatus.cardExpiry && stripeStatus.cardCvc;
65
- if (rhfValid && stripeValid) {
66
- form.clearErrors(["fullName", "cep", "street", "streetNumber", "city", "state"]);
67
- setCurrentStep(2);
68
- }
69
- }, [form, stripeStatus]);
70
- const handleBack = useCallback(() => {
71
- setCurrentStep(1);
72
- }, []);
73
- async function handleSubmit(data) {
74
- if (!stripe || !elements) return;
75
- const cardElement = elements.getElement(CardNumberElement);
76
- if (!cardElement) return;
77
- const { error, paymentMethod } = await stripe.createPaymentMethod({
78
- type: "card",
79
- card: cardElement,
80
- billing_details: {
81
- name: data.fullName,
82
- address: {
83
- country: data.country,
84
- postal_code: data.cep,
85
- line1: `${data.street}, ${data.streetNumber}`,
86
- line2: data.complement || void 0,
87
- city: data.city,
88
- state: data.state
89
- }
90
- }
91
- });
92
- if (error) {
93
- toast.custom(
94
- (t) => /* @__PURE__ */ jsx(
95
- Toast,
96
- {
97
- variant: "error",
98
- message: "N\xE3o foi poss\xEDvel adicionar o cart\xE3o na Stripe, tente novamente.",
99
- toastId: t
100
- }
101
- ),
102
- { duration: 5e3 }
103
- );
104
- return;
105
- }
106
- try {
107
- const [cardResult] = await Promise.all([
108
- createCardMutation.mutateAsync({ payment_method_id: paymentMethod.id }),
109
- updateAccountMutation.mutateAsync({
110
- financial_document_type: data.personType === "pf" ? 1 : 2,
111
- financial_document: data.personType === "pf" ? data.cpf : data.cnpj,
112
- financial_name: data.fullName,
113
- zipcode: data.cep,
114
- address: data.street,
115
- address_number: data.streetNumber,
116
- address_complement: data.complement || "",
117
- city: data.city,
118
- state: data.state
119
- })
120
- ]);
121
- if (cardResult.success && cardResult.data?.id != null) {
122
- onCardAdded?.(cardResult.data.id.toString());
123
- }
124
- toast.custom(
125
- (t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Cart\xE3o adicionado com sucesso.", toastId: t }),
126
- { duration: 5e3 }
127
- );
128
- handleClose();
129
- } catch {
130
- toast.custom(
131
- (t) => /* @__PURE__ */ jsx(
132
- Toast,
133
- {
134
- variant: "error",
135
- message: "N\xE3o foi poss\xEDvel salvar o seu novo cart\xE3o, tente novamente.",
136
- toastId: t
137
- }
138
- ),
139
- { duration: 5e3 }
140
- );
141
- }
142
- }
143
- const isSubmitting = createCardMutation.isPending || updateAccountMutation.isPending || form.formState.isSubmitting;
144
- const watchedValues = form.watch(["name", "country", "personType", "cpf", "cnpj", "fullName", "cep", "street", "streetNumber", "city", "state"]);
145
- const [name, country, personType, cpf, cnpj, fullName, cep, street, streetNumber, city, state] = watchedValues;
146
- const isStep1Valid = !!name && !!country && !!personType && (personType === "pf" ? !!cpf && cpf.length >= 14 : !!cnpj && cnpj.length >= 18) && stripeStatus.cardNumber && stripeStatus.cardExpiry && stripeStatus.cardCvc;
147
- const isStep2Valid = !!fullName && !!cep && cep.length >= 9 && !!street && !!streetNumber && !!city && !!state;
148
- return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(
149
- DialogContent,
150
- {
151
- showCloseButton: false,
152
- className: "flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-[470px] lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-y-auto",
153
- children: [
154
- /* @__PURE__ */ jsx(DialogHeader, { className: "p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center px-4 py-3 relative border-b border-zinc-200 lg:border-b-0", children: [
155
- /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-zinc-950 text-center", children: currentStep === 1 ? "Adicionar cart\xE3o" : "Dados de cobran\xE7a" }),
156
- /* @__PURE__ */ jsx(
157
- Button,
158
- {
159
- type: "button",
160
- variant: "ghost",
161
- className: "size-8! p-0 absolute right-4",
162
- onClick: handleClose,
163
- children: /* @__PURE__ */ jsx(IconX, { size: 18 })
164
- }
165
- )
166
- ] }) }),
167
- /* @__PURE__ */ jsx("div", { className: "h-1 bg-zinc-100 w-full", children: /* @__PURE__ */ jsx(
168
- "div",
169
- {
170
- className: "h-full bg-cyan-400 transition-all duration-300 ease-in-out",
171
- style: { width: currentStep === 1 ? "50%" : "100%" }
172
- }
173
- ) }),
174
- /* @__PURE__ */ jsxs(
175
- "form",
176
- {
177
- onSubmit: form.handleSubmit(handleSubmit),
178
- className: "flex flex-col flex-1 lg:flex-none",
179
- children: [
180
- /* @__PURE__ */ jsx("div", { className: `flex flex-col gap-6 lg:gap-8 p-4 lg:p-5 flex-1 lg:flex-none ${currentStep !== 1 ? "hidden" : ""}`, children: /* @__PURE__ */ jsx(
181
- CardFormFields,
182
- {
183
- form,
184
- onStripeChange: handleStripeChange,
185
- stripeErrors
186
- }
187
- ) }),
188
- /* @__PURE__ */ jsx("div", { className: `flex flex-col gap-6 lg:gap-8 p-4 lg:p-5 flex-1 lg:flex-none ${currentStep !== 2 ? "hidden" : ""}`, children: /* @__PURE__ */ jsx(BillingFormFields, { form }) }),
189
- /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center p-4 lg:p-5 border-t border-zinc-200 gap-2 mt-auto lg:mt-0", children: currentStep === 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
190
- /* @__PURE__ */ jsx(Button, { variant: "secondary", type: "button", onClick: handleClose, className: "h-10!", children: "Cancelar" }),
191
- /* @__PURE__ */ jsx(
192
- Button,
193
- {
194
- type: "button",
195
- className: "h-10!",
196
- onClick: handleContinue,
197
- disabled: !isStep1Valid,
198
- children: "Continuar"
199
- }
200
- )
201
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
202
- /* @__PURE__ */ jsx(Button, { variant: "secondary", type: "button", onClick: handleBack, className: "h-10!", children: "Voltar" }),
203
- /* @__PURE__ */ jsx(Button, { type: "submit", className: "h-10!", disabled: isSubmitting || !isStep2Valid, children: isSubmitting ? "Adicionando cart\xE3o..." : "Adicionar cart\xE3o" })
204
- ] }) })
205
- ]
206
- }
207
- )
208
- ]
209
- }
210
- ) });
211
- }
212
- export {
213
- AddCardModal as default
214
- };
215
- //# sourceMappingURL=AddCardModal.mjs.map