@gusto/embedded-react-sdk 0.24.1 → 0.25.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.
Files changed (315) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/assets/icons/slash-circle.svg.js +10 -0
  3. package/dist/assets/icons/slash-circle.svg.js.map +1 -0
  4. package/dist/components/Base/Base.d.ts +1 -1
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
  7. package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
  8. package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
  9. package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
  10. package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
  11. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  12. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
  13. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -11
  14. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  16. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  17. package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
  18. package/dist/components/Common/UI/FileInput/FileInput.js +151 -0
  19. package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
  20. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +34 -0
  21. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
  22. package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
  23. package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
  24. package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
  25. package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
  26. package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
  27. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  28. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  29. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  38. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  39. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -4
  40. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  41. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  42. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  44. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  45. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  46. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  47. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  48. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  49. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  50. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  51. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  52. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  53. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  54. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
  55. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  56. package/dist/components/Company/Industry/Context.js +7 -6
  57. package/dist/components/Company/Industry/Context.js.map +1 -1
  58. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  59. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  60. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  61. package/dist/components/Company/Locations/LocationsList/List.js +35 -33
  62. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  63. package/dist/components/Company/Locations/LocationsList/LocationsList.js +30 -29
  64. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  65. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  66. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  67. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  68. package/dist/components/Company/OnboardingOverview/Completed.js +3 -2
  69. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  70. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  71. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  72. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  73. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  74. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  75. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  76. package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
  77. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  78. package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
  79. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  80. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  81. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  82. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  83. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  84. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  85. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  86. package/dist/components/Contractor/Address/Address.js +2 -2
  87. package/dist/components/Contractor/Address/useAddress.js +6 -5
  88. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  89. package/dist/components/Contractor/ContractorList/index.js +31 -30
  90. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  91. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +61 -59
  92. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  93. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +34 -31
  94. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  95. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +29 -10
  96. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  97. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +3 -1
  98. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +33 -31
  99. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  100. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
  101. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +25 -19
  102. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  103. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
  104. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +86 -56
  105. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  106. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
  107. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
  108. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  109. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
  110. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +116 -99
  111. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  112. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
  113. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
  114. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
  115. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
  116. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
  117. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
  118. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +157 -0
  119. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
  120. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
  121. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
  122. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +46 -48
  123. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  124. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  125. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  126. package/dist/components/Contractor/Submit/Submit.js +1 -1
  127. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
  128. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  129. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
  130. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  131. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
  132. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  133. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  134. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  135. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  136. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  137. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  138. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  139. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  140. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  141. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  142. package/dist/components/Employee/EmployeeList/EmployeeList.js +58 -56
  143. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  144. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  145. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  146. package/dist/components/Employee/EmployeeList/List.js +34 -32
  147. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  148. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
  149. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  150. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  151. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
  152. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  153. package/dist/components/Employee/Landing/Landing.js +8 -8
  154. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  155. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  156. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  157. package/dist/components/Employee/Profile/useProfile.js +4 -3
  158. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  159. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
  160. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  161. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  162. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  163. package/dist/components/Flow/Flow.js +3 -2
  164. package/dist/components/Flow/Flow.js.map +1 -1
  165. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
  166. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js +142 -0
  167. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
  168. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +18 -0
  169. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
  170. package/dist/components/Payroll/InformationRequests/InformationRequestForm/index.d.ts +2 -0
  171. package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.d.ts +7 -0
  172. package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js +88 -0
  173. package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
  174. package/dist/components/Payroll/InformationRequests/InformationRequestList/index.d.ts +2 -0
  175. package/dist/components/Payroll/InformationRequests/InformationRequests.d.ts +6 -0
  176. package/dist/components/Payroll/InformationRequests/InformationRequests.js +55 -0
  177. package/dist/components/Payroll/InformationRequests/InformationRequests.js.map +1 -0
  178. package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.d.ts +19 -0
  179. package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js +20 -0
  180. package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js.map +1 -0
  181. package/dist/components/Payroll/InformationRequests/index.d.ts +3 -0
  182. package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
  183. package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js +47 -0
  184. package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js.map +1 -0
  185. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -6
  186. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  187. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +3 -2
  188. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  189. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
  190. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  191. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -2
  192. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +107 -99
  193. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  194. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
  195. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  196. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
  197. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
  198. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
  199. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
  200. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  201. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
  202. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -145
  203. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  204. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +14 -12
  205. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  206. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  207. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +174 -106
  208. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  209. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
  210. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  211. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
  212. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +84 -102
  213. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  214. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +24 -20
  215. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  216. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +2 -0
  217. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -46
  218. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  219. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
  220. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +111 -45
  221. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  222. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -125
  223. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  224. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
  225. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  226. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +117 -110
  227. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  228. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -2
  229. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +282 -278
  230. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  231. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
  232. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
  233. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
  234. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
  235. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  236. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  237. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  238. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
  239. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
  240. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
  241. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
  242. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
  243. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
  244. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
  245. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +73 -0
  246. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
  247. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +10 -0
  248. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
  249. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
  250. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
  251. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +46 -0
  252. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
  253. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
  254. package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
  255. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
  256. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
  257. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
  258. package/dist/components/Payroll/helpers.d.ts +12 -0
  259. package/dist/components/Payroll/helpers.js +129 -117
  260. package/dist/components/Payroll/helpers.js.map +1 -1
  261. package/dist/components/Payroll/index.d.ts +2 -0
  262. package/dist/components/Payroll/index.js +18 -14
  263. package/dist/components/Payroll/index.js.map +1 -1
  264. package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
  265. package/dist/components/Payroll/usePreparedPayrollData.js +43 -31
  266. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  267. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
  268. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  269. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  270. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  271. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
  272. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  273. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  274. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  275. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  276. package/dist/helpers/dateFormatting.d.ts +1 -0
  277. package/dist/helpers/dateFormatting.js +1 -0
  278. package/dist/helpers/dateFormatting.js.map +1 -1
  279. package/dist/helpers/formattedStrings.d.ts +1 -0
  280. package/dist/helpers/formattedStrings.js +23 -18
  281. package/dist/helpers/formattedStrings.js.map +1 -1
  282. package/dist/helpers/responsive.js +1 -1
  283. package/dist/helpers/responsive.js.map +1 -1
  284. package/dist/i18n/I18n.js +3 -3
  285. package/dist/i18n/I18n.js.map +1 -1
  286. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -32
  287. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
  288. package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
  289. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
  290. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
  291. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
  292. package/dist/i18n/en/Payroll.InformationRequestForm.json.js +18 -0
  293. package/dist/i18n/en/Payroll.InformationRequestForm.json.js.map +1 -0
  294. package/dist/i18n/en/Payroll.InformationRequestList.json.js +18 -0
  295. package/dist/i18n/en/Payroll.InformationRequestList.json.js.map +1 -0
  296. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
  297. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  298. package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
  299. package/dist/i18n/en/Payroll.PayrollLanding.json.js +5 -3
  300. package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
  301. package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
  302. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  303. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +14 -0
  304. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
  305. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +8 -0
  306. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
  307. package/dist/i18n/en/common.json.d.ts +5 -0
  308. package/dist/i18n/en/common.json.js +4 -2
  309. package/dist/i18n/en/common.json.js.map +1 -1
  310. package/dist/shared/constants.d.ts +24 -0
  311. package/dist/shared/constants.js +70 -54
  312. package/dist/shared/constants.js.map +1 -1
  313. package/dist/style.css +1 -1
  314. package/dist/types/i18next.d.ts +119 -3
  315. package/package.json +31 -20
