@gusto/embedded-react-sdk 0.36.0 → 0.37.0
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/CHANGELOG.md +58 -0
- package/README.md +6 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +50 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +8 -9
- package/dist/components/Base/Base.js +123 -101
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Base/useBase.d.ts +3 -7
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +3 -5
- package/dist/components/Base/useBaseSubmit.js +27 -50
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +17 -16
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +46 -36
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +21 -20
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +20 -19
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +19 -18
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +19 -18
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +10 -9
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -9
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -10
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -7
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -7
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +10 -9
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -9
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +41 -38
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +14 -13
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -7
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -9
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +38 -36
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +30 -29
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +8 -7
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -7
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +53 -53
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +8 -7
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
- package/dist/components/Employee/Terminations/index.d.ts +8 -0
- package/dist/components/Employee/Terminations/types.d.ts +1 -0
- package/dist/components/Employee/index.d.ts +7 -0
- package/dist/components/Employee/index.js +34 -28
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +31 -31
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +18 -15
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +69 -69
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +235 -196
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Transition/index.d.ts +3 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +2 -1
- package/dist/components/Payroll/helpers.js +98 -87
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +32 -26
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.d.ts +21 -0
- package/dist/components/Payroll/payrollTypes.js +27 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -4
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +29 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +27 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +151 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +114 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +71 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
- package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
- package/dist/helpers/requiredIf.d.ts +13 -0
- package/dist/helpers/requiredIf.js +8 -0
- package/dist/helpers/requiredIf.js.map +1 -0
- package/dist/i18n/I18n.js +13 -13
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.Transition.json.js +8 -0
- package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/shared/constants.d.ts +32 -0
- package/dist/shared/constants.js +83 -65
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +279 -1
- package/dist/types/observability.d.ts +31 -65
- package/dist/types/sdkError.d.ts +97 -0
- package/dist/types/sdkError.js +95 -0
- package/dist/types/sdkError.js.map +1 -0
- package/dist/types/sdkError.test.d.ts +1 -0
- package/docs/reference/endpoint-inventory.json +212 -14
- package/package.json +16 -16
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I } from "react";
|
|
3
|
+
import { useQueryClient as b } from "@tanstack/react-query";
|
|
4
|
+
import { useEmployeesGetSuspense as B } from "@gusto/embedded-api/react-query/employeesGet";
|
|
5
|
+
import { useEmployeeEmploymentsGetTerminationsSuspense as G, invalidateAllEmployeeEmploymentsGetTerminations as j } from "@gusto/embedded-api/react-query/employeeEmploymentsGetTerminations";
|
|
6
|
+
import { useEmployeeEmploymentsDeleteTerminationMutation as k } from "@gusto/embedded-api/react-query/employeeEmploymentsDeleteTermination";
|
|
7
|
+
import { invalidateAllEmployeesList as q } from "@gusto/embedded-api/react-query/employeesList";
|
|
8
|
+
import { TerminationSummaryPresentation as x } from "./TerminationSummaryPresentation.js";
|
|
9
|
+
import { normalizeToDate as F } from "../../../../helpers/dateFormatting.js";
|
|
10
|
+
import { BaseComponent as U } from "../../../Base/Base.js";
|
|
11
|
+
import { useBase as z } from "../../../Base/useBase.js";
|
|
12
|
+
import { componentEvents as o } from "../../../../shared/constants.js";
|
|
13
|
+
import { useComponentDictionary as H, useI18n as Q } from "../../../../i18n/I18n.js";
|
|
14
|
+
function ln(n) {
|
|
15
|
+
return /* @__PURE__ */ r(U, { ...n, children: /* @__PURE__ */ r(W, { ...n, children: n.children }) });
|
|
16
|
+
}
|
|
17
|
+
const W = ({
|
|
18
|
+
employeeId: n,
|
|
19
|
+
companyId: l,
|
|
20
|
+
payrollOption: i,
|
|
21
|
+
payrollUuid: C,
|
|
22
|
+
dictionary: D
|
|
23
|
+
}) => {
|
|
24
|
+
H("Employee.Terminations.TerminationSummary", D), Q("Employee.Terminations.TerminationSummary");
|
|
25
|
+
const m = b(), { onEvent: t, baseSubmitHandler: d } = z(), [T, a] = I(!1), {
|
|
26
|
+
data: { employee: s }
|
|
27
|
+
} = B({ employeeId: n }), { data: p } = G({ employeeId: n }), { mutateAsync: P, isPending: c } = k(), L = [s?.firstName, s?.lastName].filter(Boolean).join(" "), u = p.terminationList ?? [], e = u.find((Y) => Y.active) ?? u[0], f = e?.effectiveDate, R = e?.cancelable === !0, E = F(f), h = new Date((/* @__PURE__ */ new Date()).toDateString()), N = !s?.terminated && E ? E >= h : !1, y = i === "anotherWay", O = !y && (e?.runTerminationPayroll === !0 || i === "dismissalPayroll"), _ = i !== void 0, g = () => {
|
|
28
|
+
a(!0);
|
|
29
|
+
}, A = () => {
|
|
30
|
+
a(!1);
|
|
31
|
+
}, M = async () => {
|
|
32
|
+
e && await d({ terminationId: e.uuid }, async () => {
|
|
33
|
+
await P({
|
|
34
|
+
request: {
|
|
35
|
+
employeeId: n
|
|
36
|
+
}
|
|
37
|
+
}), await j(m), await q(m), a(!1), t(o.EMPLOYEE_TERMINATION_CANCELLED, {
|
|
38
|
+
employeeId: n,
|
|
39
|
+
termination: e
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}, S = () => {
|
|
43
|
+
t(o.EMPLOYEE_TERMINATION_EDIT, {
|
|
44
|
+
employeeId: n,
|
|
45
|
+
termination: e
|
|
46
|
+
});
|
|
47
|
+
}, v = () => {
|
|
48
|
+
t(o.EMPLOYEE_TERMINATION_RUN_PAYROLL, {
|
|
49
|
+
employeeId: n,
|
|
50
|
+
companyId: l,
|
|
51
|
+
payrollUuid: C,
|
|
52
|
+
termination: e
|
|
53
|
+
});
|
|
54
|
+
}, w = () => {
|
|
55
|
+
t(o.EMPLOYEE_TERMINATION_RUN_OFF_CYCLE_PAYROLL, {
|
|
56
|
+
employeeId: n,
|
|
57
|
+
companyId: l,
|
|
58
|
+
termination: e
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
return e ? /* @__PURE__ */ r(
|
|
62
|
+
x,
|
|
63
|
+
{
|
|
64
|
+
employeeName: L,
|
|
65
|
+
effectiveDate: f,
|
|
66
|
+
canCancel: R,
|
|
67
|
+
canEdit: N,
|
|
68
|
+
showRunPayroll: O,
|
|
69
|
+
showRunOffCyclePayroll: y,
|
|
70
|
+
showSuccessAlert: _,
|
|
71
|
+
onCancelClick: g,
|
|
72
|
+
onEditDismissal: S,
|
|
73
|
+
onRunDismissalPayroll: v,
|
|
74
|
+
onRunOffCyclePayroll: w,
|
|
75
|
+
isLoading: c,
|
|
76
|
+
isCancelDialogOpen: T,
|
|
77
|
+
onDialogClose: A,
|
|
78
|
+
onDialogConfirm: M,
|
|
79
|
+
isCancelling: c
|
|
80
|
+
}
|
|
81
|
+
) : null;
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
ln as TerminationSummary
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=TerminationSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminationSummary.js","sources":["../../../../../src/components/Employee/Terminations/TerminationSummary/TerminationSummary.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n useEmployeeEmploymentsGetTerminationsSuspense,\n invalidateAllEmployeeEmploymentsGetTerminations,\n} from '@gusto/embedded-api/react-query/employeeEmploymentsGetTerminations'\nimport { useEmployeeEmploymentsDeleteTerminationMutation } from '@gusto/embedded-api/react-query/employeeEmploymentsDeleteTermination'\nimport { invalidateAllEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport type { PayrollOption } from '../types'\nimport { TerminationSummaryPresentation } from './TerminationSummaryPresentation'\nimport { normalizeToDate } from '@/helpers/dateFormatting'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\n\nexport interface TerminationSummaryProps extends BaseComponentInterface<'Employee.Terminations.TerminationSummary'> {\n employeeId: string\n companyId: string\n payrollOption?: PayrollOption\n payrollUuid?: string\n}\n\nexport function TerminationSummary(props: TerminationSummaryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n employeeId,\n companyId,\n payrollOption,\n payrollUuid,\n dictionary,\n}: TerminationSummaryProps) => {\n useComponentDictionary('Employee.Terminations.TerminationSummary', dictionary)\n useI18n('Employee.Terminations.TerminationSummary')\n\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [isCancelDialogOpen, setIsCancelDialogOpen] = useState(false)\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n\n const { data: terminationsData } = useEmployeeEmploymentsGetTerminationsSuspense({ employeeId })\n\n const { mutateAsync: deleteTermination, isPending: isDeleting } =\n useEmployeeEmploymentsDeleteTerminationMutation()\n\n const employeeName = [employee?.firstName, employee?.lastName].filter(Boolean).join(' ')\n\n const terminations = terminationsData.terminationList ?? []\n const termination = terminations.find(t => t.active) ?? terminations[0]\n\n const effectiveDate = termination?.effectiveDate\n const canCancel = termination?.cancelable === true\n const effectiveDateLocal = normalizeToDate(effectiveDate)\n const todayMidnight = new Date(new Date().toDateString())\n const canEdit =\n !employee?.terminated && effectiveDateLocal ? effectiveDateLocal >= todayMidnight : false\n\n const showRunOffCyclePayroll = payrollOption === 'anotherWay'\n const showRunPayroll =\n !showRunOffCyclePayroll &&\n (termination?.runTerminationPayroll === true || payrollOption === 'dismissalPayroll')\n\n // Only show success alert if payrollOption is provided (meaning we just completed the termination)\n // Don't show it if we're just viewing an existing termination (employee already terminated)\n const showSuccessAlert = payrollOption !== undefined\n\n const handleCancelClick = () => {\n setIsCancelDialogOpen(true)\n }\n\n const handleDialogClose = () => {\n setIsCancelDialogOpen(false)\n }\n\n const handleConfirmCancel = async () => {\n if (!termination) return\n\n await baseSubmitHandler({ terminationId: termination.uuid }, async () => {\n await deleteTermination({\n request: {\n employeeId,\n },\n })\n\n await invalidateAllEmployeeEmploymentsGetTerminations(queryClient)\n await invalidateAllEmployeesList(queryClient)\n\n setIsCancelDialogOpen(false)\n\n onEvent(componentEvents.EMPLOYEE_TERMINATION_CANCELLED, {\n employeeId,\n termination,\n })\n })\n }\n\n const handleEditDismissal = () => {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_EDIT, {\n employeeId,\n termination,\n })\n }\n\n const handleRunDismissalPayroll = () => {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_RUN_PAYROLL, {\n employeeId,\n companyId,\n payrollUuid,\n termination,\n })\n }\n\n const handleRunOffCyclePayroll = () => {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_RUN_OFF_CYCLE_PAYROLL, {\n employeeId,\n companyId,\n termination,\n })\n }\n\n if (!termination) {\n return null\n }\n\n return (\n <TerminationSummaryPresentation\n employeeName={employeeName}\n effectiveDate={effectiveDate}\n canCancel={canCancel}\n canEdit={canEdit}\n showRunPayroll={showRunPayroll}\n showRunOffCyclePayroll={showRunOffCyclePayroll}\n showSuccessAlert={showSuccessAlert}\n onCancelClick={handleCancelClick}\n onEditDismissal={handleEditDismissal}\n onRunDismissalPayroll={handleRunDismissalPayroll}\n onRunOffCyclePayroll={handleRunOffCyclePayroll}\n isLoading={isDeleting}\n isCancelDialogOpen={isCancelDialogOpen}\n onDialogClose={handleDialogClose}\n onDialogConfirm={handleConfirmCancel}\n isCancelling={isDeleting}\n />\n )\n}\n"],"names":["TerminationSummary","props","jsx","BaseComponent","Root","employeeId","companyId","payrollOption","payrollUuid","dictionary","useComponentDictionary","useI18n","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","isCancelDialogOpen","setIsCancelDialogOpen","useState","employee","useEmployeesGetSuspense","terminationsData","useEmployeeEmploymentsGetTerminationsSuspense","deleteTermination","isDeleting","useEmployeeEmploymentsDeleteTerminationMutation","employeeName","terminations","termination","t","effectiveDate","canCancel","effectiveDateLocal","normalizeToDate","todayMidnight","canEdit","showRunOffCyclePayroll","showRunPayroll","showSuccessAlert","handleCancelClick","handleDialogClose","handleConfirmCancel","invalidateAllEmployeeEmploymentsGetTerminations","invalidateAllEmployeesList","componentEvents","handleEditDismissal","handleRunDismissalPayroll","handleRunOffCyclePayroll","TerminationSummaryPresentation"],"mappings":";;;;;;;;;;;;;AAyBO,SAASA,GAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC;AAAA,EACZ,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AACF,MAA+B;AAC7B,EAAAC,EAAuB,4CAA4CD,CAAU,GAC7EE,EAAQ,0CAA0C;AAElD,QAAMC,IAAcC,EAAA,GACd,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,CAACC,GAAoBC,CAAqB,IAAIC,EAAS,EAAK,GAE5D;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAAhB,GAAY,GAEpC,EAAE,MAAMiB,EAAA,IAAqBC,EAA8C,EAAE,YAAAlB,GAAY,GAEzF,EAAE,aAAam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AxC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAE;AAAA,MACA,aAAAqB;AAAA,IAAA,CACD;AAAA,EACH,GAEMmB,IAA2B,MAAM;AACrC,IAAAlC,EAAQ+B,EAAgB,4CAA4C;AAAA,MAClE,YAAAxC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAuB;AAAA,IAAA,CACD;AAAA,EACH;AAEA,SAAKA,IAKH,gBAAA3B;AAAA,IAAC+C;AAAA,IAAA;AAAA,MACC,cAAAtB;AAAA,MACA,eAAAI;AAAA,MACA,WAAAC;AAAA,MACA,SAAAI;AAAA,MACA,gBAAAE;AAAA,MACA,wBAAAD;AAAA,MACA,kBAAAE;AAAA,MACA,eAAeC;AAAA,MACf,iBAAiBM;AAAA,MACjB,uBAAuBC;AAAA,MACvB,sBAAsBC;AAAA,MACtB,WAAWvB;AAAA,MACX,oBAAAR;AAAA,MACA,eAAewB;AAAA,MACf,iBAAiBC;AAAA,MACjB,cAAcjB;AAAA,IAAA;AAAA,EAAA,IApBT;AAuBX;"}
|
package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface TerminationSummaryPresentationProps {
|
|
2
|
+
employeeName: string;
|
|
3
|
+
effectiveDate: string | undefined;
|
|
4
|
+
canCancel: boolean;
|
|
5
|
+
canEdit: boolean;
|
|
6
|
+
showRunPayroll: boolean;
|
|
7
|
+
showRunOffCyclePayroll: boolean;
|
|
8
|
+
showSuccessAlert: boolean;
|
|
9
|
+
onCancelClick: () => void;
|
|
10
|
+
onEditDismissal: () => void;
|
|
11
|
+
onRunDismissalPayroll: () => void;
|
|
12
|
+
onRunOffCyclePayroll: () => void;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
isCancelDialogOpen: boolean;
|
|
15
|
+
onDialogClose: () => void;
|
|
16
|
+
onDialogConfirm: () => void;
|
|
17
|
+
isCancelling: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function TerminationSummaryPresentation({ employeeName, effectiveDate, canCancel, canEdit, showRunPayroll, showRunOffCyclePayroll, showSuccessAlert, onCancelClick, onEditDismissal, onRunDismissalPayroll, onRunOffCyclePayroll, isLoading, isCancelDialogOpen, onDialogClose, onDialogConfirm, isCancelling, }: TerminationSummaryPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsxs as e, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as I, Trans as O } from "react-i18next";
|
|
3
|
+
import { Flex as t } from "../../../Common/Flex/Flex.js";
|
|
4
|
+
import "classnames";
|
|
5
|
+
import "../../../../shared/constants.js";
|
|
6
|
+
import { ActionsLayout as W } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { useDateFormatter as B } from "../../../../hooks/useDateFormatter.js";
|
|
10
|
+
import { useI18n as E } from "../../../../i18n/I18n.js";
|
|
11
|
+
function V({
|
|
12
|
+
employeeName: l,
|
|
13
|
+
effectiveDate: u,
|
|
14
|
+
canCancel: s,
|
|
15
|
+
canEdit: m,
|
|
16
|
+
showRunPayroll: d,
|
|
17
|
+
showRunOffCyclePayroll: p,
|
|
18
|
+
showSuccessAlert: h,
|
|
19
|
+
onCancelClick: D,
|
|
20
|
+
onEditDismissal: g,
|
|
21
|
+
onRunDismissalPayroll: y,
|
|
22
|
+
onRunOffCyclePayroll: b,
|
|
23
|
+
isLoading: a,
|
|
24
|
+
isCancelDialogOpen: x,
|
|
25
|
+
onDialogClose: A,
|
|
26
|
+
onDialogConfirm: T,
|
|
27
|
+
isCancelling: k
|
|
28
|
+
}) {
|
|
29
|
+
const { Alert: C, Heading: r, Text: o, Button: c, DescriptionList: v, Dialog: P, Link: L } = q(), { formatLongWithYear: F } = B();
|
|
30
|
+
E("Employee.Terminations.TerminationSummary");
|
|
31
|
+
const { t: i } = I("Employee.Terminations.TerminationSummary"), f = F(u) || "N/A", S = [
|
|
32
|
+
{
|
|
33
|
+
term: i("dates.today"),
|
|
34
|
+
description: i("dates.dismissed", { employeeName: l })
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
term: f,
|
|
38
|
+
description: i("dates.lastDayOfWork")
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
term: f,
|
|
42
|
+
description: i("dates.lastPayDay")
|
|
43
|
+
}
|
|
44
|
+
], j = s || m || d || p;
|
|
45
|
+
return /* @__PURE__ */ e(t, { flexDirection: "column", gap: 24, children: [
|
|
46
|
+
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 4, children: [
|
|
47
|
+
h && /* @__PURE__ */ n(C, { status: "success", label: i("alert.success.label", { employeeName: l }) }),
|
|
48
|
+
/* @__PURE__ */ n(r, { as: "h2", children: i("title") }),
|
|
49
|
+
/* @__PURE__ */ n(o, { variant: "supporting", children: i("subtitle") })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ n(v, { items: S }),
|
|
52
|
+
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 16, children: [
|
|
53
|
+
/* @__PURE__ */ n(r, { as: "h3", children: i("offboarding.title") }),
|
|
54
|
+
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 16, children: [
|
|
55
|
+
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 8, children: [
|
|
56
|
+
/* @__PURE__ */ n(r, { as: "h4", children: i("offboarding.runPayroll.title") }),
|
|
57
|
+
/* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
|
|
58
|
+
O,
|
|
59
|
+
{
|
|
60
|
+
i18nKey: "offboarding.runPayroll.description",
|
|
61
|
+
t: i,
|
|
62
|
+
components: {
|
|
63
|
+
StateRequirementsLink: /* @__PURE__ */ n(L, {})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 8, children: [
|
|
69
|
+
/* @__PURE__ */ n(r, { as: "h4", children: i("offboarding.taxForms.title") }),
|
|
70
|
+
/* @__PURE__ */ n(o, { children: i("offboarding.taxForms.description") })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 8, children: [
|
|
73
|
+
/* @__PURE__ */ n(r, { as: "h4", children: i("offboarding.disconnectAccounts.title") }),
|
|
74
|
+
/* @__PURE__ */ n(o, { children: i("offboarding.disconnectAccounts.description") })
|
|
75
|
+
] })
|
|
76
|
+
] })
|
|
77
|
+
] }),
|
|
78
|
+
j && /* @__PURE__ */ e(W, { children: [
|
|
79
|
+
s && /* @__PURE__ */ n(c, { variant: "error", onClick: D, isDisabled: a, children: i("actions.cancelTermination") }),
|
|
80
|
+
m && /* @__PURE__ */ n(c, { variant: "secondary", onClick: g, isDisabled: a, children: i("actions.editDismissal") }),
|
|
81
|
+
d && /* @__PURE__ */ n(c, { variant: "primary", onClick: y, isDisabled: a, children: i("actions.runDismissalPayroll") }),
|
|
82
|
+
p && /* @__PURE__ */ n(c, { variant: "primary", onClick: b, isDisabled: a, children: i("actions.runOffCyclePayroll") })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ n(
|
|
85
|
+
P,
|
|
86
|
+
{
|
|
87
|
+
isOpen: x,
|
|
88
|
+
onClose: A,
|
|
89
|
+
onPrimaryActionClick: T,
|
|
90
|
+
isDestructive: !0,
|
|
91
|
+
isPrimaryActionLoading: k,
|
|
92
|
+
primaryActionLabel: i("cancelDialog.confirm"),
|
|
93
|
+
closeActionLabel: i("cancelDialog.cancel"),
|
|
94
|
+
title: i("cancelDialog.title"),
|
|
95
|
+
children: /* @__PURE__ */ n(o, { children: i("cancelDialog.body") })
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
V as TerminationSummaryPresentation
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=TerminationSummaryPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminationSummaryPresentation.js","sources":["../../../../../src/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.tsx"],"sourcesContent":["import { useTranslation, Trans } from 'react-i18next'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useI18n } from '@/i18n'\n\ninterface TerminationSummaryPresentationProps {\n employeeName: string\n effectiveDate: string | undefined\n canCancel: boolean\n canEdit: boolean\n showRunPayroll: boolean\n showRunOffCyclePayroll: boolean\n showSuccessAlert: boolean\n onCancelClick: () => void\n onEditDismissal: () => void\n onRunDismissalPayroll: () => void\n onRunOffCyclePayroll: () => void\n isLoading: boolean\n isCancelDialogOpen: boolean\n onDialogClose: () => void\n onDialogConfirm: () => void\n isCancelling: boolean\n}\n\nexport function TerminationSummaryPresentation({\n employeeName,\n effectiveDate,\n canCancel,\n canEdit,\n showRunPayroll,\n showRunOffCyclePayroll,\n showSuccessAlert,\n onCancelClick,\n onEditDismissal,\n onRunDismissalPayroll,\n onRunOffCyclePayroll,\n isLoading,\n isCancelDialogOpen,\n onDialogClose,\n onDialogConfirm,\n isCancelling,\n}: TerminationSummaryPresentationProps) {\n const { Alert, Heading, Text, Button, DescriptionList, Dialog, Link } = useComponentContext()\n const { formatLongWithYear } = useDateFormatter()\n useI18n('Employee.Terminations.TerminationSummary')\n const { t } = useTranslation('Employee.Terminations.TerminationSummary')\n\n const formattedDate = formatLongWithYear(effectiveDate) || 'N/A'\n\n const dateItems = [\n {\n term: t('dates.today'),\n description: t('dates.dismissed', { employeeName }),\n },\n {\n term: formattedDate,\n description: t('dates.lastDayOfWork'),\n },\n {\n term: formattedDate,\n description: t('dates.lastPayDay'),\n },\n ]\n\n const hasActions = canCancel || canEdit || showRunPayroll || showRunOffCyclePayroll\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n {showSuccessAlert && (\n <Alert status=\"success\" label={t('alert.success.label', { employeeName })} />\n )}\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('subtitle')}</Text>\n </Flex>\n\n <DescriptionList items={dateItems} />\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('offboarding.title')}</Heading>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h4\">{t('offboarding.runPayroll.title')}</Heading>\n <Text>\n <Trans\n i18nKey=\"offboarding.runPayroll.description\"\n t={t}\n components={{\n StateRequirementsLink: <Link />,\n }}\n />\n </Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h4\">{t('offboarding.taxForms.title')}</Heading>\n <Text>{t('offboarding.taxForms.description')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h4\">{t('offboarding.disconnectAccounts.title')}</Heading>\n <Text>{t('offboarding.disconnectAccounts.description')}</Text>\n </Flex>\n </Flex>\n </Flex>\n\n {hasActions && (\n <ActionsLayout>\n {canCancel && (\n <Button variant=\"error\" onClick={onCancelClick} isDisabled={isLoading}>\n {t('actions.cancelTermination')}\n </Button>\n )}\n {canEdit && (\n <Button variant=\"secondary\" onClick={onEditDismissal} isDisabled={isLoading}>\n {t('actions.editDismissal')}\n </Button>\n )}\n {showRunPayroll && (\n <Button variant=\"primary\" onClick={onRunDismissalPayroll} isDisabled={isLoading}>\n {t('actions.runDismissalPayroll')}\n </Button>\n )}\n {showRunOffCyclePayroll && (\n <Button variant=\"primary\" onClick={onRunOffCyclePayroll} isDisabled={isLoading}>\n {t('actions.runOffCyclePayroll')}\n </Button>\n )}\n </ActionsLayout>\n )}\n\n <Dialog\n isOpen={isCancelDialogOpen}\n onClose={onDialogClose}\n onPrimaryActionClick={onDialogConfirm}\n isDestructive\n isPrimaryActionLoading={isCancelling}\n primaryActionLabel={t('cancelDialog.confirm')}\n closeActionLabel={t('cancelDialog.cancel')}\n title={t('cancelDialog.title')}\n >\n <Text>{t('cancelDialog.body')}</Text>\n </Dialog>\n </Flex>\n )\n}\n"],"names":["TerminationSummaryPresentation","employeeName","effectiveDate","canCancel","canEdit","showRunPayroll","showRunOffCyclePayroll","showSuccessAlert","onCancelClick","onEditDismissal","onRunDismissalPayroll","onRunOffCyclePayroll","isLoading","isCancelDialogOpen","onDialogClose","onDialogConfirm","isCancelling","Alert","Heading","Text","Button","DescriptionList","Dialog","Link","useComponentContext","formatLongWithYear","useDateFormatter","useI18n","t","useTranslation","formattedDate","dateItems","hasActions","jsxs","Flex","jsx","Trans","ActionsLayout"],"mappings":";;;;;;;;;;AAyBO,SAASA,EAA+B;AAAA,EAC7C,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AACF,GAAwC;AACtC,QAAM,EAAE,OAAAC,GAAO,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,iBAAAC,GAAiB,QAAAC,GAAQ,MAAAC,EAAA,IAASC,EAAA,GAClE,EAAE,oBAAAC,EAAA,IAAuBC,EAAA;AAC/B,EAAAC,EAAQ,0CAA0C;AAClD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0CAA0C,GAEjEC,IAAgBL,EAAmBvB,CAAa,KAAK,OAErD6B,IAAY;AAAA,IAChB;AA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MAACb;AAAA,MAAA;AAAA,QACC,QAAQT;AAAA,QACR,SAASC;AAAA,QACT,sBAAsBC;AAAA,QACtB,eAAa;AAAA,QACb,wBAAwBC;AAAA,QACxB,oBAAoBY,EAAE,sBAAsB;AAAA,QAC5C,kBAAkBA,EAAE,qBAAqB;AAAA,QACzC,OAAOA,EAAE,oBAAoB;AAAA,QAE7B,UAAA,gBAAAO,EAAChB,GAAA,EAAM,UAAAS,EAAE,mBAAmB,EAAA,CAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EAChC,GACF;AAEJ;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { TerminateEmployee } from './TerminateEmployee/TerminateEmployee';
|
|
3
|
+
export type { TerminateEmployeeProps } from './TerminateEmployee/TerminateEmployee';
|
|
4
|
+
export { TerminationSummary } from './TerminationSummary/TerminationSummary';
|
|
5
|
+
export type { TerminationSummaryProps } from './TerminationSummary/TerminationSummary';
|
|
6
|
+
export { TerminationFlow } from './TerminationFlow/TerminationFlow';
|
|
7
|
+
export type { TerminationFlowProps } from './TerminationFlow/TerminationFlowComponents';
|
|
8
|
+
export type { PayrollOption } from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PayrollOption = 'dismissalPayroll' | 'regularPayroll' | 'anotherWay';
|
|
@@ -14,4 +14,11 @@ export { SelfOnboardingFlow } from './SelfOnboardingFlow/SelfOnboardingFlow';
|
|
|
14
14
|
export { EmployeeDocuments } from './EmployeeDocuments';
|
|
15
15
|
export { EmploymentEligibility } from './DocumentSigner/EmploymentEligibility';
|
|
16
16
|
export type { EmploymentEligibilityProps } from './DocumentSigner/EmploymentEligibility';
|
|
17
|
+
export { TerminateEmployee } from './Terminations/TerminateEmployee/TerminateEmployee';
|
|
18
|
+
export type { TerminateEmployeeProps } from './Terminations/TerminateEmployee/TerminateEmployee';
|
|
19
|
+
export { TerminationSummary } from './Terminations/TerminationSummary/TerminationSummary';
|
|
20
|
+
export type { TerminationSummaryProps } from './Terminations/TerminationSummary/TerminationSummary';
|
|
21
|
+
export { TerminationFlow } from './Terminations/TerminationFlow/TerminationFlow';
|
|
22
|
+
export type { TerminationFlowProps } from './Terminations/TerminationFlow/TerminationFlowComponents';
|
|
23
|
+
export type { PayrollOption } from './Terminations/types';
|
|
17
24
|
export { Taxes } from './Taxes';
|
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
import { EmployeeList as e } from "./EmployeeList/EmployeeList.js";
|
|
2
|
-
import { OnboardingFlow as
|
|
3
|
-
import { SelfOnboardingFlow as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
2
|
+
import { OnboardingFlow as t } from "./OnboardingFlow/OnboardingFlow.js";
|
|
3
|
+
import { SelfOnboardingFlow as n } from "./SelfOnboardingFlow/SelfOnboardingFlow.js";
|
|
4
|
+
import { TerminateEmployee as f } from "./Terminations/TerminateEmployee/TerminateEmployee.js";
|
|
5
|
+
import { TerminationSummary as a } from "./Terminations/TerminationSummary/TerminationSummary.js";
|
|
6
|
+
import { TerminationFlow as y } from "./Terminations/TerminationFlow/TerminationFlow.js";
|
|
7
|
+
import { Compensation as s } from "./Compensation/Compensation.js";
|
|
8
|
+
import { Deductions as T } from "./Deductions/Deductions.js";
|
|
9
|
+
import { DocumentSigner as E } from "./DocumentSigner/DocumentSigner.js";
|
|
10
|
+
import { EmployeeDocuments as b } from "./EmployeeDocuments/EmployeeDocuments.js";
|
|
11
|
+
import { EmploymentEligibility as c } from "./DocumentSigner/EmploymentEligibility/EmploymentEligibility.js";
|
|
12
|
+
import { FederalTaxes as D } from "./FederalTaxes/FederalTaxes.js";
|
|
13
|
+
import { Landing as L } from "./Landing/Landing.js";
|
|
14
|
+
import { OnboardingSummary as h } from "./OnboardingSummary/OnboardingSummary.js";
|
|
15
|
+
import { PaymentMethod as M } from "./PaymentMethod/PaymentMethod.js";
|
|
16
|
+
import { Profile as k } from "./Profile/Profile.js";
|
|
17
|
+
import { StateTaxes as v } from "./StateTaxes/StateTaxes.js";
|
|
18
|
+
import { Taxes as A } from "./Taxes/Taxes.js";
|
|
16
19
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
s as Compensation,
|
|
21
|
+
T as Deductions,
|
|
22
|
+
E as DocumentSigner,
|
|
23
|
+
b as EmployeeDocuments,
|
|
21
24
|
e as EmployeeList,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
c as EmploymentEligibility,
|
|
26
|
+
D as FederalTaxes,
|
|
27
|
+
L as Landing,
|
|
28
|
+
t as OnboardingFlow,
|
|
29
|
+
h as OnboardingSummary,
|
|
30
|
+
M as PaymentMethod,
|
|
31
|
+
k as Profile,
|
|
32
|
+
n as SelfOnboardingFlow,
|
|
33
|
+
v as StateTaxes,
|
|
34
|
+
A as Taxes,
|
|
35
|
+
f as TerminateEmployee,
|
|
36
|
+
y as TerminationFlow,
|
|
37
|
+
a as TerminationSummary
|
|
32
38
|
};
|
|
33
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { createMachine as
|
|
1
|
+
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as b } from "robot3";
|
|
3
3
|
import { useMachine as L } from "react-robot";
|
|
4
|
-
import { useState as R, useCallback as p, useMemo as
|
|
4
|
+
import { useState as R, useCallback as p, useMemo as Q, Suspense as E } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
|
-
import { informationRequestsMachine as
|
|
7
|
-
import { BaseBoundaries as
|
|
6
|
+
import { informationRequestsMachine as k } from "./informationRequestsStateMachine.js";
|
|
7
|
+
import { BaseBoundaries as P } from "../Base/Base.js";
|
|
8
8
|
import "../Base/useBase.js";
|
|
9
|
-
import { Flex as
|
|
9
|
+
import { Flex as g } from "../Common/Flex/Flex.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import { informationRequestEvents as s } from "../../shared/constants.js";
|
|
12
|
-
import { useComponentContext as
|
|
12
|
+
import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
13
|
import { FlowContext as B } from "../Flow/useFlow.js";
|
|
14
14
|
import { useComponentDictionary as $, useI18n as w } from "../../i18n/I18n.js";
|
|
15
15
|
import { InformationRequestList as z } from "./InformationRequestList/InformationRequestList.js";
|
|
16
|
-
const
|
|
16
|
+
const I = "informationRequestResponded";
|
|
17
17
|
function re({
|
|
18
18
|
companyId: r,
|
|
19
|
-
dictionary:
|
|
19
|
+
dictionary: O,
|
|
20
20
|
withAlert: a = !0,
|
|
21
|
-
onEvent:
|
|
21
|
+
onEvent: M = () => {
|
|
22
22
|
}
|
|
23
23
|
}) {
|
|
24
|
-
$("InformationRequests",
|
|
25
|
-
const { t: m } = U("InformationRequests"), { Modal:
|
|
24
|
+
$("InformationRequests", O), w("InformationRequests");
|
|
25
|
+
const { t: m } = U("InformationRequests"), { Modal: h, LoadingSpinner: c, Alert: x, Text: A } = j(), [F, i] = R(!1), [N, f] = R({
|
|
26
26
|
nextAlertId: 0,
|
|
27
27
|
alerts: []
|
|
28
|
-
}),
|
|
28
|
+
}), T = p((e) => {
|
|
29
29
|
f((o) => ({
|
|
30
30
|
...o,
|
|
31
|
-
alerts: o.alerts.filter((
|
|
31
|
+
alerts: o.alerts.filter((D) => D.id !== e)
|
|
32
32
|
}));
|
|
33
|
-
}, []),
|
|
33
|
+
}, []), _ = p(() => {
|
|
34
34
|
f((e) => ({
|
|
35
35
|
nextAlertId: e.nextAlertId + 1,
|
|
36
36
|
alerts: [{ id: e.nextAlertId }, ...e.alerts]
|
|
37
37
|
}));
|
|
38
|
-
}, []),
|
|
39
|
-
() =>
|
|
38
|
+
}, []), C = Q(
|
|
39
|
+
() => b(
|
|
40
40
|
"list",
|
|
41
|
-
|
|
41
|
+
k,
|
|
42
42
|
() => ({
|
|
43
43
|
component: null,
|
|
44
44
|
companyId: r,
|
|
@@ -46,11 +46,11 @@ function re({
|
|
|
46
46
|
})
|
|
47
47
|
),
|
|
48
48
|
[r]
|
|
49
|
-
), [u,
|
|
49
|
+
), [u, S] = L(C);
|
|
50
50
|
function n(e, o) {
|
|
51
|
-
|
|
51
|
+
S({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && _(), M(e, o);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const q = () => {
|
|
54
54
|
i(!1);
|
|
55
55
|
}, l = u.context.component, d = l?.Footer || void 0;
|
|
56
56
|
return /* @__PURE__ */ t(
|
|
@@ -60,26 +60,26 @@ function re({
|
|
|
60
60
|
...u.context,
|
|
61
61
|
onEvent: n
|
|
62
62
|
},
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
a &&
|
|
63
|
+
children: /* @__PURE__ */ v(g, { flexDirection: "column", gap: 32, children: [
|
|
64
|
+
a && N.alerts.map((e) => /* @__PURE__ */ t(
|
|
65
65
|
x,
|
|
66
66
|
{
|
|
67
67
|
status: "success",
|
|
68
|
-
label: m(`alerts.${
|
|
68
|
+
label: m(`alerts.${I}.title`),
|
|
69
69
|
onDismiss: () => {
|
|
70
|
-
|
|
70
|
+
T(e.id);
|
|
71
71
|
},
|
|
72
|
-
children: /* @__PURE__ */ t(
|
|
72
|
+
children: /* @__PURE__ */ t(A, { children: m(`alerts.${I}.description`) })
|
|
73
73
|
},
|
|
74
74
|
e.id
|
|
75
75
|
)),
|
|
76
|
-
/* @__PURE__ */ t(
|
|
76
|
+
/* @__PURE__ */ t(E, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(z, { companyId: r, onEvent: n }) }),
|
|
77
77
|
/* @__PURE__ */ t(
|
|
78
|
-
|
|
78
|
+
h,
|
|
79
79
|
{
|
|
80
|
-
isOpen:
|
|
81
|
-
onClose:
|
|
82
|
-
footer: d && /* @__PURE__ */ t(
|
|
80
|
+
isOpen: F,
|
|
81
|
+
onClose: q,
|
|
82
|
+
footer: d && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(E, { fallback: /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }) }),
|
|
83
83
|
children: l && /* @__PURE__ */ t(l, {})
|
|
84
84
|
}
|
|
85
85
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries
|
|
1
|
+
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense fallback={<LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,q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