@gusto/embedded-react-sdk 0.16.0 → 0.18.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 (387) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/components/Base/Base.js +50 -65
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Base/useBase.d.ts +2 -5
  5. package/dist/components/Base/useBase.js.map +1 -1
  6. package/dist/components/Common/EmptyData/EmptyData.js +10 -10
  7. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  8. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +5 -3
  9. package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
  10. package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
  11. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +41 -33
  12. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  13. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +1 -1
  14. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  16. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  18. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  19. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  20. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  21. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  22. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +32 -18
  23. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
  24. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +12 -12
  25. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +14 -0
  26. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js +8 -0
  27. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -0
  28. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
  29. package/dist/components/Common/UI/DescriptionList/DescriptionList.d.ts +2 -0
  30. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +16 -0
  31. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -0
  32. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +10 -0
  33. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -0
  34. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +10 -0
  35. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +5 -0
  36. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -0
  37. package/dist/components/Common/UI/DescriptionList/index.d.ts +3 -0
  38. package/dist/components/Common/UI/Dialog/Dialog.js +50 -76
  39. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
  40. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +8 -14
  41. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -1
  42. package/dist/components/Common/UI/Link/LinkTypes.d.ts +7 -6
  43. package/dist/components/Common/UI/Modal/Modal.d.ts +2 -0
  44. package/dist/components/Common/UI/Modal/Modal.js +90 -0
  45. package/dist/components/Common/UI/Modal/Modal.js.map +1 -0
  46. package/dist/components/Common/UI/Modal/Modal.module.scss.js +26 -0
  47. package/dist/components/Common/UI/Modal/Modal.module.scss.js.map +1 -0
  48. package/dist/components/Common/UI/Modal/ModalTypes.d.ts +34 -0
  49. package/dist/components/Common/UI/Modal/ModalTypes.js +8 -0
  50. package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -0
  51. package/dist/components/Common/UI/Modal/index.d.ts +3 -0
  52. package/dist/components/Common/UI/Tabs/Tabs.d.ts +0 -5
  53. package/dist/components/Common/UI/Tabs/Tabs.js +45 -16
  54. package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
  55. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -4
  56. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -1
  57. package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +7 -0
  58. package/dist/components/Common/index.d.ts +0 -1
  59. package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
  60. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  61. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
  62. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  63. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  64. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  65. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
  66. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  67. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  68. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -6
  70. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  71. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  72. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  73. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
  74. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  75. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  76. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  77. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -6
  78. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  79. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  80. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  81. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -8
  82. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  83. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  84. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  85. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
  86. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  87. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -6
  88. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  89. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +22 -17
  90. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  91. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  92. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  93. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  94. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  95. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  96. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  97. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  98. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  99. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -13
  100. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  101. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -6
  102. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  103. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
  104. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  105. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
  106. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  107. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  108. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  109. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
  110. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  111. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  112. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  113. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -11
  114. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  115. package/dist/components/Company/Industry/Actions.js +5 -6
  116. package/dist/components/Company/Industry/Actions.js.map +1 -1
  117. package/dist/components/Company/Industry/Context.js +7 -9
  118. package/dist/components/Company/Industry/Context.js.map +1 -1
  119. package/dist/components/Company/Industry/Edit.js +10 -11
  120. package/dist/components/Company/Industry/Edit.js.map +1 -1
  121. package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
  122. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  123. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  124. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  125. package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -11
  126. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  127. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -6
  128. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  129. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  130. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  131. package/dist/components/Company/Locations/LocationsList/List.js +2 -3
  132. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  133. package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
  134. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  135. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -6
  136. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  137. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  138. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  139. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  140. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  141. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
  142. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  143. package/dist/components/Company/OnboardingOverview/context.js +4 -6
  144. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  145. package/dist/components/Company/PaySchedule/PaySchedule.js +39 -41
  146. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  147. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
  148. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  149. package/dist/components/Company/PaySchedule/_parts/Edit.js +35 -37
  150. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  151. package/dist/components/Company/PaySchedule/_parts/Head.js +18 -19
  152. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  153. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  154. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  155. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -8
  156. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  157. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
  158. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  159. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -6
  160. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  161. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  162. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  163. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
  164. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  165. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -6
  166. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  167. package/dist/components/Contractor/Address/Address.js +3 -5
  168. package/dist/components/Contractor/Address/Address.js.map +1 -1
  169. package/dist/components/Contractor/Address/Form.js +2 -3
  170. package/dist/components/Contractor/Address/Form.js.map +1 -1
  171. package/dist/components/Contractor/Address/useAddress.js +6 -8
  172. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  173. package/dist/components/Contractor/ContractorList/index.js +15 -16
  174. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  175. package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
  176. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  177. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
  178. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  179. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  180. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  181. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  182. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  183. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
  184. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  185. package/dist/components/Contractor/Submit/Submit.js +2 -3
  186. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Actions.js +4 -5
  188. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  189. package/dist/components/Employee/Compensation/Edit.js +10 -9
  190. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  191. package/dist/components/Employee/Compensation/List.js +5 -6
  192. package/dist/components/Employee/Compensation/List.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
  194. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +6 -6
  196. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +2 -2
  197. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -3
  198. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +44 -40
  200. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  201. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +2 -3
  202. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  203. package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
  204. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
  205. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
  207. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  209. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  210. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -6
  211. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  212. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
  213. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
  215. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  216. package/dist/components/Employee/EmployeeList/Actions.js +4 -5
  217. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  218. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  219. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/List.js +9 -10
  221. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -6
  223. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  224. package/dist/components/Employee/FederalTaxes/Actions.js +2 -3
  225. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  226. package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -6
  227. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  228. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +8 -8
  229. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  230. package/dist/components/Employee/FederalTaxes/Head.js +6 -6
  231. package/dist/components/Employee/FederalTaxes/Head.js.map +1 -1
  232. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -6
  233. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  234. package/dist/components/Employee/Landing/Landing.js +6 -7
  235. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  236. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  237. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
  239. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  240. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -4
  241. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  242. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -0
  243. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +79 -78
  244. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  245. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +12 -13
  246. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  247. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  248. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  249. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
  250. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -8
  251. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  252. package/dist/components/Employee/Profile/Actions.js +6 -7
  253. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  254. package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -35
  255. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  256. package/dist/components/Employee/Profile/HomeAddress.d.ts +52 -0
  257. package/dist/components/Employee/Profile/HomeAddress.js +63 -44
  258. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  259. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
  260. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  261. package/dist/components/Employee/Profile/Profile.js +150 -143
  262. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  263. package/dist/components/Employee/Profile/useProfile.d.ts +1 -0
  264. package/dist/components/Employee/Profile/useProfile.js +4 -6
  265. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  266. package/dist/components/Employee/StateTaxes/Actions.js +6 -7
  267. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  268. package/dist/components/Employee/StateTaxes/StateTaxes.js +4 -4
  269. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  270. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -6
  271. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  272. package/dist/components/Employee/Taxes/Actions.js +7 -8
  273. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  274. package/dist/components/Employee/Taxes/FederalForm.js +5 -6
  275. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  276. package/dist/components/Employee/Taxes/FederalHead.js +6 -6
  277. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Taxes.js +5 -5
  279. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  280. package/dist/components/Employee/Taxes/useTaxes.js +4 -6
  281. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  282. package/dist/components/Flow/Flow.js +9 -10
  283. package/dist/components/Flow/Flow.js.map +1 -1
  284. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -10
  285. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  286. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +101 -90
  287. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  288. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -1
  289. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +135 -133
  290. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  291. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +5 -3
  292. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  293. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +127 -119
  294. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  295. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -6
  296. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  297. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -1
  298. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -22
  299. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  300. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +40 -27
  301. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  302. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +50 -72
  303. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  304. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
  305. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  306. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +1 -1
  307. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +4 -4
  308. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  309. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +20 -20
  310. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  311. package/dist/components/Payroll/PayrollList/PayrollList.js +24 -21
  312. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  313. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -9
  314. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +117 -128
  315. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  316. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +6 -6
  317. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +89 -78
  318. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  319. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +195 -214
  320. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  321. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js +8 -0
  322. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map +1 -0
  323. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  324. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  325. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +49 -45
  326. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  327. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  328. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
  329. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  330. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -7
  331. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  332. package/dist/helpers/apiErrorToList.d.ts +7 -0
  333. package/dist/helpers/apiErrorToList.js +23 -0
  334. package/dist/helpers/apiErrorToList.js.map +1 -0
  335. package/dist/helpers/breadcrumbHelpers.js +30 -30
  336. package/dist/helpers/breadcrumbHelpers.js.map +1 -1
  337. package/dist/helpers/dateFormatting.d.ts +18 -6
  338. package/dist/helpers/dateFormatting.js +93 -24
  339. package/dist/helpers/dateFormatting.js.map +1 -1
  340. package/dist/helpers/formattedStrings.js +11 -12
  341. package/dist/helpers/formattedStrings.js.map +1 -1
  342. package/dist/hooks/useAsyncError.js.map +1 -0
  343. package/dist/hooks/useDateFormatter.d.ts +19 -0
  344. package/dist/hooks/useDateFormatter.js +24 -0
  345. package/dist/hooks/useDateFormatter.js.map +1 -0
  346. package/dist/hooks/useMenu.js.map +1 -0
  347. package/dist/{components/Common/hooks → hooks}/useNumberFormatter.js +1 -1
  348. package/dist/hooks/useNumberFormatter.js.map +1 -0
  349. package/dist/hooks/useOverflowDetection/index.d.ts +3 -0
  350. package/dist/hooks/useOverflowDetection/useOverflowDetection.d.ts +7 -0
  351. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +28 -0
  352. package/dist/hooks/useOverflowDetection/useOverflowDetection.js.map +1 -0
  353. package/dist/i18n/en/Company.PaySchedule.json.js +9 -9
  354. package/dist/i18n/en/Employee.Compensation.json.js +15 -15
  355. package/dist/i18n/en/Employee.Deductions.json.js +131 -105
  356. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  357. package/dist/i18n/en/Employee.FederalTaxes.json.js +9 -9
  358. package/dist/i18n/en/Employee.HomeAddress.json.js +1 -1
  359. package/dist/i18n/en/Employee.PaymentMethod.json.js +70 -66
  360. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  361. package/dist/i18n/en/Employee.Taxes.json.js +25 -27
  362. package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
  363. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +17 -17
  364. package/dist/i18n/en/Payroll.PayrollOverview.json.js +23 -23
  365. package/dist/i18n/en/common.json.d.ts +2 -1
  366. package/dist/i18n/en/common.json.js +4 -4
  367. package/dist/style.css +1 -1
  368. package/dist/types/i18next.d.ts +20 -1
  369. package/package.json +10 -10
  370. package/dist/components/Common/hooks/useAsyncError.js.map +0 -1
  371. package/dist/components/Common/hooks/useMenu.js.map +0 -1
  372. package/dist/components/Common/hooks/useNumberFormatter.js.map +0 -1
  373. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -221
  374. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
  375. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
  376. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
  377. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -132
  378. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
  379. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
  380. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
  381. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +0 -98
  382. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +0 -1
  383. /package/dist/{components/Common/hooks → hooks}/useAsyncError.d.ts +0 -0
  384. /package/dist/{components/Common/hooks → hooks}/useAsyncError.js +0 -0
  385. /package/dist/{components/Common/hooks → hooks}/useMenu.d.ts +0 -0
  386. /package/dist/{components/Common/hooks → hooks}/useMenu.js +0 -0
  387. /package/dist/{components/Common/hooks → hooks}/useNumberFormatter.d.ts +0 -0