@@ -1,9 +1,10 @@
1
- import { useCallback as F } from "react";
2
- import { useTranslation as D } from "react-i18next";
3
- import { formatPayRate as E } from "../../helpers/formattedStrings.js";
1
+ import { useCallback as E } from "react";
2
+ import { useTranslation as M } from "react-i18next";
3
+ import { formatPayRate as S } from "../../helpers/formattedStrings.js";
4
4
  import { useLocale as v } from "../../contexts/LocaleProvider/useLocale.js";
5
- import { FlsaStatus as M, COMPENSATION_NAME_REIMBURSEMENT as g } from "../../shared/constants.js";
6
- const x = "regular hours", y = (t) => t.jobs?.find((e) => e.primary) || t.jobs?.[0] || null, S = (t) => Math.round(t * 1e6) / 1e6, C = (t) => Math.round(t * 100) / 100, H = (t) => t.toLowerCase() === x, j = {
5
+ import { FlsaStatus as x, COMPENSATION_NAME_REIMBURSEMENT as g } from "../../shared/constants.js";
6
+ import { MS_PER_HOUR as D } from "../../helpers/dateFormatting.js";
7
+ const N = "regular hours", y = (e) => e.jobs?.find((t) => t.primary) || e.jobs?.[0] || null, O = (e) => Math.round(e * 1e6) / 1e6, w = (e) => Math.round(e * 100) / 100, T = (e) => e.toLowerCase() === N, j = {
7
8
  Daily: 8,
8
9
  "Every week": 40,
9
10
  "Every other week": 80,
@@ -12,155 +13,155 @@ const x = "regular hours", y = (t) => t.jobs?.find((e) => e.primary) || t.jobs?.
12
13
  Quarterly: 520,
13
14
  Semiannually: 1040,
14
15
  Annually: 2080
15
- }, N = ({
16
- employee: t,
17
- t: e,
16
+ }, U = ({
17
+ employee: e,
18
+ t,
18
19
  locale: r = "en-US"
19
20
  }) => {
20
- if (!t?.jobs)
21
+ if (!e?.jobs)
21
22
  return null;
22
- const n = y(t);
23
+ const n = y(e);
23
24
  if (!n?.compensations)
24
25
  return null;
25
26
  const o = n.compensations[0];
26
27
  if (!o || !o.rate || parseFloat(o.rate) === 0)
27
28
  return null;
28
29
  const s = parseFloat(o.rate), u = o.paymentUnit || "Hour";
29
- return E({ rate: s, paymentUnit: u, t: e, locale: r });
30
- }, V = () => {
31
- const { t } = D("common"), { locale: e } = v();
32
- return F(
33
- (r) => N({ employee: r, t, locale: e }),
34
- [t, e]
30
+ return S({ rate: s, paymentUnit: u, t, locale: r });
31
+ }, ee = () => {
32
+ const { t: e } = M("common"), { locale: t } = v();
33
+ return E(
34
+ (r) => U({ employee: r, t: e, locale: t }),
35
+ [e, t]
35
36
  );
36
- }, X = (t) => t.hourlyCompensations ? t.hourlyCompensations.filter((e) => e.name?.toLowerCase() === "regular hours").reduce((e, r) => e + parseFloat(r.hours || "0"), 0) : 0;
37
- function Z(t) {
38
- return !t.hourlyCompensations || t.excluded ? 0 : t.hourlyCompensations.filter((e) => Number(e.compensationMultiplier) > 1).reduce((e, r) => e + parseFloat(r.hours || "0"), 0);
37
+ }, te = (e) => e.hourlyCompensations ? e.hourlyCompensations.filter((t) => t.name?.toLowerCase() === "regular hours").reduce((t, r) => t + parseFloat(r.hours || "0"), 0) : 0;
38
+ function re(e) {
39
+ return !e.hourlyCompensations || e.excluded ? 0 : e.hourlyCompensations.filter((t) => Number(t.compensationMultiplier) > 1).reduce((t, r) => t + parseFloat(r.hours || "0"), 0);
39
40
  }
40
- const L = (t) => t.paidTimeOff ? t.paidTimeOff.reduce((e, r) => e + parseFloat(r.hours || "0"), 0) : 0, O = (t) => t.fixedCompensations ? t.fixedCompensations.filter((e) => {
41
- const r = e.name?.toLowerCase() || "", n = parseFloat(e.amount || "0");
41
+ const L = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r.hours || "0"), 0) : 0, A = (e) => e.fixedCompensations ? e.fixedCompensations.filter((t) => {
42
+ const r = t.name?.toLowerCase() || "", n = parseFloat(t.amount || "0");
42
43
  return r !== "reimbursement" && r !== "minimum wage adjustment" && n > 0;
43
- }).reduce((e, r) => e + parseFloat(r.amount || "0"), 0) : 0, tt = (t) => {
44
- if (!t.fixedCompensations)
44
+ }).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0, ne = (e) => {
45
+ if (!e.fixedCompensations)
45
46
  return 0;
46
- const e = t.fixedCompensations.find(
47
+ const t = e.fixedCompensations.find(
47
48
  (r) => r.name?.toLowerCase() === "reimbursement"
48
49
  );
49
- return e ? parseFloat(e.amount || "0") : 0;
50
- }, et = (t) => {
51
- const e = C(t);
52
- return e % 1 === 0 ? `${e}.0` : e.toString();
53
- }, U = (t) => t.frequency && j[t.frequency] || 0, h = (t, e) => {
54
- if (!t.length) return null;
55
- const r = [...t].sort(
50
+ return t ? parseFloat(t.amount || "0") : 0;
51
+ }, oe = (e) => {
52
+ const t = w(e);
53
+ return t % 1 === 0 ? `${t}.0` : t.toString();
54
+ }, W = (e) => e.frequency && j[e.frequency] || 0, h = (e, t) => {
55
+ if (!e.length) return null;
56
+ const r = [...e].sort(
56
57
  (n, o) => (n.effectiveDate ? new Date(n.effectiveDate).getTime() : 0) - (o.effectiveDate ? new Date(o.effectiveDate).getTime() : 0)
57
58
  );
58
59
  for (let n = r.length - 1; n >= 0; n--) {
59
60
  const o = r[n]?.effectiveDate, s = o ? new Date(o) : null;
60
- if (s && s <= e)
61
+ if (s && s <= t)
61
62
  return r[n] || null;
62
63
  }
63
64
  return r[0] || null;
64
- }, A = (t, e) => {
65
- if (!t.length) return null;
66
- const r = [...t].sort(
65
+ }, I = (e, t) => {
66
+ if (!e.length) return null;
67
+ const r = [...e].sort(
67
68
  (n, o) => (n.effectiveDate ? new Date(n.effectiveDate).getTime() : 0) - (o.effectiveDate ? new Date(o.effectiveDate).getTime() : 0)
68
69
  );
69
70
  for (let n = r.length - 1; n >= 0; n--) {
70
71
  const o = r[n]?.effectiveDate, s = o ? new Date(o) : null;
71
- if (s && s <= e)
72
+ if (s && s <= t)
72
73
  return r[n] || null;
73
74
  }
74
75
  return r[0] || null;
75
- }, W = (t) => t.flsaStatus === "Exempt" || t.flsaStatus === "Salaried Nonexempt", I = (t) => t.length ? t.filter((e) => {
76
- const r = e.name?.toLowerCase(), n = parseFloat(e.amount || "0");
76
+ }, _ = (e) => e.flsaStatus === "Exempt" || e.flsaStatus === "Salaried Nonexempt", k = (e) => e.length ? e.filter((t) => {
77
+ const r = t.name?.toLowerCase(), n = parseFloat(t.amount || "0");
77
78
  return (r === "paycheck tips" || r === "cash tips") && n > 0;
78
- }).reduce((e, r) => e + parseFloat(r.amount || "0"), 0) : 0, P = (t) => {
79
- const e = parseFloat(t.rate || "0");
80
- switch (t.paymentUnit || "Hour") {
79
+ }).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0, P = (e) => {
80
+ const t = parseFloat(e.rate || "0");
81
+ switch (e.paymentUnit || "Hour") {
81
82
  case "Hour":
82
- return e;
83
+ return t;
83
84
  case "Year":
84
- return e / 2080;
85
+ return t / 2080;
85
86
  // 52 weeks * 40 hours
86
87
  case "Month":
87
- return e / 173.333333;
88
+ return t / 173.333333;
88
89
  case "Week":
89
- return e / 40;
90
+ return t / 40;
90
91
  case "Paycheck":
91
92
  return 0;
92
93
  // Paycheck rate is 0 for hourly calculation
93
94
  default:
94
- return e;
95
+ return t;
95
96
  }
96
- }, _ = (t, e, r) => {
97
- const n = t.jobs?.find((s) => s.uuid === e);
97
+ }, G = (e, t, r) => {
98
+ const n = e.jobs?.find((s) => s.uuid === t);
98
99
  if (!n?.compensations)
99
100
  return 0;
100
101
  const o = h(n.compensations, r);
101
102
  return o ? P(o) : 0;
102
- }, R = (t, e) => {
103
- const r = y(t);
103
+ }, H = (e, t) => {
104
+ const r = y(e);
104
105
  if (!r?.compensations)
105
106
  return 0;
106
- const n = h(r.compensations, e);
107
+ const n = h(r.compensations, t);
107
108
  return n ? P(n) : 0;
108
- }, k = (t) => t.paidTimeOff ? t.paidTimeOff.reduce(
109
- (e, r) => e + parseFloat(r.finalPayoutUnusedHoursInput || "0"),
109
+ }, J = (e) => e.paidTimeOff ? e.paidTimeOff.reduce(
110
+ (t, r) => t + parseFloat(r.finalPayoutUnusedHoursInput || "0"),
110
111
  0
111
- ) : 0, w = (t, e, r, n) => {
112
- const o = L(t);
112
+ ) : 0, R = (e, t, r, n) => {
113
+ const o = L(e);
113
114
  if (n) {
114
- const s = k(t);
115
+ const s = J(e);
115
116
  return o + s;
116
117
  }
117
- return e ? Math.min(r, o) : o;
118
- }, G = (t, e, r) => {
119
- if (!t.adjustForMinimumWage) return 0;
120
- const n = A(
121
- t.minimumWages || [],
118
+ return t ? Math.min(r, o) : o;
119
+ }, Y = (e, t, r) => {
120
+ if (!e.adjustForMinimumWage) return 0;
121
+ const n = I(
122
+ e.minimumWages || [],
122
123
  r
123
124
  );
124
125
  if (!n)
125
126
  return 0;
126
- const o = e.hourlyCompensations?.reduce(
127
+ const o = t.hourlyCompensations?.reduce(
127
128
  (m, i) => m + parseFloat(i.hours || "0"),
128
129
  0
129
- ) || 0, s = P(t), u = (parseFloat(n.wage || "0") - s) * o, a = I(e.fixedCompensations || []);
130
+ ) || 0, s = P(e), u = (parseFloat(n.wage || "0") - s) * o, a = k(t.fixedCompensations || []);
130
131
  return Math.max(0, u - a);
131
- }, J = (t, e, r, n, o, s, u) => {
132
+ }, q = (e, t, r, n, o, s, u) => {
132
133
  if (!u && n)
133
- return R(e, r) * (o - s);
134
- if (!t.hourlyCompensations || !e.jobs)
134
+ return H(t, r) * (o - s);
135
+ if (!e.hourlyCompensations || !t.jobs)
135
136
  return 0;
136
- const a = t.hourlyCompensations.reduce((l, c) => {
137
- const p = parseFloat(c.hours || "0"), d = _(e, c.jobUuid || "", r);
138
- return l + p * d;
139
- }, 0), m = t.hourlyCompensations.reduce((l, c) => l + parseFloat(c.hours || "0"), 0);
137
+ const a = e.hourlyCompensations.reduce((l, c) => {
138
+ const d = parseFloat(c.hours || "0"), p = G(t, c.jobUuid || "", r);
139
+ return l + d * p;
140
+ }, 0), m = e.hourlyCompensations.reduce((l, c) => l + parseFloat(c.hours || "0"), 0);
140
141
  if (m === 0) return a;
141
- const i = S(a / m), f = t.hourlyCompensations.filter((l) => !H(l.name || "")).reduce((l, c) => {
142
- const p = parseFloat(c.hours || "0"), d = c.compensationMultiplier || 1;
143
- return l + p * i * (d - 1);
142
+ const i = O(a / m), f = e.hourlyCompensations.filter((l) => !T(l.name || "")).reduce((l, c) => {
143
+ const d = parseFloat(c.hours || "0"), p = c.compensationMultiplier || 1;
144
+ return l + d * i * (p - 1);
144
145
  }, 0);
145
146
  return a + f;
146
- }, q = (t, e, r, n, o, s) => {
147
- const u = w(
148
- t,
147
+ }, B = (e, t, r, n, o, s) => {
148
+ const u = R(
149
+ e,
149
150
  n,
150
151
  o,
151
152
  s
152
- ), a = R(e, r);
153
+ ), a = H(t, r);
153
154
  return u * a;
154
- }, B = (t, e, r) => {
155
- if (!e) return !1;
156
- const n = t.hourlyCompensations?.find(
157
- (s) => H(s.name || "")
155
+ }, Q = (e, t, r) => {
156
+ if (!t) return !1;
157
+ const n = e.hourlyCompensations?.find(
158
+ (s) => T(s.name || "")
158
159
  );
159
160
  return n ? parseFloat(n.hours || "0") === r : !1;
160
- }, rt = (t, e, r, n, o = !1) => {
161
- if (t.excluded)
161
+ }, se = (e, t, r, n, o = !1) => {
162
+ if (e.excluded)
162
163
  return 0;
163
- const s = r ? new Date(r) : /* @__PURE__ */ new Date(), u = y(e);
164
+ const s = r ? new Date(r) : /* @__PURE__ */ new Date(), u = y(t);
164
165
  if (!u?.compensations)
165
166
  return 0;
166
167
  const a = h(
@@ -169,45 +170,45 @@ const L = (t) => t.paidTimeOff ? t.paidTimeOff.reduce((e, r) => e + parseFloat(r
169
170
  );
170
171
  if (!a)
171
172
  return 0;
172
- const m = W(a), i = n ? U(n) : 0, f = B(
173
- t,
173
+ const m = _(a), i = n ? W(n) : 0, f = Q(
174
+ e,
174
175
  m,
175
176
  i
176
- ), l = w(
177
- t,
177
+ ), l = R(
178
+ e,
178
179
  f,
179
180
  i,
180
181
  o
181
- ), c = J(
182
- t,
182
+ ), c = q(
183
183
  e,
184
+ t,
184
185
  s,
185
186
  f,
186
187
  i,
187
188
  l,
188
189
  o
189
- ), p = O(t), d = q(
190
- t,
190
+ ), d = A(e), p = B(
191
191
  e,
192
+ t,
192
193
  s,
193
194
  f,
194
195
  i,
195
196
  o
196
- ), b = G(
197
+ ), b = Y(
197
198
  a,
198
- t,
199
+ e,
199
200
  s
200
- ), T = c + p + d + b;
201
- return C(T);
202
- }, nt = (t) => t.external ? "External" : t.offCycle ? "Off-Cycle" : "Regular", ot = ({
203
- flsaStatus: t,
204
- existingFixedCompensations: e = [],
201
+ ), F = c + d + p + b;
202
+ return w(F);
203
+ }, ae = (e) => e.external ? "External" : e.offCycle ? "Off-Cycle" : "Regular", ue = ({
204
+ flsaStatus: e,
205
+ existingFixedCompensations: t = [],
205
206
  primaryJobUuid: r,
206
207
  fixedCompensationTypes: n = [],
207
208
  excludedTypes: o = []
208
209
  }) => {
209
- const s = [...e];
210
- return t !== M.OWNER && r && n.length > 0 && n.map((a) => a.name).filter(Boolean).forEach((a) => {
210
+ const s = [...t];
211
+ return e !== x.OWNER && r && n.length > 0 && n.map((a) => a.name).filter(Boolean).forEach((a) => {
211
212
  s.some(
212
213
  (i) => i.name?.toLowerCase() === a.toLowerCase()
213
214
  ) || s.push({
@@ -216,32 +217,43 @@ const L = (t) => t.paidTimeOff ? t.paidTimeOff.reduce((e, r) => e + parseFloat(r
216
217
  jobUuid: r
217
218
  });
218
219
  }), s.filter((u) => u.name && !o.includes(u.name)).sort((u, a) => (u.name || "").localeCompare(a.name || ""));
219
- }, st = (t, e, r) => {
220
- const n = t.find(
220
+ }, ie = (e, t, r) => {
221
+ const n = e.find(
221
222
  (o) => o.name?.toLowerCase() === g.toLowerCase()
222
223
  );
223
- return n || (r && e.some(
224
+ return n || (r && t.some(
224
225
  (o) => o.name?.toLowerCase() === g.toLowerCase()
225
226
  ) ? {
226
227
  name: g,
227
228
  amount: "0.00",
228
229
  jobUuid: r
229
230
  } : null);
230
- }, at = (t) => t.totals ? Number(t.totals.grossPay ?? 0) + Number(t.totals.employerTaxes ?? 0) + Number(t.totals.reimbursements ?? 0) + Number(t.totals.benefits ?? 0) : 0;
231
+ }, le = (e) => e.totals ? Number(e.totals.grossPay ?? 0) + Number(e.totals.employerTaxes ?? 0) + Number(e.totals.reimbursements ?? 0) + Number(e.totals.benefits ?? 0) : 0, C = (e) => {
232
+ const t = e.getFullYear(), r = new Date(t, 2, 1);
233
+ r.setDate(1 + (7 - r.getDay()) + 7);
234
+ const n = new Date(t, 10, 1);
235
+ return n.setDate(1 + (7 - n.getDay()) % 7), e >= r && e < n ? -7 : -8;
236
+ }, ce = (e) => {
237
+ if (e.payrollStatusMeta?.cancellable === !1 || !e.processed || !e.payrollDeadline)
238
+ return !1;
239
+ const t = /* @__PURE__ */ new Date(), r = new Date(e.payrollDeadline), n = new Date(t.getTime() + C(t) * D), o = new Date(r.getTime() + C(r) * D), s = new Date(o);
240
+ return s.setUTCHours(16, 0, 0, 0), !(n >= s);
241
+ };
231
242
  export {
232
- rt as calculateGrossPay,
233
- at as calculateTotalPayroll,
234
- N as formatEmployeePayRate,
235
- et as formatHoursDisplay,
236
- O as getAdditionalEarnings,
237
- ot as getAdditionalEarningsCompensations,
238
- Z as getOvertimeHours,
239
- nt as getPayrollType,
243
+ se as calculateGrossPay,
244
+ le as calculateTotalPayroll,
245
+ ce as canCancelPayroll,
246
+ U as formatEmployeePayRate,
247
+ oe as formatHoursDisplay,
248
+ A as getAdditionalEarnings,
249
+ ue as getAdditionalEarningsCompensations,
250
+ re as getOvertimeHours,
251
+ ae as getPayrollType,
240
252
  y as getPrimaryJob,
241
- X as getRegularHours,
242
- st as getReimbursementCompensation,
243
- tt as getReimbursements,
253
+ te as getRegularHours,
254
+ ie as getReimbursementCompensation,
255
+ ne as getReimbursements,
244
256
  L as getTotalPtoHours,
245
- V as useFormatEmployeePayRate
257
+ ee as useFormatEmployeePayRate
246
258
  };
247
259
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollShowFixedCompensations } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { FixedCompensations } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { COMPENSATION_NAME_REIMBURSEMENT, FlsaStatus } from '@/shared/constants'\n\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nexport const getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\nexport const getEmployeePayRateInfo = (employee: Employee | undefined) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return { rate, paymentUnit }\n}\n\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n isOffCycle: boolean = false,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n isOffCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n// Payroll type and status utilities\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\nexport const getReimbursementCompensation = (\n fixedCompensations: FixedCompensations[],\n fixedCompensationTypes: PayrollFixedCompensationTypesType[],\n primaryJobUuid?: string,\n) => {\n const reimbursementCompensation = fixedCompensations.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n\n if (reimbursementCompensation) {\n return reimbursementCompensation\n }\n\n if (\n primaryJobUuid &&\n fixedCompensationTypes.some(\n type => type.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n ) {\n return {\n name: COMPENSATION_NAME_REIMBURSEMENT,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n }\n }\n\n return null\n}\n\n// Total Payroll = Gross Pay + Employer Taxes + Reimbursements + Benefits\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","t","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursementComp","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","compensationEffectiveDate","salaried","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","getPayrollType","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","getReimbursementCompens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MACzB,MAAM/F;AAAA,MACN,QAAQ;AAAA,MACR,SAAS4F;AAAA,IAAA,CACV;AAAA,EAEL,CAAC,GAIIG,EACJ,OAAO,CAAAG,MAAQA,EAAK,QAAQ,CAACJ,EAAc,SAASI,EAAK,IAAI,CAAC,EAC9D,KAAK,CAAC9D,GAAGC,OAAOD,EAAE,QAAQ,IAAI,cAAcC,EAAE,QAAQ,EAAE,CAAC;AAC9D,GAEa8D,KAA+B,CAC1CtD,GACAgD,GACAD,MACG;AACH,QAAMQ,IAA4BvD,EAAmB;AAAA,IACnD,OAAQqD,EAAK,MAAM,YAAA,MAAkBG,EAAgC,YAAA;AAAA,EAAY;AAGnF,SAAID,MAKFR,KACAC,EAAuB;AAAA,IACrB,OAAQI,EAAK,MAAM,YAAA,MAAkBI,EAAgC,YAAA;AAAA,EAAY,IAG5E;AAAA,IACL,MAAMA;AAAA,IACN,QAAQ;AAAA,IACR,SAAST;AAAA,EAAA,IAIN;AACT,GAGaU,KAAwB,CAACC,MACfA,EAAY,SAC7B,OAAOA,EAAY,OAAO,YAAY,CAAC,IACvC,OAAOA,EAAY,OAAO,iBAAiB,CAAC,IAC5C,OAAOA,EAAY,OAAO,kBAAkB,CAAC,IAC7C,OAAOA,EAAY,OAAO,YAAY,CAAC,IACvC;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollShowFixedCompensations } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { FixedCompensations } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { COMPENSATION_NAME_REIMBURSEMENT, FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nexport const getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\nexport const getEmployeePayRateInfo = (employee: Employee | undefined) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return { rate, paymentUnit }\n}\n\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n isOffCycle: boolean = false,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n isOffCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n// Payroll type and status utilities\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\nexport const getReimbursementCompensation = (\n fixedCompensations: FixedCompensations[],\n fixedCompensationTypes: PayrollFixedCompensationTypesType[],\n primaryJobUuid?: string,\n) => {\n const reimbursementCompensation = fixedCompensations.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n\n if (reimbursementCompensation) {\n return reimbursementCompensation\n }\n\n if (\n primaryJobUuid &&\n fixedCompensationTypes.some(\n type => type.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n ) {\n return {\n name: COMPENSATION_NAME_REIMBURSEMENT,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n }\n }\n\n return null\n}\n\n// Total Payroll = Gross Pay + Employer Taxes + Reimbursements + Benefits\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines if a payroll can be cancelled based on business rules.\n *\n * A payroll can be cancelled if all of the following conditions are met:\n * - The payroll has been processed (processed === true)\n * - Current time is before 4:00 PM PT on the payroll deadline\n * - The payrollStatusMeta.cancellable flag is not explicitly false\n *\n * This check enforces the business rule that payrolls can only be cancelled\n * before the 4:00 PM PT cutoff time on their deadline date.\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursementComp","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","compensationEffectiveDate","salaried","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","getPayrollType","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","getReimbursementCompensation","reimbursementCompensation","COMPENSATION_NAME_REIMBURSEMENT","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;AAgBA,MAAMA,IAAqB,iBAGdC,IAAgB,CAACC,MACrBA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AACZ,GAEaC,IAAwB,CAAC;AAAA,EACpC,UAAAR;AAAA,EACA;AAAA,EACA,QAAAS,IAAS;AACX,MAIM;AACJ,MAAI,CAACT,GAAU;AACb,WAAO;AAGT,QAAMU,IAAaX,EAAcC,CAA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AY,OAAO,iBAAiB,CAAC,IAC5C,OAAOA,EAAY,OAAO,kBAAkB,CAAC,IAC7C,OAAOA,EAAY,OAAO,YAAY,CAAC,IACvC,GAaAC,IAAuB,CAACC,MAAuB;AACnD,QAAMC,IAAOD,EAAK,YAAA,GAEZE,IAAoB,IAAI,KAAKD,GAAM,GAAG,CAAC;AAC7C,EAAAC,EAAkB,QAAQ,KAAK,IAAIA,EAAkB,OAAA,KAAY,CAAC;AAElE,QAAMC,IAAsB,IAAI,KAAKF,GAAM,IAAI,CAAC;AAChD,SAAAE,EAAoB,QAAQ,KAAM,IAAIA,EAAoB,OAAA,KAAY,CAAE,GAE1DH,KAAQE,KAAqBF,IAAOG,IACnC,KAAK;AACtB,GAaaC,KAAmB,CAACrB,MAA8B;AAS7D,MARIA,EAAQ,mBAAmB,gBAAgB,MAI3C,CAACA,EAAQ,aAIT,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMsB,wBAAU,KAAA,GACVC,IAAW,IAAI,KAAKvB,EAAQ,eAAe,GAE3CwB,IAAU,IAAI,KAAKF,EAAI,YAAYN,EAAqBM,CAAG,IAAIG,CAAW,GAC1EC,IAAe,IAAI,KAAKH,EAAS,YAAYP,EAAqBO,CAAQ,IAAIE,CAAW,GAEzFE,IAAa,IAAI,KAAKD,CAAY;AAGxC,SAFAC,EAAW,YAAY,IAAI,GAAG,GAAG,CAAC,GAE9B,EAAAH,KAAWG;AAKjB;"}
@@ -10,3 +10,5 @@ export { PayrollReceipts } from './PayrollReceipts/PayrollReceipts';
10
10
  export { ConfirmWireDetails } from './ConfirmWireDetails/ConfirmWireDetails';
11
11
  export type { ConfirmWireDetailsProps, ConfirmWireDetailsComponentType } from './ConfirmWireDetails';
12
12
  export { PayrollBlocker, type ApiPayrollBlocker } from './PayrollBlocker';
13
+ export { InformationRequests } from './InformationRequests';
14
+ export { RecoveryCases } from './RecoveryCases/RecoveryCases';
@@ -1,23 +1,27 @@
1
- import { PayrollConfiguration as l } from "./PayrollConfiguration/PayrollConfiguration.js";
1
+ import { PayrollConfiguration as e } from "./PayrollConfiguration/PayrollConfiguration.js";
2
2
  import { PayrollEditEmployee as t } from "./PayrollEditEmployee/PayrollEditEmployee.js";
3
- import { PayrollHistory as f } from "./PayrollHistory/PayrollHistory.js";
3
+ import { PayrollHistory as m } from "./PayrollHistory/PayrollHistory.js";
4
4
  import { PayrollLanding as p } from "./PayrollLanding/PayrollLanding.js";
5
- import { PayrollList as y } from "./PayrollList/PayrollList.js";
5
+ import { PayrollList as x } from "./PayrollList/PayrollList.js";
6
6
  import { PayrollOverview as P } from "./PayrollOverview/PayrollOverview.js";
7
- import { PayrollFlow as s } from "./PayrollFlow/PayrollFlow.js";
8
- import { PayrollReceipts as d } from "./PayrollReceipts/PayrollReceipts.js";
9
- import { ConfirmWireDetails as v } from "./ConfirmWireDetails/ConfirmWireDetails.js";
10
- import { PayrollBlocker as C } from "./PayrollBlocker/PayrollBlocker.js";
7
+ import { PayrollFlow as n } from "./PayrollFlow/PayrollFlow.js";
8
+ import { PayrollReceipts as v } from "./PayrollReceipts/PayrollReceipts.js";
9
+ import { ConfirmWireDetails as R } from "./ConfirmWireDetails/ConfirmWireDetails.js";
10
+ import { RecoveryCases as g } from "./RecoveryCases/RecoveryCases.js";
11
+ import { PayrollBlocker as w } from "./PayrollBlocker/PayrollBlocker.js";
12
+ import { InformationRequests as L } from "./InformationRequests/InformationRequests.js";
11
13
  export {
12
- v as ConfirmWireDetails,
13
- C as PayrollBlocker,
14
- l as PayrollConfiguration,
14
+ R as ConfirmWireDetails,
15
+ L as InformationRequests,
16
+ w as PayrollBlocker,
17
+ e as PayrollConfiguration,
15
18
  t as PayrollEditEmployee,
16
- s as PayrollFlow,
17
- f as PayrollHistory,
19
+ n as PayrollFlow,
20
+ m as PayrollHistory,
18
21
  p as PayrollLanding,
19
- y as PayrollList,
22
+ x as PayrollList,
20
23
  P as PayrollOverview,
21
- d as PayrollReceipts
24
+ v as PayrollReceipts,
25
+ g as RecoveryCases
22
26
  };
23
27
  //# 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":";;;;;;;;;;;;"}
@@ -6,12 +6,15 @@ interface UsePreparedPayrollDataParams {
6
6
  payrollId: string;
7
7
  employeeUuids?: string[];
8
8
  sortBy?: PayrollPrepareSortBy;
9
+ onDataReady?: (preparedPayroll: PayrollPrepared) => void;
9
10
  }
10
11
  interface UsePreparedPayrollDataReturn {
11
12
  handlePreparePayroll: () => Promise<void>;
12
13
  preparedPayroll: PayrollPrepared | undefined;
13
14
  paySchedule: PayScheduleObject | undefined;
14
15
  isLoading: boolean;
16
+ isPaginating: boolean;
17
+ hasInitialData: boolean;
15
18
  }
16
- export declare const usePreparedPayrollData: ({ companyId, payrollId, employeeUuids, sortBy, }: UsePreparedPayrollDataParams) => UsePreparedPayrollDataReturn;
19
+ export declare const usePreparedPayrollData: ({ companyId, payrollId, employeeUuids, sortBy, onDataReady, }: UsePreparedPayrollDataParams) => UsePreparedPayrollDataReturn;
17
20
  export {};