@greatapps/common 1.1.789 → 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 +41 -6
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +43 -13
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/layers.mjs +72 -26
- 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 +20 -8
- 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 +70 -33
- package/src/components/ui/overlay/Sheet.tsx +89 -56
- package/src/components/ui/overlay/layers.tsx +114 -27
- 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,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
4
|
+
function SegmentedControl({
|
|
5
|
+
value,
|
|
6
|
+
onChange,
|
|
7
|
+
options,
|
|
8
|
+
className,
|
|
9
|
+
optionClassName,
|
|
10
|
+
selectedClassName,
|
|
11
|
+
unselectedClassName
|
|
12
|
+
}) {
|
|
13
|
+
const handleKeyDown = (event) => {
|
|
14
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
const currentIndex = options.findIndex((option) => option.value === value);
|
|
17
|
+
if (currentIndex === -1) return;
|
|
18
|
+
const direction = event.key === "ArrowRight" ? 1 : -1;
|
|
19
|
+
const nextIndex = (currentIndex + direction + options.length) % options.length;
|
|
20
|
+
onChange(options[nextIndex].value);
|
|
21
|
+
};
|
|
22
|
+
const baseSelected = selectedClassName ?? "bg-white text-zinc-950 shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)]";
|
|
23
|
+
const baseUnselected = unselectedClassName ?? "text-zinc-950";
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: cn("inline-flex items-stretch rounded-[12px] bg-zinc-100 p-1.5 gap-1", className),
|
|
28
|
+
role: "radiogroup",
|
|
29
|
+
onKeyDown: handleKeyDown,
|
|
30
|
+
children: options.map((option) => {
|
|
31
|
+
const isActive = option.value === value;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
type: "button",
|
|
36
|
+
role: "radio",
|
|
37
|
+
"aria-checked": isActive,
|
|
38
|
+
className: cn(
|
|
39
|
+
"px-3 py-1.5 rounded-lg paragraph-small-semibold transition-colors cursor-pointer",
|
|
40
|
+
isActive ? baseSelected : baseUnselected,
|
|
41
|
+
optionClassName,
|
|
42
|
+
option.className
|
|
43
|
+
),
|
|
44
|
+
onClick: () => onChange(option.value),
|
|
45
|
+
children: option.label
|
|
46
|
+
},
|
|
47
|
+
String(option.value)
|
|
48
|
+
);
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
SegmentedControl
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=SegmentedControl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/form/SegmentedControl.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../../infra/utils/clsx';\n\ntype SegmentedControlOption<Value extends string | number> = {\n value: Value;\n label: React.ReactNode;\n className?: string;\n};\n\ninterface SegmentedControlProps<Value extends string | number> {\n value: Value;\n onChange: (value: Value) => void;\n options: SegmentedControlOption<Value>[];\n className?: string;\n optionClassName?: string;\n selectedClassName?: string;\n unselectedClassName?: string;\n}\n\n/** Alternador de opções curtas (periodicidade da vitrine, por exemplo). */\nexport function SegmentedControl<Value extends string | number = string>({\n value,\n onChange,\n options,\n className,\n optionClassName,\n selectedClassName,\n unselectedClassName,\n}: SegmentedControlProps<Value>) {\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n\n event.preventDefault();\n const currentIndex = options.findIndex((option) => option.value === value);\n if (currentIndex === -1) return;\n\n const direction = event.key === 'ArrowRight' ? 1 : -1;\n const nextIndex = (currentIndex + direction + options.length) % options.length;\n onChange(options[nextIndex].value);\n };\n\n const baseSelected =\n selectedClassName ?? 'bg-white text-zinc-950 shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)]';\n const baseUnselected = unselectedClassName ?? 'text-zinc-950';\n\n return (\n <div\n className={cn('inline-flex items-stretch rounded-[12px] bg-zinc-100 p-1.5 gap-1', className)}\n role=\"radiogroup\"\n onKeyDown={handleKeyDown}\n >\n {options.map((option) => {\n const isActive = option.value === value;\n\n return (\n <button\n key={String(option.value)}\n type=\"button\"\n role=\"radio\"\n aria-checked={isActive}\n className={cn(\n 'px-3 py-1.5 rounded-lg paragraph-small-semibold transition-colors cursor-pointer',\n isActive ? baseSelected : baseUnselected,\n optionClassName,\n option.className\n )}\n onClick={() => onChange(option.value)}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";AAyDU;AAtDV,SAAS,UAAU;AAmBZ,SAAS,iBAAyD;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AAC/B,QAAM,gBAAgB,CAAC,UAA+C;AACpE,QAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,aAAc;AAE7D,UAAM,eAAe;AACrB,UAAM,eAAe,QAAQ,UAAU,CAAC,WAAW,OAAO,UAAU,KAAK;AACzE,QAAI,iBAAiB,GAAI;AAEzB,UAAM,YAAY,MAAM,QAAQ,eAAe,IAAI;AACnD,UAAM,aAAa,eAAe,YAAY,QAAQ,UAAU,QAAQ;AACxE,aAAS,QAAQ,SAAS,EAAE,KAAK;AAAA,EACnC;AAEA,QAAM,eACJ,qBAAqB;AACvB,QAAM,iBAAiB,uBAAuB;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,oEAAoE,SAAS;AAAA,MAC3F,MAAK;AAAA,MACL,WAAW;AAAA,MAEV,kBAAQ,IAAI,CAAC,WAAW;AACvB,cAAM,WAAW,OAAO,UAAU;AAElC,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,MAAK;AAAA,YACL,gBAAc;AAAA,YACd,WAAW;AAAA,cACT;AAAA,cACA,WAAW,eAAe;AAAA,cAC1B;AAAA,cACA,OAAO;AAAA,YACT;AAAA,YACA,SAAS,MAAM,SAAS,OAAO,KAAK;AAAA,YAEnC,iBAAO;AAAA;AAAA,UAZH,OAAO,OAAO,KAAK;AAAA,QAa1B;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -1,13 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
5
|
import { IconX } from "@tabler/icons-react";
|
|
5
6
|
import { cn } from "../../../infra/utils/clsx";
|
|
6
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
OverlayLayerContext,
|
|
9
|
+
OverlayTopContext,
|
|
10
|
+
useDialogLayer,
|
|
11
|
+
useIsTopOverlay,
|
|
12
|
+
useOverlayPosition,
|
|
13
|
+
useTopLayerScrollIsolation
|
|
14
|
+
} from "./layers";
|
|
7
15
|
function Dialog({
|
|
16
|
+
open,
|
|
17
|
+
defaultOpen,
|
|
18
|
+
onOpenChange,
|
|
19
|
+
modal,
|
|
8
20
|
...props
|
|
9
21
|
}) {
|
|
10
|
-
|
|
22
|
+
const [openState, setOpenState] = React.useState(defaultOpen ?? false);
|
|
23
|
+
const { layer, isTop } = useOverlayPosition(open ?? openState);
|
|
24
|
+
const handleOpenChange = (next) => {
|
|
25
|
+
setOpenState(next);
|
|
26
|
+
onOpenChange?.(next);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(OverlayTopContext.Provider, { value: isTop, children: /* @__PURE__ */ jsx(
|
|
29
|
+
DialogPrimitive.Root,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "dialog",
|
|
32
|
+
open,
|
|
33
|
+
defaultOpen,
|
|
34
|
+
onOpenChange: handleOpenChange,
|
|
35
|
+
modal,
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
) }) });
|
|
11
39
|
}
|
|
12
40
|
function DialogTrigger({
|
|
13
41
|
...props
|
|
@@ -48,16 +76,23 @@ function DialogContent({
|
|
|
48
76
|
showCloseButton = true,
|
|
49
77
|
overlayClassName,
|
|
50
78
|
hideOverlay = false,
|
|
79
|
+
ref,
|
|
51
80
|
...props
|
|
52
81
|
}) {
|
|
53
|
-
const
|
|
54
|
-
|
|
82
|
+
const layer = useDialogLayer();
|
|
83
|
+
const contentRef = React.useRef(null);
|
|
84
|
+
useTopLayerScrollIsolation(contentRef, useIsTopOverlay());
|
|
85
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
55
86
|
!hideOverlay && /* @__PURE__ */ jsx(DialogOverlay, { className: overlayClassName }),
|
|
56
87
|
/* @__PURE__ */ jsxs(
|
|
57
88
|
DialogPrimitive.Content,
|
|
58
89
|
{
|
|
59
|
-
ref: presenceRef,
|
|
60
90
|
"data-slot": "dialog-content",
|
|
91
|
+
ref: (node) => {
|
|
92
|
+
contentRef.current = node;
|
|
93
|
+
if (typeof ref === "function") ref(node);
|
|
94
|
+
else if (ref) ref.current = node;
|
|
95
|
+
},
|
|
61
96
|
className: cn(
|
|
62
97
|
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
63
98
|
layer.content,
|
|
@@ -80,7 +115,7 @@ function DialogContent({
|
|
|
80
115
|
]
|
|
81
116
|
}
|
|
82
117
|
)
|
|
83
|
-
] })
|
|
118
|
+
] });
|
|
84
119
|
}
|
|
85
120
|
function DialogHeader({ className, ...props }) {
|
|
86
121
|
return /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport {\n OverlayLayerContext,\n OverlayTopContext,\n useDialogLayer,\n useIsTopOverlay,\n useOverlayPosition,\n useTopLayerScrollIsolation,\n} from \"./layers\";\n\nfunction Dialog({\n open,\n defaultOpen,\n onOpenChange,\n modal,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const { layer, isTop } = useOverlayPosition(open ?? openState);\n\n const handleOpenChange = (next: boolean) => {\n setOpenState(next);\n onOpenChange?.(next);\n };\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <OverlayTopContext.Provider value={isTop}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n {...props}\n />\n </OverlayTopContext.Provider>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n const layer = useDialogLayer();\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/50\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n hideOverlay = false,\n ref,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n hideOverlay?: boolean;\n}) {\n const layer = useDialogLayer();\n const contentRef = React.useRef<HTMLDivElement>(null);\n useTopLayerScrollIsolation(contentRef, useIsTopOverlay());\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n {!hideOverlay && <DialogOverlay className={overlayClassName} />}\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n layer.content,\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <div className=\"absolute top-0.5 right-0\">\n <div className=\"p-4\">\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </div>\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"p-5 flex flex-col gap-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"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","names":[]}
|
|
@@ -5,14 +5,34 @@ import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
|
5
5
|
import { IconX } from "@tabler/icons-react";
|
|
6
6
|
import { cn } from "../../../infra/utils/clsx";
|
|
7
7
|
import { hideCrisp, showCrisp } from "../../embeds/CrispEmbed";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {
|
|
9
|
+
OverlayLayerContext,
|
|
10
|
+
OverlayTopContext,
|
|
11
|
+
useDialogLayer,
|
|
12
|
+
useIsTopOverlay,
|
|
13
|
+
useOverlayPosition,
|
|
14
|
+
useTopLayerScrollIsolation
|
|
15
|
+
} from "./layers";
|
|
16
|
+
function Sheet({ open, defaultOpen, onOpenChange, modal = true, ...props }) {
|
|
17
|
+
const [openState, setOpenState] = React.useState(defaultOpen ?? false);
|
|
18
|
+
const { layer, isTop } = useOverlayPosition(open ?? openState);
|
|
19
|
+
const handleOpenChange = React.useCallback((next) => {
|
|
20
|
+
if (next) hideCrisp();
|
|
12
21
|
else showCrisp();
|
|
13
|
-
|
|
22
|
+
setOpenState(next);
|
|
23
|
+
onOpenChange?.(next);
|
|
14
24
|
}, [onOpenChange]);
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
+
return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(OverlayTopContext.Provider, { value: isTop, children: /* @__PURE__ */ jsx(
|
|
26
|
+
SheetPrimitive.Root,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "sheet",
|
|
29
|
+
modal,
|
|
30
|
+
open,
|
|
31
|
+
defaultOpen,
|
|
32
|
+
onOpenChange: handleOpenChange,
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
) }) });
|
|
16
36
|
}
|
|
17
37
|
function SheetTrigger({
|
|
18
38
|
...props
|
|
@@ -38,12 +58,15 @@ function SheetOverlay({
|
|
|
38
58
|
"div",
|
|
39
59
|
{
|
|
40
60
|
"data-slot": "sheet-overlay",
|
|
61
|
+
...props,
|
|
41
62
|
className: cn(
|
|
42
|
-
|
|
63
|
+
// `pointer-events-auto` explícito: este overlay é um div nosso, e quando o sheet abre
|
|
64
|
+
// por cima de um dialog o Radix trava `pointer-events: none` no body — sem isto ele
|
|
65
|
+
// herdaria o bloqueio, viraria só cor e os cliques atravessariam para o que está atrás.
|
|
66
|
+
"animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default pointer-events-auto",
|
|
43
67
|
layer.overlay,
|
|
44
68
|
className
|
|
45
|
-
)
|
|
46
|
-
...props
|
|
69
|
+
)
|
|
47
70
|
}
|
|
48
71
|
) });
|
|
49
72
|
}
|
|
@@ -53,16 +76,23 @@ function SheetContent({
|
|
|
53
76
|
side = "right",
|
|
54
77
|
showCloseButton = true,
|
|
55
78
|
noAnimation = false,
|
|
79
|
+
ref,
|
|
56
80
|
...props
|
|
57
81
|
}) {
|
|
58
|
-
const
|
|
59
|
-
|
|
82
|
+
const layer = useDialogLayer();
|
|
83
|
+
const contentRef = React.useRef(null);
|
|
84
|
+
useTopLayerScrollIsolation(contentRef, useIsTopOverlay());
|
|
85
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
60
86
|
/* @__PURE__ */ jsx(SheetOverlay, { className: noAnimation ? "!animate-none" : void 0 }),
|
|
61
87
|
/* @__PURE__ */ jsxs(
|
|
62
88
|
SheetPrimitive.Content,
|
|
63
89
|
{
|
|
64
|
-
ref: presenceRef,
|
|
65
90
|
"data-slot": "sheet-content",
|
|
91
|
+
ref: (node) => {
|
|
92
|
+
contentRef.current = node;
|
|
93
|
+
if (typeof ref === "function") ref(node);
|
|
94
|
+
else if (ref) ref.current = node;
|
|
95
|
+
},
|
|
66
96
|
onInteractOutside: (e) => e.preventDefault(),
|
|
67
97
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
68
98
|
className: cn(
|
|
@@ -96,7 +126,7 @@ function SheetContent({
|
|
|
96
126
|
]
|
|
97
127
|
}
|
|
98
128
|
)
|
|
99
|
-
] })
|
|
129
|
+
] });
|
|
100
130
|
}
|
|
101
131
|
function SheetHeader({ className, ...props }) {
|
|
102
132
|
return /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/overlay/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { hideCrisp, showCrisp } from \"../../embeds/CrispEmbed\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/overlay/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { hideCrisp, showCrisp } from \"../../embeds/CrispEmbed\";\nimport {\n OverlayLayerContext,\n OverlayTopContext,\n useDialogLayer,\n useIsTopOverlay,\n useOverlayPosition,\n useTopLayerScrollIsolation,\n} from \"./layers\";\n\n/** `modal` ligado por padrão: drawer segura o foco e o fundo enquanto está aberto. */\nfunction Sheet({ open, defaultOpen, onOpenChange, modal = true, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const { layer, isTop } = useOverlayPosition(open ?? openState);\n\n const handleOpenChange = React.useCallback((next: boolean) => {\n if (next) hideCrisp();\n else showCrisp();\n setOpenState(next);\n onOpenChange?.(next);\n }, [onOpenChange]);\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <OverlayTopContext.Provider value={isTop}>\n <SheetPrimitive.Root\n data-slot=\"sheet\"\n modal={modal}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </OverlayTopContext.Provider>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction SheetTrigger({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n const layer = useDialogLayer();\n return (\n <SheetPrimitive.Close tabIndex={-1} asChild>\n <div\n data-slot=\"sheet-overlay\"\n {...props}\n className={cn(\n // `pointer-events-auto` explícito: este overlay é um div nosso, e quando o sheet abre\n // por cima de um dialog o Radix trava `pointer-events: none` no body — sem isto ele\n // herdaria o bloqueio, viraria só cor e os cliques atravessariam para o que está atrás.\n \"animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default pointer-events-auto\",\n layer.overlay,\n className,\n )}\n />\n </SheetPrimitive.Close>\n );\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n noAnimation = false,\n ref,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n noAnimation?: boolean;\n}) {\n const layer = useDialogLayer();\n const contentRef = React.useRef<HTMLDivElement>(null);\n useTopLayerScrollIsolation(contentRef, useIsTopOverlay());\n return (\n <SheetPortal>\n <SheetOverlay className={noAnimation ? \"!animate-none\" : undefined} />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n onInteractOutside={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n className={cn(\n \"bg-background fixed flex flex-col gap-4 shadow-lg\",\n layer.content,\n !noAnimation &&\n \"data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n !noAnimation &&\n side === \"right\" &&\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\",\n !noAnimation &&\n side === \"left\" &&\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\",\n !noAnimation &&\n side === \"top\" &&\n \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n !noAnimation &&\n side === \"bottom\" &&\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n side === \"right\" &&\n \"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n side === \"left\" &&\n \"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n side === \"top\" && \"inset-x-0 top-0 h-auto border-b\",\n side === \"bottom\" && \"inset-x-0 bottom-0 h-auto border-t\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n className=\"absolute top-3 right-3 hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":"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","names":[]}
|
|
@@ -14,35 +14,49 @@ const ROOT_LAYER = { overlay: "z-[1000]", content: "z-[1001]", popover: "z-[1002
|
|
|
14
14
|
const openOverlays = /* @__PURE__ */ new Set();
|
|
15
15
|
const overlayListeners = /* @__PURE__ */ new Set();
|
|
16
16
|
let saturationWarned = false;
|
|
17
|
-
function
|
|
18
|
-
overlayListeners.
|
|
19
|
-
return () => {
|
|
20
|
-
overlayListeners.delete(onStoreChange);
|
|
21
|
-
};
|
|
17
|
+
function notifyOverlays() {
|
|
18
|
+
overlayListeners.forEach((listener) => listener());
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
() => Math.max(Array.from(openOverlays).indexOf(token.current), 0),
|
|
29
|
-
() => 0
|
|
20
|
+
function warnOnSaturation() {
|
|
21
|
+
if (process.env.NODE_ENV === "production" || saturationWarned || openOverlays.size <= OVERLAY_LAYERS.length) return;
|
|
22
|
+
saturationWarned = true;
|
|
23
|
+
console.warn(
|
|
24
|
+
`[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`
|
|
30
25
|
);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
}
|
|
27
|
+
const OverlayLayerContext = React.createContext(ROOT_LAYER);
|
|
28
|
+
const OverlayTopContext = React.createContext(true);
|
|
29
|
+
function useIsTopOverlay() {
|
|
30
|
+
return React.useContext(OverlayTopContext);
|
|
31
|
+
}
|
|
32
|
+
function readPosition(token) {
|
|
33
|
+
const tokens = Array.from(openOverlays);
|
|
34
|
+
const index = tokens.indexOf(token);
|
|
35
|
+
return { rank: Math.max(index, 0), isTop: index === tokens.length - 1 };
|
|
36
|
+
}
|
|
37
|
+
function useOverlayPosition(open) {
|
|
38
|
+
const [position, setPosition] = React.useState({ rank: 0, isTop: true });
|
|
39
|
+
React.useLayoutEffect(() => {
|
|
40
|
+
if (!open) return;
|
|
41
|
+
const token = {};
|
|
42
|
+
const sync = () => setPosition(readPosition(token));
|
|
43
|
+
overlayListeners.add(sync);
|
|
44
|
+
openOverlays.add(token);
|
|
45
|
+
notifyOverlays();
|
|
46
|
+
warnOnSaturation();
|
|
40
47
|
return () => {
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
overlayListeners.delete(sync);
|
|
49
|
+
openOverlays.delete(token);
|
|
50
|
+
notifyOverlays();
|
|
43
51
|
};
|
|
44
|
-
}, []);
|
|
45
|
-
return {
|
|
52
|
+
}, [open]);
|
|
53
|
+
return {
|
|
54
|
+
layer: OVERLAY_LAYERS[Math.min(position.rank, OVERLAY_LAYERS.length - 1)],
|
|
55
|
+
isTop: position.isTop
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function useOverlayLayer(open) {
|
|
59
|
+
return useOverlayPosition(open).layer;
|
|
46
60
|
}
|
|
47
61
|
function useDialogLayer() {
|
|
48
62
|
return React.useContext(OverlayLayerContext);
|
|
@@ -50,12 +64,44 @@ function useDialogLayer() {
|
|
|
50
64
|
function DialogLayer({ children }) {
|
|
51
65
|
return children;
|
|
52
66
|
}
|
|
67
|
+
const FLOATING_CONTENT_SELECTOR = [
|
|
68
|
+
"[data-radix-popper-content-wrapper]",
|
|
69
|
+
"[data-radix-menu-content]",
|
|
70
|
+
'[data-slot="select-content"]',
|
|
71
|
+
'[data-slot="popover-content"]',
|
|
72
|
+
'[data-slot="dropdown-menu-content"]',
|
|
73
|
+
'[data-slot="command-list"]',
|
|
74
|
+
'[role="listbox"]',
|
|
75
|
+
'[role="menu"]'
|
|
76
|
+
].join(",");
|
|
77
|
+
function useTopLayerScrollIsolation(ref, enabled) {
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
if (!enabled) return;
|
|
80
|
+
const stopForThisLayer = (event) => {
|
|
81
|
+
const target = event.target;
|
|
82
|
+
if (!target) return;
|
|
83
|
+
const isFloatingContent = target instanceof Element && target.closest(FLOATING_CONTENT_SELECTOR) !== null;
|
|
84
|
+
if (isFloatingContent || ref.current?.contains(target)) event.stopPropagation();
|
|
85
|
+
};
|
|
86
|
+
const options = { capture: true };
|
|
87
|
+
document.addEventListener("wheel", stopForThisLayer, options);
|
|
88
|
+
document.addEventListener("touchmove", stopForThisLayer, options);
|
|
89
|
+
return () => {
|
|
90
|
+
document.removeEventListener("wheel", stopForThisLayer, options);
|
|
91
|
+
document.removeEventListener("touchmove", stopForThisLayer, options);
|
|
92
|
+
};
|
|
93
|
+
}, [ref, enabled]);
|
|
94
|
+
}
|
|
53
95
|
export {
|
|
54
96
|
DialogLayer,
|
|
55
97
|
OVERLAY_LAYERS,
|
|
56
98
|
OverlayLayerContext,
|
|
99
|
+
OverlayTopContext,
|
|
57
100
|
ROOT_LAYER,
|
|
58
101
|
useDialogLayer,
|
|
59
|
-
|
|
102
|
+
useIsTopOverlay,
|
|
103
|
+
useOverlayLayer,
|
|
104
|
+
useOverlayPosition,
|
|
105
|
+
useTopLayerScrollIsolation
|
|
60
106
|
};
|
|
61
107
|
//# sourceMappingURL=layers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/overlay/layers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport const OVERLAY_LAYERS = [\n { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-[1003]\" },\n { overlay: \"z-[1010]\", content: \"z-[1011]\", popover: \"z-[1012]\", tooltip: \"z-[1013]\" },\n { overlay: \"z-[1020]\", content: \"z-[1021]\", popover: \"z-[1022]\", tooltip: \"z-[1023]\" },\n { overlay: \"z-[1030]\", content: \"z-[1031]\", popover: \"z-[1032]\", tooltip: \"z-[1033]\" },\n { overlay: \"z-[1040]\", content: \"z-[1041]\", popover: \"z-[1042]\", tooltip: \"z-[1043]\" },\n { overlay: \"z-[1050]\", content: \"z-[1051]\", popover: \"z-[1052]\", tooltip: \"z-[1053]\" },\n { overlay: \"z-[1060]\", content: \"z-[1061]\", popover: \"z-[1062]\", tooltip: \"z-[1063]\" },\n { overlay: \"z-[1070]\", content: \"z-[1071]\", popover: \"z-[1072]\", tooltip: \"z-[1073]\" },\n] as const;\n\nexport const ROOT_LAYER = { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-50\" } as const;\n\nexport type DialogLayerClasses = (typeof OVERLAY_LAYERS)[number] | typeof ROOT_LAYER;\n\nconst openOverlays = new Set<object>();\nconst overlayListeners = new Set<() => void>();\nlet saturationWarned = false;\n\nfunction
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/overlay/layers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport const OVERLAY_LAYERS = [\n { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-[1003]\" },\n { overlay: \"z-[1010]\", content: \"z-[1011]\", popover: \"z-[1012]\", tooltip: \"z-[1013]\" },\n { overlay: \"z-[1020]\", content: \"z-[1021]\", popover: \"z-[1022]\", tooltip: \"z-[1023]\" },\n { overlay: \"z-[1030]\", content: \"z-[1031]\", popover: \"z-[1032]\", tooltip: \"z-[1033]\" },\n { overlay: \"z-[1040]\", content: \"z-[1041]\", popover: \"z-[1042]\", tooltip: \"z-[1043]\" },\n { overlay: \"z-[1050]\", content: \"z-[1051]\", popover: \"z-[1052]\", tooltip: \"z-[1053]\" },\n { overlay: \"z-[1060]\", content: \"z-[1061]\", popover: \"z-[1062]\", tooltip: \"z-[1063]\" },\n { overlay: \"z-[1070]\", content: \"z-[1071]\", popover: \"z-[1072]\", tooltip: \"z-[1073]\" },\n] as const;\n\nexport const ROOT_LAYER = { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-50\" } as const;\n\nexport type DialogLayerClasses = (typeof OVERLAY_LAYERS)[number] | typeof ROOT_LAYER;\n\nconst openOverlays = new Set<object>();\nconst overlayListeners = new Set<() => void>();\nlet saturationWarned = false;\n\nfunction notifyOverlays() {\n overlayListeners.forEach((listener) => listener());\n}\n\nfunction warnOnSaturation() {\n if (process.env.NODE_ENV === \"production\" || saturationWarned || openOverlays.size <= OVERLAY_LAYERS.length) return;\n saturationWarned = true;\n console.warn(\n `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. ` +\n `Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. ` +\n `Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`,\n );\n}\n\nexport const OverlayLayerContext = React.createContext<DialogLayerClasses>(ROOT_LAYER);\n\n/** Se a camada em volta é a do topo da pilha (ver `useTopLayerScrollIsolation`). */\nexport const OverlayTopContext = React.createContext<boolean>(true);\n\nexport function useIsTopOverlay(): boolean {\n return React.useContext(OverlayTopContext);\n}\n\ntype OverlayPosition = { layer: DialogLayerClasses; isTop: boolean };\n\nfunction readPosition(token: object): { rank: number; isTop: boolean } {\n const tokens = Array.from(openOverlays);\n const index = tokens.indexOf(token);\n return { rank: Math.max(index, 0), isTop: index === tokens.length - 1 };\n}\n\n/**\n * Faixa de z do overlay e se ele é o de cima da pilha.\n *\n * O `isTop` existe por causa do bloqueio de scroll: o Radix cancela wheel e touchmove de tudo\n * que não seja filho do conteúdo dele, e cada overlay vive no próprio portal. Com dois modais\n * ativos, o de baixo cancelaria a rolagem do de cima — então quem não está no topo deixa de ser\n * modal enquanto houver alguém acima.\n */\nexport function useOverlayPosition(open: boolean): OverlayPosition {\n const [position, setPosition] = React.useState({ rank: 0, isTop: true });\n\n React.useLayoutEffect(() => {\n if (!open) return;\n\n const token = {};\n const sync = () => setPosition(readPosition(token));\n\n overlayListeners.add(sync);\n openOverlays.add(token);\n notifyOverlays();\n warnOnSaturation();\n\n return () => {\n overlayListeners.delete(sync);\n openOverlays.delete(token);\n notifyOverlays();\n };\n }, [open]);\n\n return {\n layer: OVERLAY_LAYERS[Math.min(position.rank, OVERLAY_LAYERS.length - 1)],\n isTop: position.isTop,\n };\n}\n\nexport function useOverlayLayer(open: boolean): DialogLayerClasses {\n return useOverlayPosition(open).layer;\n}\n\nexport function useDialogLayer(): DialogLayerClasses {\n return React.useContext(OverlayLayerContext);\n}\n\nexport function DialogLayer({ children }: { children: React.ReactNode }) {\n return children;\n}\n\n/**\n * Isola a rolagem desta camada do bloqueio de scroll das camadas de baixo.\n *\n * O bloqueio do Radix escuta wheel e touchmove no document e cancela tudo que não seja filho do\n * conteúdo dele. Cada overlay vive no próprio portal, então o modal de baixo cancelava a rolagem\n * do drawer de cima — e de um jeito traiçoeiro: evento avulso passava, rajada de trackpad era\n * cancelada inteira. Parar a propagação na captura impede que aquele ouvinte chegue a ver o\n * evento, e o navegador rola normalmente.\n *\n * O custo é que `onWheel`/`onTouchMove` de React dentro desta camada deixam de receber esses dois\n * eventos — nada na lib depende disso (listas paginam por `scroll` e por sentinela).\n */\n/** Portais de conteúdo flutuante do Radix que acompanham a camada aberta. */\nconst FLOATING_CONTENT_SELECTOR = [\n \"[data-radix-popper-content-wrapper]\",\n \"[data-radix-menu-content]\",\n '[data-slot=\"select-content\"]',\n '[data-slot=\"popover-content\"]',\n '[data-slot=\"dropdown-menu-content\"]',\n '[data-slot=\"command-list\"]',\n '[role=\"listbox\"]',\n '[role=\"menu\"]',\n].join(\",\");\n\nexport function useTopLayerScrollIsolation(\n ref: React.RefObject<HTMLElement | null>,\n enabled: boolean,\n) {\n React.useEffect(() => {\n if (!enabled) return;\n\n const stopForThisLayer = (event: Event) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n // Conteúdo flutuante (select, popover, menu) abre em portal próprio, fora do conteúdo da\n // camada, mas pertence a ela — sem isto, lista longa de select dentro do modal não rolava.\n const isFloatingContent =\n target instanceof Element && target.closest(FLOATING_CONTENT_SELECTOR) !== null;\n\n if (isFloatingContent || ref.current?.contains(target)) event.stopPropagation();\n };\n\n const options = { capture: true } as const;\n document.addEventListener(\"wheel\", stopForThisLayer, options);\n document.addEventListener(\"touchmove\", stopForThisLayer, options);\n\n return () => {\n document.removeEventListener(\"wheel\", stopForThisLayer, options);\n document.removeEventListener(\"touchmove\", stopForThisLayer, options);\n };\n }, [ref, enabled]);\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var AccountHubFlow = /* @__PURE__ */ ((AccountHubFlow2) => {
|
|
2
|
+
AccountHubFlow2["PLANS"] = "plans";
|
|
3
|
+
AccountHubFlow2["ADDONS"] = "addons";
|
|
4
|
+
AccountHubFlow2["REACTIVATE"] = "reactivate";
|
|
5
|
+
AccountHubFlow2["RECEIPT"] = "receipt";
|
|
6
|
+
AccountHubFlow2["CREATE_PROJECT"] = "create-project";
|
|
7
|
+
AccountHubFlow2["ADD_USER"] = "add-user";
|
|
8
|
+
return AccountHubFlow2;
|
|
9
|
+
})(AccountHubFlow || {});
|
|
10
|
+
export {
|
|
11
|
+
AccountHubFlow
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=AccountHubFlow.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/enums/AccountHubFlow.ts"],"sourcesContent":["export enum AccountHubFlow {\n PLANS = 'plans',\n ADDONS = 'addons',\n REACTIVATE = 'reactivate',\n RECEIPT = 'receipt',\n CREATE_PROJECT = 'create-project',\n ADD_USER = 'add-user',\n}\n"],"mappings":"AAAO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,oBAAiB;AACjB,EAAAA,gBAAA,cAAW;AAND,SAAAA;AAAA,GAAA;","names":["AccountHubFlow"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var DateFilterPeriod = /* @__PURE__ */ ((DateFilterPeriod2) => {
|
|
2
|
+
DateFilterPeriod2["TODAY"] = "TODAY";
|
|
3
|
+
DateFilterPeriod2["YESTERDAY"] = "YESTERDAY";
|
|
4
|
+
DateFilterPeriod2["LAST_7_DAYS"] = "LAST_7_DAYS";
|
|
5
|
+
DateFilterPeriod2["LAST_30_DAYS"] = "LAST_30_DAYS";
|
|
6
|
+
DateFilterPeriod2["LAST_MONTH"] = "LAST_MONTH";
|
|
7
|
+
DateFilterPeriod2["ALL_TIME"] = "ALL_TIME";
|
|
8
|
+
return DateFilterPeriod2;
|
|
9
|
+
})(DateFilterPeriod || {});
|
|
10
|
+
const DATE_FILTER_PERIODS = [
|
|
11
|
+
"TODAY" /* TODAY */,
|
|
12
|
+
"YESTERDAY" /* YESTERDAY */,
|
|
13
|
+
"LAST_7_DAYS" /* LAST_7_DAYS */,
|
|
14
|
+
"LAST_30_DAYS" /* LAST_30_DAYS */,
|
|
15
|
+
"LAST_MONTH" /* LAST_MONTH */,
|
|
16
|
+
"ALL_TIME" /* ALL_TIME */
|
|
17
|
+
];
|
|
18
|
+
export {
|
|
19
|
+
DATE_FILTER_PERIODS,
|
|
20
|
+
DateFilterPeriod
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=DateFilterPeriod.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/enums/DateFilterPeriod.ts"],"sourcesContent":["export enum DateFilterPeriod {\n TODAY = 'TODAY',\n YESTERDAY = 'YESTERDAY',\n LAST_7_DAYS = 'LAST_7_DAYS',\n LAST_30_DAYS = 'LAST_30_DAYS',\n LAST_MONTH = 'LAST_MONTH',\n ALL_TIME = 'ALL_TIME',\n}\n\nexport const DATE_FILTER_PERIODS = [\n DateFilterPeriod.TODAY,\n DateFilterPeriod.YESTERDAY,\n DateFilterPeriod.LAST_7_DAYS,\n DateFilterPeriod.LAST_30_DAYS,\n DateFilterPeriod.LAST_MONTH,\n DateFilterPeriod.ALL_TIME,\n] as const;\n"],"mappings":"AAAO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,WAAQ;AACR,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,iBAAc;AACd,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,gBAAa;AACb,EAAAA,kBAAA,cAAW;AAND,SAAAA;AAAA,GAAA;AASL,MAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["DateFilterPeriod"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var WorkspaceSectionType = /* @__PURE__ */ ((WorkspaceSectionType2) => {
|
|
2
|
+
WorkspaceSectionType2["SUBSCRIPTION"] = "subscription";
|
|
3
|
+
WorkspaceSectionType2["PROJECTS"] = "projects";
|
|
4
|
+
WorkspaceSectionType2["TEAM"] = "team";
|
|
5
|
+
WorkspaceSectionType2["AFFILIATES"] = "affiliates";
|
|
6
|
+
return WorkspaceSectionType2;
|
|
7
|
+
})(WorkspaceSectionType || {});
|
|
8
|
+
export {
|
|
9
|
+
WorkspaceSectionType
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=WorkspaceSectionType.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/enums/WorkspaceSectionType.ts"],"sourcesContent":["export enum WorkspaceSectionType {\n SUBSCRIPTION = 'subscription',\n PROJECTS = 'projects',\n TEAM = 'team',\n AFFILIATES = 'affiliates',\n}\n"],"mappings":"AAAO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,kBAAe;AACf,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,gBAAa;AAJH,SAAAA;AAAA,GAAA;","names":["WorkspaceSectionType"]}
|
package/dist/handlers.mjs
CHANGED
|
@@ -13,29 +13,53 @@ import { createFindProjectHandler } from "./modules/projects/handlers/find-proje
|
|
|
13
13
|
import { createListProjectUsersHandler } from "./modules/projects/handlers/list-project-users.handler";
|
|
14
14
|
import { createListAvailableUsersHandler } from "./modules/projects/handlers/list-available-users.handler";
|
|
15
15
|
import { createListAllAccountUsersHandler } from "./modules/projects/handlers/list-all-account-users.handler";
|
|
16
|
+
import { createListAccountMembersHandler } from "./modules/accounts/handlers/list-account-members.handler";
|
|
16
17
|
import { createListSubscriptionsHandler } from "./modules/subscriptions/handlers/list-subscriptions.handler";
|
|
17
18
|
import { createCurrentSubscriptionHandler } from "./modules/subscriptions/handlers/current-subscription.handler";
|
|
18
19
|
import { createFreezeNoticeHandler } from "./modules/subscriptions/handlers/freeze-notice.handler";
|
|
19
20
|
import { createListMessagesHandler } from "./modules/users/handlers/list-messages.handler";
|
|
21
|
+
import { createCurrentAffiliateHandler } from "./modules/affiliates/handlers/current-affiliate.handler";
|
|
22
|
+
import { createAffiliateReportAnalyticsHandler } from "./modules/affiliates/handlers/affiliate-report-analytics.handler";
|
|
23
|
+
import { createListAffiliateTransactionsHandler } from "./modules/affiliates/handlers/list-affiliate-transactions.handler";
|
|
24
|
+
import { createListAffiliateCouponsHandler } from "./modules/affiliates/handlers/list-affiliate-coupons.handler";
|
|
25
|
+
import { createListAffiliateLeadsHandler } from "./modules/affiliates/handlers/list-affiliate-leads.handler";
|
|
26
|
+
import { createAffiliateWithdrawalLimitsHandler } from "./modules/affiliates/handlers/affiliate-withdrawal-limits.handler";
|
|
27
|
+
import { createPendingPixStatusHandler } from "./modules/subscriptions/handlers/pending-pix-status.handler";
|
|
28
|
+
import { createListIaCreditOperationsHandler } from "./modules/ia-credits/handlers/list-ia-credit-operations.handler";
|
|
29
|
+
import { createFindCouponByIdHandler } from "./modules/coupons/handlers/find-coupon-by-id.handler";
|
|
30
|
+
import { createFindCouponByCodeHandler } from "./modules/coupons/handlers/find-coupon-by-code.handler";
|
|
31
|
+
import { createCountDomainsHandler } from "./modules/domains/handlers/count-domains.handler";
|
|
20
32
|
export {
|
|
33
|
+
createAffiliateReportAnalyticsHandler,
|
|
34
|
+
createAffiliateWithdrawalLimitsHandler,
|
|
35
|
+
createCountDomainsHandler,
|
|
21
36
|
createCountPagesHandler,
|
|
37
|
+
createCurrentAffiliateHandler,
|
|
22
38
|
createCurrentSubscriptionHandler,
|
|
23
39
|
createFindCardByIdHandler,
|
|
24
40
|
createFindChargeByIdHandler,
|
|
41
|
+
createFindCouponByCodeHandler,
|
|
42
|
+
createFindCouponByIdHandler,
|
|
25
43
|
createFindPlanByIdHandler,
|
|
26
44
|
createFindProjectHandler,
|
|
27
45
|
createFreezeNoticeHandler,
|
|
28
46
|
createGetAiCreditsOfferEligibilityHandler,
|
|
47
|
+
createListAccountMembersHandler,
|
|
48
|
+
createListAffiliateCouponsHandler,
|
|
49
|
+
createListAffiliateLeadsHandler,
|
|
50
|
+
createListAffiliateTransactionsHandler,
|
|
29
51
|
createListAllAccountUsersHandler,
|
|
30
52
|
createListAvailableUsersHandler,
|
|
31
53
|
createListCardsHandler,
|
|
32
54
|
createListChargesHandler,
|
|
55
|
+
createListIaCreditOperationsHandler,
|
|
33
56
|
createListIaCreditsHandler,
|
|
34
57
|
createListMessagesHandler,
|
|
35
58
|
createListPlansHandler,
|
|
36
59
|
createListProjectUsersHandler,
|
|
37
60
|
createListProjectsHandler,
|
|
38
61
|
createListSubscriptionsHandler,
|
|
62
|
+
createPendingPixStatusHandler,
|
|
39
63
|
createPurchaseIaCreditsHandler
|
|
40
64
|
};
|
|
41
65
|
//# sourceMappingURL=handlers.mjs.map
|