@@ -1,79 +1,79 @@
1
- import { jsx as t, jsxs as B, Fragment as le } from "react/jsx-runtime";
2
- import { zodResolver as ue } from "@hookform/resolvers/zod";
3
- import { useState as ce, useRef as pe, useEffect as ye } from "react";
4
- import { useForm as fe, useWatch as Ae, FormProvider as Ee } from "react-hook-form";
5
- import { useLocationsGetSuspense as he } from "@gusto/embedded-api/react-query/locationsGet";
6
- import { useEmployeesCreateMutation as De } from "@gusto/embedded-api/react-query/employeesCreate";
7
- import { useEmployeesGetSuspense as Oe } from "@gusto/embedded-api/react-query/employeesGet";
8
- import { useEmployeeAddressesGetSuspense as Se } from "@gusto/embedded-api/react-query/employeeAddressesGet";
9
- import { useEmployeeAddressesCreateMutation as ge } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
10
- import { useEmployeeAddressesUpdateMutation as Pe } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
11
- import { useEmployeeAddressesUpdateWorkAddressMutation as be } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
12
- import { useEmployeesUpdateMutation as Ne } from "@gusto/embedded-api/react-query/employeesUpdate";
13
- import { useEmployeeAddressesGetWorkAddressesSuspense as Ie } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
14
- import { useEmployeeAddressesCreateWorkAddressMutation as _e } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
15
- import { RFCDate as R } from "@gusto/embedded-api/types/rfcdate";
16
- import { useEmployeesUpdateOnboardingStatusMutation as we } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
17
- import { AdminPersonalDetailsSchema as v, AdminSelfOnboardingPersonalDetailsSchema as Me, AdminPersonalDetails as ke } from "./AdminPersonalDetails.js";
18
- import { SelfPersonalDetailsSchema as Be, SelfPersonalDetails as Re } from "./SelfPersonalDetails.js";
19
- import { Head as ve } from "./Head.js";
20
- import { Actions as Le } from "./Actions.js";
21
- import { HomeAddressSchema as Ce, HomeAddress as We } from "./HomeAddress.js";
22
- import { WorkAddress as Ue } from "./WorkAddress.js";
23
- import { ProfileProvider as Te } from "./useProfile.js";
24
- import { getEmployeeAddressForProfile as qe } from "./getEmployeeAddressForProfile.js";
25
- import { Grid as Ge } from "../../Common/Grid/Grid.js";
26
- import { Form as He } from "../../Common/Form/Form.js";
27
- import { BaseComponent as Fe } from "../../Base/Base.js";
28
- import { useBase as Ve } from "../../Base/useBase.js";
29
- import { useI18n as L, useComponentDictionary as Ye } from "../../../i18n/I18n.js";
30
- import { EmployeeOnboardingStatus as a, EmployeeSelfOnboardingStatuses as xe, componentEvents as d } from "../../../shared/constants.js";
31
- import { useFlow as ze } from "../../Flow/useFlow.js";
32
- import { ensureRequired as je } from "../../../helpers/ensureRequired.js";
33
- function Ke(r) {
34
- return /* @__PURE__ */ t(Fe, { ...r, children: r.employeeId ? /* @__PURE__ */ t(Je, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(C, { ...r, children: r.children }) });
1
+ import { jsx as t, jsxs as k, Fragment as Ee } from "react/jsx-runtime";
2
+ import { zodResolver as fe } from "@hookform/resolvers/zod";
3
+ import { useState as W, useRef as he, useEffect as Oe } from "react";
4
+ import { useForm as Se, useWatch as De, FormProvider as ge } from "react-hook-form";
5
+ import { useLocationsGetSuspense as Pe } from "@gusto/embedded-api/react-query/locationsGet";
6
+ import { useEmployeesCreateMutation as be } from "@gusto/embedded-api/react-query/employeesCreate";
7
+ import { useEmployeesGetSuspense as Ne } from "@gusto/embedded-api/react-query/employeesGet";
8
+ import { useEmployeeAddressesGetSuspense as _e } from "@gusto/embedded-api/react-query/employeeAddressesGet";
9
+ import { useEmployeeAddressesCreateMutation as Ie } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
10
+ import { useEmployeeAddressesUpdateMutation as we } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
11
+ import { useEmployeeAddressesUpdateWorkAddressMutation as Me } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
12
+ import { useEmployeesUpdateMutation as Be } from "@gusto/embedded-api/react-query/employeesUpdate";
13
+ import { useEmployeeAddressesGetWorkAddressesSuspense as Ce } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
14
+ import { useEmployeeAddressesCreateWorkAddressMutation as Re } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
15
+ import { RFCDate as v } from "@gusto/embedded-api/types/rfcdate";
16
+ import { useEmployeesUpdateOnboardingStatusMutation as Le } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
17
+ import { AdminPersonalDetailsSchema as T, AdminSelfOnboardingPersonalDetailsSchema as ke, AdminPersonalDetails as We } from "./AdminPersonalDetails.js";
18
+ import { SelfPersonalDetailsSchema as ve, SelfPersonalDetails as Te } from "./SelfPersonalDetails.js";
19
+ import { Head as Ge } from "./Head.js";
20
+ import { Actions as Ue } from "./Actions.js";
21
+ import { HomeAddressSchema as G, HomeAddressSchemaWithCompletedOnboarding as qe, HomeAddress as He } from "./HomeAddress.js";
22
+ import { WorkAddress as Fe } from "./WorkAddress.js";
23
+ import { ProfileProvider as Ve } from "./useProfile.js";
24
+ import { getEmployeeAddressForProfile as Ye } from "./getEmployeeAddressForProfile.js";
25
+ import { Grid as ze } from "../../Common/Grid/Grid.js";
26
+ import { Form as xe } from "../../Common/Form/Form.js";
27
+ import { BaseComponent as je } from "../../Base/Base.js";
28
+ import { useBase as Ke } from "../../Base/useBase.js";
29
+ import { useI18n as U, useComponentDictionary as Je } from "../../../i18n/I18n.js";
30
+ import { EmployeeOnboardingStatus as i, EmployeeSelfOnboardingStatuses as Qe, componentEvents as d } from "../../../shared/constants.js";
31
+ import { useFlow as Xe } from "../../Flow/useFlow.js";
32
+ import { ensureRequired as Ze } from "../../../helpers/ensureRequired.js";
33
+ function $e(r) {
34
+ return /* @__PURE__ */ t(je, { ...r, children: r.employeeId ? /* @__PURE__ */ t(er, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(q, { ...r, children: r.children }) });
35
35
  }
36
- function Je({ employeeId: r, ...i }) {
36
+ function er({ employeeId: r, ...m }) {
37
37
  const {
38
- data: { employee: l }
39
- } = Oe({ employeeId: r }), {
40
- data: { employeeAddressList: u }
41
- } = Se({ employeeId: r }), {
42
- data: { employeeWorkAddressesList: m }
43
- } = Ie({ employeeId: r });
38
+ data: { employee: p }
39
+ } = Ne({ employeeId: r }), {
40
+ data: { employeeAddressList: y }
41
+ } = _e({ employeeId: r }), {
42
+ data: { employeeWorkAddressesList: l }
43
+ } = Ce({ employeeId: r });
44
44
  return /* @__PURE__ */ t(
45
- C,
45
+ q,
46
46
  {
47
- ...i,
48
- employee: l,
49
- homeAddresses: u,
50
- workAddresses: m
47
+ ...m,
48
+ employee: p,
49
+ homeAddresses: y,
50
+ workAddresses: l
51
51
  }
52
52
  );
53
53
  }
54
- const C = ({
54
+ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED || r?.onboardingStatus === i.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW || r?.onboardingStatus === i.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE, q = ({
55
55
  isAdmin: r = !1,
56
- isSelfOnboardingEnabled: i = !0,
57
- dictionary: l,
58
- ...u
56
+ isSelfOnboardingEnabled: m = !0,
57
+ dictionary: p,
58
+ ...y
59
59
  }) => {
60
- L("Employee.Profile"), L("Employee.HomeAddress"), Ye("Employee.Profile", l);
60
+ U("Employee.Profile"), U("Employee.HomeAddress"), Je("Employee.Profile", p);
61
61
  const {
62
- companyId: m,
63
- employee: h,
64
- homeAddresses: W,
65
- workAddresses: g,
66
- children: P,
67
- className: U = "",
62
+ companyId: l,
63
+ employee: u,
64
+ homeAddresses: H,
65
+ workAddresses: P,
66
+ children: b,
67
+ className: F = "",
68
68
  defaultValues: s
69
- } = u, { onEvent: n, baseSubmitHandler: T } = Ve(), [q, b] = ce(v), { data: G } = he({ companyId: m }), H = G.locationList, { mutateAsync: F, isPending: V } = De(), { mutateAsync: Y, isPending: x } = Ne(), { mutateAsync: z, isPending: j } = _e(), { mutateAsync: K, isPending: J } = be(), { mutateAsync: Q, isPending: X } = ge(), { mutateAsync: Z, isPending: $ } = Pe(), {
70
- mutateAsync: ee,
71
- isPending: re
72
- } = we(), N = { employee: h, workAddresses: g }, te = qe(W), oe = N.workAddresses?.find((S) => S.active), e = pe({
73
- employee: N.employee,
74
- homeAddress: te,
75
- workAddress: oe
76
- }), D = {
69
+ } = y, { onEvent: n, baseSubmitHandler: V } = Ke(), [Y, N] = W(T), [z, _] = W(G), { data: x } = Pe({ companyId: l }), j = x.locationList, { mutateAsync: K, isPending: J } = be(), { mutateAsync: Q, isPending: X } = Be(), { mutateAsync: Z, isPending: $ } = Re(), { mutateAsync: ee, isPending: re } = Me(), { mutateAsync: te, isPending: oe } = Ie(), { mutateAsync: se, isPending: ne } = we(), {
70
+ mutateAsync: de,
71
+ isPending: ie
72
+ } = Le(), I = { employee: u, workAddresses: P }, ae = Ye(H), me = I.workAddresses?.find((c) => c.active), e = he({
73
+ employee: I.employee,
74
+ homeAddress: ae,
75
+ workAddress: me
76
+ }), S = {
77
77
  firstName: e.current.employee?.firstName ?? s?.employee?.firstName ?? "",
78
78
  middleInitial: e.current.employee?.middleInitial ?? s?.employee?.middleInitial ?? "",
79
79
  lastName: e.current.employee?.lastName ?? s?.employee?.lastName ?? "",
@@ -88,62 +88,65 @@ const C = ({
88
88
  zip: e.current.homeAddress?.zip ?? s?.homeAddress?.zip ?? "",
89
89
  state: e.current.homeAddress?.state ?? s?.homeAddress?.state ?? "",
90
90
  courtesyWithholding: e.current.homeAddress?.courtesyWithholding ?? !1
91
- }, se = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === a.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== a.ADMIN_ONBOARDING_INCOMPLETE ? { ...D, enableSsn: !1, selfOnboarding: !0 } : {
92
- ...D,
93
- selfOnboarding: i ? e.current.employee?.onboardingStatus ? (
91
+ }, le = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === i.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== i.ADMIN_ONBOARDING_INCOMPLETE ? { ...S, enableSsn: !1, selfOnboarding: !0 } : {
92
+ ...S,
93
+ selfOnboarding: m ? e.current.employee?.onboardingStatus ? (
94
94
  // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
95
- xe.has(e.current.employee.onboarding_status)
95
+ Qe.has(e.current.employee.onboarding_status)
96
96
  ) : s?.inviteEmployeeDefault ?? !1 : !1,
97
97
  enableSsn: !e.current.employee?.hasSsn,
98
98
  ssn: ""
99
- }, ne = {
100
- ...D,
99
+ }, ue = {
100
+ ...S,
101
101
  enableSsn: !e.current.employee?.hasSsn,
102
102
  ssn: ""
103
- }, O = fe({
103
+ }, D = Se({
104
104
  // @ts-expect-error: Complex discriminated union schema causes type inference issues with zodResolver v5.2.1
105
- resolver: ue(
105
+ resolver: fe(
106
106
  // @ts-expect-error: Zod discriminated union intersection incompatible with zodResolver v5.2.1
107
- (r ? q : Be).and(Ce)
107
+ (r ? Y : ve).and(z)
108
108
  ),
109
- defaultValues: r ? se : ne
110
- }), { handleSubmit: de } = O, y = Ae({ control: O.control, name: "selfOnboarding" });
111
- ye(() => {
112
- r && b(y ? Me : v);
113
- }, [y, r]);
114
- const ie = async (S) => {
115
- await T(S, async (f) => {
116
- const { workAddress: I, startDate: ae, selfOnboarding: A, ...E } = f;
109
+ defaultValues: r ? le : ue
110
+ }), { handleSubmit: ce } = D, A = De({ control: D.control, name: "selfOnboarding" });
111
+ Oe(() => {
112
+ if (r) {
113
+ const c = g(u);
114
+ N(A && !c ? ke : T), _(A && c ? qe : G);
115
+ }
116
+ }, [A, r, u?.onboardingStatus, u?.onboarded]);
117
+ const pe = async (c) => {
118
+ await V(c, async (a) => {
119
+ const { workAddress: w, startDate: Ae, selfOnboarding: h, ...O } = a;
117
120
  if (e.current.employee) {
118
- if (r && (A && e.current.employee.onboardingStatus === a.ADMIN_ONBOARDING_INCOMPLETE || !A && e.current.employee.onboardingStatus === a.SELF_ONBOARDING_PENDING_INVITE)) {
119
- const { employeeOnboardingStatus: c } = await ee({
121
+ if (r && (h && e.current.employee.onboardingStatus === i.ADMIN_ONBOARDING_INCOMPLETE || !h && e.current.employee.onboardingStatus === i.SELF_ONBOARDING_PENDING_INVITE)) {
122
+ const { employeeOnboardingStatus: E } = await de({
120
123
  request: {
121
124
  employeeId: e.current.employee.uuid,
122
125
  requestBody: {
123
- onboardingStatus: A ? a.SELF_ONBOARDING_PENDING_INVITE : a.ADMIN_ONBOARDING_INCOMPLETE
126
+ onboardingStatus: h ? i.SELF_ONBOARDING_PENDING_INVITE : i.ADMIN_ONBOARDING_INCOMPLETE
124
127
  }
125
128
  }
126
129
  });
127
130
  e.current.employee = {
128
131
  ...e.current.employee,
129
- onboardingStatus: c.onboardingStatus
130
- }, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, c);
132
+ onboardingStatus: E.onboardingStatus
133
+ }, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, E);
131
134
  }
132
- const { employee: o } = await Y({
135
+ const { employee: o } = await Q({
133
136
  request: {
134
137
  employeeId: e.current.employee.uuid,
135
- requestBody: { ...E, version: e.current.employee.version }
138
+ requestBody: { ...O, version: e.current.employee.version }
136
139
  }
137
140
  });
138
141
  e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_UPDATED, o);
139
142
  } else {
140
- const { employee: o } = await F({
143
+ const { employee: o } = await K({
141
144
  request: {
142
- companyId: m,
145
+ companyId: l,
143
146
  requestBody: {
144
- ...E,
145
- selfOnboarding: A,
146
- dateOfBirth: E.dateOfBirth ? new R(E.dateOfBirth) : void 0
147
+ ...O,
148
+ selfOnboarding: h,
149
+ dateOfBirth: O.dateOfBirth ? new v(O.dateOfBirth) : void 0
147
150
  }
148
151
  }
149
152
  });
@@ -151,60 +154,63 @@ const C = ({
151
154
  }
152
155
  if (typeof e.current.employee?.uuid != "string")
153
156
  throw new Error("Employee id is not available");
154
- if ((!y || !r) && !f.selfOnboarding) {
155
- const { street1: o, street2: c, city: _, state: w, zip: M, courtesyWithholding: k } = f;
157
+ const M = g(
158
+ e.current.employee
159
+ );
160
+ if ((!r || !A || M) && (!a.selfOnboarding || M) && "street1" in a && "city" in a && "state" in a && "zip" in a) {
161
+ const { street1: o, street2: E, city: B, state: C, zip: R, courtesyWithholding: L } = a;
156
162
  if (e.current.homeAddress) {
157
- const { employeeAddress: p } = await Z({
163
+ const { employeeAddress: f } = await se({
158
164
  request: {
159
165
  homeAddressUuid: e.current.homeAddress.uuid,
160
166
  requestBody: {
161
167
  version: e.current.homeAddress.version,
162
168
  street1: o,
163
- street2: c,
164
- city: _,
165
- state: w,
166
- zip: M,
167
- courtesyWithholding: k
169
+ street2: E,
170
+ city: B,
171
+ state: C,
172
+ zip: R,
173
+ courtesyWithholding: L
168
174
  }
169
175
  }
170
176
  });
171
- e.current = { ...e.current, homeAddress: p }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, p);
177
+ e.current = { ...e.current, homeAddress: f }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, f);
172
178
  } else {
173
- const { employeeAddress: p } = await Q({
179
+ const { employeeAddress: f } = await te({
174
180
  request: {
175
181
  employeeId: e.current.employee.uuid,
176
182
  requestBody: {
177
183
  street1: o,
178
- street2: c,
179
- city: _,
180
- state: w,
181
- zip: M,
182
- courtesyWithholding: k
184
+ street2: E,
185
+ city: B,
186
+ state: C,
187
+ zip: R,
188
+ courtesyWithholding: L
183
189
  }
184
190
  }
185
191
  });
186
- e.current = { ...e.current, homeAddress: p }, n(d.EMPLOYEE_HOME_ADDRESS_CREATED, p);
192
+ e.current = { ...e.current, homeAddress: f }, n(d.EMPLOYEE_HOME_ADDRESS_CREATED, f);
187
193
  }
188
194
  }
189
195
  if (r)
190
196
  if (e.current.workAddress) {
191
- const { employeeWorkAddress: o } = await K({
197
+ const { employeeWorkAddress: o } = await ee({
192
198
  request: {
193
199
  workAddressUuid: e.current.workAddress.uuid,
194
200
  requestBody: {
195
201
  version: e.current.workAddress.version,
196
- locationUuid: I
202
+ locationUuid: w
197
203
  }
198
204
  }
199
205
  });
200
206
  e.current = { ...e.current, workAddress: o }, n(d.EMPLOYEE_WORK_ADDRESS_UPDATED, o);
201
207
  } else {
202
- const { employeeWorkAddress: o } = await z({
208
+ const { employeeWorkAddress: o } = await Z({
203
209
  request: {
204
210
  employeeId: e.current.employee?.uuid,
205
211
  requestBody: {
206
- locationUuid: I,
207
- effectiveDate: new R(f.startDate || /* @__PURE__ */ new Date())
212
+ locationUuid: w,
213
+ effectiveDate: new v(a.startDate || /* @__PURE__ */ new Date())
208
214
  }
209
215
  }
210
216
  });
@@ -212,53 +218,54 @@ const C = ({
212
218
  }
213
219
  n(d.EMPLOYEE_PROFILE_DONE, {
214
220
  ...e.current.employee,
215
- startDate: ae
221
+ startDate: Ae
216
222
  });
217
223
  });
218
- }, me = () => {
224
+ }, ye = () => {
219
225
  n(d.CANCEL);
220
226
  };
221
- return /* @__PURE__ */ t("section", { className: U, children: /* @__PURE__ */ t(
222
- Te,
227
+ return /* @__PURE__ */ t("section", { className: F, children: /* @__PURE__ */ t(
228
+ Ve,
223
229
  {
224
230
  value: {
225
- companyLocations: H,
226
- workAddresses: g,
231
+ companyLocations: j,
232
+ workAddresses: P,
227
233
  employee: e.current.employee ?? void 0,
228
- isSelfOnboardingIntended: y,
229
- handleCancel: me,
234
+ isSelfOnboardingIntended: A,
235
+ handleCancel: ye,
230
236
  isAdmin: r,
231
- isSelfOnboardingEnabled: i,
232
- isPending: x || J || X || $ || V || j || re
237
+ isSelfOnboardingEnabled: m,
238
+ hasCompletedSelfOnboarding: g(e.current.employee),
239
+ isPending: X || re || oe || ne || J || $ || ie
233
240
  },
234
- children: /* @__PURE__ */ t(Ee, { ...O, children: /* @__PURE__ */ t(He, { onSubmit: de(ie), children: P || /* @__PURE__ */ B(le, { children: [
235
- /* @__PURE__ */ B(Ge, { gridTemplateColumns: "1fr", gap: 24, children: [
236
- /* @__PURE__ */ t(ve, {}),
237
- /* @__PURE__ */ t(ke, {}),
238
- /* @__PURE__ */ t(Re, {}),
241
+ children: /* @__PURE__ */ t(ge, { ...D, children: /* @__PURE__ */ t(xe, { onSubmit: ce(pe), children: b || /* @__PURE__ */ k(Ee, { children: [
242
+ /* @__PURE__ */ k(ze, { gridTemplateColumns: "1fr", gap: 24, children: [
243
+ /* @__PURE__ */ t(Ge, {}),
239
244
  /* @__PURE__ */ t(We, {}),
240
- /* @__PURE__ */ t(Ue, {})
245
+ /* @__PURE__ */ t(Te, {}),
246
+ /* @__PURE__ */ t(He, {}),
247
+ /* @__PURE__ */ t(Fe, {})
241
248
  ] }),
242
- /* @__PURE__ */ t(Le, {})
249
+ /* @__PURE__ */ t(Ue, {})
243
250
  ] }) }) })
244
251
  }
245
252
  ) });
246
- }, wr = () => {
247
- const { companyId: r, employeeId: i, onEvent: l, isAdmin: u, defaultValues: m, isSelfOnboardingEnabled: h } = ze();
253
+ }, Lr = () => {
254
+ const { companyId: r, employeeId: m, onEvent: p, isAdmin: y, defaultValues: l, isSelfOnboardingEnabled: u } = Xe();
248
255
  return /* @__PURE__ */ t(
249
- Ke,
256
+ $e,
250
257
  {
251
- companyId: je(r),
252
- employeeId: i,
253
- onEvent: l,
254
- isAdmin: u,
255
- defaultValues: m?.profile,
256
- isSelfOnboardingEnabled: h
258
+ companyId: Ze(r),
259
+ employeeId: m,
260
+ onEvent: p,
261
+ isAdmin: y,
262
+ defaultValues: l?.profile,
263
+ isSelfOnboardingEnabled: u
257
264
  }
258
265
  );
259
266
  };
260
267
  export {
261
- Ke as Profile,
262
- wr as ProfileContextual
268
+ $e as Profile,
269
+ Lr as ProfileContextual
263
270
  };
264
271
  //# sourceMappingURL=Profile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n inviteEmployeeDefault?: boolean\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation()\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : (defaultValues?.inviteEmployeeDefault ?? false)\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n // @ts-expect-error: Complex discriminated union schema causes type inference issues with zodResolver v5.2.1\n resolver: zodResolver(\n // @ts-expect-error: Zod discriminated union intersection incompatible with zodResolver v5.2.1\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n if (watchedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n isAdmin &&\n ((selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE))\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Grid gridTemplateColumns=\"1fr\" gap={24}>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n </Grid>\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","AdminSelfOnboardingPersonalDetailsSchema","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Grid","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFO,SAASA,GAAQC,GAA8C;AACpE,SACE,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAA,EAAkB,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,UACT,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CAErC;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AAC5F,QAAM;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAA;AAAA,EAAS,IACfC,GAAwB,EAAE,YAAAF,GAAY,GACpC;AAAA,IACJ,MAAM,EAAE,qBAAAG,EAAA;AAAA,EAAoB,IAC1BC,GAAgC,EAAE,YAAAJ,GAAY,GAC5C;AAAA,IACJ,MAAM,EAAE,2BAAAK,EAAA;AAAA,EAA0B,IAChCC,GAA6C,EAAE,YAAAN,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K,IACnC,UAAA;AAAA,UAAA,gBAAAnG,EAACoG,IAAA,EAAK;AAAA,4BACLC,IAAA,EAAqB;AAAA,4BACrBC,IAAA,EAAoB;AAAA,4BACpBC,IAAA,EAAY;AAAA,4BACZC,IAAA,CAAA,CAAY;AAAA,QAAA,GACf;AAAA,0BACCC,IAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEaC,KAAoB,MAAM;AACrC,QAAM,EAAE,WAAA1F,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,EAAA,IAC9D+F,GAAA;AAEF,SACE,gBAAA3G;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW8G,GAAe5F,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport {\n HomeAddress,\n HomeAddressSchema,\n HomeAddressSchemaWithCompletedOnboarding,\n type HomeAddressInputs,\n} from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n inviteEmployeeDefault?: boolean\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst checkHasCompletedSelfOnboarding = (employee?: Employee) => {\n return (\n employee?.onboarded ||\n employee?.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n employee?.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee?.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const [AddressSchema, setAddressSchema] = useState<\n typeof HomeAddressSchema | typeof HomeAddressSchemaWithCompletedOnboarding\n >(HomeAddressSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation()\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : (defaultValues?.inviteEmployeeDefault ?? false)\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n // @ts-expect-error: Complex discriminated union schema causes type inference issues with zodResolver v5.2.1\n resolver: zodResolver(\n // @ts-expect-error: Zod discriminated union intersection incompatible with zodResolver v5.2.1\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(AddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n const hasCompletedSelfOnboarding = checkHasCompletedSelfOnboarding(employee)\n\n if (watchedSelfOnboarding && !hasCompletedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n\n if (watchedSelfOnboarding && hasCompletedSelfOnboarding) {\n setAddressSchema(HomeAddressSchemaWithCompletedOnboarding)\n } else {\n setAddressSchema(HomeAddressSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin, employee?.onboardingStatus, employee?.onboarded])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n isAdmin &&\n ((selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE))\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n\n const hasCompletedSelfOnboarding = checkHasCompletedSelfOnboarding(\n mergedData.current.employee,\n )\n\n //create or update home address - only if not intended for self onboarding or after self onboarding is completed\n if (!isAdmin || !watchedSelfOnboarding || hasCompletedSelfOnboarding) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding || hasCompletedSelfOnboarding) {\n if ('street1' in payload && 'city' in payload && 'state' in payload && 'zip' in payload) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n hasCompletedSelfOnboarding: checkHasCompletedSelfOnboarding(mergedData.current.employee),\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Grid gridTemplateColumns=\"1fr\" gap={24}>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n </Grid>\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","checkHasCompletedSelfOnboarding","EmployeeOnboardingStatus","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","AddressSchema","setAddressSchema","HomeAddressSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","hasCompletedSelfOnboarding","AdminSelfOnboardingPersonalDetailsSchema","HomeAddressSchemaWithCompletedOnboarding","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Grid","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFO,SAASA,GAAQC,GAA8C;AACpE,SACE,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAA,EAAkB,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,UACT,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CAErC;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AAC5F,QAAM;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAA;AAAA,EAAS,IACfC,GAAwB,EAAE,YAAAF,GAAY,GACpC;AAAA,IACJ,MAAM,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,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -10,6 +10,7 @@ type ProfileContextType = {
10
10
  isAdmin: boolean;
11
11
  handleCancel: () => void;
12
12
  isSelfOnboardingEnabled: boolean;
13
+ hasCompletedSelfOnboarding: boolean;
13
14
  };
14
15
  declare const useProfile: () => ProfileContextType, ProfileProvider: import('react').Provider<ProfileContextType | null>;
15
16
  export { useProfile, ProfileProvider };
@@ -8,14 +8,12 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../Base/useBase.js";
10
10
  import "../../../shared/constants.js";
11
- import "classnames";
12
- import "dompurify";
13
- import "../../../contexts/LocaleProvider/useLocale.js";
14
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import "dompurify";
15
13
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
16
- const [u, a] = o("ProfileContext");
14
+ const [d, s] = o("ProfileContext");
17
15
  export {
18
- a as ProfileProvider,
19
- u as useProfile
16
+ s as ProfileProvider,
17
+ d as useProfile
20
18
  };
21
19
  //# sourceMappingURL=useProfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
1
+ {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n hasCompletedSelfOnboarding: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
@@ -1,14 +1,13 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
- import { useStateTaxes as r } from "./useStateTaxes.js";
4
- import "classnames";
5
- import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
3
+ import { useStateTaxes as s } from "./useStateTaxes.js";
4
+ import { ActionsLayout as r } from "../../Common/ActionsLayout/ActionsLayout.js";
6
5
  import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function d() {
8
- const { t: o } = i("Employee.StateTaxes"), { isPending: n } = r(), e = m();
9
- return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
6
+ function x() {
7
+ const { t: o } = i("Employee.StateTaxes"), { isPending: n } = s(), e = m();
8
+ return /* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(e.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
10
9
  }
11
10
  export {
12
- d as Actions
11
+ x as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map