@greatapps/common 1.1.170 → 1.1.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/auth/schema.ts +1 -0
- package/src/modules/auth/services/auth.service.ts +1 -0
- package/dist/components/account/AccountModals.mjs +0 -18
- package/dist/components/account/AccountModals.mjs.map +0 -1
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -132
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +0 -45
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +0 -45
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +0 -1
- package/dist/components/account/DeleteAccountModal.mjs +0 -123
- package/dist/components/account/DeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +0 -67
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +0 -42
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +0 -190
- package/dist/components/account/TwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/constants.mjs +0 -29
- package/dist/components/account/constants.mjs.map +0 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +0 -53
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +0 -47
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +0 -64
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -33
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +0 -54
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +0 -94
- package/dist/components/account/hooks/useOtpVerification.mjs.map +0 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +0 -80
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +0 -180
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +0 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +0 -64
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +0 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +0 -182
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +0 -1
- package/dist/components/account/sections/MyProfileSection.mjs +0 -303
- package/dist/components/account/sections/MyProfileSection.mjs.map +0 -1
- package/dist/components/account/sections/PreferencesSection.mjs +0 -250
- package/dist/components/account/sections/PreferencesSection.mjs.map +0 -1
- package/dist/components/account/sections/SecuritySection.mjs +0 -147
- package/dist/components/account/sections/SecuritySection.mjs.map +0 -1
- package/dist/components/handlers/SearchParamsHandler.mjs +0 -24
- package/dist/components/handlers/SearchParamsHandler.mjs.map +0 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +0 -115
- package/dist/components/layouts/AppMobileNavBar.mjs.map +0 -1
- package/dist/components/layouts/AppNavBar.mjs +0 -49
- package/dist/components/layouts/AppNavBar.mjs.map +0 -1
- package/dist/components/layouts/MainLayout.mjs +0 -60
- package/dist/components/layouts/MainLayout.mjs.map +0 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +0 -54
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/NavBar.mjs +0 -132
- package/dist/components/layouts/NavBar.mjs.map +0 -1
- package/dist/components/layouts/NavBarItem.mjs +0 -23
- package/dist/components/layouts/NavBarItem.mjs.map +0 -1
- package/dist/components/layouts/NotificationsPopover.mjs +0 -97
- package/dist/components/layouts/NotificationsPopover.mjs.map +0 -1
- package/dist/components/layouts/ProfilePopover.mjs +0 -149
- package/dist/components/layouts/ProfilePopover.mjs.map +0 -1
- package/dist/components/layouts/SideBarNavigation.mjs +0 -22
- package/dist/components/layouts/SideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +0 -230
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +0 -1
- package/dist/components/modals/ModalManager.mjs +0 -19
- package/dist/components/modals/ModalManager.mjs.map +0 -1
- package/dist/components/modals/Modals.mjs +0 -20
- package/dist/components/modals/Modals.mjs.map +0 -1
- package/dist/components/navigation/AppNavigation.mjs +0 -30
- package/dist/components/navigation/AppNavigation.mjs.map +0 -1
- package/dist/components/navigation/AppNavigationContext.mjs +0 -13
- package/dist/components/navigation/AppNavigationContext.mjs.map +0 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +0 -59
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +0 -1
- package/dist/components/navigation/NavItem.mjs +0 -35
- package/dist/components/navigation/NavItem.mjs.map +0 -1
- package/dist/components/navigation/NavItemsContext.mjs +0 -16
- package/dist/components/navigation/NavItemsContext.mjs.map +0 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +0 -128
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +0 -1
- package/dist/components/navigation/shells/DesktopShell.mjs +0 -11
- package/dist/components/navigation/shells/DesktopShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MdShell.mjs +0 -11
- package/dist/components/navigation/shells/MdShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MobileShell.mjs +0 -27
- package/dist/components/navigation/shells/MobileShell.mjs.map +0 -1
- package/dist/components/navigation/shells/TabsMobileShell.mjs +0 -59
- package/dist/components/navigation/shells/TabsMobileShell.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +0 -30
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/NavItems.mjs +0 -25
- package/dist/components/navigation/subcomponents/NavItems.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +0 -25
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +0 -130
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +0 -1
- package/dist/components/navigation/types.mjs +0 -1
- package/dist/components/navigation/types.mjs.map +0 -1
- package/dist/components/pages/notifications/Notifications.mjs +0 -156
- package/dist/components/pages/notifications/Notifications.mjs.map +0 -1
- package/dist/components/ui/buttons/Button.mjs +0 -52
- package/dist/components/ui/buttons/Button.mjs.map +0 -1
- package/dist/components/ui/buttons/CancelButton.mjs +0 -17
- package/dist/components/ui/buttons/CancelButton.mjs.map +0 -1
- package/dist/components/ui/buttons/CopyButton.mjs +0 -42
- package/dist/components/ui/buttons/CopyButton.mjs.map +0 -1
- package/dist/components/ui/data-display/Accordion.mjs +0 -76
- package/dist/components/ui/data-display/Accordion.mjs.map +0 -1
- package/dist/components/ui/data-display/Badge.mjs +0 -42
- package/dist/components/ui/data-display/Badge.mjs.map +0 -1
- package/dist/components/ui/data-display/Card.mjs +0 -92
- package/dist/components/ui/data-display/Card.mjs.map +0 -1
- package/dist/components/ui/data-display/Pagination.mjs +0 -118
- package/dist/components/ui/data-display/Pagination.mjs.map +0 -1
- package/dist/components/ui/data-display/ScrollArea.mjs +0 -62
- package/dist/components/ui/data-display/ScrollArea.mjs.map +0 -1
- package/dist/components/ui/data-display/Separator.mjs +0 -28
- package/dist/components/ui/data-display/Separator.mjs.map +0 -1
- package/dist/components/ui/data-display/Table.mjs +0 -116
- package/dist/components/ui/data-display/Table.mjs.map +0 -1
- package/dist/components/ui/data-display/Tabs.mjs +0 -69
- package/dist/components/ui/data-display/Tabs.mjs.map +0 -1
- package/dist/components/ui/data-display/UserAvatar.mjs +0 -49
- package/dist/components/ui/data-display/UserAvatar.mjs.map +0 -1
- package/dist/components/ui/feedback/CircularProgress.mjs +0 -71
- package/dist/components/ui/feedback/CircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +0 -50
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/LoadingOverlay.mjs +0 -19
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +0 -1
- package/dist/components/ui/feedback/Progress.mjs +0 -37
- package/dist/components/ui/feedback/Progress.mjs.map +0 -1
- package/dist/components/ui/feedback/Toast.mjs +0 -77
- package/dist/components/ui/feedback/Toast.mjs.map +0 -1
- package/dist/components/ui/form/Calendar.mjs +0 -204
- package/dist/components/ui/form/Calendar.mjs.map +0 -1
- package/dist/components/ui/form/Checkbox.mjs +0 -33
- package/dist/components/ui/form/Checkbox.mjs.map +0 -1
- package/dist/components/ui/form/ComboboxField.mjs +0 -130
- package/dist/components/ui/form/ComboboxField.mjs.map +0 -1
- package/dist/components/ui/form/DatePicker.mjs +0 -82
- package/dist/components/ui/form/DatePicker.mjs.map +0 -1
- package/dist/components/ui/form/DateRangePicker.mjs +0 -92
- package/dist/components/ui/form/DateRangePicker.mjs.map +0 -1
- package/dist/components/ui/form/FormField.mjs +0 -103
- package/dist/components/ui/form/FormField.mjs.map +0 -1
- package/dist/components/ui/form/Input.mjs +0 -21
- package/dist/components/ui/form/Input.mjs.map +0 -1
- package/dist/components/ui/form/InputOtp.mjs +0 -70
- package/dist/components/ui/form/InputOtp.mjs.map +0 -1
- package/dist/components/ui/form/PhoneInput.mjs +0 -78
- package/dist/components/ui/form/PhoneInput.mjs.map +0 -1
- package/dist/components/ui/form/RadioGroup.mjs +0 -37
- package/dist/components/ui/form/RadioGroup.mjs.map +0 -1
- package/dist/components/ui/form/Select.mjs +0 -179
- package/dist/components/ui/form/Select.mjs.map +0 -1
- package/dist/components/ui/form/SelectField.mjs +0 -80
- package/dist/components/ui/form/SelectField.mjs.map +0 -1
- package/dist/components/ui/form/Switch.mjs +0 -33
- package/dist/components/ui/form/Switch.mjs.map +0 -1
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +0 -40
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +0 -1
- package/dist/components/ui/form/TextAreaField.mjs +0 -56
- package/dist/components/ui/form/TextAreaField.mjs.map +0 -1
- package/dist/components/ui/form/Textarea.mjs +0 -20
- package/dist/components/ui/form/Textarea.mjs.map +0 -1
- package/dist/components/ui/overlay/Command.mjs +0 -178
- package/dist/components/ui/overlay/Command.mjs.map +0 -1
- package/dist/components/ui/overlay/Dialog.mjs +0 -142
- package/dist/components/ui/overlay/Dialog.mjs.map +0 -1
- package/dist/components/ui/overlay/Popover.mjs +0 -46
- package/dist/components/ui/overlay/Popover.mjs.map +0 -1
- package/dist/components/ui/overlay/Sheet.mjs +0 -142
- package/dist/components/ui/overlay/Sheet.mjs.map +0 -1
- package/dist/components/ui/overlay/Tooltip.mjs +0 -57
- package/dist/components/ui/overlay/Tooltip.mjs.map +0 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs +0 -54
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +0 -1
- package/dist/enums/AccountSectionType.mjs +0 -11
- package/dist/enums/AccountSectionType.mjs.map +0 -1
- package/dist/hooks/copy-to-clipboard.hook.mjs +0 -52
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +0 -1
- package/dist/hooks/useCountdownTimer.mjs +0 -29
- package/dist/hooks/useCountdownTimer.mjs.map +0 -1
- package/dist/hooks/useDebounce.mjs +0 -19
- package/dist/hooks/useDebounce.mjs.map +0 -1
- package/dist/hooks/useDebounceState.mjs +0 -12
- package/dist/hooks/useDebounceState.mjs.map +0 -1
- package/dist/hooks/useDebouncedEffect.mjs +0 -44
- package/dist/hooks/useDebouncedEffect.mjs.map +0 -1
- package/dist/hooks/useIsMobile.mjs +0 -18
- package/dist/hooks/useIsMobile.mjs.map +0 -1
- package/dist/hooks/usePasswordVisibility.mjs +0 -13
- package/dist/hooks/usePasswordVisibility.mjs.map +0 -1
- package/dist/index.mjs +0 -457
- package/dist/index.mjs.map +0 -1
- package/dist/infra/api/client.mjs +0 -136
- package/dist/infra/api/client.mjs.map +0 -1
- package/dist/infra/api/types.mjs +0 -31
- package/dist/infra/api/types.mjs.map +0 -1
- package/dist/infra/utils/client-info.mjs +0 -27
- package/dist/infra/utils/client-info.mjs.map +0 -1
- package/dist/infra/utils/clsx.mjs +0 -9
- package/dist/infra/utils/clsx.mjs.map +0 -1
- package/dist/infra/utils/params.mjs +0 -21
- package/dist/infra/utils/params.mjs.map +0 -1
- package/dist/infra/utils/parser.mjs +0 -24
- package/dist/infra/utils/parser.mjs.map +0 -1
- package/dist/infra/utils/percentage.mjs +0 -20
- package/dist/infra/utils/percentage.mjs.map +0 -1
- package/dist/middleware.mjs +0 -10
- package/dist/middleware.mjs.map +0 -1
- package/dist/middlewares/chain.mjs +0 -37
- package/dist/middlewares/chain.mjs.map +0 -1
- package/dist/middlewares/create-auth-middleware.mjs +0 -28
- package/dist/middlewares/create-auth-middleware.mjs.map +0 -1
- package/dist/middlewares/types.mjs +0 -11
- package/dist/middlewares/types.mjs.map +0 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +0 -82
- package/dist/modules/accounts/actions/account-management.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/find-current-account.action.mjs +0 -10
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-currencies.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-timezones.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +0 -1
- package/dist/modules/accounts/hooks/current-account.hook.mjs +0 -24
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +0 -71
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useCurrencies.mjs +0 -17
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useTimezones.mjs +0 -17
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +0 -1
- package/dist/modules/accounts/services/account.service.mjs +0 -180
- package/dist/modules/accounts/services/account.service.mjs.map +0 -1
- package/dist/modules/accounts/services/currency.service.mjs +0 -24
- package/dist/modules/accounts/services/currency.service.mjs.map +0 -1
- package/dist/modules/accounts/services/timezone.service.mjs +0 -65
- package/dist/modules/accounts/services/timezone.service.mjs.map +0 -1
- package/dist/modules/accounts/services/two-factor.service.mjs +0 -77
- package/dist/modules/accounts/services/two-factor.service.mjs.map +0 -1
- package/dist/modules/accounts/types.mjs +0 -1
- package/dist/modules/accounts/types.mjs.map +0 -1
- package/dist/modules/auth/actions/login.action.mjs +0 -14
- package/dist/modules/auth/actions/login.action.mjs.map +0 -1
- package/dist/modules/auth/actions/logout.action.mjs +0 -14
- package/dist/modules/auth/actions/logout.action.mjs.map +0 -1
- package/dist/modules/auth/actions/register.action.mjs +0 -14
- package/dist/modules/auth/actions/register.action.mjs.map +0 -1
- package/dist/modules/auth/actions/validate-session.action.mjs +0 -60
- package/dist/modules/auth/actions/validate-session.action.mjs.map +0 -1
- package/dist/modules/auth/actions/verify-two-factor.action.mjs +0 -17
- package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +0 -1
- package/dist/modules/auth/hooks/login.hook.mjs +0 -13
- package/dist/modules/auth/hooks/login.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/logout.hook.mjs +0 -13
- package/dist/modules/auth/hooks/logout.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/register.hook.mjs +0 -13
- package/dist/modules/auth/hooks/register.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs +0 -63
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +0 -1
- package/dist/modules/auth/schema.mjs +0 -1
- package/dist/modules/auth/schema.mjs.map +0 -1
- package/dist/modules/auth/services/auth.service.mjs +0 -293
- package/dist/modules/auth/services/auth.service.mjs.map +0 -1
- package/dist/modules/auth/utils/get-user-context.mjs +0 -24
- package/dist/modules/auth/utils/get-user-context.mjs.map +0 -1
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +0 -10
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +0 -1
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +0 -76
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +0 -1
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +0 -31
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +0 -1
- package/dist/modules/ia-credits/types.mjs +0 -25
- package/dist/modules/ia-credits/types.mjs.map +0 -1
- package/dist/modules/projects/actions/add-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-available-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-available-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-project-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +0 -1
- package/dist/modules/projects/services/project-users.service.mjs +0 -78
- package/dist/modules/projects/services/project-users.service.mjs.map +0 -1
- package/dist/modules/projects/types.mjs +0 -22
- package/dist/modules/projects/types.mjs.map +0 -1
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +0 -10
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +0 -1
- package/dist/modules/subscriptions/constants/addons.constants.mjs +0 -12
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +0 -20
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +0 -18
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +0 -32
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +0 -1
- package/dist/modules/subscriptions/types.mjs +0 -57
- package/dist/modules/subscriptions/types.mjs.map +0 -1
- package/dist/modules/users/action/find-user-by-id.action.mjs +0 -10
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +0 -1
- package/dist/modules/users/action/list-messages.action.mjs +0 -13
- package/dist/modules/users/action/list-messages.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +0 -1
- package/dist/modules/users/hooks/messages.hook.mjs +0 -57
- package/dist/modules/users/hooks/messages.hook.mjs.map +0 -1
- package/dist/modules/users/schema/messages.schema.mjs +0 -21
- package/dist/modules/users/schema/messages.schema.mjs.map +0 -1
- package/dist/modules/users/schema.mjs +0 -11
- package/dist/modules/users/schema.mjs.map +0 -1
- package/dist/modules/users/services/messages.service.mjs +0 -35
- package/dist/modules/users/services/messages.service.mjs.map +0 -1
- package/dist/modules/users/services/user.service.mjs +0 -50
- package/dist/modules/users/services/user.service.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs +0 -15
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +0 -21
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +0 -1
- package/dist/modules/whitelabel/schema.mjs +0 -1
- package/dist/modules/whitelabel/schema.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs +0 -81
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel.service.mjs +0 -61
- package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs.map +0 -1
- package/dist/providers/auth.provider.mjs +0 -100
- package/dist/providers/auth.provider.mjs.map +0 -1
- package/dist/providers/query.provider.mjs +0 -99
- package/dist/providers/query.provider.mjs.map +0 -1
- package/dist/providers/whitelabel.provider.mjs +0 -31
- package/dist/providers/whitelabel.provider.mjs.map +0 -1
- package/dist/server.mjs +0 -84
- package/dist/server.mjs.map +0 -1
- package/dist/store/useAccountModals.mjs +0 -18
- package/dist/store/useAccountModals.mjs.map +0 -1
- package/dist/store/useMdSidebarStore.mjs +0 -11
- package/dist/store/useMdSidebarStore.mjs.map +0 -1
- package/dist/store/useMobileNavbarSheet.mjs +0 -14
- package/dist/store/useMobileNavbarSheet.mjs.map +0 -1
- package/dist/store/useModalManager.mjs +0 -75
- package/dist/store/useModalManager.mjs.map +0 -1
- package/dist/utils/browser/clipboard.mjs +0 -36
- package/dist/utils/browser/clipboard.mjs.map +0 -1
- package/dist/utils/file/index.mjs +0 -9
- package/dist/utils/file/index.mjs.map +0 -1
- package/dist/utils/format/masks.mjs +0 -56
- package/dist/utils/format/masks.mjs.map +0 -1
- package/dist/utils/intl/locales.mjs +0 -12
- package/dist/utils/intl/locales.mjs.map +0 -1
- package/dist/utils/safeServerAction.mjs +0 -16
- package/dist/utils/safeServerAction.mjs.map +0 -1
- package/dist/utils/validators/account.mjs +0 -26
- package/dist/utils/validators/account.mjs.map +0 -1
- package/dist/utils/validators/common.mjs +0 -47
- package/dist/utils/validators/common.mjs.map +0 -1
- package/dist/utils/withAction.mjs +0 -13
- package/dist/utils/withAction.mjs.map +0 -1
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ChevronLeft, X, MessageSquare } from "lucide-react";
|
|
4
|
-
import { Button } from "../../ui/buttons/Button";
|
|
5
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../ui/overlay/Dialog";
|
|
6
|
-
import { Separator } from "../../ui/data-display/Separator";
|
|
7
|
-
import { InputOTP, InputOTPGroup, InputOTPSlot } from "../../ui/form/InputOtp";
|
|
8
|
-
import PhoneInput from "../../ui/form/PhoneInput";
|
|
9
|
-
import { formatTimer, formatPhone } from "../../../utils/format/masks";
|
|
10
|
-
import { OTP_CODE_LENGTH } from "../../../utils/validators/account";
|
|
11
|
-
import { useAuth } from "../../../providers/auth.provider";
|
|
12
|
-
import { useInvalidateUser } from "../../../modules/auth/hooks/useUserQuery";
|
|
13
|
-
import { confirmPhoneChangeAction } from "../../../modules/accounts/actions/account-management.action";
|
|
14
|
-
import useChangePhoneForm from "../hooks/useChangePhoneForm";
|
|
15
|
-
import useOtpVerification from "../hooks/useOtpVerification";
|
|
16
|
-
function ChangePhoneModal({ open, onClose }) {
|
|
17
|
-
const { user } = useAuth();
|
|
18
|
-
const invalidateUser = useInvalidateUser();
|
|
19
|
-
const currentPhoneDisplay = user?.phone ? formatPhone(
|
|
20
|
-
user.ddi && user.phone.startsWith(user.ddi) ? user.phone.slice(user.ddi.length) : user.phone
|
|
21
|
-
) : "";
|
|
22
|
-
const {
|
|
23
|
-
showVerification,
|
|
24
|
-
phoneValue,
|
|
25
|
-
isSubmitting,
|
|
26
|
-
errors,
|
|
27
|
-
handlePhoneChange,
|
|
28
|
-
handleContinue,
|
|
29
|
-
handleBack,
|
|
30
|
-
resetForm
|
|
31
|
-
} = useChangePhoneForm();
|
|
32
|
-
const handleSuccess = () => {
|
|
33
|
-
invalidateUser();
|
|
34
|
-
resetForm();
|
|
35
|
-
onClose();
|
|
36
|
-
};
|
|
37
|
-
const {
|
|
38
|
-
code,
|
|
39
|
-
isLoading,
|
|
40
|
-
hasError,
|
|
41
|
-
timer,
|
|
42
|
-
canResend,
|
|
43
|
-
isValidLength,
|
|
44
|
-
handleCodeChange,
|
|
45
|
-
handleValidate,
|
|
46
|
-
handleResend,
|
|
47
|
-
reset: resetOtp
|
|
48
|
-
} = useOtpVerification({
|
|
49
|
-
onSuccess: handleSuccess,
|
|
50
|
-
successMessage: "Telefone alterado",
|
|
51
|
-
validateFn: async (token) => {
|
|
52
|
-
const result = await confirmPhoneChangeAction(token, phoneValue);
|
|
53
|
-
return result.success;
|
|
54
|
-
},
|
|
55
|
-
resendFn: async () => {
|
|
56
|
-
const { requestPhoneChangeAction } = await import("../../../modules/accounts/actions/account-management.action");
|
|
57
|
-
const result = await requestPhoneChangeAction(phoneValue);
|
|
58
|
-
if (!result.success) {
|
|
59
|
-
throw new Error(result.error);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
const handleClose = () => {
|
|
64
|
-
resetForm();
|
|
65
|
-
resetOtp();
|
|
66
|
-
onClose();
|
|
67
|
-
};
|
|
68
|
-
const handleBackFromVerification = () => {
|
|
69
|
-
resetOtp();
|
|
70
|
-
handleBack();
|
|
71
|
-
};
|
|
72
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(
|
|
73
|
-
DialogContent,
|
|
74
|
-
{
|
|
75
|
-
showCloseButton: false,
|
|
76
|
-
className: "flex flex-col p-0 gap-0 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-125! lg:h-auto! 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%]!",
|
|
77
|
-
children: [
|
|
78
|
-
showVerification ? /* @__PURE__ */ jsxs(DialogHeader, { className: "flex flex-row items-center justify-between px-4 py-3 border-b border-gray-200 lg:border-b-0", children: [
|
|
79
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", className: "size-8! p-0", onClick: handleBackFromVerification, children: /* @__PURE__ */ jsx(ChevronLeft, { size: 20, className: "text-gray-950" }) }),
|
|
80
|
-
/* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950 text-center flex-1", children: "Alterar telefone" }),
|
|
81
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", className: "size-8! p-0", onClick: handleClose, children: /* @__PURE__ */ jsx(X, { size: 18, className: "text-gray-500" }) })
|
|
82
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
-
/* @__PURE__ */ jsx(DialogHeader, { className: "sr-only", children: /* @__PURE__ */ jsx(DialogTitle, { children: "Alterar telefone" }) }),
|
|
84
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center px-4 py-3 relative border-b border-gray-200 lg:border-b-0", children: [
|
|
85
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-950 text-center", children: "Alterar telefone" }),
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
Button,
|
|
88
|
-
{
|
|
89
|
-
variant: "ghost",
|
|
90
|
-
className: "absolute right-2 size-8! p-0",
|
|
91
|
-
onClick: handleClose,
|
|
92
|
-
children: /* @__PURE__ */ jsx(X, { size: 18, className: "text-gray-500" })
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
] })
|
|
96
|
-
] }),
|
|
97
|
-
/* @__PURE__ */ jsx("div", { className: `${showVerification ? "w-full" : "w-1/2"} h-0.75 bg-pages-300` }),
|
|
98
|
-
showVerification ? /* @__PURE__ */ jsxs(
|
|
99
|
-
"form",
|
|
100
|
-
{
|
|
101
|
-
onSubmit: (e) => {
|
|
102
|
-
e.preventDefault();
|
|
103
|
-
handleValidate();
|
|
104
|
-
},
|
|
105
|
-
className: "flex flex-col flex-1 lg:flex-none",
|
|
106
|
-
children: [
|
|
107
|
-
/* @__PURE__ */ jsxs("div", { className: "px-4 lg:px-5 py-5 lg:py-6 flex flex-col gap-4 flex-1 lg:flex-none", children: [
|
|
108
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center size-12 bg-white rounded-lg shadow-xs border border-gray-200", children: /* @__PURE__ */ jsx(MessageSquare, { size: 20, className: "text-gray-950" }) }),
|
|
109
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
110
|
-
/* @__PURE__ */ jsx("h3", { className: "paragraph-medium-semibold text-gray-950", children: "C\xF3digo de valida\xE7\xE3o" }),
|
|
111
|
-
/* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-gray-600", children: [
|
|
112
|
-
"Enviamos um c\xF3digo de valida\xE7\xE3o para o n\xFAmero atual",
|
|
113
|
-
" ",
|
|
114
|
-
/* @__PURE__ */ jsxs("span", { className: "font-semibold text-gray-950", children: [
|
|
115
|
-
currentPhoneDisplay,
|
|
116
|
-
"."
|
|
117
|
-
] })
|
|
118
|
-
] })
|
|
119
|
-
] }),
|
|
120
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
121
|
-
/* @__PURE__ */ jsx(InputOTP, { maxLength: OTP_CODE_LENGTH, value: code, onChange: handleCodeChange, children: /* @__PURE__ */ jsx(InputOTPGroup, { className: "flex flex-row gap-2", children: [...Array(OTP_CODE_LENGTH)].map((_, i) => /* @__PURE__ */ jsx(
|
|
122
|
-
InputOTPSlot,
|
|
123
|
-
{
|
|
124
|
-
index: i,
|
|
125
|
-
className: `uppercase text-2xl font-medium w-11 lg:w-12 h-13 lg:h-14 rounded-lg border bg-white shadow-none [&_div.animate-caret-blink]:bg-gray-950 ${hasError ? "border-red-500" : "border-gray-200"}`
|
|
126
|
-
},
|
|
127
|
-
i
|
|
128
|
-
)) }) }),
|
|
129
|
-
hasError && /* @__PURE__ */ jsx("p", { className: "paragraph-small-regular text-red-500", children: "C\xF3digo incorreto" })
|
|
130
|
-
] }),
|
|
131
|
-
canResend ? /* @__PURE__ */ jsx(
|
|
132
|
-
"button",
|
|
133
|
-
{
|
|
134
|
-
type: "button",
|
|
135
|
-
onClick: handleResend,
|
|
136
|
-
className: "paragraph-small-medium text-gray-950 underline cursor-pointer hover:text-gray-700 w-fit",
|
|
137
|
-
children: "Reenviar c\xF3digo"
|
|
138
|
-
}
|
|
139
|
-
) : /* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-gray-500", children: [
|
|
140
|
-
"Reenviar em",
|
|
141
|
-
" ",
|
|
142
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950", children: formatTimer(timer) })
|
|
143
|
-
] })
|
|
144
|
-
] }),
|
|
145
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
146
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 lg:px-5 py-4 lg:py-5 mt-auto lg:mt-0", children: [
|
|
147
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10!", type: "button", onClick: handleClose, children: "Cancelar" }),
|
|
148
|
-
/* @__PURE__ */ jsx(Button, { className: "h-10!", type: "submit", disabled: !isValidLength || isLoading, children: isLoading ? "Validando..." : "Alterar telefone" })
|
|
149
|
-
] })
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
) : /* @__PURE__ */ jsxs("form", { onSubmit: handleContinue, className: "flex flex-col flex-1 lg:flex-none", children: [
|
|
153
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 lg:gap-6 px-4 lg:px-5 py-5 lg:py-6 flex-1 lg:flex-none", children: [
|
|
154
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
155
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-950", children: "Atualizar telefone de contato" }),
|
|
156
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-gray-600", children: "Informe o novo n\xFAmero para manter seu contato atualizado." })
|
|
157
|
-
] }),
|
|
158
|
-
/* @__PURE__ */ jsx(
|
|
159
|
-
PhoneInput,
|
|
160
|
-
{
|
|
161
|
-
label: "Novo n\xFAmero",
|
|
162
|
-
placeholder: "(00) 0 0000-0000",
|
|
163
|
-
value: phoneValue,
|
|
164
|
-
onChange: handlePhoneChange,
|
|
165
|
-
error: !!errors.phone,
|
|
166
|
-
errorMessage: errors.phone?.message
|
|
167
|
-
}
|
|
168
|
-
)
|
|
169
|
-
] }),
|
|
170
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0", children: [
|
|
171
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10!", type: "button", onClick: handleClose, children: "Cancelar" }),
|
|
172
|
-
/* @__PURE__ */ jsx(Button, { className: "h-10!", type: "submit", disabled: isSubmitting, children: isSubmitting ? "Enviando..." : "Continuar" })
|
|
173
|
-
] })
|
|
174
|
-
] })
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
) });
|
|
178
|
-
}
|
|
179
|
-
export {
|
|
180
|
-
ChangePhoneModal
|
|
181
|
-
};
|
|
182
|
-
//# sourceMappingURL=ChangePhoneModal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/sections/ChangePhoneModal.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { ChevronLeft, X, MessageSquare } from 'lucide-react';\r\nimport { Button } from '../../ui/buttons/Button';\r\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../ui/overlay/Dialog';\r\nimport { Separator } from '../../ui/data-display/Separator';\r\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '../../ui/form/InputOtp';\r\nimport PhoneInput from '../../ui/form/PhoneInput';\r\nimport { formatTimer, formatPhone } from '../../../utils/format/masks';\r\nimport { OTP_CODE_LENGTH } from '../../../utils/validators/account';\r\nimport { useAuth } from '../../../providers/auth.provider';\r\nimport { useInvalidateUser } from '../../../modules/auth/hooks/useUserQuery';\r\nimport { confirmPhoneChangeAction } from '../../../modules/accounts/actions/account-management.action';\r\nimport useChangePhoneForm from '../hooks/useChangePhoneForm';\r\nimport useOtpVerification from '../hooks/useOtpVerification';\r\n\r\ninterface ChangePhoneModalProps {\r\n open: boolean;\r\n onClose: () => void;\r\n}\r\n\r\nexport function ChangePhoneModal({ open, onClose }: ChangePhoneModalProps) {\r\n const { user } = useAuth();\r\n const invalidateUser = useInvalidateUser();\r\n\r\n const currentPhoneDisplay = user?.phone\r\n ? formatPhone(\r\n user.ddi && user.phone.startsWith(user.ddi) ? user.phone.slice(user.ddi.length) : user.phone\r\n )\r\n : '';\r\n\r\n const {\r\n showVerification,\r\n phoneValue,\r\n isSubmitting,\r\n errors,\r\n handlePhoneChange,\r\n handleContinue,\r\n handleBack,\r\n resetForm,\r\n } = useChangePhoneForm();\r\n\r\n const handleSuccess = () => {\r\n invalidateUser();\r\n resetForm();\r\n onClose();\r\n };\r\n\r\n const {\r\n code,\r\n isLoading,\r\n hasError,\r\n timer,\r\n canResend,\r\n isValidLength,\r\n handleCodeChange,\r\n handleValidate,\r\n handleResend,\r\n reset: resetOtp,\r\n } = useOtpVerification({\r\n onSuccess: handleSuccess,\r\n successMessage: 'Telefone alterado',\r\n validateFn: async (token) => {\r\n const result = await confirmPhoneChangeAction(token, phoneValue);\r\n return result.success;\r\n },\r\n resendFn: async () => {\r\n const { requestPhoneChangeAction } = await import('../../../modules/accounts/actions/account-management.action');\r\n const result = await requestPhoneChangeAction(phoneValue);\r\n if (!result.success) {\r\n throw new Error(result.error);\r\n }\r\n },\r\n });\r\n\r\n const handleClose = () => {\r\n resetForm();\r\n resetOtp();\r\n onClose();\r\n };\r\n\r\n const handleBackFromVerification = () => {\r\n resetOtp();\r\n handleBack();\r\n };\r\n\r\n return (\r\n <Dialog open={open} onOpenChange={handleClose}>\r\n <DialogContent\r\n showCloseButton={false}\r\n className=\"flex flex-col p-0 gap-0 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-125! lg:h-auto! 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%]!\"\r\n >\r\n {showVerification ? (\r\n <DialogHeader className=\"flex flex-row items-center justify-between px-4 py-3 border-b border-gray-200 lg:border-b-0\">\r\n <Button variant=\"ghost\" className=\"size-8! p-0\" onClick={handleBackFromVerification}>\r\n <ChevronLeft size={20} className=\"text-gray-950\" />\r\n </Button>\r\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950 text-center flex-1\">\r\n Alterar telefone\r\n </DialogTitle>\r\n <Button variant=\"ghost\" className=\"size-8! p-0\" onClick={handleClose}>\r\n <X size={18} className=\"text-gray-500\" />\r\n </Button>\r\n </DialogHeader>\r\n ) : (\r\n <>\r\n <DialogHeader className=\"sr-only\">\r\n <DialogTitle>Alterar telefone</DialogTitle>\r\n </DialogHeader>\r\n <div className=\"flex items-center justify-center px-4 py-3 relative border-b border-gray-200 lg:border-b-0\">\r\n <span className=\"paragraph-medium-semibold text-gray-950 text-center\">\r\n Alterar telefone\r\n </span>\r\n <Button\r\n variant=\"ghost\"\r\n className=\"absolute right-2 size-8! p-0\"\r\n onClick={handleClose}\r\n >\r\n <X size={18} className=\"text-gray-500\" />\r\n </Button>\r\n </div>\r\n </>\r\n )}\r\n\r\n <div className={`${showVerification ? 'w-full' : 'w-1/2'} h-0.75 bg-pages-300`} />\r\n\r\n {showVerification ? (\r\n <form\r\n onSubmit={(e) => {\r\n e.preventDefault();\r\n handleValidate();\r\n }}\r\n className=\"flex flex-col flex-1 lg:flex-none\"\r\n >\r\n <div className=\"px-4 lg:px-5 py-5 lg:py-6 flex flex-col gap-4 flex-1 lg:flex-none\">\r\n <div className=\"flex items-center justify-center size-12 bg-white rounded-lg shadow-xs border border-gray-200\">\r\n <MessageSquare size={20} className=\"text-gray-950\" />\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-1\">\r\n <h3 className=\"paragraph-medium-semibold text-gray-950\">Código de validação</h3>\r\n <p className=\"paragraph-small-regular text-gray-600\">\r\n Enviamos um código de validação para o número atual{' '}\r\n <span className=\"font-semibold text-gray-950\">{currentPhoneDisplay}.</span>\r\n </p>\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-2\">\r\n <InputOTP maxLength={OTP_CODE_LENGTH} value={code} onChange={handleCodeChange}>\r\n <InputOTPGroup className=\"flex flex-row gap-2\">\r\n {[...Array(OTP_CODE_LENGTH)].map((_, i) => (\r\n <InputOTPSlot\r\n key={i}\r\n index={i}\r\n className={`uppercase text-2xl font-medium w-11 lg:w-12 h-13 lg:h-14 rounded-lg border bg-white shadow-none [&_div.animate-caret-blink]:bg-gray-950 ${hasError ? 'border-red-500' : 'border-gray-200'}`}\r\n />\r\n ))}\r\n </InputOTPGroup>\r\n </InputOTP>\r\n {hasError && (\r\n <p className=\"paragraph-small-regular text-red-500\">Código incorreto</p>\r\n )}\r\n </div>\r\n\r\n {canResend ? (\r\n <button\r\n type=\"button\"\r\n onClick={handleResend}\r\n className=\"paragraph-small-medium text-gray-950 underline cursor-pointer hover:text-gray-700 w-fit\"\r\n >\r\n Reenviar código\r\n </button>\r\n ) : (\r\n <p className=\"paragraph-small-regular text-gray-500\">\r\n Reenviar em{' '}\r\n <span className=\"paragraph-small-semibold text-gray-950\">\r\n {formatTimer(timer)}\r\n </span>\r\n </p>\r\n )}\r\n </div>\r\n\r\n <Separator />\r\n\r\n <div className=\"flex items-center justify-between px-4 lg:px-5 py-4 lg:py-5 mt-auto lg:mt-0\">\r\n <Button variant=\"secondary\" className=\"h-10!\" type=\"button\" onClick={handleClose}>\r\n Cancelar\r\n </Button>\r\n <Button className=\"h-10!\" type=\"submit\" disabled={!isValidLength || isLoading}>\r\n {isLoading ? 'Validando...' : 'Alterar telefone'}\r\n </Button>\r\n </div>\r\n </form>\r\n ) : (\r\n <form onSubmit={handleContinue} className=\"flex flex-col flex-1 lg:flex-none\">\r\n <div className=\"flex flex-col gap-5 lg:gap-6 px-4 lg:px-5 py-5 lg:py-6 flex-1 lg:flex-none\">\r\n <div className=\"flex flex-col gap-1\">\r\n <span className=\"paragraph-medium-semibold text-gray-950\">\r\n Atualizar telefone de contato\r\n </span>\r\n <span className=\"paragraph-small-regular text-gray-600\">\r\n Informe o novo número para manter seu contato atualizado.\r\n </span>\r\n </div>\r\n\r\n <PhoneInput\r\n label=\"Novo número\"\r\n placeholder=\"(00) 0 0000-0000\"\r\n value={phoneValue}\r\n onChange={handlePhoneChange}\r\n error={!!errors.phone}\r\n errorMessage={errors.phone?.message}\r\n />\r\n </div>\r\n\r\n <div className=\"flex items-center justify-between p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0\">\r\n <Button variant=\"secondary\" className=\"h-10!\" type=\"button\" onClick={handleClose}>\r\n Cancelar\r\n </Button>\r\n <Button className=\"h-10!\" type=\"submit\" disabled={isSubmitting}>\r\n {isSubmitting ? 'Enviando...' : 'Continuar'}\r\n </Button>\r\n </div>\r\n </form>\r\n )}\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n"],"mappings":";AA6FU,SAYA,UAVI,KAFJ;AA3FV,SAAS,aAAa,GAAG,qBAAqB;AAC9C,SAAS,cAAc;AACvB,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,iBAAiB;AAC1B,SAAS,UAAU,eAAe,oBAAoB;AACtD,OAAO,gBAAgB;AACvB,SAAS,aAAa,mBAAmB;AACzC,SAAS,uBAAuB;AAChC,SAAS,eAAe;AACxB,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,OAAO,wBAAwB;AAC/B,OAAO,wBAAwB;AAOxB,SAAS,iBAAiB,EAAE,MAAM,QAAQ,GAA0B;A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AAA,aACF;AAAA,UAEA,qBAAC,SAAI,WAAU,yFACb;AAAA,gCAAC,UAAO,SAAQ,aAAY,WAAU,SAAQ,MAAK,UAAS,SAAS,aAAa,sBAElF;AAAA,YACA,oBAAC,UAAO,WAAU,SAAQ,MAAK,UAAS,UAAU,cAC/C,yBAAe,gBAAgB,aAClC;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useRef } from "react";
|
|
4
|
-
import Image from "next/image";
|
|
5
|
-
import { useForm } from "react-hook-form";
|
|
6
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
7
|
-
import { toast } from "sonner";
|
|
8
|
-
import { Upload, Trash } from "lucide-react";
|
|
9
|
-
import { Button } from "../../ui/buttons/Button";
|
|
10
|
-
import { Separator } from "../../ui/data-display/Separator";
|
|
11
|
-
import { Toast } from "../../ui/feedback/Toast";
|
|
12
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../ui/overlay/Dialog";
|
|
13
|
-
import { FormField } from "../../ui/form/FormField";
|
|
14
|
-
import { SelectField } from "../../ui/form/SelectField";
|
|
15
|
-
import PhoneInput from "../../ui/form/PhoneInput";
|
|
16
|
-
import { useAuth } from "../../../providers/auth.provider";
|
|
17
|
-
import { UserProfile } from "../../../modules/users/schema";
|
|
18
|
-
import { myProfileSchema } from "../../../utils/validators/account";
|
|
19
|
-
import {
|
|
20
|
-
useUpdateAccountUser,
|
|
21
|
-
useDeleteAccount,
|
|
22
|
-
useDeleteAccountUser
|
|
23
|
-
} from "../../../modules/accounts/hooks/useAccountManagement";
|
|
24
|
-
import { GENDER_OPTIONS } from "../constants";
|
|
25
|
-
import { ChangePhoneModal } from "./ChangePhoneModal";
|
|
26
|
-
import { ChangeEmailModal } from "./ChangeEmailModal";
|
|
27
|
-
function MyProfileSection({ onClose, storageUrl }) {
|
|
28
|
-
const { user, logout } = useAuth();
|
|
29
|
-
const updateAccountUser = useUpdateAccountUser();
|
|
30
|
-
const deleteAccount = useDeleteAccount();
|
|
31
|
-
const deleteAccountUser = useDeleteAccountUser();
|
|
32
|
-
const fileInputRef = useRef(null);
|
|
33
|
-
const [selectedPhoto, setSelectedPhoto] = useState(null);
|
|
34
|
-
const [photoRemoved, setPhotoRemoved] = useState(false);
|
|
35
|
-
const [changePhoneOpen, setChangePhoneOpen] = useState(false);
|
|
36
|
-
const [changeEmailOpen, setChangeEmailOpen] = useState(false);
|
|
37
|
-
const [deleteConfirmOpen, setDeleteConfirmOpen] = useState(false);
|
|
38
|
-
const isOwner = user?.profile === UserProfile.owner;
|
|
39
|
-
const isDeleting = deleteAccount.isPending || deleteAccountUser.isPending;
|
|
40
|
-
const form = useForm({
|
|
41
|
-
resolver: zodResolver(myProfileSchema),
|
|
42
|
-
mode: "onChange",
|
|
43
|
-
defaultValues: {
|
|
44
|
-
name: user?.name ?? "",
|
|
45
|
-
gender: GENDER_OPTIONS.find((g) => g.apiValue === user?.gender)?.value ?? ""
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const {
|
|
49
|
-
register,
|
|
50
|
-
handleSubmit,
|
|
51
|
-
watch,
|
|
52
|
-
setValue,
|
|
53
|
-
formState: { errors, isSubmitting }
|
|
54
|
-
} = form;
|
|
55
|
-
const baseStorageUrl = storageUrl ?? process.env.NEXT_PUBLIC_STORAGE_URL ?? "";
|
|
56
|
-
const avatarPreview = selectedPhoto ? URL.createObjectURL(selectedPhoto) : !photoRemoved && user?.photo ? `${baseStorageUrl}/${user.photo}` : null;
|
|
57
|
-
const handlePhotoChange = (e) => {
|
|
58
|
-
const file = e.target.files?.[0] ?? null;
|
|
59
|
-
if (file) {
|
|
60
|
-
setSelectedPhoto(file);
|
|
61
|
-
setPhotoRemoved(false);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const handleRemovePhoto = () => {
|
|
65
|
-
setSelectedPhoto(null);
|
|
66
|
-
setPhotoRemoved(true);
|
|
67
|
-
};
|
|
68
|
-
const handleDelete = async () => {
|
|
69
|
-
try {
|
|
70
|
-
if (isOwner) {
|
|
71
|
-
await deleteAccount.mutateAsync();
|
|
72
|
-
} else {
|
|
73
|
-
await deleteAccountUser.mutateAsync(user.id);
|
|
74
|
-
}
|
|
75
|
-
await logout();
|
|
76
|
-
} catch (error) {
|
|
77
|
-
toast.custom((t) => /* @__PURE__ */ jsx(
|
|
78
|
-
Toast,
|
|
79
|
-
{
|
|
80
|
-
variant: "error",
|
|
81
|
-
message: error instanceof Error ? error.message : "Erro ao excluir. Tente novamente.",
|
|
82
|
-
toastId: t
|
|
83
|
-
}
|
|
84
|
-
));
|
|
85
|
-
setDeleteConfirmOpen(false);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
const onSubmit = async (data) => {
|
|
89
|
-
try {
|
|
90
|
-
await updateAccountUser.mutateAsync({
|
|
91
|
-
name: data.name,
|
|
92
|
-
gender: GENDER_OPTIONS.find((g) => g.value === data.gender)?.apiValue,
|
|
93
|
-
...selectedPhoto ? { photo: selectedPhoto } : {},
|
|
94
|
-
...photoRemoved ? { photo: "" } : {}
|
|
95
|
-
});
|
|
96
|
-
form.reset(data);
|
|
97
|
-
setSelectedPhoto(null);
|
|
98
|
-
setPhotoRemoved(false);
|
|
99
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Perfil atualizado com sucesso", toastId: t }));
|
|
100
|
-
onClose();
|
|
101
|
-
} catch (error) {
|
|
102
|
-
toast.custom((t) => /* @__PURE__ */ jsx(
|
|
103
|
-
Toast,
|
|
104
|
-
{
|
|
105
|
-
variant: "error",
|
|
106
|
-
message: error instanceof Error ? error.message : "Erro ao atualizar perfil",
|
|
107
|
-
toastId: t
|
|
108
|
-
}
|
|
109
|
-
));
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
113
|
-
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit(onSubmit), className: "lg:h-full lg:flex lg:flex-col", children: [
|
|
114
|
-
/* @__PURE__ */ jsx(
|
|
115
|
-
"input",
|
|
116
|
-
{
|
|
117
|
-
ref: fileInputRef,
|
|
118
|
-
type: "file",
|
|
119
|
-
accept: "image/*",
|
|
120
|
-
className: "hidden",
|
|
121
|
-
onChange: handlePhotoChange
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 overflow-y-auto overscroll-contain px-4 pb-20 lg:p-5 lg:static lg:flex-1 lg:min-h-0 lg:overscroll-auto flex flex-col gap-5 lg:gap-6", children: [
|
|
125
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-950 hidden lg:block", children: "Meu perfil" }),
|
|
126
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
127
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
128
|
-
avatarPreview ? /* @__PURE__ */ jsx(
|
|
129
|
-
Image,
|
|
130
|
-
{
|
|
131
|
-
src: avatarPreview,
|
|
132
|
-
alt: "Foto do usu\xE1rio",
|
|
133
|
-
width: 48,
|
|
134
|
-
height: 48,
|
|
135
|
-
className: "size-12 rounded-full object-cover cursor-pointer",
|
|
136
|
-
onClick: () => fileInputRef.current?.click()
|
|
137
|
-
}
|
|
138
|
-
) : /* @__PURE__ */ jsx(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
className: "size-12 rounded-full bg-gray-50 border border-dashed border-gray-200 flex items-center justify-center cursor-pointer",
|
|
142
|
-
onClick: () => fileInputRef.current?.click(),
|
|
143
|
-
children: /* @__PURE__ */ jsx(Upload, { size: 20, className: "text-gray-400" })
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
avatarPreview ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
147
|
-
/* @__PURE__ */ jsx(
|
|
148
|
-
Button,
|
|
149
|
-
{
|
|
150
|
-
variant: "secondary",
|
|
151
|
-
className: "w-fit h-8!",
|
|
152
|
-
type: "button",
|
|
153
|
-
onClick: () => fileInputRef.current?.click(),
|
|
154
|
-
children: "Alterar foto"
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ jsx(
|
|
158
|
-
Button,
|
|
159
|
-
{
|
|
160
|
-
type: "button",
|
|
161
|
-
variant: "ghost",
|
|
162
|
-
className: "h-8!",
|
|
163
|
-
onClick: handleRemovePhoto,
|
|
164
|
-
children: /* @__PURE__ */ jsx(Trash, { size: 16, className: "text-gray-500" })
|
|
165
|
-
}
|
|
166
|
-
)
|
|
167
|
-
] }) : /* @__PURE__ */ jsx(
|
|
168
|
-
Button,
|
|
169
|
-
{
|
|
170
|
-
variant: "secondary",
|
|
171
|
-
className: "w-fit h-8!",
|
|
172
|
-
type: "button",
|
|
173
|
-
onClick: () => fileInputRef.current?.click(),
|
|
174
|
-
children: "Alterar foto"
|
|
175
|
-
}
|
|
176
|
-
)
|
|
177
|
-
] }),
|
|
178
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", children: [
|
|
179
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
180
|
-
/* @__PURE__ */ jsx(
|
|
181
|
-
FormField,
|
|
182
|
-
{
|
|
183
|
-
label: "Nome completo",
|
|
184
|
-
placeholder: "Digite seu nome",
|
|
185
|
-
error: !!errors.name,
|
|
186
|
-
errorMessage: errors.name?.message,
|
|
187
|
-
...register("name")
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
191
|
-
SelectField,
|
|
192
|
-
{
|
|
193
|
-
label: "G\xEAnero",
|
|
194
|
-
placeholder: "Selecione seu g\xEAnero",
|
|
195
|
-
options: GENDER_OPTIONS,
|
|
196
|
-
value: watch("gender"),
|
|
197
|
-
className: "h-10!",
|
|
198
|
-
onChange: (value) => setValue("gender", value)
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
202
|
-
/* @__PURE__ */ jsx(
|
|
203
|
-
PhoneInput,
|
|
204
|
-
{
|
|
205
|
-
label: "Telefone",
|
|
206
|
-
value: user?.phone ?? "",
|
|
207
|
-
disabled: true,
|
|
208
|
-
classnameContainer: "bg-gray-50 border-0!"
|
|
209
|
-
}
|
|
210
|
-
),
|
|
211
|
-
/* @__PURE__ */ jsx(
|
|
212
|
-
"button",
|
|
213
|
-
{
|
|
214
|
-
type: "button",
|
|
215
|
-
className: "absolute right-3 top-5.5 h-10 flex items-center paragraph-xsmall-semibold text-gray-950 underline cursor-pointer",
|
|
216
|
-
onClick: () => setChangePhoneOpen(true),
|
|
217
|
-
children: "Alterar"
|
|
218
|
-
}
|
|
219
|
-
)
|
|
220
|
-
] })
|
|
221
|
-
] }),
|
|
222
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
223
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
224
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-600", children: "Dados de acesso" }),
|
|
225
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
226
|
-
/* @__PURE__ */ jsx(
|
|
227
|
-
FormField,
|
|
228
|
-
{
|
|
229
|
-
label: "E-mail",
|
|
230
|
-
value: user?.email ?? "",
|
|
231
|
-
disabled: true,
|
|
232
|
-
classnameContainer: "bg-gray-50 border-0!"
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
/* @__PURE__ */ jsx(
|
|
236
|
-
"button",
|
|
237
|
-
{
|
|
238
|
-
type: "button",
|
|
239
|
-
className: "absolute right-3 top-5.5 h-10 flex items-center paragraph-xsmall-semibold text-gray-950 underline cursor-pointer",
|
|
240
|
-
onClick: () => setChangeEmailOpen(true),
|
|
241
|
-
children: "Alterar"
|
|
242
|
-
}
|
|
243
|
-
)
|
|
244
|
-
] })
|
|
245
|
-
] })
|
|
246
|
-
] })
|
|
247
|
-
] })
|
|
248
|
-
] }),
|
|
249
|
-
/* @__PURE__ */ jsxs("div", { className: "fixed bottom-0 left-0 right-0 lg:static flex items-center h-20 px-4 lg:px-5 border-t border-gray-200 justify-between bg-white z-10", children: [
|
|
250
|
-
/* @__PURE__ */ jsx(
|
|
251
|
-
Button,
|
|
252
|
-
{
|
|
253
|
-
variant: "secondary",
|
|
254
|
-
className: "h-10!",
|
|
255
|
-
type: "button",
|
|
256
|
-
disabled: isSubmitting,
|
|
257
|
-
onClick: () => {
|
|
258
|
-
form.reset();
|
|
259
|
-
setSelectedPhoto(null);
|
|
260
|
-
setPhotoRemoved(false);
|
|
261
|
-
onClose();
|
|
262
|
-
},
|
|
263
|
-
children: "Cancelar"
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
/* @__PURE__ */ jsx(Button, { className: "h-10! cursor-pointer", type: "submit", disabled: isSubmitting, children: isSubmitting ? "Salvando..." : "Salvar altera\xE7\xF5es" })
|
|
267
|
-
] })
|
|
268
|
-
] }),
|
|
269
|
-
/* @__PURE__ */ jsx(ChangePhoneModal, { open: changePhoneOpen, onClose: () => setChangePhoneOpen(false) }),
|
|
270
|
-
/* @__PURE__ */ jsx(ChangeEmailModal, { open: changeEmailOpen, onClose: () => setChangeEmailOpen(false) }),
|
|
271
|
-
/* @__PURE__ */ jsx(Dialog, { open: deleteConfirmOpen, onOpenChange: setDeleteConfirmOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-sm! gap-5", children: [
|
|
272
|
-
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-large-semibold text-gray-950", children: isOwner ? "Excluir conta" : "Excluir usu\xE1rio" }) }),
|
|
273
|
-
/* @__PURE__ */ jsx("p", { className: "paragraph-small-regular text-gray-600", children: isOwner ? "Tem certeza que deseja excluir sua conta? Todos os dados ser\xE3o apagados permanentemente e essa a\xE7\xE3o n\xE3o pode ser desfeita." : "Tem certeza que deseja excluir seu usu\xE1rio? Voc\xEA perder\xE1 acesso a esta conta permanentemente." }),
|
|
274
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 justify-end", children: [
|
|
275
|
-
/* @__PURE__ */ jsx(
|
|
276
|
-
Button,
|
|
277
|
-
{
|
|
278
|
-
type: "button",
|
|
279
|
-
variant: "secondary",
|
|
280
|
-
className: "h-10!",
|
|
281
|
-
disabled: isDeleting,
|
|
282
|
-
onClick: () => setDeleteConfirmOpen(false),
|
|
283
|
-
children: "Cancelar"
|
|
284
|
-
}
|
|
285
|
-
),
|
|
286
|
-
/* @__PURE__ */ jsx(
|
|
287
|
-
Button,
|
|
288
|
-
{
|
|
289
|
-
type: "button",
|
|
290
|
-
className: "h-10! bg-red-600 hover:bg-red-700 text-white border-0!",
|
|
291
|
-
disabled: isDeleting,
|
|
292
|
-
onClick: handleDelete,
|
|
293
|
-
children: isDeleting ? "Excluindo..." : "Confirmar exclus\xE3o"
|
|
294
|
-
}
|
|
295
|
-
)
|
|
296
|
-
] })
|
|
297
|
-
] }) })
|
|
298
|
-
] });
|
|
299
|
-
}
|
|
300
|
-
export {
|
|
301
|
-
MyProfileSection
|
|
302
|
-
};
|
|
303
|
-
//# sourceMappingURL=MyProfileSection.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/sections/MyProfileSection.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useState, useRef } from 'react';\r\nimport Image from 'next/image';\r\nimport { useForm } from 'react-hook-form';\r\nimport { zodResolver } from '@hookform/resolvers/zod';\r\nimport { toast } from 'sonner';\r\nimport { Upload, Trash } from 'lucide-react';\r\nimport { Button } from '../../ui/buttons/Button';\r\nimport { Separator } from '../../ui/data-display/Separator';\r\nimport { Toast } from '../../ui/feedback/Toast';\r\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../ui/overlay/Dialog';\r\nimport { FormField } from '../../ui/form/FormField';\r\nimport { SelectField } from '../../ui/form/SelectField';\r\nimport PhoneInput from '../../ui/form/PhoneInput';\r\nimport { useAuth } from '../../../providers/auth.provider';\r\nimport { UserProfile } from '../../../modules/users/schema';\r\nimport { myProfileSchema, type MyProfileFormData } from '../../../utils/validators/account';\r\nimport {\r\n useUpdateAccountUser,\r\n useDeleteAccount,\r\n useDeleteAccountUser,\r\n} from '../../../modules/accounts/hooks/useAccountManagement';\r\nimport { GENDER_OPTIONS } from '../constants';\r\nimport { ChangePhoneModal } from './ChangePhoneModal';\r\nimport { ChangeEmailModal } from './ChangeEmailModal';\r\n\r\ninterface MyProfileSectionProps {\r\n onClose: () => void;\r\n storageUrl?: string;\r\n}\r\n\r\nexport function MyProfileSection({ onClose, storageUrl }: MyProfileSectionProps) {\r\n const { user, logout } = useAuth();\r\n const updateAccountUser = useUpdateAccountUser();\r\n const deleteAccount = useDeleteAccount();\r\n const deleteAccountUser = useDeleteAccountUser();\r\n const fileInputRef = useRef<HTMLInputElement>(null);\r\n const [selectedPhoto, setSelectedPhoto] = useState<File | null>(null);\r\n const [photoRemoved, setPhotoRemoved] = useState(false);\r\n const [changePhoneOpen, setChangePhoneOpen] = useState(false);\r\n const [changeEmailOpen, setChangeEmailOpen] = useState(false);\r\n const [deleteConfirmOpen, setDeleteConfirmOpen] = useState(false);\r\n\r\n const isOwner = user?.profile === UserProfile.owner;\r\n const isDeleting = deleteAccount.isPending || deleteAccountUser.isPending;\r\n\r\n const form = useForm<MyProfileFormData>({\r\n resolver: zodResolver(myProfileSchema),\r\n mode: 'onChange',\r\n defaultValues: {\r\n name: user?.name ?? '',\r\n gender: GENDER_OPTIONS.find((g) => g.apiValue === user?.gender)?.value ?? '',\r\n },\r\n });\r\n\r\n const {\r\n register,\r\n handleSubmit,\r\n watch,\r\n setValue,\r\n formState: { errors, isSubmitting },\r\n } = form;\r\n\r\n const baseStorageUrl = storageUrl ?? process.env.NEXT_PUBLIC_STORAGE_URL ?? '';\r\n\r\n const avatarPreview = selectedPhoto\r\n ? URL.createObjectURL(selectedPhoto)\r\n : !photoRemoved && user?.photo\r\n ? `${baseStorageUrl}/${user.photo}`\r\n : null;\r\n\r\n const handlePhotoChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n const file = e.target.files?.[0] ?? null;\r\n if (file) {\r\n setSelectedPhoto(file);\r\n setPhotoRemoved(false);\r\n }\r\n };\r\n\r\n const handleRemovePhoto = () => {\r\n setSelectedPhoto(null);\r\n setPhotoRemoved(true);\r\n };\r\n\r\n const handleDelete = async () => {\r\n try {\r\n if (isOwner) {\r\n await deleteAccount.mutateAsync();\r\n } else {\r\n await deleteAccountUser.mutateAsync(user!.id);\r\n }\r\n await logout();\r\n } catch (error) {\r\n toast.custom((t) => (\r\n <Toast\r\n variant=\"error\"\r\n message={error instanceof Error ? error.message : 'Erro ao excluir. Tente novamente.'}\r\n toastId={t}\r\n />\r\n ));\r\n setDeleteConfirmOpen(false);\r\n }\r\n };\r\n\r\n const onSubmit = async (data: MyProfileFormData) => {\r\n try {\r\n await updateAccountUser.mutateAsync({\r\n name: data.name,\r\n gender: GENDER_OPTIONS.find((g) => g.value === data.gender)?.apiValue,\r\n ...(selectedPhoto ? { photo: selectedPhoto } : {}),\r\n ...(photoRemoved ? { photo: '' } : {}),\r\n });\r\n\r\n form.reset(data);\r\n setSelectedPhoto(null);\r\n setPhotoRemoved(false);\r\n toast.custom((t) => (\r\n <Toast variant=\"success\" message=\"Perfil atualizado com sucesso\" toastId={t} />\r\n ));\r\n onClose();\r\n } catch (error) {\r\n toast.custom((t) => (\r\n <Toast\r\n variant=\"error\"\r\n message={error instanceof Error ? error.message : 'Erro ao atualizar perfil'}\r\n toastId={t}\r\n />\r\n ));\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"lg:h-full lg:flex lg:flex-col\">\r\n <input\r\n ref={fileInputRef}\r\n type=\"file\"\r\n accept=\"image/*\"\r\n className=\"hidden\"\r\n onChange={handlePhotoChange}\r\n />\r\n <div className=\"absolute inset-0 overflow-y-auto overscroll-contain px-4 pb-20 lg:p-5 lg:static lg:flex-1 lg:min-h-0 lg:overscroll-auto flex flex-col gap-5 lg:gap-6\">\r\n <span className=\"paragraph-medium-semibold text-gray-950 hidden lg:block\">\r\n Meu perfil\r\n </span>\r\n <div className=\"flex flex-col gap-5\">\r\n <div className=\"flex items-center gap-4\">\r\n {avatarPreview ? (\r\n <Image\r\n src={avatarPreview}\r\n alt=\"Foto do usuário\"\r\n width={48}\r\n height={48}\r\n className=\"size-12 rounded-full object-cover cursor-pointer\"\r\n onClick={() => fileInputRef.current?.click()}\r\n />\r\n ) : (\r\n <div\r\n className=\"size-12 rounded-full bg-gray-50 border border-dashed border-gray-200 flex items-center justify-center cursor-pointer\"\r\n onClick={() => fileInputRef.current?.click()}\r\n >\r\n <Upload size={20} className=\"text-gray-400\" />\r\n </div>\r\n )}\r\n {avatarPreview ? (\r\n <div className=\"flex items-center gap-2\">\r\n <Button\r\n variant=\"secondary\"\r\n className=\"w-fit h-8!\"\r\n type=\"button\"\r\n onClick={() => fileInputRef.current?.click()}\r\n >\r\n Alterar foto\r\n </Button>\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n className=\"h-8!\"\r\n onClick={handleRemovePhoto}\r\n >\r\n <Trash size={16} className=\"text-gray-500\" />\r\n </Button>\r\n </div>\r\n ) : (\r\n <Button\r\n variant=\"secondary\"\r\n className=\"w-fit h-8!\"\r\n type=\"button\"\r\n onClick={() => fileInputRef.current?.click()}\r\n >\r\n Alterar foto\r\n </Button>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-8\">\r\n <div className=\"flex flex-col gap-4\">\r\n <FormField\r\n label=\"Nome completo\"\r\n placeholder=\"Digite seu nome\"\r\n error={!!errors.name}\r\n errorMessage={errors.name?.message}\r\n {...register('name')}\r\n />\r\n <SelectField\r\n label=\"Gênero\"\r\n placeholder=\"Selecione seu gênero\"\r\n options={GENDER_OPTIONS}\r\n value={watch('gender')}\r\n className=\"h-10!\"\r\n onChange={(value) => setValue('gender', value as string)}\r\n />\r\n <div className=\"relative\">\r\n <PhoneInput\r\n label=\"Telefone\"\r\n value={user?.phone ?? ''}\r\n disabled\r\n classnameContainer=\"bg-gray-50 border-0!\"\r\n />\r\n <button\r\n type=\"button\"\r\n className=\"absolute right-3 top-5.5 h-10 flex items-center paragraph-xsmall-semibold text-gray-950 underline cursor-pointer\"\r\n onClick={() => setChangePhoneOpen(true)}\r\n >\r\n Alterar\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <Separator />\r\n\r\n <div className=\"flex flex-col gap-4\">\r\n <span className=\"paragraph-medium-semibold text-gray-600\">Dados de acesso</span>\r\n <div className=\"relative\">\r\n <FormField\r\n label=\"E-mail\"\r\n value={user?.email ?? ''}\r\n disabled\r\n classnameContainer=\"bg-gray-50 border-0!\"\r\n />\r\n <button\r\n type=\"button\"\r\n className=\"absolute right-3 top-5.5 h-10 flex items-center paragraph-xsmall-semibold text-gray-950 underline cursor-pointer\"\r\n onClick={() => setChangeEmailOpen(true)}\r\n >\r\n Alterar\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"fixed bottom-0 left-0 right-0 lg:static flex items-center h-20 px-4 lg:px-5 border-t border-gray-200 justify-between bg-white z-10\">\r\n <Button\r\n variant=\"secondary\"\r\n className=\"h-10!\"\r\n type=\"button\"\r\n disabled={isSubmitting}\r\n onClick={() => {\r\n form.reset();\r\n setSelectedPhoto(null);\r\n setPhotoRemoved(false);\r\n onClose();\r\n }}\r\n >\r\n Cancelar\r\n </Button>\r\n <Button className=\"h-10! cursor-pointer\" type=\"submit\" disabled={isSubmitting}>\r\n {isSubmitting ? 'Salvando...' : 'Salvar alterações'}\r\n </Button>\r\n </div>\r\n </form>\r\n\r\n <ChangePhoneModal open={changePhoneOpen} onClose={() => setChangePhoneOpen(false)} />\r\n <ChangeEmailModal open={changeEmailOpen} onClose={() => setChangeEmailOpen(false)} />\r\n\r\n <Dialog open={deleteConfirmOpen} onOpenChange={setDeleteConfirmOpen}>\r\n <DialogContent className=\"max-w-sm! gap-5\">\r\n <DialogHeader>\r\n <DialogTitle className=\"paragraph-large-semibold text-gray-950\">\r\n {isOwner ? 'Excluir conta' : 'Excluir usuário'}\r\n </DialogTitle>\r\n </DialogHeader>\r\n <p className=\"paragraph-small-regular text-gray-600\">\r\n {isOwner\r\n ? 'Tem certeza que deseja excluir sua conta? Todos os dados serão apagados permanentemente e essa ação não pode ser desfeita.'\r\n : 'Tem certeza que deseja excluir seu usuário? Você perderá acesso a esta conta permanentemente.'}\r\n </p>\r\n <div className=\"flex items-center gap-3 justify-end\">\r\n <Button\r\n type=\"button\"\r\n variant=\"secondary\"\r\n className=\"h-10!\"\r\n disabled={isDeleting}\r\n onClick={() => setDeleteConfirmOpen(false)}\r\n >\r\n Cancelar\r\n </Button>\r\n <Button\r\n type=\"button\"\r\n className=\"h-10! bg-red-600 hover:bg-red-700 text-white border-0!\"\r\n disabled={isDeleting}\r\n onClick={handleDelete}\r\n >\r\n {isDeleting ? 'Excluindo...' : 'Confirmar exclusão'}\r\n </Button>\r\n </div>\r\n </DialogContent>\r\n </Dialog>\r\n </>\r\n );\r\n}\r\n"],"mappings":";AA+FQ,SAsCJ,UAtCI,KAuEQ,YAvER;AA7FR,SAAS,UAAU,cAAc;AACjC,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,QAAQ,aAAa;AAC9B,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,OAAO,gBAAgB;AAC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