@gusto/embedded-react-sdk 0.10.7-rc.2 → 0.11.0-rc.1

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 (135) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
  3. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  4. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  5. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  6. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  7. package/dist/components/Common/UI/Button/Button.js +4 -4
  8. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  9. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
  10. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
  11. package/dist/components/Company/AssignSignatory/AssignSignatory.js +39 -42
  12. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -53
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -42
  18. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  19. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  20. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  21. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  22. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  23. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  24. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  25. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  27. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  28. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  30. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  31. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  32. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  33. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +37 -41
  34. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  35. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  36. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  37. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  38. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  39. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +40 -44
  40. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  41. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  42. package/dist/components/Company/Industry/Industry.js +23 -29
  43. package/dist/components/Company/Industry/Industry.js.map +1 -1
  44. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  45. package/dist/components/Company/Locations/LocationForm/LocationForm.js +41 -44
  46. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  47. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  48. package/dist/components/Company/Locations/Locations.js +14 -18
  49. package/dist/components/Company/Locations/Locations.js.map +1 -1
  50. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  51. package/dist/components/Company/Locations/LocationsList/LocationsList.js +28 -31
  52. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  53. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  54. package/dist/components/Company/PaySchedule/PaySchedule.js +67 -71
  55. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  56. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  57. package/dist/components/Company/StateTaxes/StateTaxes.js +39 -22
  58. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  59. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +8 -6
  60. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +16 -15
  61. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  62. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  63. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  64. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  65. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  66. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  67. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  68. package/dist/components/Company/StateTaxes/stateTaxesReducer.d.ts +20 -0
  69. package/dist/components/Company/StateTaxes/stateTaxesReducer.js +40 -0
  70. package/dist/components/Company/StateTaxes/stateTaxesReducer.js.map +1 -0
  71. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  72. package/dist/components/Contractor/Address/Address.js +35 -38
  73. package/dist/components/Contractor/Address/Address.js.map +1 -1
  74. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  75. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  76. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  77. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  78. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  79. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  80. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  81. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  82. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  83. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  84. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  85. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  86. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  87. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  88. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  89. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  90. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  91. package/dist/components/Contractor/Submit/index.js +18 -0
  92. package/dist/components/Contractor/Submit/index.js.map +1 -0
  93. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  94. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  95. package/dist/components/Contractor/index.d.ts +2 -0
  96. package/dist/components/Contractor/index.js +10 -6
  97. package/dist/components/Contractor/index.js.map +1 -1
  98. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  99. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  100. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  101. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  102. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +25 -28
  103. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  104. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  105. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  106. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  107. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  108. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +40 -44
  109. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  110. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  111. package/dist/components/Employee/EmployeeList/EmployeeList.js +56 -59
  112. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  113. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  114. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  115. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  116. package/dist/components/Employee/Profile/Profile.js +131 -138
  117. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  118. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  119. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  120. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  121. package/dist/i18n/I18n.js +1 -1
  122. package/dist/i18n/I18n.js.map +1 -1
  123. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  124. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  125. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  126. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  127. package/dist/shared/constants.d.ts +14 -0
  128. package/dist/shared/constants.js +33 -26
  129. package/dist/shared/constants.js.map +1 -1
  130. package/dist/style.css +1 -1
  131. package/dist/types/i18next.d.ts +77 -1
  132. package/package.json +2 -2
  133. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +0 -5
  134. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +0 -48
  135. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +0 -1
