@greatapps/common 1.1.790 → 1.1.791
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/AccountHubLinkHandler.mjs +36 -0
- package/dist/components/account/AccountHubLinkHandler.mjs.map +1 -0
- package/dist/components/account/AccountModalLayout.mjs +137 -0
- package/dist/components/account/AccountModalLayout.mjs.map +1 -0
- package/dist/components/account/AccountModals.mjs +10 -3
- package/dist/components/account/AccountModals.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +1 -1
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/MyAccountModal.mjs +167 -0
- package/dist/components/account/MyAccountModal.mjs.map +1 -0
- package/dist/components/account/TwoFactorAuthModal.mjs +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/hooks/useAccountHubActions.mjs +85 -0
- package/dist/components/account/hooks/useAccountHubActions.mjs.map +1 -0
- package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs +44 -0
- package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs.map +1 -0
- package/dist/components/account/hooks/useAffiliatesActions.mjs +69 -0
- package/dist/components/account/hooks/useAffiliatesActions.mjs.map +1 -0
- package/dist/components/account/hooks/useMyAccountModal.mjs +27 -0
- package/dist/components/account/hooks/useMyAccountModal.mjs.map +1 -0
- package/dist/components/account/hooks/useProjectsActions.mjs +40 -0
- package/dist/components/account/hooks/useProjectsActions.mjs.map +1 -0
- package/dist/components/account/hooks/useSubscriptionActions.mjs +87 -0
- package/dist/components/account/hooks/useSubscriptionActions.mjs.map +1 -0
- package/dist/components/account/hooks/useTeamActions.mjs +31 -0
- package/dist/components/account/hooks/useTeamActions.mjs.map +1 -0
- package/dist/components/account/sections/AffiliatesSection.mjs +313 -0
- package/dist/components/account/sections/AffiliatesSection.mjs.map +1 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs +5 -5
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +194 -144
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +60 -49
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/ProjectsSection.mjs +77 -0
- package/dist/components/account/sections/ProjectsSection.mjs.map +1 -0
- package/dist/components/account/sections/SecuritySection.mjs +55 -36
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/SubscriptionSection.mjs +29 -0
- package/dist/components/account/sections/SubscriptionSection.mjs.map +1 -0
- package/dist/components/account/sections/TeamSection.mjs +119 -0
- package/dist/components/account/sections/TeamSection.mjs.map +1 -0
- package/dist/components/account/sections/TokenSection.mjs +41 -43
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs +73 -0
- package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateFlows.mjs +20 -0
- package/dist/components/account/sections/affiliates/AffiliateFlows.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs +99 -0
- package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs +31 -0
- package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs +15 -0
- package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs +108 -0
- package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs +49 -0
- package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs +182 -0
- package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs +476 -0
- package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs +34 -0
- package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs +27 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs +30 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs +120 -0
- package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs.map +1 -0
- package/dist/components/account/sections/projects/DeleteProjectModal.mjs +205 -0
- package/dist/components/account/sections/projects/DeleteProjectModal.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectFlows.mjs +16 -0
- package/dist/components/account/sections/projects/ProjectFlows.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectMembersStack.mjs +53 -0
- package/dist/components/account/sections/projects/ProjectMembersStack.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectRow.mjs +85 -0
- package/dist/components/account/sections/projects/ProjectRow.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectSheet.mjs +499 -0
- package/dist/components/account/sections/projects/ProjectSheet.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs +55 -0
- package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs.map +1 -0
- package/dist/components/account/sections/projects/project-form.schema.mjs +28 -0
- package/dist/components/account/sections/projects/project-form.schema.mjs.map +1 -0
- package/dist/components/account/sections/shared/ConnectListRow.mjs +45 -0
- package/dist/components/account/sections/shared/ConnectListRow.mjs.map +1 -0
- package/dist/components/account/sections/shared/DateFilterPopover.mjs +51 -0
- package/dist/components/account/sections/shared/DateFilterPopover.mjs.map +1 -0
- package/dist/components/account/sections/shared/EntityAvatar.mjs +41 -0
- package/dist/components/account/sections/shared/EntityAvatar.mjs.map +1 -0
- package/dist/components/account/sections/shared/FilterPopover.mjs +62 -0
- package/dist/components/account/sections/shared/FilterPopover.mjs.map +1 -0
- package/dist/components/account/sections/shared/FormSection.mjs +14 -0
- package/dist/components/account/sections/shared/FormSection.mjs.map +1 -0
- package/dist/components/account/sections/shared/IconBox.mjs +18 -0
- package/dist/components/account/sections/shared/IconBox.mjs.map +1 -0
- package/dist/components/account/sections/shared/InfiniteScrollList.mjs +36 -0
- package/dist/components/account/sections/shared/InfiniteScrollList.mjs.map +1 -0
- package/dist/components/account/sections/shared/ListPagination.mjs +69 -0
- package/dist/components/account/sections/shared/ListPagination.mjs.map +1 -0
- package/dist/components/account/sections/shared/RowActionsMenu.mjs +52 -0
- package/dist/components/account/sections/shared/RowActionsMenu.mjs.map +1 -0
- package/dist/components/account/sections/shared/SectionLoadError.mjs +20 -0
- package/dist/components/account/sections/shared/SectionLoadError.mjs.map +1 -0
- package/dist/components/account/sections/shared/StatusBadge.mjs +26 -0
- package/dist/components/account/sections/shared/StatusBadge.mjs.map +1 -0
- package/dist/components/account/sections/shared/WorkspaceSection.mjs +10 -0
- package/dist/components/account/sections/shared/WorkspaceSection.mjs.map +1 -0
- package/dist/components/account/sections/subscription/AiCreditsUsage.mjs +106 -0
- package/dist/components/account/sections/subscription/AiCreditsUsage.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BillingAddressSheet.mjs +407 -0
- package/dist/components/account/sections/subscription/BillingAddressSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs +73 -0
- package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs +22 -0
- package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/CancelPlanDialog.mjs +161 -0
- package/dist/components/account/sections/subscription/CancelPlanDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargeRow.mjs +127 -0
- package/dist/components/account/sections/subscription/ChargeRow.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs +27 -0
- package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargesList.mjs +88 -0
- package/dist/components/account/sections/subscription/ChargesList.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ManageCardsSheet.mjs +49 -0
- package/dist/components/account/sections/subscription/ManageCardsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs +26 -0
- package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PayChargeDialog.mjs +222 -0
- package/dist/components/account/sections/subscription/PayChargeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs +61 -0
- package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs +72 -0
- package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PendingChangeDialog.mjs +117 -0
- package/dist/components/account/sections/subscription/PendingChangeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PixDetailsDialog.mjs +165 -0
- package/dist/components/account/sections/subscription/PixDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PixPaymentDialog.mjs +155 -0
- package/dist/components/account/sections/subscription/PixPaymentDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs +253 -0
- package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs +237 -0
- package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/SubscriptionFlows.mjs +40 -0
- package/dist/components/account/sections/subscription/SubscriptionFlows.mjs.map +1 -0
- package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs +303 -0
- package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/UsageReportSheet.mjs +163 -0
- package/dist/components/account/sections/subscription/UsageReportSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs +75 -0
- package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs +55 -0
- package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs +188 -0
- package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs +66 -0
- package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs +42 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs +119 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs +17 -0
- package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs +130 -0
- package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs +38 -0
- package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs +127 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs +111 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs +69 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs +88 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs +115 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs +918 -0
- package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs.map +1 -0
- package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs +216 -0
- package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs +128 -0
- package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlanCard.mjs +281 -0
- package/dist/components/account/sections/subscription/plans/PlanCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs +53 -0
- package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs +119 -0
- package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs.map +1 -0
- package/dist/components/account/sections/team/DeleteUserModal.mjs +116 -0
- package/dist/components/account/sections/team/DeleteUserModal.mjs.map +1 -0
- package/dist/components/account/sections/team/TeamFlows.mjs +14 -0
- package/dist/components/account/sections/team/TeamFlows.mjs.map +1 -0
- package/dist/components/account/sections/team/TeamMemberRow.mjs +99 -0
- package/dist/components/account/sections/team/TeamMemberRow.mjs.map +1 -0
- package/dist/components/account/sections/team/UserSheet.mjs +570 -0
- package/dist/components/account/sections/team/UserSheet.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/NotificationsStep.mjs +80 -0
- package/dist/components/account/sections/team/steps/NotificationsStep.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs +180 -0
- package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/UserInformationStep.mjs +371 -0
- package/dist/components/account/sections/team/steps/UserInformationStep.mjs.map +1 -0
- package/dist/components/account/sections/team/user-form.schema.mjs +37 -0
- package/dist/components/account/sections/team/user-form.schema.mjs.map +1 -0
- package/dist/components/account/types/workspace-actions.type.mjs +1 -0
- package/dist/components/account/types/workspace-actions.type.mjs.map +1 -0
- package/dist/components/layouts/ProfilePopover.mjs +10 -12
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +7 -4
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/AccountDeletionWarningModal.mjs +4 -5
- package/dist/components/modals/AccountDeletionWarningModal.mjs.map +1 -1
- package/dist/components/modals/AccountFrozenModal.mjs +6 -3
- package/dist/components/modals/AccountFrozenModal.mjs.map +1 -1
- package/dist/components/modals/Modals.mjs +3 -3
- package/dist/components/modals/Modals.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +4 -5
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddFirstCardWarningModal.mjs +63 -0
- package/dist/components/modals/cards/AddFirstCardWarningModal.mjs.map +1 -0
- package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs +187 -0
- package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs.map +1 -0
- package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs +5 -4
- package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +9 -1
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentMethodIcons.mjs +50 -0
- package/dist/components/ui/data-display/PaymentMethodIcons.mjs.map +1 -0
- package/dist/components/ui/form/BillingPeriodSelector.mjs +108 -0
- package/dist/components/ui/form/BillingPeriodSelector.mjs.map +1 -0
- package/dist/components/ui/form/PaymentMethodToggle.mjs +82 -0
- package/dist/components/ui/form/PaymentMethodToggle.mjs.map +1 -0
- package/dist/components/ui/form/RadioOptionFieldIcon.mjs +57 -0
- package/dist/components/ui/form/RadioOptionFieldIcon.mjs.map +1 -0
- package/dist/components/ui/form/SegmentedControl.mjs +56 -0
- package/dist/components/ui/form/SegmentedControl.mjs.map +1 -0
- package/dist/components/ui/overlay/Dialog.mjs +21 -4
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +26 -8
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/layers.mjs +52 -5
- package/dist/components/ui/overlay/layers.mjs.map +1 -1
- package/dist/enums/AccountHubFlow.mjs +13 -0
- package/dist/enums/AccountHubFlow.mjs.map +1 -0
- package/dist/enums/DateFilterPeriod.mjs +22 -0
- package/dist/enums/DateFilterPeriod.mjs.map +1 -0
- package/dist/enums/WorkspaceSectionType.mjs +11 -0
- package/dist/enums/WorkspaceSectionType.mjs.map +1 -0
- package/dist/handlers.mjs +24 -0
- package/dist/handlers.mjs.map +1 -1
- package/dist/hooks/useDebounce.mjs +5 -3
- package/dist/hooks/useDebounce.mjs.map +1 -1
- package/dist/hooks/useUploadProgress.mjs +33 -0
- package/dist/hooks/useUploadProgress.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +863 -3
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs +863 -3
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs +863 -3
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/index.mjs +87 -7
- package/dist/index.mjs.map +1 -1
- package/dist/infra/http/paged.mjs +20 -0
- package/dist/infra/http/paged.mjs.map +1 -0
- package/dist/middleware.mjs +2 -0
- package/dist/middleware.mjs.map +1 -1
- package/dist/middlewares/create-auth-middleware.mjs +1 -3
- package/dist/middlewares/create-auth-middleware.mjs.map +1 -1
- package/dist/middlewares/create-legacy-account-routes-middleware.mjs +44 -0
- package/dist/middlewares/create-legacy-account-routes-middleware.mjs.map +1 -0
- package/dist/middlewares/is-route-equals.mjs +7 -0
- package/dist/middlewares/is-route-equals.mjs.map +1 -0
- package/dist/modules/accounts/actions/account-management.action.mjs +20 -1
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/accounts/constants/account-hub-link.constants.mjs +9 -0
- package/dist/modules/accounts/constants/account-hub-link.constants.mjs.map +1 -0
- package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs +5 -0
- package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs.map +1 -0
- package/dist/modules/accounts/handlers/list-account-members.handler.mjs +22 -0
- package/dist/modules/accounts/handlers/list-account-members.handler.mjs.map +1 -0
- package/dist/modules/accounts/hooks/add-user-projects.hook.mjs +51 -0
- package/dist/modules/accounts/hooks/add-user-projects.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/create-account-user.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/create-account-user.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs +47 -0
- package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/use-account-members.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/use-account-members.hook.mjs.map +1 -0
- package/dist/modules/accounts/services/account.service.mjs +59 -0
- package/dist/modules/accounts/services/account.service.mjs.map +1 -1
- package/dist/modules/accounts/types/account-hub-link.type.mjs +1 -0
- package/dist/modules/accounts/types/account-hub-link.type.mjs.map +1 -0
- package/dist/modules/accounts/utils/build-account-hub-url.mjs +16 -0
- package/dist/modules/accounts/utils/build-account-hub-url.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-account-hub-flow.mjs +9 -0
- package/dist/modules/accounts/utils/is-account-hub-flow.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-account-section.mjs +9 -0
- package/dist/modules/accounts/utils/is-account-section.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-my-account-section.mjs +13 -0
- package/dist/modules/accounts/utils/is-my-account-section.mjs.map +1 -0
- package/dist/modules/accounts/utils/map-legacy-account-route.mjs +93 -0
- package/dist/modules/accounts/utils/map-legacy-account-route.mjs.map +1 -0
- package/dist/modules/accounts/utils/parse-account-hub-link.mjs +20 -0
- package/dist/modules/accounts/utils/parse-account-hub-link.mjs.map +1 -0
- package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs +10 -0
- package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs.map +1 -0
- package/dist/modules/affiliates/actions/request-deposit.action.mjs +10 -0
- package/dist/modules/affiliates/actions/request-deposit.action.mjs.map +1 -0
- package/dist/modules/affiliates/actions/update-affiliate.action.mjs +10 -0
- package/dist/modules/affiliates/actions/update-affiliate.action.mjs.map +1 -0
- package/dist/modules/affiliates/constants/affiliate.constants.mjs +11 -0
- package/dist/modules/affiliates/constants/affiliate.constants.mjs.map +1 -0
- package/dist/modules/affiliates/constants/query-keys.constants.mjs +15 -0
- package/dist/modules/affiliates/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs +16 -0
- package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs +22 -0
- package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs +22 -0
- package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs +22 -0
- package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs +20 -0
- package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs +23 -0
- package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs +28 -0
- package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs +22 -0
- package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs.map +1 -0
- package/dist/modules/affiliates/services/affiliates.service.mjs +183 -0
- package/dist/modules/affiliates/services/affiliates.service.mjs.map +1 -0
- package/dist/modules/affiliates/types/affiliate.type.mjs +100 -0
- package/dist/modules/affiliates/types/affiliate.type.mjs.map +1 -0
- package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs +9 -0
- package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs.map +1 -0
- package/dist/modules/charges/actions/get-nota-fiscal.action.mjs +10 -0
- package/dist/modules/charges/actions/get-nota-fiscal.action.mjs.map +1 -0
- package/dist/modules/charges/actions/refresh-pix.action.mjs +10 -0
- package/dist/modules/charges/actions/refresh-pix.action.mjs.map +1 -0
- package/dist/modules/charges/hooks/nota-fiscal.hook.mjs +13 -0
- package/dist/modules/charges/hooks/nota-fiscal.hook.mjs.map +1 -0
- package/dist/modules/charges/hooks/refresh-pix.hook.mjs +13 -0
- package/dist/modules/charges/hooks/refresh-pix.hook.mjs.map +1 -0
- package/dist/modules/charges/services/charges.service.mjs +67 -0
- package/dist/modules/charges/services/charges.service.mjs.map +1 -1
- package/dist/modules/charges/types/nota-fiscal.type.mjs +1 -0
- package/dist/modules/charges/types/nota-fiscal.type.mjs.map +1 -0
- package/dist/modules/charges/types/refresh-pix.type.mjs +1 -0
- package/dist/modules/charges/types/refresh-pix.type.mjs.map +1 -0
- package/dist/modules/charges/utils/get-charge-download-url.mjs +8 -0
- package/dist/modules/charges/utils/get-charge-download-url.mjs.map +1 -0
- package/dist/modules/coupons/constants/query-keys.constants.mjs +5 -0
- package/dist/modules/coupons/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs +17 -0
- package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs.map +1 -0
- package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs +16 -0
- package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs.map +1 -0
- package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs +15 -0
- package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs.map +1 -0
- package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs +18 -0
- package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs.map +1 -0
- package/dist/modules/coupons/services/coupons.service.mjs +44 -0
- package/dist/modules/coupons/services/coupons.service.mjs.map +1 -0
- package/dist/modules/coupons/types/coupon.type.mjs +61 -0
- package/dist/modules/coupons/types/coupon.type.mjs.map +1 -0
- package/dist/modules/coupons/utils/coupon-restrictions.mjs +60 -0
- package/dist/modules/coupons/utils/coupon-restrictions.mjs.map +1 -0
- package/dist/modules/domains/handlers/count-domains.handler.mjs +12 -0
- package/dist/modules/domains/handlers/count-domains.handler.mjs.map +1 -0
- package/dist/modules/domains/hooks/count-domains.hook.mjs +17 -0
- package/dist/modules/domains/hooks/count-domains.hook.mjs.map +1 -0
- package/dist/modules/domains/services/domains.service.mjs +18 -0
- package/dist/modules/domains/services/domains.service.mjs.map +1 -0
- package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs +15 -0
- package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs.map +1 -0
- package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs +28 -0
- package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs.map +1 -0
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +23 -2
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -1
- package/dist/modules/pages/handlers/count-pages.handler.mjs +4 -2
- package/dist/modules/pages/handlers/count-pages.handler.mjs.map +1 -1
- package/dist/modules/pages/hooks/count-published-pages.hook.mjs +26 -0
- package/dist/modules/pages/hooks/count-published-pages.hook.mjs.map +1 -0
- package/dist/modules/pages/services/pages.service.mjs +3 -2
- package/dist/modules/pages/services/pages.service.mjs.map +1 -1
- package/dist/modules/plans/constants/plan-tooltips.constants.mjs +14 -0
- package/dist/modules/plans/constants/plan-tooltips.constants.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs +28 -0
- package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-ui-plans.hook.mjs +20 -0
- package/dist/modules/plans/hooks/use-ui-plans.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/add-project-users.hook.mjs +25 -0
- package/dist/modules/projects/hooks/add-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/remove-project-users.hook.mjs +25 -0
- package/dist/modules/projects/hooks/remove-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/services/project-users.service.mjs +5 -0
- package/dist/modules/projects/services/project-users.service.mjs.map +1 -1
- package/dist/modules/projects/types.mjs +3 -2
- package/dist/modules/projects/types.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/create-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/create-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs +35 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/constants/downgrade.constants.mjs +25 -0
- package/dist/modules/subscriptions/constants/downgrade.constants.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/subscription.constants.mjs +2 -0
- package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs +15 -0
- package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs +25 -0
- package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs +33 -0
- package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs +18 -0
- package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs +25 -0
- package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +71 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -1
- package/dist/modules/subscriptions/types/cancel-subscription.type.mjs +9 -0
- package/dist/modules/subscriptions/types/cancel-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/create-subscription.type.mjs +62 -0
- package/dist/modules/subscriptions/types/create-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/pending-pix-status.type.mjs +28 -0
- package/dist/modules/subscriptions/types/pending-pix-status.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/subscription.type.mjs +9 -1
- package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/addon-buckets.mjs +69 -0
- package/dist/modules/subscriptions/utils/addon-buckets.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs +8 -2
- package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/first-period-pricing.mjs +25 -0
- package/dist/modules/subscriptions/utils/first-period-pricing.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-api-subscription.mjs +8 -0
- package/dist/modules/subscriptions/utils/is-api-subscription.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-boleto-payer.mjs +17 -0
- package/dist/modules/subscriptions/utils/is-boleto-payer.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-free-subscription.mjs +8 -0
- package/dist/modules/subscriptions/utils/is-free-subscription.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/periodicity.mjs +55 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs +27 -0
- package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs.map +1 -0
- package/dist/modules/users/hooks/messages.hook.mjs +3 -5
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
- package/dist/server.mjs +6 -0
- package/dist/server.mjs.map +1 -1
- package/dist/store/useAccountModals.mjs +9 -2
- package/dist/store/useAccountModals.mjs.map +1 -1
- package/dist/store/useAffiliateFlows.mjs +23 -0
- package/dist/store/useAffiliateFlows.mjs.map +1 -0
- package/dist/store/useProjectFlows.mjs +18 -0
- package/dist/store/useProjectFlows.mjs.map +1 -0
- package/dist/store/useSubscriptionFlows.mjs +58 -0
- package/dist/store/useSubscriptionFlows.mjs.map +1 -0
- package/dist/store/useTeamFlows.mjs +15 -0
- package/dist/store/useTeamFlows.mjs.map +1 -0
- package/dist/testing/factories/coupon.factory.mjs +19 -0
- package/dist/testing/factories/coupon.factory.mjs.map +1 -0
- package/dist/testing/factories/index.mjs +6 -0
- package/dist/testing/factories/index.mjs.map +1 -1
- package/dist/testing/factories/project-user.factory.mjs +17 -0
- package/dist/testing/factories/project-user.factory.mjs.map +1 -0
- package/dist/testing/factories/project.factory.mjs +21 -0
- package/dist/testing/factories/project.factory.mjs.map +1 -0
- package/dist/testing/react/providers.mjs +1 -1
- package/dist/testing/react/providers.mjs.map +1 -1
- package/dist/utils/browser/chart-custom-tooltip.mjs +69 -0
- package/dist/utils/browser/chart-custom-tooltip.mjs.map +1 -0
- package/dist/utils/browser/get-css-variable.mjs +9 -0
- package/dist/utils/browser/get-css-variable.mjs.map +1 -0
- package/dist/utils/constants/scrollbar.mjs +5 -0
- package/dist/utils/constants/scrollbar.mjs.map +1 -0
- package/dist/utils/date-filter-period.mjs +34 -0
- package/dist/utils/date-filter-period.mjs.map +1 -0
- package/dist/utils/file/index.mjs +11 -1
- package/dist/utils/file/index.mjs.map +1 -1
- package/dist/utils/format/initials.mjs +8 -0
- package/dist/utils/format/initials.mjs.map +1 -0
- package/dist/utils/format/masks.mjs +32 -1
- package/dist/utils/format/masks.mjs.map +1 -1
- package/dist/utils/qrcode/to-data-url.mjs +12 -0
- package/dist/utils/qrcode/to-data-url.mjs.map +1 -0
- package/dist/utils/validators/account.mjs +1 -7
- package/dist/utils/validators/account.mjs.map +1 -1
- package/package.json +15 -2
- package/src/components/account/AccountHubLinkHandler.tsx +39 -0
- package/src/components/account/AccountModalLayout.tsx +190 -0
- package/src/components/account/AccountModals.tsx +12 -2
- package/src/components/account/DeleteAccountModal.tsx +1 -1
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +9 -1
- package/src/components/account/MyAccountModal.tsx +215 -0
- package/src/components/account/TwoFactorAuthModal.tsx +1 -1
- package/src/components/account/hooks/useAccountHubActions.ts +95 -0
- package/src/components/account/hooks/useAddCardWithPaymentSwitch.ts +70 -0
- package/src/components/account/hooks/useAffiliatesActions.tsx +78 -0
- package/src/components/account/hooks/useMyAccountModal.ts +40 -0
- package/src/components/account/hooks/useProjectsActions.ts +44 -0
- package/src/components/account/hooks/useSubscriptionActions.ts +99 -0
- package/src/components/account/hooks/useTeamActions.ts +35 -0
- package/src/components/account/sections/AffiliatesSection.tsx +342 -0
- package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
- package/src/components/account/sections/MyProfileSection.tsx +207 -143
- package/src/components/account/sections/PreferencesSection.tsx +55 -51
- package/src/components/account/sections/ProjectsSection.tsx +110 -0
- package/src/components/account/sections/SecuritySection.tsx +72 -62
- package/src/components/account/sections/SubscriptionSection.tsx +36 -0
- package/src/components/account/sections/TeamSection.tsx +161 -0
- package/src/components/account/sections/TokenSection.tsx +4 -8
- package/src/components/account/sections/affiliates/AffiliateCommissionCard.tsx +83 -0
- package/src/components/account/sections/affiliates/AffiliateFlows.tsx +20 -0
- package/src/components/account/sections/affiliates/AffiliateLeadsSheet.tsx +143 -0
- package/src/components/account/sections/affiliates/AffiliateStatsCard.tsx +56 -0
- package/src/components/account/sections/affiliates/AffiliateStepCard.tsx +20 -0
- package/src/components/account/sections/affiliates/AffiliateTransactionsList.tsx +194 -0
- package/src/components/account/sections/affiliates/NoReceivingAccountModal.tsx +63 -0
- package/src/components/account/sections/affiliates/ReceivingAccountModal.tsx +213 -0
- package/src/components/account/sections/affiliates/RequestWithdrawalSheet.tsx +586 -0
- package/src/components/account/sections/affiliates/ViewAttachmentModal.tsx +47 -0
- package/src/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.tsx +45 -0
- package/src/components/account/sections/affiliates/reports/AffiliatesReportsTab.tsx +44 -0
- package/src/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.ts +148 -0
- package/src/components/account/sections/projects/DeleteProjectModal.tsx +246 -0
- package/src/components/account/sections/projects/ProjectFlows.tsx +16 -0
- package/src/components/account/sections/projects/ProjectMembersStack.tsx +75 -0
- package/src/components/account/sections/projects/ProjectRow.tsx +96 -0
- package/src/components/account/sections/projects/ProjectSheet.tsx +603 -0
- package/src/components/account/sections/projects/ProjectsDisabledModal.tsx +69 -0
- package/src/components/account/sections/projects/project-form.schema.ts +30 -0
- package/src/components/account/sections/shared/ConnectListRow.tsx +68 -0
- package/src/components/account/sections/shared/DateFilterPopover.tsx +58 -0
- package/src/components/account/sections/shared/EntityAvatar.tsx +54 -0
- package/src/components/account/sections/shared/FilterPopover.tsx +79 -0
- package/src/components/account/sections/shared/FormSection.tsx +23 -0
- package/src/components/account/sections/shared/IconBox.tsx +21 -0
- package/src/components/account/sections/shared/InfiniteScrollList.tsx +57 -0
- package/src/components/account/sections/shared/ListPagination.tsx +84 -0
- package/src/components/account/sections/shared/RowActionsMenu.tsx +66 -0
- package/src/components/account/sections/shared/SectionLoadError.tsx +27 -0
- package/src/components/account/sections/shared/StatusBadge.tsx +33 -0
- package/src/components/account/sections/shared/WorkspaceSection.tsx +22 -0
- package/src/components/account/sections/subscription/AiCreditsUsage.tsx +152 -0
- package/src/components/account/sections/subscription/BillingAddressSheet.tsx +460 -0
- package/src/components/account/sections/subscription/BoletoDetailsDialog.tsx +104 -0
- package/src/components/account/sections/subscription/BoletoGeneratedDialog.tsx +24 -0
- package/src/components/account/sections/subscription/CancelPlanDialog.tsx +221 -0
- package/src/components/account/sections/subscription/ChargeRow.tsx +161 -0
- package/src/components/account/sections/subscription/ChargeStatusBadge.tsx +29 -0
- package/src/components/account/sections/subscription/ChargesList.tsx +125 -0
- package/src/components/account/sections/subscription/ManageCardsSheet.tsx +93 -0
- package/src/components/account/sections/subscription/OverdueReceiptOpener.tsx +29 -0
- package/src/components/account/sections/subscription/PayChargeDialog.tsx +306 -0
- package/src/components/account/sections/subscription/PaymentConfirmationDialog.tsx +70 -0
- package/src/components/account/sections/subscription/PaymentMethodsCard.tsx +117 -0
- package/src/components/account/sections/subscription/PendingChangeDialog.tsx +168 -0
- package/src/components/account/sections/subscription/PixDetailsDialog.tsx +246 -0
- package/src/components/account/sections/subscription/PixPaymentDialog.tsx +242 -0
- package/src/components/account/sections/subscription/PlanDetailsSheet.tsx +380 -0
- package/src/components/account/sections/subscription/ReceiptDetailsSheet.tsx +318 -0
- package/src/components/account/sections/subscription/SubscriptionFlows.tsx +40 -0
- package/src/components/account/sections/subscription/SubscriptionPlanCard.tsx +433 -0
- package/src/components/account/sections/subscription/UsageReportSheet.tsx +244 -0
- package/src/components/account/sections/subscription/change-plan/ChangePlanSheet.tsx +95 -0
- package/src/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.tsx +57 -0
- package/src/components/account/sections/subscription/change-plan/components/AddonsBlock.tsx +214 -0
- package/src/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.tsx +92 -0
- package/src/components/account/sections/subscription/change-plan/components/CouponBlock.tsx +42 -0
- package/src/components/account/sections/subscription/change-plan/components/CouponDialog.tsx +134 -0
- package/src/components/account/sections/subscription/change-plan/components/PricePreview.tsx +28 -0
- package/src/components/account/sections/subscription/change-plan/components/SummaryBlock.tsx +194 -0
- package/src/components/account/sections/subscription/change-plan/plan-comparison.ts +52 -0
- package/src/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.tsx +161 -0
- package/src/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.tsx +165 -0
- package/src/components/account/sections/subscription/change-plan/steps/PlanViewStep.tsx +89 -0
- package/src/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.tsx +117 -0
- package/src/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.tsx +139 -0
- package/src/components/account/sections/subscription/change-plan/useChangePlanState.tsx +1158 -0
- package/src/components/account/sections/subscription/downgrade/CannotDowngradeDialog.tsx +297 -0
- package/src/components/account/sections/subscription/downgrade/DowngradeReasonDialog.tsx +154 -0
- package/src/components/account/sections/subscription/plans/PlanCard.tsx +417 -0
- package/src/components/account/sections/subscription/plans/PlanCardSkeleton.tsx +70 -0
- package/src/components/account/sections/subscription/plans/PlansCatalogDialog.tsx +156 -0
- package/src/components/account/sections/team/DeleteUserModal.tsx +134 -0
- package/src/components/account/sections/team/TeamFlows.tsx +14 -0
- package/src/components/account/sections/team/TeamMemberRow.tsx +151 -0
- package/src/components/account/sections/team/UserSheet.tsx +688 -0
- package/src/components/account/sections/team/steps/NotificationsStep.tsx +109 -0
- package/src/components/account/sections/team/steps/ProjectSelectionStep.tsx +219 -0
- package/src/components/account/sections/team/steps/UserInformationStep.tsx +423 -0
- package/src/components/account/sections/team/user-form.schema.ts +43 -0
- package/src/components/account/types/workspace-actions.type.ts +56 -0
- package/src/components/layouts/ProfilePopover.tsx +11 -12
- package/src/components/layouts/UsersSelectorPopover.tsx +7 -4
- package/src/components/modals/AccountDeletionWarningModal.tsx +4 -5
- package/src/components/modals/AccountFrozenModal.tsx +6 -3
- package/src/components/modals/Modals.tsx +6 -3
- package/src/components/modals/PaidPlanRequiredModal.tsx +4 -5
- package/src/components/modals/cards/AddFirstCardWarningModal.tsx +72 -0
- package/src/components/modals/cards/SwitchPaymentToCardModal.tsx +232 -0
- package/src/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.tsx +5 -4
- package/src/components/ui/data-display/CardItem.tsx +9 -5
- package/src/components/ui/data-display/PaymentMethodIcons.tsx +43 -0
- package/src/components/ui/form/BillingPeriodSelector.tsx +173 -0
- package/src/components/ui/form/PaymentMethodToggle.tsx +119 -0
- package/src/components/ui/form/RadioOptionFieldIcon.tsx +64 -0
- package/src/components/ui/form/SegmentedControl.tsx +77 -0
- package/src/components/ui/overlay/Dialog.tsx +21 -2
- package/src/components/ui/overlay/Sheet.tsx +26 -5
- package/src/components/ui/overlay/layers.tsx +88 -4
- package/src/enums/AccountHubFlow.ts +8 -0
- package/src/enums/DateFilterPeriod.ts +17 -0
- package/src/enums/WorkspaceSectionType.ts +6 -0
- package/src/handlers.ts +14 -0
- package/src/hooks/useDebounce.ts +5 -3
- package/src/hooks/useUploadProgress.ts +42 -0
- package/src/i18n/messages/en-us.ts +904 -2
- package/src/i18n/messages/es-es.ts +908 -2
- package/src/i18n/messages/pt-br.ts +908 -2
- package/src/index.ts +56 -1
- package/src/infra/http/paged.ts +24 -0
- package/src/middleware.ts +1 -0
- package/src/middlewares/create-auth-middleware.ts +1 -4
- package/src/middlewares/create-legacy-account-routes-middleware.ts +54 -0
- package/src/middlewares/is-route-equals.ts +3 -0
- package/src/modules/accounts/actions/account-management.action.ts +22 -1
- package/src/modules/accounts/constants/account-hub-link.constants.ts +3 -0
- package/src/modules/accounts/constants/legacy-account-routes.constants.ts +1 -0
- package/src/modules/accounts/handlers/list-account-members.handler.ts +23 -0
- package/src/modules/accounts/hooks/add-user-projects.hook.ts +72 -0
- package/src/modules/accounts/hooks/create-account-user.hook.ts +21 -0
- package/src/modules/accounts/hooks/remove-user-projects.hook.ts +68 -0
- package/src/modules/accounts/hooks/use-account-members.hook.ts +31 -0
- package/src/modules/accounts/services/account.service.ts +71 -0
- package/src/modules/accounts/types/account-hub-link.type.ts +13 -0
- package/src/modules/accounts/types.ts +9 -0
- package/src/modules/accounts/utils/build-account-hub-url.ts +14 -0
- package/src/modules/accounts/utils/is-account-hub-flow.ts +7 -0
- package/src/modules/accounts/utils/is-account-section.ts +7 -0
- package/src/modules/accounts/utils/is-my-account-section.ts +12 -0
- package/src/modules/accounts/utils/map-legacy-account-route.ts +108 -0
- package/src/modules/accounts/utils/parse-account-hub-link.ts +21 -0
- package/src/modules/affiliates/actions/ensure-affiliate.action.ts +9 -0
- package/src/modules/affiliates/actions/request-deposit.action.ts +9 -0
- package/src/modules/affiliates/actions/update-affiliate.action.ts +9 -0
- package/src/modules/affiliates/constants/affiliate.constants.ts +11 -0
- package/src/modules/affiliates/constants/query-keys.constants.ts +7 -0
- package/src/modules/affiliates/handlers/affiliate-report-analytics.handler.ts +16 -0
- package/src/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.ts +10 -0
- package/src/modules/affiliates/handlers/current-affiliate.handler.ts +10 -0
- package/src/modules/affiliates/handlers/list-affiliate-coupons.handler.ts +10 -0
- package/src/modules/affiliates/handlers/list-affiliate-leads.handler.ts +23 -0
- package/src/modules/affiliates/handlers/list-affiliate-transactions.handler.ts +23 -0
- package/src/modules/affiliates/hooks/use-affiliate-coupons.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-affiliate-leads.hook.ts +27 -0
- package/src/modules/affiliates/hooks/use-affiliate-report-analytics.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-affiliate-transactions.hook.ts +25 -0
- package/src/modules/affiliates/hooks/use-current-affiliate.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-ensure-affiliate.hook.ts +24 -0
- package/src/modules/affiliates/hooks/use-request-deposit.hook.ts +29 -0
- package/src/modules/affiliates/hooks/use-update-affiliate.hook.ts +24 -0
- package/src/modules/affiliates/hooks/use-withdrawal-limits.hook.ts +20 -0
- package/src/modules/affiliates/services/affiliates.service.ts +240 -0
- package/src/modules/affiliates/types/affiliate.type.ts +180 -0
- package/src/modules/affiliates/utils/get-affiliate-share-link.ts +8 -0
- package/src/modules/charges/actions/get-nota-fiscal.action.ts +8 -0
- package/src/modules/charges/actions/refresh-pix.action.ts +8 -0
- package/src/modules/charges/hooks/nota-fiscal.hook.ts +13 -0
- package/src/modules/charges/hooks/refresh-pix.hook.ts +13 -0
- package/src/modules/charges/services/charges.service.ts +121 -0
- package/src/modules/charges/types/nota-fiscal.type.ts +20 -0
- package/src/modules/charges/types/refresh-pix.type.ts +14 -0
- package/src/modules/charges/utils/get-charge-download-url.ts +10 -0
- package/src/modules/coupons/constants/query-keys.constants.ts +1 -0
- package/src/modules/coupons/handlers/find-coupon-by-code.handler.ts +16 -0
- package/src/modules/coupons/handlers/find-coupon-by-id.handler.ts +15 -0
- package/src/modules/coupons/hooks/use-coupon-by-code.hook.ts +16 -0
- package/src/modules/coupons/hooks/use-coupon-by-id.hook.ts +20 -0
- package/src/modules/coupons/services/coupons.service.ts +54 -0
- package/src/modules/coupons/types/coupon.type.ts +70 -0
- package/src/modules/coupons/utils/coupon-restrictions.ts +112 -0
- package/src/modules/domains/handlers/count-domains.handler.ts +10 -0
- package/src/modules/domains/hooks/count-domains.hook.ts +17 -0
- package/src/modules/domains/services/domains.service.ts +18 -0
- package/src/modules/ia-credits/handlers/list-ia-credit-operations.handler.ts +14 -0
- package/src/modules/ia-credits/hooks/ia-credit-operations.hook.ts +33 -0
- package/src/modules/ia-credits/services/ia-credits.service.ts +32 -1
- package/src/modules/pages/handlers/count-pages.handler.ts +5 -2
- package/src/modules/pages/hooks/count-published-pages.hook.ts +26 -0
- package/src/modules/pages/services/pages.service.ts +3 -2
- package/src/modules/plans/constants/plan-tooltips.constants.ts +16 -0
- package/src/modules/plans/hooks/use-enriched-plans.hook.ts +31 -0
- package/src/modules/plans/hooks/use-ui-plans.hook.ts +22 -0
- package/src/modules/projects/hooks/add-project-users.hook.ts +29 -0
- package/src/modules/projects/hooks/list-all-account-users.hook.ts +3 -6
- package/src/modules/projects/hooks/list-available-users.hook.ts +3 -6
- package/src/modules/projects/hooks/list-infinite-projects.hook.ts +3 -6
- package/src/modules/projects/hooks/list-project-users.hook.ts +3 -6
- package/src/modules/projects/hooks/remove-project-users.hook.ts +29 -0
- package/src/modules/projects/services/project-users.service.ts +135 -130
- package/src/modules/projects/types.ts +89 -88
- package/src/modules/subscriptions/actions/cancel-subscription.action.ts +12 -0
- package/src/modules/subscriptions/actions/create-subscription.action.ts +9 -0
- package/src/modules/subscriptions/actions/find-pending-pix-status.action.ts +8 -0
- package/src/modules/subscriptions/actions/find-subscription-by-id.action.ts +8 -0
- package/src/modules/subscriptions/constants/addons.constants.ts +50 -0
- package/src/modules/subscriptions/constants/downgrade.constants.ts +30 -0
- package/src/modules/subscriptions/constants/subscription.constants.ts +3 -0
- package/src/modules/subscriptions/handlers/pending-pix-status.handler.ts +17 -0
- package/src/modules/subscriptions/hooks/cancel-subscription.hook.ts +28 -0
- package/src/modules/subscriptions/hooks/create-subscription.hook.ts +34 -0
- package/src/modules/subscriptions/hooks/find-subscription-by-id.hook.ts +17 -0
- package/src/modules/subscriptions/hooks/pending-pix-status.hook.ts +30 -0
- package/src/modules/subscriptions/services/subscriptions.service.ts +401 -301
- package/src/modules/subscriptions/types/cancel-subscription.type.ts +8 -0
- package/src/modules/subscriptions/types/create-subscription.type.ts +79 -0
- package/src/modules/subscriptions/types/pending-pix-status.type.ts +33 -0
- package/src/modules/subscriptions/types/subscription.type.ts +157 -147
- package/src/modules/subscriptions/utils/addon-buckets.ts +129 -0
- package/src/modules/subscriptions/utils/confirm-payment-if-required.ts +9 -2
- package/src/modules/subscriptions/utils/first-period-pricing.ts +63 -0
- package/src/modules/subscriptions/utils/is-api-subscription.ts +6 -0
- package/src/modules/subscriptions/utils/is-boleto-payer.ts +21 -0
- package/src/modules/subscriptions/utils/is-free-subscription.ts +6 -0
- package/src/modules/subscriptions/utils/periodicity.ts +101 -0
- package/src/modules/subscriptions/utils/resolve-subscription-plan-name.ts +44 -0
- package/src/modules/users/hooks/messages.hook.ts +3 -5
- package/src/server.ts +102 -99
- package/src/store/useAccountModals.ts +22 -5
- package/src/store/useAffiliateFlows.ts +46 -0
- package/src/store/useProjectFlows.ts +42 -0
- package/src/store/useSubscriptionFlows.ts +176 -0
- package/src/store/useTeamFlows.ts +34 -0
- package/src/testing/factories/coupon.factory.ts +17 -0
- package/src/testing/factories/index.ts +3 -0
- package/src/testing/factories/project-user.factory.ts +15 -0
- package/src/testing/factories/project.factory.ts +19 -0
- package/src/testing/react/providers.tsx +2 -1
- package/src/utils/browser/chart-custom-tooltip.ts +85 -0
- package/src/utils/browser/get-css-variable.ts +6 -0
- package/src/utils/constants/scrollbar.ts +10 -0
- package/src/utils/date-filter-period.ts +34 -0
- package/src/utils/file/index.ts +13 -0
- package/src/utils/format/initials.ts +10 -0
- package/src/utils/format/masks.ts +41 -0
- package/src/utils/qrcode/to-data-url.ts +23 -0
- package/src/utils/validators/account.ts +0 -8
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -143
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -34
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +0 -179
- package/src/components/account/hooks/useConfigurationsModal.ts +0 -45
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { IconEye, IconInfoCircle } from "@tabler/icons-react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
import { Button } from "../../../ui/buttons/Button";
|
|
6
|
+
import { Separator } from "../../../ui/data-display/Separator";
|
|
7
|
+
import { Skeleton } from "../../../ui/feedback/Skeleton";
|
|
8
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../ui/data-display/Table";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../ui/overlay/Tooltip";
|
|
10
|
+
import { formatCurrencyNumber } from "../../../../utils/format/currency";
|
|
11
|
+
import { StatusBadge } from "../shared/StatusBadge";
|
|
12
|
+
const TRANSACTION_TYPE_COMMISSION = 1;
|
|
13
|
+
const TRANSACTION_TYPE_WITHDRAWAL = 2;
|
|
14
|
+
const STATUS_TONES = {
|
|
15
|
+
pending: "yellow",
|
|
16
|
+
consolidated: "green",
|
|
17
|
+
canceled: "red",
|
|
18
|
+
refused: "red"
|
|
19
|
+
};
|
|
20
|
+
const headClasses = "h-11 px-3 first:pl-6 paragraph-xsmall-semibold text-zinc-500";
|
|
21
|
+
function formatDateTime(value) {
|
|
22
|
+
const date = new Date(value);
|
|
23
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
24
|
+
const pad = (part) => String(part).padStart(2, "0");
|
|
25
|
+
return `${pad(date.getDate())}/${pad(date.getMonth() + 1)}/${date.getFullYear()} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
26
|
+
}
|
|
27
|
+
function TransactionTypeBadge({ type }) {
|
|
28
|
+
const translate = useTranslations();
|
|
29
|
+
const label = type === TRANSACTION_TYPE_COMMISSION ? translate("common.account.workspace.affiliates.transactions.typeCommission") : type === TRANSACTION_TYPE_WITHDRAWAL ? translate("common.account.workspace.affiliates.transactions.typeWithdrawal") : translate("common.account.workspace.affiliates.transactions.typeFallback", { type: String(type) });
|
|
30
|
+
return /* @__PURE__ */ jsx(StatusBadge, { tone: type === TRANSACTION_TYPE_COMMISSION ? "green" : "blue", children: label });
|
|
31
|
+
}
|
|
32
|
+
function TransactionStatusBadge({ transaction }) {
|
|
33
|
+
const translate = useTranslations();
|
|
34
|
+
const translateStatus = useTranslations("common.account.workspace.affiliates.transactions.status");
|
|
35
|
+
const { status } = transaction;
|
|
36
|
+
const hasInfo = status === "pending" || status === "refused";
|
|
37
|
+
const badge = /* @__PURE__ */ jsxs(StatusBadge, { tone: STATUS_TONES[status], children: [
|
|
38
|
+
translateStatus(status),
|
|
39
|
+
hasInfo && /* @__PURE__ */ jsx(IconInfoCircle, { size: 14, className: "shrink-0" })
|
|
40
|
+
] });
|
|
41
|
+
if (!hasInfo) return badge;
|
|
42
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: badge }),
|
|
44
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", className: "max-w-xs p-3", children: status === "pending" ? translate("common.account.workspace.affiliates.transactions.pendingTooltip") : transaction.refused_reason || translate("common.account.workspace.affiliates.transactions.refusedTooltip") })
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
function AffiliateTransactionsList({ transactions, isLoading, onViewAttachment }) {
|
|
48
|
+
const translate = useTranslations();
|
|
49
|
+
if (isLoading) {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx(Skeleton, { className: "h-14 w-full rounded-lg" }, index)) });
|
|
51
|
+
}
|
|
52
|
+
if (transactions.length === 0) {
|
|
53
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12 border border-zinc-200 rounded-lg bg-white", children: /* @__PURE__ */ jsx("p", { className: "paragraph-small-medium text-zinc-500", children: translate("common.account.workspace.affiliates.transactions.empty") }) });
|
|
54
|
+
}
|
|
55
|
+
const viewAttachmentButton = (attachment) => attachment ? /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
57
|
+
Button,
|
|
58
|
+
{
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
className: "size-10! p-0",
|
|
61
|
+
"aria-label": translate("common.account.workspace.affiliates.transactions.viewAttachment"),
|
|
62
|
+
onClick: () => onViewAttachment(attachment),
|
|
63
|
+
children: /* @__PURE__ */ jsx(IconEye, { size: 20 })
|
|
64
|
+
}
|
|
65
|
+
) }),
|
|
66
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", children: translate("common.account.workspace.affiliates.transactions.viewAttachment") })
|
|
67
|
+
] }) : null;
|
|
68
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx("div", { className: "hidden lg:block rounded-lg border border-zinc-200 bg-white overflow-hidden", children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "bg-zinc-50 hover:bg-zinc-50", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(TableHead, { className: headClasses, children: translate("common.account.workspace.affiliates.transactions.date") }),
|
|
72
|
+
/* @__PURE__ */ jsx(TableHead, { className: headClasses, children: translate("common.account.workspace.affiliates.transactions.value") }),
|
|
73
|
+
/* @__PURE__ */ jsx(TableHead, { className: headClasses, children: translate("common.account.workspace.affiliates.transactions.type") }),
|
|
74
|
+
/* @__PURE__ */ jsx(TableHead, { className: headClasses, children: translate("common.account.workspace.affiliates.transactions.statusColumn") }),
|
|
75
|
+
/* @__PURE__ */ jsx(TableHead, { className: "h-11 w-16" })
|
|
76
|
+
] }) }),
|
|
77
|
+
/* @__PURE__ */ jsx(TableBody, { children: transactions.map((transaction) => /* @__PURE__ */ jsxs(TableRow, { className: "hover:bg-zinc-50", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(TableCell, { className: "pl-6 pr-3 py-5", children: /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-600", children: formatDateTime(transaction.datetime_add) }) }),
|
|
79
|
+
/* @__PURE__ */ jsx(TableCell, { className: "px-3 py-5", children: /* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-zinc-600", children: formatCurrencyNumber(transaction.value) }) }),
|
|
80
|
+
/* @__PURE__ */ jsx(TableCell, { className: "px-3 py-5", children: /* @__PURE__ */ jsx(TransactionTypeBadge, { type: transaction.type }) }),
|
|
81
|
+
/* @__PURE__ */ jsx(TableCell, { className: "px-3 py-5", children: /* @__PURE__ */ jsx(TransactionStatusBadge, { transaction }) }),
|
|
82
|
+
/* @__PURE__ */ jsx(TableCell, { className: "w-16 py-4", children: /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: viewAttachmentButton(transaction.attachment) }) })
|
|
83
|
+
] }, transaction.id)) })
|
|
84
|
+
] }) }),
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: "flex lg:hidden flex-col gap-3", children: transactions.map((transaction) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 border border-zinc-200 rounded-lg p-4 bg-white", children: [
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 min-h-10", children: [
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-600", children: formatDateTime(transaction.datetime_add) }),
|
|
88
|
+
viewAttachmentButton(transaction.attachment)
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
92
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-600", children: transaction.email ?? "\u2014" }),
|
|
93
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xlarge-semibold text-zinc-600", children: formatCurrencyNumber(transaction.value) }),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(TransactionTypeBadge, { type: transaction.type }),
|
|
96
|
+
/* @__PURE__ */ jsx(TransactionStatusBadge, { transaction })
|
|
97
|
+
] })
|
|
98
|
+
] }),
|
|
99
|
+
transaction.status === "refused" && transaction.refused_reason && /* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-zinc-500", children: translate("common.account.workspace.affiliates.transactions.refusedReason", {
|
|
100
|
+
reason: transaction.refused_reason
|
|
101
|
+
}) })
|
|
102
|
+
] }, transaction.id)) })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
AffiliateTransactionsList
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=AffiliateTransactionsList.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/AffiliateTransactionsList.tsx"],"sourcesContent":["'use client';\n\nimport { IconEye, IconInfoCircle } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { Button } from '../../../ui/buttons/Button';\nimport { Separator } from '../../../ui/data-display/Separator';\nimport { Skeleton } from '../../../ui/feedback/Skeleton';\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../../ui/data-display/Table';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/overlay/Tooltip';\nimport { formatCurrencyNumber } from '../../../../utils/format/currency';\nimport type { AffiliateTransaction } from '../../../../modules/affiliates/types/affiliate.type';\nimport { StatusBadge, type StatusBadgeTone } from '../shared/StatusBadge';\n\nconst TRANSACTION_TYPE_COMMISSION = 1;\nconst TRANSACTION_TYPE_WITHDRAWAL = 2;\n\nconst STATUS_TONES: Record<AffiliateTransaction['status'], StatusBadgeTone> = {\n pending: 'yellow',\n consolidated: 'green',\n canceled: 'red',\n refused: 'red',\n};\n\nconst headClasses = 'h-11 px-3 first:pl-6 paragraph-xsmall-semibold text-zinc-500';\n\nfunction formatDateTime(value: string): string {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return value;\n const pad = (part: number) => String(part).padStart(2, '0');\n return `${pad(date.getDate())}/${pad(date.getMonth() + 1)}/${date.getFullYear()} ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n}\n\nfunction TransactionTypeBadge({ type }: { type: number }) {\n const translate = useTranslations();\n\n const label =\n type === TRANSACTION_TYPE_COMMISSION\n ? translate('common.account.workspace.affiliates.transactions.typeCommission')\n : type === TRANSACTION_TYPE_WITHDRAWAL\n ? translate('common.account.workspace.affiliates.transactions.typeWithdrawal')\n : translate('common.account.workspace.affiliates.transactions.typeFallback', { type: String(type) });\n\n return <StatusBadge tone={type === TRANSACTION_TYPE_COMMISSION ? 'green' : 'blue'}>{label}</StatusBadge>;\n}\n\nfunction TransactionStatusBadge({ transaction }: { transaction: AffiliateTransaction }) {\n const translate = useTranslations();\n const translateStatus = useTranslations('common.account.workspace.affiliates.transactions.status');\n const { status } = transaction;\n const hasInfo = status === 'pending' || status === 'refused';\n\n const badge = (\n <StatusBadge tone={STATUS_TONES[status]}>\n {translateStatus(status)}\n {hasInfo && <IconInfoCircle size={14} className=\"shrink-0\" />}\n </StatusBadge>\n );\n\n if (!hasInfo) return badge;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{badge}</TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-xs p-3\">\n {status === 'pending'\n ? translate('common.account.workspace.affiliates.transactions.pendingTooltip')\n : transaction.refused_reason || translate('common.account.workspace.affiliates.transactions.refusedTooltip')}\n </TooltipContent>\n </Tooltip>\n );\n}\n\ntype AffiliateTransactionsListProps = {\n transactions: AffiliateTransaction[];\n isLoading: boolean;\n onViewAttachment: (attachment: string) => void;\n};\n\nexport function AffiliateTransactionsList({ transactions, isLoading, onViewAttachment }: AffiliateTransactionsListProps) {\n const translate = useTranslations();\n\n if (isLoading) {\n return (\n <div className=\"flex flex-col gap-3\">\n {Array.from({ length: 4 }).map((_, index) => (\n <Skeleton key={index} className=\"h-14 w-full rounded-lg\" />\n ))}\n </div>\n );\n }\n\n if (transactions.length === 0) {\n return (\n <div className=\"flex items-center justify-center py-12 border border-zinc-200 rounded-lg bg-white\">\n <p className=\"paragraph-small-medium text-zinc-500\">\n {translate('common.account.workspace.affiliates.transactions.empty')}\n </p>\n </div>\n );\n }\n\n const viewAttachmentButton = (attachment?: string | null) =>\n attachment ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n className=\"size-10! p-0\"\n aria-label={translate('common.account.workspace.affiliates.transactions.viewAttachment')}\n onClick={() => onViewAttachment(attachment)}\n >\n <IconEye size={20} />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"top\">\n {translate('common.account.workspace.affiliates.transactions.viewAttachment')}\n </TooltipContent>\n </Tooltip>\n ) : null;\n\n return (\n <>\n <div className=\"hidden lg:block rounded-lg border border-zinc-200 bg-white overflow-hidden\">\n <Table>\n <TableHeader>\n <TableRow className=\"bg-zinc-50 hover:bg-zinc-50\">\n <TableHead className={headClasses}>\n {translate('common.account.workspace.affiliates.transactions.date')}\n </TableHead>\n <TableHead className={headClasses}>\n {translate('common.account.workspace.affiliates.transactions.value')}\n </TableHead>\n <TableHead className={headClasses}>\n {translate('common.account.workspace.affiliates.transactions.type')}\n </TableHead>\n <TableHead className={headClasses}>\n {translate('common.account.workspace.affiliates.transactions.statusColumn')}\n </TableHead>\n <TableHead className=\"h-11 w-16\" />\n </TableRow>\n </TableHeader>\n <TableBody>\n {transactions.map((transaction) => (\n <TableRow key={transaction.id} className=\"hover:bg-zinc-50\">\n <TableCell className=\"pl-6 pr-3 py-5\">\n <span className=\"paragraph-small-medium text-zinc-600\">{formatDateTime(transaction.datetime_add)}</span>\n </TableCell>\n <TableCell className=\"px-3 py-5\">\n <span className=\"paragraph-small-semibold text-zinc-600\">{formatCurrencyNumber(transaction.value)}</span>\n </TableCell>\n <TableCell className=\"px-3 py-5\">\n <TransactionTypeBadge type={transaction.type} />\n </TableCell>\n <TableCell className=\"px-3 py-5\">\n <TransactionStatusBadge transaction={transaction} />\n </TableCell>\n <TableCell className=\"w-16 py-4\">\n <div className=\"flex justify-center\">{viewAttachmentButton(transaction.attachment)}</div>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n\n <div className=\"flex lg:hidden flex-col gap-3\">\n {transactions.map((transaction) => (\n <div key={transaction.id} className=\"flex flex-col gap-3 border border-zinc-200 rounded-lg p-4 bg-white\">\n <div className=\"flex items-center justify-between gap-4 min-h-10\">\n <span className=\"paragraph-small-regular text-zinc-600\">{formatDateTime(transaction.datetime_add)}</span>\n {viewAttachmentButton(transaction.attachment)}\n </div>\n <Separator />\n <div className=\"flex flex-col gap-3\">\n <span className=\"paragraph-small-regular text-zinc-600\">{transaction.email ?? '—'}</span>\n <span className=\"paragraph-xlarge-semibold text-zinc-600\">{formatCurrencyNumber(transaction.value)}</span>\n <div className=\"flex items-center justify-between gap-2\">\n <TransactionTypeBadge type={transaction.type} />\n <TransactionStatusBadge transaction={transaction} />\n </div>\n </div>\n {transaction.status === 'refused' && transaction.refused_reason && (\n <span className=\"paragraph-xsmall-medium text-zinc-500\">\n {translate('common.account.workspace.affiliates.transactions.refusedReason', {\n reason: transaction.refused_reason,\n })}\n </span>\n )}\n </div>\n ))}\n </div>\n </>\n );\n}\n"],"mappings":";AA0CS,SA+EL,UA/EK,KAUL,YAVK;AAxCT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C,SAAI,WAAU,2CACb;AAAA,8BAAC,wBAAqB,MAAM,YAAY,MAAM;AAAA,UAC9C,oBAAC,0BAAuB,aAA0B;AAAA,WACpD;AAAA,SACF;AAAA,MACC,YAAY,WAAW,aAAa,YAAY,kBAC/C,oBAAC,UAAK,WAAU,yCACb,oBAAU,kEAAkE;AAAA,QAC3E,QAAQ,YAAY;AAAA,MACtB,CAAC,GACH;AAAA,SAnBM,YAAY,EAqBtB,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { IconBuildingBank } from "@tabler/icons-react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
import { Button } from "../../../ui/buttons/Button";
|
|
6
|
+
import { Separator } from "../../../ui/data-display/Separator";
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle
|
|
13
|
+
} from "../../../ui/overlay/Dialog";
|
|
14
|
+
import { useAffiliateFlows } from "../../../../store/useAffiliateFlows";
|
|
15
|
+
function NoReceivingAccountModal() {
|
|
16
|
+
const translate = useTranslations();
|
|
17
|
+
const isOpen = useAffiliateFlows((state) => state.isMissingReceivingAccountOpen);
|
|
18
|
+
const close = useAffiliateFlows((state) => state.closeMissingReceivingAccount);
|
|
19
|
+
const openReceivingAccount = useAffiliateFlows((state) => state.openReceivingAccount);
|
|
20
|
+
const handleRegister = () => {
|
|
21
|
+
close();
|
|
22
|
+
openReceivingAccount();
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (nextOpen) => !nextOpen && close(), children: /* @__PURE__ */ jsxs(
|
|
25
|
+
DialogContent,
|
|
26
|
+
{
|
|
27
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
28
|
+
className: "flex flex-col p-0 gap-0 md:w-[410px]! lg:w-[410px]! max-w-[410px]! max-[410px]:w-[calc(100%-32px)] duration-0!",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "gap-3 text-left p-5", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-10 h-10 bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsx(IconBuildingBank, { size: 20, className: "text-gray-950" }) }),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-zinc-950", children: translate("common.account.workspace.affiliates.noBankAccount.title") }),
|
|
34
|
+
/* @__PURE__ */ jsx(DialogDescription, { className: "paragraph-small-regular text-zinc-600", asChild: true, children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ jsx("p", { children: translate("common.account.workspace.affiliates.noBankAccount.description") }) }) })
|
|
35
|
+
] })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-5", children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Button, { className: "h-10! transition-colors", onClick: handleRegister, children: translate("common.account.workspace.affiliates.noBankAccount.registerButton") }),
|
|
40
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10! transition-colors", onClick: close, children: translate("common.actions.cancel") })
|
|
41
|
+
] })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
NoReceivingAccountModal
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=NoReceivingAccountModal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/NoReceivingAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconBuildingBank } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { Button } from '../../../ui/buttons/Button';\nimport { Separator } from '../../../ui/data-display/Separator';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../../../ui/overlay/Dialog';\nimport { useAffiliateFlows } from '../../../../store/useAffiliateFlows';\n\n/** Aviso de saque sem conta de recebimento cadastrada, com o caminho para cadastrar. */\nexport function NoReceivingAccountModal() {\n const translate = useTranslations();\n const isOpen = useAffiliateFlows((state) => state.isMissingReceivingAccountOpen);\n const close = useAffiliateFlows((state) => state.closeMissingReceivingAccount);\n const openReceivingAccount = useAffiliateFlows((state) => state.openReceivingAccount);\n\n const handleRegister = () => {\n close();\n openReceivingAccount();\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={(nextOpen) => !nextOpen && close()}>\n <DialogContent\n onOpenAutoFocus={(event) => event.preventDefault()}\n className=\"flex flex-col p-0 gap-0 md:w-[410px]! lg:w-[410px]! max-w-[410px]! max-[410px]:w-[calc(100%-32px)] duration-0!\"\n >\n <DialogHeader className=\"gap-3 text-left p-5\">\n <div className=\"flex items-center justify-center w-10 h-10 bg-gray-100 rounded-lg\">\n <IconBuildingBank size={20} className=\"text-gray-950\" />\n </div>\n <div className=\"flex flex-col gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950\">\n {translate('common.account.workspace.affiliates.noBankAccount.title')}\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-zinc-600\" asChild>\n <div className=\"flex flex-col gap-3\">\n <p>{translate('common.account.workspace.affiliates.noBankAccount.description')}</p>\n </div>\n </DialogDescription>\n </div>\n </DialogHeader>\n\n <Separator />\n\n <div className=\"flex items-center gap-2 p-5\">\n <Button className=\"h-10! transition-colors\" onClick={handleRegister}>\n {translate('common.account.workspace.affiliates.noBankAccount.registerButton')}\n </Button>\n <Button variant=\"secondary\" className=\"h-10! transition-colors\"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AQ,aAAY,WAAU,2BAA0B,SAAS,OACtE,oBAAU,uBAAuB,GACpC;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo } from "react";
|
|
4
|
+
import { Controller, useForm } from "react-hook-form";
|
|
5
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
+
import { useTranslations } from "next-intl";
|
|
7
|
+
import { toast } from "sonner";
|
|
8
|
+
import z from "zod";
|
|
9
|
+
import { Button } from "../../../ui/buttons/Button";
|
|
10
|
+
import { Toast } from "../../../ui/feedback/Toast";
|
|
11
|
+
import { FormField } from "../../../ui/form/FormField";
|
|
12
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../../ui/overlay/Dialog";
|
|
13
|
+
import { useCurrentAffiliate } from "../../../../modules/affiliates/hooks/use-current-affiliate.hook";
|
|
14
|
+
import { useUpdateAffiliate } from "../../../../modules/affiliates/hooks/use-update-affiliate.hook";
|
|
15
|
+
import { formatCPFCNPJ, formatDocument, normalizeCpfCnpjForStorage } from "../../../../utils/format/masks";
|
|
16
|
+
import { isValidCNPJ, isValidCPF } from "../../../../utils/validators/common";
|
|
17
|
+
import { useAffiliateFlows } from "../../../../store/useAffiliateFlows";
|
|
18
|
+
const EMAIL_KEY = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
19
|
+
const RANDOM_KEY = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
20
|
+
const PHONE_KEY = /^\+\d{11,14}$/;
|
|
21
|
+
function ReceivingAccountModal() {
|
|
22
|
+
const translate = useTranslations();
|
|
23
|
+
const translateModal = useTranslations("common.account.workspace.affiliates.bankAccount");
|
|
24
|
+
const isOpen = useAffiliateFlows((state) => state.isReceivingAccountOpen);
|
|
25
|
+
const close = useAffiliateFlows((state) => state.closeReceivingAccount);
|
|
26
|
+
const { data: affiliateData } = useCurrentAffiliate();
|
|
27
|
+
const affiliate = affiliateData?.data;
|
|
28
|
+
const updateAffiliate = useUpdateAffiliate();
|
|
29
|
+
const schema = useMemo(
|
|
30
|
+
() => z.object({
|
|
31
|
+
pix: z.string().min(1, translateModal("validationPix")),
|
|
32
|
+
holder_name: z.string().min(1, translateModal("validationHolder")),
|
|
33
|
+
holder_document: z.string().min(1, translateModal("validationDocument"))
|
|
34
|
+
}).superRefine((data, ctx) => {
|
|
35
|
+
const digits = data.holder_document.replace(/\D/g, "");
|
|
36
|
+
if (!digits) return;
|
|
37
|
+
if (digits.length !== 11 && digits.length !== 14) {
|
|
38
|
+
ctx.addIssue({
|
|
39
|
+
code: z.ZodIssueCode.custom,
|
|
40
|
+
path: ["holder_document"],
|
|
41
|
+
message: translateModal("validationDocumentLength")
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const isValid = digits.length === 14 ? isValidCNPJ(digits) : isValidCPF(digits);
|
|
46
|
+
if (!isValid) {
|
|
47
|
+
ctx.addIssue({
|
|
48
|
+
code: z.ZodIssueCode.custom,
|
|
49
|
+
path: ["holder_document"],
|
|
50
|
+
message: digits.length === 14 ? translateModal("validationCnpjChecksum") : translateModal("validationCpfChecksum")
|
|
51
|
+
});
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const pix = data.pix.trim();
|
|
55
|
+
if (EMAIL_KEY.test(pix) || RANDOM_KEY.test(pix) || PHONE_KEY.test(pix.replace(/[\s().-]/g, ""))) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const pixDigits = pix.replace(/\D/g, "");
|
|
59
|
+
const pixIsCnpj = pixDigits.length === 14 && isValidCNPJ(pixDigits);
|
|
60
|
+
const pixIsCpf = pixDigits.length === 11 && isValidCPF(pixDigits);
|
|
61
|
+
if ((pixIsCnpj || pixIsCpf) && pixDigits !== digits) {
|
|
62
|
+
ctx.addIssue({
|
|
63
|
+
code: z.ZodIssueCode.custom,
|
|
64
|
+
path: ["pix"],
|
|
65
|
+
message: translateModal("validationPixDocumentMismatch")
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
[translateModal]
|
|
70
|
+
);
|
|
71
|
+
const form = useForm({
|
|
72
|
+
resolver: zodResolver(schema),
|
|
73
|
+
mode: "onChange",
|
|
74
|
+
defaultValues: { pix: "", holder_name: "", holder_document: "" }
|
|
75
|
+
});
|
|
76
|
+
const resetForm = form.reset;
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!isOpen || !affiliate) return;
|
|
79
|
+
resetForm({
|
|
80
|
+
pix: affiliate.pix ?? "",
|
|
81
|
+
holder_name: affiliate.holder_name ?? "",
|
|
82
|
+
holder_document: affiliate.holder_document ? formatDocument(affiliate.holder_document) : ""
|
|
83
|
+
});
|
|
84
|
+
}, [isOpen, affiliate, resetForm]);
|
|
85
|
+
const handleClose = () => {
|
|
86
|
+
form.reset();
|
|
87
|
+
close();
|
|
88
|
+
};
|
|
89
|
+
const onSubmit = async (data) => {
|
|
90
|
+
if (!affiliate) return;
|
|
91
|
+
try {
|
|
92
|
+
await updateAffiliate.mutateAsync({
|
|
93
|
+
...data,
|
|
94
|
+
holder_document: normalizeCpfCnpjForStorage(data.holder_document),
|
|
95
|
+
pix: normalizeCpfCnpjForStorage(data.pix),
|
|
96
|
+
bank: "",
|
|
97
|
+
agency: "",
|
|
98
|
+
account: ""
|
|
99
|
+
});
|
|
100
|
+
toast.custom((toastId) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: translateModal("saveSuccess"), toastId }));
|
|
101
|
+
handleClose();
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const message = error instanceof Error ? error.message : translateModal("saveError");
|
|
104
|
+
toast.custom((toastId) => /* @__PURE__ */ jsx(Toast, { variant: "error", message, toastId }));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const isCnpjHolder = form.watch("holder_document").replace(/\D/g, "").length === 14;
|
|
108
|
+
return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (nextOpen) => !nextOpen && handleClose(), children: /* @__PURE__ */ jsxs(
|
|
109
|
+
DialogContent,
|
|
110
|
+
{
|
|
111
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
112
|
+
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-lg 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 [scrollbar-width:auto] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-zinc-300",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx(DialogHeader, { className: "h-16 flex items-center justify-center px-5 border-b border-zinc-200 lg:border-b-0", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-center paragraph-medium-semibold", children: translateModal("dialogTitle") }) }),
|
|
115
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col flex-1 lg:flex-none", children: [
|
|
116
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 lg:px-5 pb-4 lg:pb-5 mt-4 lg:mt-5 flex-1 lg:flex-none flex flex-col gap-5", children: [
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
FormField,
|
|
119
|
+
{
|
|
120
|
+
label: translateModal("pixKeyLabel"),
|
|
121
|
+
placeholder: translateModal("pixKeyPlaceholder"),
|
|
122
|
+
required: true,
|
|
123
|
+
error: !!form.formState.errors.pix,
|
|
124
|
+
errorMessage: form.formState.errors.pix?.message,
|
|
125
|
+
...form.register("pix")
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsx("p", { className: "paragraph-xsmall-medium text-zinc-500 -mt-3", children: translateModal("pixKeyHint") }),
|
|
129
|
+
isCnpjHolder && /* @__PURE__ */ jsx("p", { className: "paragraph-xsmall-medium text-zinc-500 -mt-3", children: translateModal("pixCnpjInvoiceNotice") }),
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
FormField,
|
|
132
|
+
{
|
|
133
|
+
label: translateModal("holderNameLabel"),
|
|
134
|
+
placeholder: translateModal("holderNamePlaceholder"),
|
|
135
|
+
required: true,
|
|
136
|
+
error: !!form.formState.errors.holder_name,
|
|
137
|
+
errorMessage: form.formState.errors.holder_name?.message,
|
|
138
|
+
...form.register("holder_name")
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsx(
|
|
142
|
+
Controller,
|
|
143
|
+
{
|
|
144
|
+
name: "holder_document",
|
|
145
|
+
control: form.control,
|
|
146
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
147
|
+
FormField,
|
|
148
|
+
{
|
|
149
|
+
label: translateModal("holderDocumentLabel"),
|
|
150
|
+
placeholder: translateModal("holderDocumentPlaceholder"),
|
|
151
|
+
required: true,
|
|
152
|
+
error: !!fieldState.error,
|
|
153
|
+
errorMessage: fieldState.error?.message,
|
|
154
|
+
value: field.value,
|
|
155
|
+
onChange: (event) => field.onChange(formatCPFCNPJ(event.target.value))
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-2 p-4 lg:p-5 border-t border-zinc-200 mt-auto lg:mt-0", children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", type: "button", onClick: handleClose, className: "h-10!", children: translate("common.actions.cancel") }),
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
Button,
|
|
165
|
+
{
|
|
166
|
+
type: "submit",
|
|
167
|
+
className: "h-10!",
|
|
168
|
+
disabled: !form.formState.isValid,
|
|
169
|
+
loading: form.formState.isSubmitting,
|
|
170
|
+
children: form.formState.isSubmitting ? translate("common.actions.saving") : translate("common.actions.save")
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] })
|
|
174
|
+
] })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
) });
|
|
178
|
+
}
|
|
179
|
+
export {
|
|
180
|
+
ReceivingAccountModal
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=ReceivingAccountModal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/ReceivingAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport z from 'zod';\nimport { Button } from '../../../ui/buttons/Button';\nimport { Toast } from '../../../ui/feedback/Toast';\nimport { FormField } from '../../../ui/form/FormField';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../../ui/overlay/Dialog';\nimport { useCurrentAffiliate } from '../../../../modules/affiliates/hooks/use-current-affiliate.hook';\nimport { useUpdateAffiliate } from '../../../../modules/affiliates/hooks/use-update-affiliate.hook';\nimport { formatCPFCNPJ, formatDocument, normalizeCpfCnpjForStorage } from '../../../../utils/format/masks';\nimport { isValidCNPJ, isValidCPF } from '../../../../utils/validators/common';\nimport { useAffiliateFlows } from '../../../../store/useAffiliateFlows';\n\ntype ReceivingAccountFormData = {\n pix: string;\n holder_name: string;\n holder_document: string;\n};\n\nconst EMAIL_KEY = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nconst RANDOM_KEY = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nconst PHONE_KEY = /^\\+\\d{11,14}$/;\n\n/** Cadastro da conta de recebimento do afiliado: chave PIX e titular. */\nexport function ReceivingAccountModal() {\n const translate = useTranslations();\n const translateModal = useTranslations('common.account.workspace.affiliates.bankAccount');\n const isOpen = useAffiliateFlows((state) => state.isReceivingAccountOpen);\n const close = useAffiliateFlows((state) => state.closeReceivingAccount);\n const { data: affiliateData } = useCurrentAffiliate();\n const affiliate = affiliateData?.data;\n const updateAffiliate = useUpdateAffiliate();\n\n const schema = useMemo(\n () =>\n z\n .object({\n pix: z.string().min(1, translateModal('validationPix')),\n holder_name: z.string().min(1, translateModal('validationHolder')),\n holder_document: z.string().min(1, translateModal('validationDocument')),\n })\n .superRefine((data, ctx) => {\n // O documento do titular decide PF x PJ pela contagem de dígitos, e é ele que vai para a\n // instituição no saque — tamanho certo com dígito verificador errado passa aqui e só\n // falha no pagamento.\n const digits = data.holder_document.replace(/\\D/g, '');\n if (!digits) return;\n\n if (digits.length !== 11 && digits.length !== 14) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['holder_document'],\n message: translateModal('validationDocumentLength'),\n });\n return;\n }\n\n const isValid = digits.length === 14 ? isValidCNPJ(digits) : isValidCPF(digits);\n if (!isValid) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['holder_document'],\n message:\n digits.length === 14\n ? translateModal('validationCnpjChecksum')\n : translateModal('validationCpfChecksum'),\n });\n return;\n }\n\n const pix = data.pix.trim();\n if (EMAIL_KEY.test(pix) || RANDOM_KEY.test(pix) || PHONE_KEY.test(pix.replace(/[\\s().-]/g, ''))) {\n return;\n }\n\n const pixDigits = pix.replace(/\\D/g, '');\n const pixIsCnpj = pixDigits.length === 14 && isValidCNPJ(pixDigits);\n const pixIsCpf = pixDigits.length === 11 && isValidCPF(pixDigits);\n if ((pixIsCnpj || pixIsCpf) && pixDigits !== digits) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['pix'],\n message: translateModal('validationPixDocumentMismatch'),\n });\n }\n }),\n [translateModal]\n );\n\n const form = useForm<ReceivingAccountFormData>({\n resolver: zodResolver(schema),\n mode: 'onChange',\n defaultValues: { pix: '', holder_name: '', holder_document: '' },\n });\n\n const resetForm = form.reset;\n\n useEffect(() => {\n if (!isOpen || !affiliate) return;\n resetForm({\n pix: affiliate.pix ?? '',\n holder_name: affiliate.holder_name ?? '',\n holder_document: affiliate.holder_document ? formatDocument(affiliate.holder_document) : '',\n });\n }, [isOpen, affiliate, resetForm]);\n\n const handleClose = () => {\n form.reset();\n close();\n };\n\n const onSubmit = async (data: ReceivingAccountFormData) => {\n if (!affiliate) return;\n\n try {\n await updateAffiliate.mutateAsync({\n ...data,\n holder_document: normalizeCpfCnpjForStorage(data.holder_document),\n pix: normalizeCpfCnpjForStorage(data.pix),\n bank: '',\n agency: '',\n account: '',\n });\n toast.custom((toastId) => (\n <Toast variant=\"success\" message={translateModal('saveSuccess')} toastId={toastId} />\n ));\n handleClose();\n } catch (error) {\n const message = error instanceof Error ? error.message : translateModal('saveError');\n toast.custom((toastId) => <Toast variant=\"error\" message={message} toastId={toastId} />);\n }\n };\n\n const isCnpjHolder = form.watch('holder_document').replace(/\\D/g, '').length === 14;\n\n return (\n <Dialog open={isOpen} onOpenChange={(nextOpen) => !nextOpen && handleClose()}>\n <DialogContent\n onOpenAutoFocus={(event) => event.preventDefault()}\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-lg 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 [scrollbar-width:auto] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-zinc-300\"\n >\n <DialogHeader className=\"h-16 flex items-center justify-center px-5 border-b border-zinc-200 lg:border-b-0\">\n <DialogTitle className=\"text-center paragraph-medium-semibold\">\n {translateModal('dialogTitle')}\n </DialogTitle>\n </DialogHeader>\n\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"flex flex-col flex-1 lg:flex-none\">\n <div className=\"px-4 lg:px-5 pb-4 lg:pb-5 mt-4 lg:mt-5 flex-1 lg:flex-none flex flex-col gap-5\">\n <FormField\n label={translateModal('pixKeyLabel')}\n placeholder={translateModal('pixKeyPlaceholder')}\n required\n error={!!form.formState.errors.pix}\n errorMessage={form.formState.errors.pix?.message}\n {...form.register('pix')}\n />\n <p className=\"paragraph-xsmall-medium text-zinc-500 -mt-3\">{translateModal('pixKeyHint')}</p>\n {isCnpjHolder && (\n <p className=\"paragraph-xsmall-medium text-zinc-500 -mt-3\">\n {translateModal('pixCnpjInvoiceNotice')}\n </p>\n )}\n <FormField\n label={translateModal('holderNameLabel')}\n placeholder={translateModal('holderNamePlaceholder')}\n required\n error={!!form.formState.errors.holder_name}\n errorMessage={form.formState.errors.holder_name?.message}\n {...form.register('holder_name')}\n />\n <Controller\n name=\"holder_document\"\n control={form.control}\n render={({ field, fieldState }) => (\n <FormField\n label={translateModal('holderDocumentLabel')}\n placeholder={translateModal('holderDocumentPlaceholder')}\n required\n error={!!fieldState.error}\n errorMessage={fieldState.error?.message}\n value={field.value}\n onChange={(event) => field.onChange(formatCPFCNPJ(event.target.value))}\n />\n )}\n />\n </div>\n\n <div className=\"flex justify-between gap-2 p-4 lg:p-5 border-t border-zinc-200 mt-auto lg:mt-0\">\n <Button variant=\"secondary\" type=\"button\" onClick={handleClose} className=\"h-10!\">\n {translate('common.actions.cancel')}\n </Button>\n <Button\n type=\"submit\"\n className=\"h-10!\"\n disabled={!form.formState.isValid}\n loading={form.formState.isSubmitting}\n >\n {form.formState.isSubmitting\n ? translate('common.actions.saving')\n : translate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