@@ -1,78 +1,78 @@
1
- import { jsx as t, jsxs as fe, Fragment as Ee } from "react/jsx-runtime";
2
- import { zodResolver as he } from "@hookform/resolvers/zod";
3
- import { useState as De, useRef as Oe, useEffect as Se } from "react";
4
- import { useForm as Pe, useWatch as ge, FormProvider as be } from "react-hook-form";
5
- import { useLocationsGetSuspense as Ne } from "@gusto/embedded-api/react-query/locationsGet";
6
- import { useEmployeesCreateMutation as Ie } from "@gusto/embedded-api/react-query/employeesCreate";
7
- import { useEmployeesGetSuspense as _e } from "@gusto/embedded-api/react-query/employeesGet";
8
- import { useEmployeeAddressesGetSuspense as we } from "@gusto/embedded-api/react-query/employeeAddressesGet";
9
- import { useEmployeeAddressesCreateMutation as ke } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
10
- import { useEmployeeAddressesUpdateMutation as Me } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
11
- import { useEmployeeAddressesUpdateWorkAddressMutation as Be } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
12
- import { useEmployeesUpdateMutation as Re } from "@gusto/embedded-api/react-query/employeesUpdate";
13
- import { useEmployeeAddressesGetWorkAddressesSuspense as Le } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
14
- import { useEmployeeAddressesCreateWorkAddressMutation as ve } 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 L, AdminSelfOnboardingPersonalDetailsSchema as Ce, AdminPersonalDetails as W } from "./AdminPersonalDetails.js";
18
- import { SelfPersonalDetailsSchema as Ue, SelfPersonalDetails as C } from "./SelfPersonalDetails.js";
19
- import { Head as U } from "./Head.js";
20
- import { Actions as q } from "./Actions.js";
21
- import { HomeAddressSchema as qe, HomeAddress as T } from "./HomeAddress.js";
22
- import { WorkAddress as H } from "./WorkAddress.js";
23
- import { ProfileProvider as Te } from "./useProfile.js";
24
- import { getEmployeeAddressForProfile as He } from "./getEmployeeAddressForProfile.js";
1
+ import { jsx as t, jsxs as ae, 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 Ae, useWatch as fe, 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 B } from "@gusto/embedded-api/types/rfcdate";
16
+ import { useEmployeesUpdateOnboardingStatusMutation as we } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
17
+ import { AdminPersonalDetailsSchema as R, AdminSelfOnboardingPersonalDetailsSchema as Me, AdminPersonalDetails as ke } from "./AdminPersonalDetails.js";
18
+ import { SelfPersonalDetailsSchema as Be, SelfPersonalDetails as Re } from "./SelfPersonalDetails.js";
19
+ import { Head as Le } from "./Head.js";
20
+ import { Actions as ve } 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 qe } from "./useProfile.js";
24
+ import { getEmployeeAddressForProfile as Te } from "./getEmployeeAddressForProfile.js";
25
25
  import { Form as Ge } from "../../Common/Form/Form.js";
26
- import { BaseComponent as Fe } from "../../Base/Base.js";
27
- import { useBase as Ve } from "../../Base/useBase.js";
28
- import { useI18n as v, useComponentDictionary as Ye } from "../../../i18n/I18n.js";
29
- import { EmployeeOnboardingStatus as l, EmployeeSelfOnboardingStatuses as xe, componentEvents as d } from "../../../shared/constants.js";
30
- import { useFlow as ze } from "../../Flow/useFlow.js";
31
- import { ensureRequired as je } from "../../../helpers/ensureRequired.js";
32
- function i(r) {
33
- return /* @__PURE__ */ t(Fe, { ...r, children: r.employeeId ? /* @__PURE__ */ t(Ke, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(G, { ...r, children: r.children }) });
26
+ import { BaseComponent as He } from "../../Base/Base.js";
27
+ import { useBase as Fe } from "../../Base/useBase.js";
28
+ import { useI18n as L, useComponentDictionary as Ve } from "../../../i18n/I18n.js";
29
+ import { EmployeeOnboardingStatus as a, EmployeeSelfOnboardingStatuses as Ye, componentEvents as d } from "../../../shared/constants.js";
30
+ import { useFlow as xe } from "../../Flow/useFlow.js";
31
+ import { ensureRequired as ze } from "../../../helpers/ensureRequired.js";
32
+ function je(r) {
33
+ return /* @__PURE__ */ t(He, { ...r, children: r.employeeId ? /* @__PURE__ */ t(Ke, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(v, { ...r, children: r.children }) });
34
34
  }
35
- function Ke({ employeeId: r, ...a }) {
35
+ function Ke({ employeeId: r, ...i }) {
36
36
  const {
37
- data: { employee: u }
38
- } = _e({ employeeId: r }), {
39
- data: { employeeAddressList: c }
40
- } = we({ employeeId: r }), {
37
+ data: { employee: l }
38
+ } = Oe({ employeeId: r }), {
39
+ data: { employeeAddressList: u }
40
+ } = Se({ employeeId: r }), {
41
41
  data: { employeeWorkAddressesList: m }
42
- } = Le({ employeeId: r });
42
+ } = Ie({ employeeId: r });
43
43
  return /* @__PURE__ */ t(
44
- G,
44
+ v,
45
45
  {
46
- ...a,
47
- employee: u,
48
- homeAddresses: c,
46
+ ...i,
47
+ employee: l,
48
+ homeAddresses: u,
49
49
  workAddresses: m
50
50
  }
51
51
  );
52
52
  }
53
- const G = ({
53
+ const v = ({
54
54
  isAdmin: r = !1,
55
- isSelfOnboardingEnabled: a = !0,
56
- dictionary: u,
57
- ...c
55
+ isSelfOnboardingEnabled: i = !0,
56
+ dictionary: l,
57
+ ...u
58
58
  }) => {
59
- v("Employee.Profile"), v("Employee.HomeAddress"), Ye("Employee.Profile", u);
59
+ L("Employee.Profile"), L("Employee.HomeAddress"), Ve("Employee.Profile", l);
60
60
  const {
61
61
  companyId: m,
62
- employee: D,
63
- homeAddresses: F,
62
+ employee: h,
63
+ homeAddresses: C,
64
64
  workAddresses: g,
65
- children: b,
66
- className: V = "",
65
+ children: P,
66
+ className: W = "",
67
67
  defaultValues: s
68
- } = c, { onEvent: n, baseSubmitHandler: Y } = Ve(), [x, N] = De(L), { data: z } = Ne({ companyId: m }), j = z.locationList, { mutateAsync: K, isPending: J } = Ie(), { mutateAsync: Q, isPending: X } = Re(), { mutateAsync: Z, isPending: $ } = ve(), { mutateAsync: ee, isPending: re } = Be(), { mutateAsync: te, isPending: oe } = ke(), { mutateAsync: se, isPending: ne } = Me(), {
69
- mutateAsync: de,
70
- isPending: ie
71
- } = We(), I = { employee: D, workAddresses: g }, ae = He(F), me = I.workAddresses?.find((P) => P.active), e = Oe({
72
- employee: I.employee,
73
- homeAddress: ae,
74
- workAddress: me
75
- }), O = {
68
+ } = u, { onEvent: n, baseSubmitHandler: U } = Fe(), [q, b] = ce(R), { data: T } = he({ companyId: m }), G = T.locationList, { mutateAsync: H, isPending: F } = De(), { mutateAsync: V, isPending: Y } = Ne(), { mutateAsync: x, isPending: z } = _e(), { mutateAsync: j, isPending: K } = be(), { mutateAsync: J, isPending: Q } = ge(), { mutateAsync: X, isPending: Z } = Pe(), {
69
+ mutateAsync: $,
70
+ isPending: ee
71
+ } = we(), N = { employee: h, workAddresses: g }, re = Te(C), te = N.workAddresses?.find((S) => S.active), e = pe({
72
+ employee: N.employee,
73
+ homeAddress: re,
74
+ workAddress: te
75
+ }), D = {
76
76
  firstName: e.current.employee?.firstName ?? s?.employee?.firstName ?? "",
77
77
  middleInitial: e.current.employee?.middleInitial ?? s?.employee?.middleInitial ?? "",
78
78
  lastName: e.current.employee?.lastName ?? s?.employee?.lastName ?? "",
@@ -87,60 +87,60 @@ const G = ({
87
87
  zip: e.current.homeAddress?.zip ?? s?.homeAddress?.zip ?? "",
88
88
  state: e.current.homeAddress?.state ?? s?.homeAddress?.state ?? "",
89
89
  courtesyWithholding: e.current.homeAddress?.courtesyWithholding ?? !1
90
- }, le = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === l.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== l.ADMIN_ONBOARDING_INCOMPLETE ? { ...O, enableSsn: !1, selfOnboarding: !0 } : {
91
- ...O,
92
- selfOnboarding: a && e.current.employee?.onboardingStatus ? (
90
+ }, oe = 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 } : {
91
+ ...D,
92
+ selfOnboarding: i && e.current.employee?.onboardingStatus ? (
93
93
  // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
94
- xe.has(e.current.employee.onboarding_status)
94
+ Ye.has(e.current.employee.onboarding_status)
95
95
  ) : !1,
96
96
  enableSsn: !e.current.employee?.hasSsn,
97
97
  ssn: ""
98
- }, ue = {
99
- ...O,
98
+ }, se = {
99
+ ...D,
100
100
  enableSsn: !e.current.employee?.hasSsn,
101
101
  ssn: ""
102
- }, S = Pe({
103
- resolver: he(
104
- (r ? x : Ue).and(qe)
102
+ }, O = Ae({
103
+ resolver: ue(
104
+ (r ? q : Be).and(Ce)
105
105
  ),
106
- defaultValues: r ? le : ue
107
- }), { handleSubmit: ce } = S, A = ge({ control: S.control, name: "selfOnboarding" });
108
- Se(() => {
109
- r && N(A ? Ce : L);
110
- }, [A, r]);
111
- const pe = async (P) => {
112
- await Y(P, async (f) => {
113
- const { workAddress: _, startDate: Ae, selfOnboarding: E, ...h } = f;
106
+ defaultValues: r ? oe : se
107
+ }), { handleSubmit: ne } = O, y = fe({ control: O.control, name: "selfOnboarding" });
108
+ ye(() => {
109
+ r && b(y ? Me : R);
110
+ }, [y, r]);
111
+ const de = async (S) => {
112
+ await U(S, async (A) => {
113
+ const { workAddress: I, startDate: me, selfOnboarding: f, ...E } = A;
114
114
  if (e.current.employee) {
115
- if (E && e.current.employee.onboardingStatus === l.ADMIN_ONBOARDING_INCOMPLETE || !E && e.current.employee.onboardingStatus === l.SELF_ONBOARDING_PENDING_INVITE) {
116
- const { employeeOnboardingStatus: p } = await de({
115
+ if (f && e.current.employee.onboardingStatus === a.ADMIN_ONBOARDING_INCOMPLETE || !f && e.current.employee.onboardingStatus === a.SELF_ONBOARDING_PENDING_INVITE) {
116
+ const { employeeOnboardingStatus: c } = await $({
117
117
  request: {
118
118
  employeeId: e.current.employee.uuid,
119
119
  requestBody: {
120
- onboardingStatus: E ? l.SELF_ONBOARDING_PENDING_INVITE : l.ADMIN_ONBOARDING_INCOMPLETE
120
+ onboardingStatus: f ? a.SELF_ONBOARDING_PENDING_INVITE : a.ADMIN_ONBOARDING_INCOMPLETE
121
121
  }
122
122
  }
123
123
  });
124
124
  e.current.employee = {
125
125
  ...e.current.employee,
126
- onboardingStatus: p.onboardingStatus
127
- }, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, p);
126
+ onboardingStatus: c.onboardingStatus
127
+ }, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, c);
128
128
  }
129
- const { employee: o } = await Q({
129
+ const { employee: o } = await V({
130
130
  request: {
131
131
  employeeId: e.current.employee.uuid,
132
- requestBody: { ...h, version: e.current.employee.version }
132
+ requestBody: { ...E, version: e.current.employee.version }
133
133
  }
134
134
  });
135
135
  e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_UPDATED, o);
136
136
  } else {
137
- const { employee: o } = await K({
137
+ const { employee: o } = await H({
138
138
  request: {
139
139
  companyId: m,
140
140
  requestBody: {
141
- ...h,
142
- selfOnboarding: E,
143
- dateOfBirth: h.dateOfBirth ? new R(h.dateOfBirth) : void 0
141
+ ...E,
142
+ selfOnboarding: f,
143
+ dateOfBirth: E.dateOfBirth ? new B(E.dateOfBirth) : void 0
144
144
  }
145
145
  }
146
146
  });
@@ -148,60 +148,60 @@ const G = ({
148
148
  }
149
149
  if (typeof e.current.employee?.uuid != "string")
150
150
  throw new Error("Employee id is not available");
151
- if ((!A || !r) && !f.selfOnboarding) {
152
- const { street1: o, street2: p, city: w, state: k, zip: M, courtesyWithholding: B } = f;
151
+ if ((!y || !r) && !A.selfOnboarding) {
152
+ const { street1: o, street2: c, city: _, state: w, zip: M, courtesyWithholding: k } = A;
153
153
  if (e.current.homeAddress) {
154
- const { employeeAddress: y } = await se({
154
+ const { employeeAddress: p } = await X({
155
155
  request: {
156
156
  homeAddressUuid: e.current.homeAddress.uuid,
157
157
  requestBody: {
158
158
  version: e.current.homeAddress.version,
159
159
  street1: o,
160
- street2: p,
161
- city: w,
162
- state: k,
160
+ street2: c,
161
+ city: _,
162
+ state: w,
163
163
  zip: M,
164
- courtesyWithholding: B
164
+ courtesyWithholding: k
165
165
  }
166
166
  }
167
167
  });
168
- e.current = { ...e.current, homeAddress: y }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, y);
168
+ e.current = { ...e.current, homeAddress: p }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, p);
169
169
  } else {
170
- const { employeeAddress: y } = await te({
170
+ const { employeeAddress: p } = await J({
171
171
  request: {
172
172
  employeeId: e.current.employee.uuid,
173
173
  requestBody: {
174
174
  street1: o,
175
- street2: p,
176
- city: w,
177
- state: k,
175
+ street2: c,
176
+ city: _,
177
+ state: w,
178
178
  zip: M,
179
- courtesyWithholding: B
179
+ courtesyWithholding: k
180
180
  }
181
181
  }
182
182
  });
183
- e.current = { ...e.current, homeAddress: y }, n(d.EMPLOYEE_HOME_ADDRESS_CREATED, y);
183
+ e.current = { ...e.current, homeAddress: p }, n(d.EMPLOYEE_HOME_ADDRESS_CREATED, p);
184
184
  }
185
185
  }
186
186
  if (r)
187
187
  if (e.current.workAddress) {
188
- const { employeeWorkAddress: o } = await ee({
188
+ const { employeeWorkAddress: o } = await j({
189
189
  request: {
190
190
  workAddressUuid: e.current.workAddress.uuid,
191
191
  requestBody: {
192
192
  version: e.current.workAddress.version,
193
- locationUuid: _
193
+ locationUuid: I
194
194
  }
195
195
  }
196
196
  });
197
197
  e.current = { ...e.current, workAddress: o }, n(d.EMPLOYEE_WORK_ADDRESS_UPDATED, o);
198
198
  } else {
199
- const { employeeWorkAddress: o } = await Z({
199
+ const { employeeWorkAddress: o } = await x({
200
200
  request: {
201
201
  employeeId: e.current.employee?.uuid,
202
202
  requestBody: {
203
- locationUuid: _,
204
- effectiveDate: new R(f.startDate || /* @__PURE__ */ new Date())
203
+ locationUuid: I,
204
+ effectiveDate: new B(A.startDate || /* @__PURE__ */ new Date())
205
205
  }
206
206
  }
207
207
  });
@@ -209,58 +209,51 @@ const G = ({
209
209
  }
210
210
  n(d.EMPLOYEE_PROFILE_DONE, {
211
211
  ...e.current.employee,
212
- startDate: Ae
212
+ startDate: me
213
213
  });
214
214
  });
215
- }, ye = () => {
215
+ }, ie = () => {
216
216
  n(d.CANCEL);
217
217
  };
218
- return /* @__PURE__ */ t("section", { className: V, children: /* @__PURE__ */ t(
219
- Te,
218
+ return /* @__PURE__ */ t("section", { className: W, children: /* @__PURE__ */ t(
219
+ qe,
220
220
  {
221
221
  value: {
222
- companyLocations: j,
222
+ companyLocations: G,
223
223
  workAddresses: g,
224
224
  employee: e.current.employee ?? void 0,
225
- isSelfOnboardingIntended: A,
226
- handleCancel: ye,
225
+ isSelfOnboardingIntended: y,
226
+ handleCancel: ie,
227
227
  isAdmin: r,
228
- isSelfOnboardingEnabled: a,
229
- isPending: X || re || oe || ne || J || $ || ie
228
+ isSelfOnboardingEnabled: i,
229
+ isPending: Y || K || Q || Z || F || z || ee
230
230
  },
231
- children: /* @__PURE__ */ t(be, { ...S, children: /* @__PURE__ */ t(Ge, { onSubmit: ce(pe), children: b || /* @__PURE__ */ fe(Ee, { children: [
232
- /* @__PURE__ */ t(U, {}),
233
- /* @__PURE__ */ t(W, {}),
234
- /* @__PURE__ */ t(C, {}),
235
- /* @__PURE__ */ t(T, {}),
236
- /* @__PURE__ */ t(H, {}),
237
- /* @__PURE__ */ t(q, {})
231
+ children: /* @__PURE__ */ t(Ee, { ...O, children: /* @__PURE__ */ t(Ge, { onSubmit: ne(de), children: P || /* @__PURE__ */ ae(le, { children: [
232
+ /* @__PURE__ */ t(Le, {}),
233
+ /* @__PURE__ */ t(ke, {}),
234
+ /* @__PURE__ */ t(Re, {}),
235
+ /* @__PURE__ */ t(We, {}),
236
+ /* @__PURE__ */ t(Ue, {}),
237
+ /* @__PURE__ */ t(ve, {})
238
238
  ] }) }) })
239
239
  }
240
240
  ) });
241
- };
242
- i.Head = U;
243
- i.Actions = q;
244
- i.AdminPersonalDetails = W;
245
- i.SelfPersonalDetails = C;
246
- i.HomeAddress = T;
247
- i.WorkAddress = H;
248
- const Ir = () => {
249
- const { companyId: r, employeeId: a, onEvent: u, isAdmin: c, defaultValues: m, isSelfOnboardingEnabled: D } = ze();
241
+ }, Ir = () => {
242
+ const { companyId: r, employeeId: i, onEvent: l, isAdmin: u, defaultValues: m, isSelfOnboardingEnabled: h } = xe();
250
243
  return /* @__PURE__ */ t(
251
- i,
244
+ je,
252
245
  {
253
- companyId: je(r),
254
- employeeId: a,
255
- onEvent: u,
256
- isAdmin: c,
246
+ companyId: ze(r),
247
+ employeeId: i,
248
+ onEvent: l,
249
+ isAdmin: u,
257
250
  defaultValues: m?.profile,
258
- isSelfOnboardingEnabled: D
251
+ isSelfOnboardingEnabled: h
259
252
  }
260
253
  );
261
254
  };
262
255
  export {
263
- i as Profile,
256
+ je as Profile,
264
257
  Ir as ProfileContextual
265
258
  };
266
259
  //# 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/OnboardingFlow'\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 { 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}>\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 : 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 resolver: zodResolver(\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 (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 <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nProfile.Head = Head\nProfile.Actions = Actions\nProfile.AdminPersonalDetails = AdminPersonalDetails\nProfile.SelfPersonalDetails = SelfPersonalDetails\nProfile.HomeAddress = HomeAddress\nProfile.WorkAddress = WorkAddress\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","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFO,SAASA,EAAQC,GAA8C;AAElE,SAAA,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAkB,EAAA,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,SACT,CAAA,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAMA,EAAA,SAAA,CAAS,EAErC,CAAA;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AACtF,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAS;AAAA,EAAA,IACfC,GAAwB,EAAE,YAAAF,GAAY,GACpC;AAAA,IACJ,MAAM,EAAE,qBAAAG,EAAoB;AAAA,EAAA,IAC1BC,GAAgC,EAAE,YAAAJ,GAAY,GAC5C;AAAA,IACJ,MAAM,EAAE,2BAAAK,EAA0B;AAAA,EAAA,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B,EAAA;AAAA,0BACrBC,GAAoB,EAAA;AAAA,0BACpBC,GAAY,EAAA;AAAA,0BACZC,GAAY,EAAA;AAAA,0BACZC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA1G,EAAQ,OAAOqG;AACfrG,EAAQ,UAAU0G;AAClB1G,EAAQ,uBAAuBsG;AAC/BtG,EAAQ,sBAAsBuG;AAC9BvG,EAAQ,cAAcwG;AACtBxG,EAAQ,cAAcyG;AAEf,MAAME,KAAoB,MAAM;AAC/B,QAAA,EAAE,WAAAzF,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,MAC9D8F,GAAoC;AAGpC,SAAA,gBAAA1G;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW6G,GAAe3F,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
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/OnboardingFlow'\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 { 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}>\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 : 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 resolver: zodResolver(\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 (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 <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\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","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFO,SAASA,GAAQC,GAA8C;AAElE,SAAA,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAkB,EAAA,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,SACT,CAAA,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAMA,EAAA,SAAA,CAAS,EAErC,CAAA;AAEJ;AAGA,SA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,WACEwB,KACAM,KACAG,KACAG,KACAf,KACAM,KACAY;AAAA,MACJ;AAAA,MAEA,UAAC,gBAAAnD,EAAA+F,IAAA,EAAc,GAAG9B,GAChB,UAAC,gBAAAjE,EAAAgG,IAAA,EAAK,UAAU1B,GAAaK,EAAQ,GAClC,UACCxD,KAGE,gBAAA8E,GAAAC,IAAA,EAAA,UAAA;AAAA,QAAA,gBAAAlG,EAACmG,IAAK,EAAA;AAAA,0BACLC,IAAqB,EAAA;AAAA,0BACrBC,IAAoB,EAAA;AAAA,0BACpBC,IAAY,EAAA;AAAA,0BACZC,IAAY,EAAA;AAAA,0BACZC,IAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEaC,KAAoB,MAAM;AAC/B,QAAA,EAAE,WAAAzF,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,MAC9D8F,GAAoC;AAGpC,SAAA,gBAAA1G;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW6G,GAAe3F,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -4,11 +4,5 @@ interface TaxesProps extends CommonComponentInterface<'Employee.Taxes'> {
4
4
  isAdmin?: boolean;
5
5
  }
6
6
  export declare function Taxes(props: TaxesProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
7
- export declare namespace Taxes {
8
- var FederalHead: typeof import("./FederalHead").FederalHead;
9
- var FederalForm: typeof import("./FederalForm").FederalForm;
10
- var StateForm: () => (import("react/jsx-runtime").JSX.Element | null)[];
11
- var Actions: () => import("react/jsx-runtime").JSX.Element;
12
- }
13
7
  export declare const TaxesContextual: () => import("react/jsx-runtime").JSX.Element;
14
8
  export {};