@gusto/embedded-react-sdk 0.55.1 → 0.55.2

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 (131) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  3. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  4. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  5. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  6. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  7. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  8. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  9. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  10. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  11. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  12. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  13. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  14. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  15. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  16. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  17. package/dist/components/Company/Industry/Context.js +7 -6
  18. package/dist/components/Company/Industry/Context.js.map +1 -1
  19. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  20. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  21. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  22. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  23. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  24. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  25. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  26. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  27. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  28. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  29. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -3
  30. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  31. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  32. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  33. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
  34. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
  35. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
  36. package/dist/components/Flow/Flow.js +1 -1
  37. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
  38. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  39. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +7 -0
  40. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +191 -153
  41. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  42. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +1 -0
  43. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +87 -81
  44. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  45. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +1 -0
  46. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  47. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +73 -48
  48. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  49. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  50. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +22 -20
  51. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  52. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
  53. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -20
  54. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  55. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -0
  56. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +34 -26
  57. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  58. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +4 -0
  59. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -43
  60. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  61. package/dist/components/Payroll/PayrollList/PayrollList.d.ts +2 -0
  62. package/dist/components/Payroll/PayrollList/PayrollList.js +48 -47
  63. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  64. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
  65. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +44 -43
  66. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  67. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +7 -0
  68. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +115 -112
  69. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  70. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  71. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +94 -103
  72. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  73. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +22 -16
  74. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  75. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +58 -49
  76. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  77. package/dist/components/Payroll/PrintChecks/PrintChecks.d.ts +21 -0
  78. package/dist/components/Payroll/PrintChecks/PrintChecks.js +68 -0
  79. package/dist/components/Payroll/PrintChecks/PrintChecks.js.map +1 -0
  80. package/dist/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.d.ts +9 -0
  81. package/dist/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.js +34 -0
  82. package/dist/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.js.map +1 -0
  83. package/dist/components/Payroll/PrintChecks/PrintChecksBanner/index.d.ts +1 -0
  84. package/dist/components/Payroll/PrintChecks/PrintChecksComponents.d.ts +48 -0
  85. package/dist/components/Payroll/PrintChecks/PrintChecksComponents.js +26 -0
  86. package/dist/components/Payroll/PrintChecks/PrintChecksComponents.js.map +1 -0
  87. package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.d.ts +14 -0
  88. package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js +47 -0
  89. package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js.map +1 -0
  90. package/dist/components/Payroll/PrintChecks/PrintChecksFailure/index.d.ts +1 -0
  91. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.d.ts +16 -0
  92. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js +144 -0
  93. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js.map +1 -0
  94. package/dist/components/Payroll/PrintChecks/PrintChecksForm/index.d.ts +1 -0
  95. package/dist/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.d.ts +14 -0
  96. package/dist/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.js +39 -0
  97. package/dist/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.js.map +1 -0
  98. package/dist/components/Payroll/PrintChecks/PrintChecksSummary/index.d.ts +1 -0
  99. package/dist/components/Payroll/PrintChecks/index.d.ts +2 -0
  100. package/dist/components/Payroll/PrintChecks/printChecksStateMachine.d.ts +33 -0
  101. package/dist/components/Payroll/PrintChecks/printChecksStateMachine.js +93 -0
  102. package/dist/components/Payroll/PrintChecks/printChecksStateMachine.js.map +1 -0
  103. package/dist/components/Payroll/PrintChecks/types.d.ts +14 -0
  104. package/dist/components/Payroll/index.d.ts +2 -0
  105. package/dist/components/Payroll/index.js +26 -24
  106. package/dist/components/Payroll/index.js.map +1 -1
  107. package/dist/components/Payroll/usePreparedPayrollData.js +9 -8
  108. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  109. package/dist/i18n/I18n.js +4 -0
  110. package/dist/i18n/I18n.js.map +1 -1
  111. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +9 -9
  112. package/dist/i18n/en/Payroll.PayrollOverview.json.js +38 -38
  113. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +2 -2
  114. package/dist/i18n/en/Payroll.PrintChecksBanner.json.js +14 -0
  115. package/dist/i18n/en/Payroll.PrintChecksBanner.json.js.map +1 -0
  116. package/dist/i18n/en/Payroll.PrintChecksFailure.json.js +12 -0
  117. package/dist/i18n/en/Payroll.PrintChecksFailure.json.js.map +1 -0
  118. package/dist/i18n/en/Payroll.PrintChecksForm.json.js +28 -0
  119. package/dist/i18n/en/Payroll.PrintChecksForm.json.js.map +1 -0
  120. package/dist/i18n/en/Payroll.PrintChecksSummary.json.js +14 -0
  121. package/dist/i18n/en/Payroll.PrintChecksSummary.json.js.map +1 -0
  122. package/dist/i18n/types.d.ts +65 -7
  123. package/dist/models/external.d.ts +3 -0
  124. package/dist/partner-hook-utils/form/buildFormSchema.js +60 -54
  125. package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -1
  126. package/dist/shared/constants.d.ts +28 -0
  127. package/dist/shared/constants.js +61 -50
  128. package/dist/shared/constants.js.map +1 -1
  129. package/dist/style.css +1 -1
  130. package/docs/guides/endpoint-inventory.json +26 -0
  131. package/package.json +2 -2
@@ -1,9 +1,9 @@
1
- import { state as l, transition as t, reduce as r, guard as y } from "robot3";
2
- import { PayrollOverviewContextual as c, PayrollConfigurationContextual as d, PayrollReceiptsContextual as u, PayrollEditEmployeeContextual as P, PayrollBlockerContextual as b } from "../PayrollFlow/PayrollFlowComponents.js";
1
+ import { state as n, transition as r, reduce as t, guard as P } from "robot3";
2
+ import { PayrollOverviewContextual as c, PayrollConfigurationContextual as d, PayrollReceiptsContextual as u, PayrollEditEmployeeContextual as b, PayrollBlockerContextual as f } from "../PayrollFlow/PayrollFlowComponents.js";
3
3
  import { componentEvents as i } from "../../../shared/constants.js";
4
- import { updateBreadcrumbs as n, patchBreadcrumbsHeader as p, hideBreadcrumb as f } from "../../../helpers/breadcrumbHelpers.js";
5
- import { createBreadcrumbNavigateTransition as g } from "../../Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js";
6
- const s = g(), S = (e = !1) => ({
4
+ import { updateBreadcrumbs as l, patchBreadcrumbsHeader as p, hideBreadcrumb as g } from "../../../helpers/breadcrumbHelpers.js";
5
+ import { createBreadcrumbNavigateTransition as L } from "../../Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js";
6
+ const s = L(), B = (e = !1) => ({
7
7
  configuration: {
8
8
  parent: null,
9
9
  item: {
@@ -11,7 +11,7 @@ const s = g(), S = (e = !1) => ({
11
11
  label: e ? "breadcrumbLabelDismissal" : "breadcrumbLabel",
12
12
  namespace: "Payroll.PayrollConfiguration",
13
13
  onNavigate: ((o) => ({
14
- ...n("configuration", o, {
14
+ ...l("configuration", o, {
15
15
  startDate: o.payPeriod?.startDate ?? "",
16
16
  endDate: o.payPeriod?.endDate ?? ""
17
17
  }),
@@ -27,7 +27,7 @@ const s = g(), S = (e = !1) => ({
27
27
  label: "breadcrumbLabel",
28
28
  namespace: "Payroll.PayrollOverview",
29
29
  onNavigate: ((o) => ({
30
- ...n("overview", o, {
30
+ ...l("overview", o, {
31
31
  startDate: o.payPeriod?.startDate ?? "",
32
32
  endDate: o.payPeriod?.endDate ?? ""
33
33
  }),
@@ -60,12 +60,12 @@ const s = g(), S = (e = !1) => ({
60
60
  namespace: "Payroll.PayrollBlocker"
61
61
  }
62
62
  }
63
- }), L = t(
63
+ }), v = r(
64
64
  i.RUN_PAYROLL_CALCULATED,
65
65
  "overview",
66
- r(
66
+ t(
67
67
  (e, a) => ({
68
- ...n("overview", e, {
68
+ ...l("overview", e, {
69
69
  startDate: a.payload.payPeriod?.startDate ?? "",
70
70
  endDate: a.payload.payPeriod?.endDate ?? ""
71
71
  }),
@@ -81,37 +81,61 @@ const s = g(), S = (e = !1) => ({
81
81
  }
82
82
  })
83
83
  )
84
- ), E = t(
84
+ ), D = r(
85
+ i.RUN_PAYROLL_ALREADY_PROCESSED,
86
+ "overview",
87
+ t(
88
+ (e, a) => {
89
+ const o = a.payload.payPeriod ?? e.payPeriod;
90
+ return {
91
+ ...l("overview", e, {
92
+ startDate: o?.startDate ?? "",
93
+ endDate: o?.endDate ?? ""
94
+ }),
95
+ component: c,
96
+ payPeriod: o,
97
+ alerts: a.payload.alert ? [
98
+ ...(e.alerts ?? []).filter((m) => m.alertKey !== "alreadyProcessed"),
99
+ { ...a.payload.alert, alertKey: "alreadyProcessed" }
100
+ ] : e.alerts,
101
+ ctaConfig: {
102
+ labelKey: "exitFlowCta",
103
+ namespace: "Payroll.PayrollOverview"
104
+ }
105
+ };
106
+ }
107
+ )
108
+ ), E = r(
85
109
  i.RUN_PAYROLL_EMPLOYEE_EDIT,
86
110
  "editEmployee",
87
- r(
111
+ t(
88
112
  (e, a) => ({
89
- ...n("editEmployee", e, {
113
+ ...l("editEmployee", e, {
90
114
  firstName: a.payload.firstName,
91
115
  lastName: a.payload.lastName,
92
116
  startDate: e.payPeriod?.startDate ?? "",
93
117
  endDate: e.payPeriod?.endDate ?? ""
94
118
  }),
95
- component: P,
119
+ component: b,
96
120
  employeeId: a.payload.employeeId,
97
121
  firstName: a.payload.firstName,
98
122
  lastName: a.payload.lastName,
99
123
  ctaConfig: null
100
124
  })
101
125
  )
102
- ), v = t(
126
+ ), C = r(
103
127
  i.RUN_PAYROLL_BLOCKERS_VIEW_ALL,
104
128
  "blockers",
105
- r((e) => ({
106
- ...n("blockers", e),
107
- component: b
129
+ t((e) => ({
130
+ ...l("blockers", e),
131
+ component: f
108
132
  }))
109
- ), m = (e) => !e.hasPayrollSubmissionStarted, D = t(
133
+ ), y = (e) => !e.hasPayrollSubmissionStarted, N = r(
110
134
  i.RUN_PAYROLL_EDIT,
111
135
  "configuration",
112
- y(m),
113
- r((e) => ({
114
- ...n("configuration", e, {
136
+ P(y),
137
+ t((e) => ({
138
+ ...l("configuration", e, {
115
139
  startDate: e.payPeriod?.startDate ?? "",
116
140
  endDate: e.payPeriod?.endDate ?? ""
117
141
  }),
@@ -122,18 +146,18 @@ const s = g(), S = (e = !1) => ({
122
146
  namespace: "Payroll.PayrollConfiguration"
123
147
  }
124
148
  }))
125
- ), C = t(
149
+ ), R = r(
126
150
  i.RUN_PAYROLL_SUBMITTING,
127
151
  "overview",
128
- r((e) => ({
129
- ...f("configuration", e),
152
+ t((e) => ({
153
+ ...g("configuration", e),
130
154
  hasPayrollSubmissionStarted: !0
131
155
  }))
132
- ), N = t(
156
+ ), _ = r(
133
157
  i.RUN_PAYROLL_RECEIPT_GET,
134
158
  "receipts",
135
- r((e) => ({
136
- ...n("receipts", e, {
159
+ t((e) => ({
160
+ ...l("receipts", e, {
137
161
  startDate: e.payPeriod?.startDate ?? "",
138
162
  endDate: e.payPeriod?.endDate ?? ""
139
163
  }),
@@ -144,10 +168,10 @@ const s = g(), S = (e = !1) => ({
144
168
  namespace: "Payroll.PayrollReceipts"
145
169
  }
146
170
  }))
147
- ), _ = t(
171
+ ), w = r(
148
172
  i.RUN_PAYROLL_EMPLOYEE_SAVED,
149
173
  "configuration",
150
- r((e) => ({
174
+ t((e) => ({
151
175
  ...p(e, { currentBreadcrumbId: "configuration" }),
152
176
  component: d,
153
177
  employeeId: void 0,
@@ -158,10 +182,10 @@ const s = g(), S = (e = !1) => ({
158
182
  namespace: "Payroll.PayrollConfiguration"
159
183
  }
160
184
  }))
161
- ), R = t(
185
+ ), O = r(
162
186
  i.RUN_PAYROLL_EMPLOYEE_CANCELLED,
163
187
  "configuration",
164
- r((e) => ({
188
+ t((e) => ({
165
189
  ...p(e, { currentBreadcrumbId: "configuration" }),
166
190
  component: d,
167
191
  employeeId: void 0,
@@ -172,29 +196,30 @@ const s = g(), S = (e = !1) => ({
172
196
  namespace: "Payroll.PayrollConfiguration"
173
197
  }
174
198
  }))
175
- ), B = {
176
- configuration: l(
199
+ ), K = {
200
+ configuration: n(
177
201
  s("configuration"),
178
- L,
202
+ v,
203
+ D,
179
204
  E,
180
- v
205
+ C
181
206
  ),
182
- overview: l(
183
- s("configuration", m),
184
- C,
185
- D,
186
- N
207
+ overview: n(
208
+ s("configuration", y),
209
+ R,
210
+ N,
211
+ _
187
212
  ),
188
- editEmployee: l(
213
+ editEmployee: n(
189
214
  s("configuration"),
190
- _,
191
- R
215
+ w,
216
+ O
192
217
  ),
193
- receipts: l(s("configuration")),
194
- blockers: l(s("configuration"))
218
+ receipts: n(s("configuration")),
219
+ blockers: n(s("configuration"))
195
220
  };
196
221
  export {
197
- S as getPayrollExecutionBreadcrumbsNodes,
198
- B as payrollExecutionMachine
222
+ B as getPayrollExecutionBreadcrumbsNodes,
223
+ K as payrollExecutionMachine
199
224
  };
200
225
  //# sourceMappingURL=payrollExecutionMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payrollExecutionMachine.js","sources":["../../../../src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.ts"],"sourcesContent":["import { transition, reduce, state, guard } from 'robot3'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport {\n PayrollConfigurationContextual,\n PayrollOverviewContextual,\n PayrollEditEmployeeContextual,\n PayrollReceiptsContextual,\n PayrollBlockerContextual,\n type PayrollFlowContextInterface,\n} from '../PayrollFlow/PayrollFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport {\n hideBreadcrumb,\n patchBreadcrumbsHeader,\n updateBreadcrumbs,\n} from '@/helpers/breadcrumbHelpers'\nimport type {\n BreadcrumbNode,\n BreadcrumbNodes,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { createBreadcrumbNavigateTransition } from '@/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers'\n\ntype PayrollEventPayloads = {\n [componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT]: {\n employeeId: string\n firstName: string\n lastName: string\n }\n [componentEvents.RUN_PAYROLL_CALCULATED]: {\n payrollUuid: string\n alert?: PayrollFlowAlert\n payPeriod?: PayrollPayPeriodType\n }\n [componentEvents.BREADCRUMB_NAVIGATE]: {\n key: string\n onNavigate: (ctx: PayrollFlowContextInterface) => PayrollFlowContextInterface\n }\n [componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL]: undefined\n [componentEvents.RUN_PAYROLL_EDIT]: undefined\n}\n\nconst breadcrumbNavigateTransition =\n createBreadcrumbNavigateTransition<PayrollFlowContextInterface>()\n\ntype BreadcrumbNodeKeys = 'configuration' | 'overview' | 'editEmployee' | 'receipts' | 'blockers'\n\n/** @internal */\nexport const getPayrollExecutionBreadcrumbsNodes = (\n isDismissal: boolean = false,\n): BreadcrumbNodes => {\n const configLabel = isDismissal ? 'breadcrumbLabelDismissal' : 'breadcrumbLabel'\n\n return {\n configuration: {\n parent: null,\n item: {\n id: 'configuration',\n label: configLabel,\n namespace: 'Payroll.PayrollConfiguration',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n overview: {\n parent: 'configuration',\n item: {\n id: 'overview',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollOverview',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n editEmployee: {\n parent: 'configuration',\n item: {\n id: 'editEmployee',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollEditEmployee',\n },\n },\n receipts: {\n parent: 'overview',\n item: {\n id: 'receipts',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollReceipts',\n },\n },\n blockers: {\n parent: 'configuration',\n item: {\n id: 'blockers',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollBlocker',\n },\n },\n } satisfies Record<BreadcrumbNodeKeys, BreadcrumbNode>\n}\n\nconst calculatedTransition = transition(\n componentEvents.RUN_PAYROLL_CALCULATED,\n 'overview',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_CALCULATED>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ev.payload.payPeriod?.startDate ?? '',\n endDate: ev.payload.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n payPeriod: ev.payload.payPeriod ?? ctx.payPeriod,\n alerts: ev.payload.alert\n ? [\n ...(ctx.alerts ?? []).filter(a => a.alertKey !== 'progressSaved'),\n { ...ev.payload.alert, alertKey: 'progressSaved' as const },\n ]\n : ctx.alerts,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollOverview',\n },\n }\n },\n ),\n)\n\nconst employeeEditTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT,\n 'editEmployee',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('editEmployee', ctx, {\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollEditEmployeeContextual,\n employeeId: ev.payload.employeeId,\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n ctaConfig: null,\n }\n },\n ),\n)\n\nconst blockersViewAllTransition = transition(\n componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL,\n 'blockers',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('blockers', ctx),\n component: PayrollBlockerContextual,\n }\n }),\n)\n\nconst notSubmitted = (ctx: PayrollFlowContextInterface) => !ctx.hasPayrollSubmissionStarted\n\nconst editPayrollTransition = transition(\n componentEvents.RUN_PAYROLL_EDIT,\n 'configuration',\n guard(notSubmitted),\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }\n }),\n)\n\nconst payrollSubmittingTransition = transition(\n componentEvents.RUN_PAYROLL_SUBMITTING,\n 'overview',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...hideBreadcrumb('configuration', ctx),\n hasPayrollSubmissionStarted: true,\n })),\n)\n\nconst receiptGetTransition = transition(\n componentEvents.RUN_PAYROLL_RECEIPT_GET,\n 'receipts',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...updateBreadcrumbs('receipts', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollReceiptsContextual,\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollReceipts',\n },\n })),\n)\n\nconst employeeSavedTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED,\n 'configuration',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: 'configuration' }),\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n })),\n)\n\nconst employeeCancelledTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED,\n 'configuration',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: 'configuration' }),\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n })),\n)\n\n/** @internal */\nexport const payrollExecutionMachine = {\n configuration: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n calculatedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n ),\n overview: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration', notSubmitted),\n payrollSubmittingTransition,\n editPayrollTransition,\n receiptGetTransition,\n ),\n editEmployee: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n employeeSavedTransition,\n employeeCancelledTransition,\n ),\n receipts: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n blockers: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n}\n"],"names":["breadcrumbNavigateTransition","createBreadcrumbNavigateTransition","getPayrollExecutionBreadcrumbsNodes","isDismissal","ctx","updateBreadcrumbs","PayrollConfigurationContextual","PayrollOverviewContextual","calculatedTransition","transition","componentEvents","reduce","ev","a","employeeEditTransition","PayrollEditEmployeeContextual","blockersViewAllTransition","PayrollBlockerContextual","notSubmitted","editPayrollTransition","guard","payrollSubmittingTransition","hideBreadcrumb","receiptGetTransition","PayrollReceiptsContextual","employeeSavedTransition","patchBreadcrumbsHeader","employeeCancelledTransition","payrollExecutionMachine","state"],"mappings":";;;;;AA2CA,MAAMA,IACJC,EAAA,GAKWC,IAAsC,CACjDC,IAAuB,QAIhB;AAAA,EACL,eAAe;AAAA,IACb,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAPcA,IAAc,6BAA6B;AAAA,MAQzD,WAAW;AAAA,MACX,aAAa,CAACC,OAAsC;AAAA,QAClD,GAAGC,EAAkB,iBAAiBD,GAAK;AAAA,UACzC,WAAWA,EAAI,WAAW,aAAa;AAAA,UACvC,SAASA,EAAI,WAAW,WAAW;AAAA,QAAA,CACpC;AAAA,QACD,WAAWE;AAAA,QACX,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAa,CAACF,OAAsC;AAAA,QAClD,GAAGC,EAAkB,YAAYD,GAAK;AAAA,UACpC,WAAWA,EAAI,WAAW,aAAa;AAAA,UACvC,SAASA,EAAI,WAAW,WAAW;AAAA,QAAA,CACpC;AAAA,QACD,WAAWG;AAAA,QACX,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF;AAAA,EAEF,c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AAAA,EACb,EACA;AACJ,GAEMC,IAA0BhB;AAAA,EAC9BC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACP,OAAmE;AAAA,IACzE,GAAGsB,EAAuBtB,GAAK,EAAE,qBAAqB,iBAAiB;AAAA,IACvE,WAAWE;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,IAAA;AAAA,EACb,EACA;AACJ,GAEMqB,IAA8BlB;AAAA,EAClCC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACP,OAAmE;AAAA,IACzE,GAAGsB,EAAuBtB,GAAK,EAAE,qBAAqB,iBAAiB;AAAA,IACvE,WAAWE;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,IAAA;AAAA,EACb,EACA;AACJ,GAGasB,IAA0B;AAAA,EACrC,eAAeC;AAAA,IACb7B,EAA6B,eAAe;AAAA,IAC5CQ;AAAA,IACAM;AAAA,IACAE;AAAA,EAAA;AAAA,EAEF,UAAUa;AAAA,IACR7B,EAA6B,iBAAiBkB,CAAY;AAAA,IAC1DG;AAAA,IACAF;AAAA,IACAI;AAAA,EAAA;AAAA,EAEF,cAAcM;AAAA,IACZ7B,EAA6B,eAAe;AAAA,IAC5CyB;AAAA,IACAE;AAAA,EAAA;AAAA,EAEF,UAAUE,EAAyB7B,EAA6B,eAAe,CAAC;AAAA,EAChF,UAAU6B,EAAyB7B,EAA6B,eAAe,CAAC;AAClF;"}
1
+ {"version":3,"file":"payrollExecutionMachine.js","sources":["../../../../src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.ts"],"sourcesContent":["import { transition, reduce, state, guard } from 'robot3'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport {\n PayrollConfigurationContextual,\n PayrollOverviewContextual,\n PayrollEditEmployeeContextual,\n PayrollReceiptsContextual,\n PayrollBlockerContextual,\n type PayrollFlowContextInterface,\n} from '../PayrollFlow/PayrollFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport {\n hideBreadcrumb,\n patchBreadcrumbsHeader,\n updateBreadcrumbs,\n} from '@/helpers/breadcrumbHelpers'\nimport type {\n BreadcrumbNode,\n BreadcrumbNodes,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { createBreadcrumbNavigateTransition } from '@/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers'\n\ntype PayrollEventPayloads = {\n [componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT]: {\n employeeId: string\n firstName: string\n lastName: string\n }\n [componentEvents.RUN_PAYROLL_CALCULATED]: {\n payrollUuid: string\n alert?: PayrollFlowAlert\n payPeriod?: PayrollPayPeriodType\n }\n [componentEvents.RUN_PAYROLL_ALREADY_PROCESSED]: {\n payrollId: string\n alert?: PayrollFlowAlert\n payPeriod?: PayrollPayPeriodType\n }\n [componentEvents.BREADCRUMB_NAVIGATE]: {\n key: string\n onNavigate: (ctx: PayrollFlowContextInterface) => PayrollFlowContextInterface\n }\n [componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL]: undefined\n [componentEvents.RUN_PAYROLL_EDIT]: undefined\n}\n\nconst breadcrumbNavigateTransition =\n createBreadcrumbNavigateTransition<PayrollFlowContextInterface>()\n\ntype BreadcrumbNodeKeys = 'configuration' | 'overview' | 'editEmployee' | 'receipts' | 'blockers'\n\n/** @internal */\nexport const getPayrollExecutionBreadcrumbsNodes = (\n isDismissal: boolean = false,\n): BreadcrumbNodes => {\n const configLabel = isDismissal ? 'breadcrumbLabelDismissal' : 'breadcrumbLabel'\n\n return {\n configuration: {\n parent: null,\n item: {\n id: 'configuration',\n label: configLabel,\n namespace: 'Payroll.PayrollConfiguration',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n overview: {\n parent: 'configuration',\n item: {\n id: 'overview',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollOverview',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n editEmployee: {\n parent: 'configuration',\n item: {\n id: 'editEmployee',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollEditEmployee',\n },\n },\n receipts: {\n parent: 'overview',\n item: {\n id: 'receipts',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollReceipts',\n },\n },\n blockers: {\n parent: 'configuration',\n item: {\n id: 'blockers',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollBlocker',\n },\n },\n } satisfies Record<BreadcrumbNodeKeys, BreadcrumbNode>\n}\n\nconst calculatedTransition = transition(\n componentEvents.RUN_PAYROLL_CALCULATED,\n 'overview',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_CALCULATED>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ev.payload.payPeriod?.startDate ?? '',\n endDate: ev.payload.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n payPeriod: ev.payload.payPeriod ?? ctx.payPeriod,\n alerts: ev.payload.alert\n ? [\n ...(ctx.alerts ?? []).filter(a => a.alertKey !== 'progressSaved'),\n { ...ev.payload.alert, alertKey: 'progressSaved' as const },\n ]\n : ctx.alerts,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollOverview',\n },\n }\n },\n ),\n)\n\nconst alreadyProcessedTransition = transition(\n componentEvents.RUN_PAYROLL_ALREADY_PROCESSED,\n 'overview',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<\n PayrollEventPayloads,\n typeof componentEvents.RUN_PAYROLL_ALREADY_PROCESSED\n >,\n ): PayrollFlowContextInterface => {\n const payPeriod = ev.payload.payPeriod ?? ctx.payPeriod\n return {\n ...updateBreadcrumbs('overview', ctx, {\n startDate: payPeriod?.startDate ?? '',\n endDate: payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n payPeriod,\n alerts: ev.payload.alert\n ? [\n ...(ctx.alerts ?? []).filter(a => a.alertKey !== 'alreadyProcessed'),\n { ...ev.payload.alert, alertKey: 'alreadyProcessed' as const },\n ]\n : ctx.alerts,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollOverview',\n },\n }\n },\n ),\n)\n\nconst employeeEditTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT,\n 'editEmployee',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('editEmployee', ctx, {\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollEditEmployeeContextual,\n employeeId: ev.payload.employeeId,\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n ctaConfig: null,\n }\n },\n ),\n)\n\nconst blockersViewAllTransition = transition(\n componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL,\n 'blockers',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('blockers', ctx),\n component: PayrollBlockerContextual,\n }\n }),\n)\n\nconst notSubmitted = (ctx: PayrollFlowContextInterface) => !ctx.hasPayrollSubmissionStarted\n\nconst editPayrollTransition = transition(\n componentEvents.RUN_PAYROLL_EDIT,\n 'configuration',\n guard(notSubmitted),\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }\n }),\n)\n\nconst payrollSubmittingTransition = transition(\n componentEvents.RUN_PAYROLL_SUBMITTING,\n 'overview',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...hideBreadcrumb('configuration', ctx),\n hasPayrollSubmissionStarted: true,\n })),\n)\n\nconst receiptGetTransition = transition(\n componentEvents.RUN_PAYROLL_RECEIPT_GET,\n 'receipts',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...updateBreadcrumbs('receipts', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollReceiptsContextual,\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollReceipts',\n },\n })),\n)\n\nconst employeeSavedTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED,\n 'configuration',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: 'configuration' }),\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n })),\n)\n\nconst employeeCancelledTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED,\n 'configuration',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...patchBreadcrumbsHeader(ctx, { currentBreadcrumbId: 'configuration' }),\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n })),\n)\n\n/** @internal */\nexport const payrollExecutionMachine = {\n configuration: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n calculatedTransition,\n alreadyProcessedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n ),\n overview: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration', notSubmitted),\n payrollSubmittingTransition,\n editPayrollTransition,\n receiptGetTransition,\n ),\n editEmployee: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n employeeSavedTransition,\n employeeCancelledTransition,\n ),\n receipts: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n blockers: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n}\n"],"names":["breadcrumbNavigateTransition","createBreadcrumbNavigateTransition","getPayrollExecutionBreadcrumbsNodes","isDismissal","ctx","updateBreadcrumbs","PayrollConfigurationContextual","PayrollOverviewContextual","calculatedTransition","transition","componentEvents","reduce","ev","a","alreadyProcessedTransition","payPeriod","employeeEditTransition","PayrollEditEmployeeContextual","blockersViewAllTransition","PayrollBlockerContextual","notSubmitted","editPayrollTransition","guard","payrollSubmittingTransition","hideBreadcrumb","receiptGetTransition","PayrollReceiptsContextual","employeeSavedTransition","patchBreadcrumbsHeader","employeeCancelledTransition","payrollExecutionMachine","state"],"mappings":";;;;;AAgDA,MAAMA,IACJC,EAAA,GAKWC,IAAsC,CACjDC,IAAuB,QAIhB;AAAA,EACL,eAAe;AAAA,IACb,QAAQ;AAAA,IACR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W;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,IAAA;AAAA,EACb,EACA;AACJ,GAEMC,IAA0BlB;AAAA,EAC9BC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACP,OAAmE;AAAA,IACzE,GAAGwB,EAAuBxB,GAAK,EAAE,qBAAqB,iBAAiB;AAAA,IACvE,WAAWE;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,IAAA;AAAA,EACb,EACA;AACJ,GAEMuB,IAA8BpB;AAAA,EAClCC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACP,OAAmE;AAAA,IACzE,GAAGwB,EAAuBxB,GAAK,EAAE,qBAAqB,iBAAiB;AAAA,IACvE,WAAWE;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,IAAA;AAAA,EACb,EACA;AACJ,GAGawB,IAA0B;AAAA,EACrC,eAAeC;AAAA,IACb/B,EAA6B,eAAe;AAAA,IAC5CQ;AAAA,IACAM;AAAA,IACAE;AAAA,IACAE;AAAA,EAAA;AAAA,EAEF,UAAUa;AAAA,IACR/B,EAA6B,iBAAiBoB,CAAY;AAAA,IAC1DG;AAAA,IACAF;AAAA,IACAI;AAAA,EAAA;AAAA,EAEF,cAAcM;AAAA,IACZ/B,EAA6B,eAAe;AAAA,IAC5C2B;AAAA,IACAE;AAAA,EAAA;AAAA,EAEF,UAAUE,EAAyB/B,EAA6B,eAAe,CAAC;AAAA,EAChF,UAAU+B,EAAyB/B,EAA6B,eAAe,CAAC;AAClF;"}
@@ -47,4 +47,4 @@ import { PayrollFlowProps } from './PayrollFlowComponents';
47
47
  * }
48
48
  * ```
49
49
  */
50
- export declare const PayrollFlow: ({ companyId, onEvent, withReimbursements, ConfirmWireDetailsComponent, }: PayrollFlowProps) => import("react").JSX.Element;
50
+ export declare const PayrollFlow: ({ companyId, onEvent, withReimbursements, withOffcyclePayroll, ConfirmWireDetailsComponent, }: PayrollFlowProps) => import("react").JSX.Element;
@@ -1,38 +1,40 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as p } from "react/jsx-runtime";
2
2
  import { createMachine as c } from "robot3";
3
- import { useMemo as p } from "react";
4
- import { payrollFlowMachine as d, payrollFlowBreadcrumbsNodes as i } from "./payrollStateMachine.js";
5
- import { SaveAndExitCta as n, PayrollLandingContextual as u } from "./PayrollFlowComponents.js";
6
- import { Flow as b } from "../../Flow/Flow.js";
7
- import { buildBreadcrumbs as f } from "../../../helpers/breadcrumbHelpers.js";
8
- const g = ({
3
+ import { useMemo as d } from "react";
4
+ import { payrollFlowMachine as n, payrollFlowBreadcrumbsNodes as u } from "./payrollStateMachine.js";
5
+ import { SaveAndExitCta as i, PayrollLandingContextual as b } from "./PayrollFlowComponents.js";
6
+ import { Flow as s } from "../../Flow/Flow.js";
7
+ import { buildBreadcrumbs as F } from "../../../helpers/breadcrumbHelpers.js";
8
+ const B = ({
9
9
  companyId: r,
10
- onEvent: l,
10
+ onEvent: t,
11
11
  withReimbursements: o = !0,
12
- ConfirmWireDetailsComponent: a
12
+ withOffcyclePayroll: a = !0,
13
+ ConfirmWireDetailsComponent: m
13
14
  }) => {
14
- const m = p(
15
+ const e = d(
15
16
  () => c(
16
17
  "landing",
17
- d,
18
- (t) => ({
19
- ...t,
20
- component: u,
18
+ n,
19
+ (l) => ({
20
+ ...l,
21
+ component: b,
21
22
  companyId: r,
22
23
  header: {
23
24
  type: "breadcrumbs",
24
- breadcrumbs: f(i),
25
- cta: n
25
+ breadcrumbs: F(u),
26
+ cta: i
26
27
  },
27
28
  withReimbursements: o,
28
- ConfirmWireDetailsComponent: a
29
+ withOffcyclePayroll: a,
30
+ ConfirmWireDetailsComponent: m
29
31
  })
30
32
  ),
31
- [r, o, a]
33
+ [r, o, a, m]
32
34
  );
33
- return /* @__PURE__ */ e(b, { machine: m, onEvent: l });
35
+ return /* @__PURE__ */ p(s, { machine: e, onEvent: t });
34
36
  };
35
37
  export {
36
- g as PayrollFlow
38
+ B as PayrollFlow
37
39
  };
38
40
  //# sourceMappingURL=PayrollFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollFlow.js","sources":["../../../../src/components/Payroll/PayrollFlow/PayrollFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { payrollFlowBreadcrumbsNodes, payrollFlowMachine } from './payrollStateMachine'\nimport type { PayrollFlowProps } from './PayrollFlowComponents'\nimport {\n SaveAndExitCta,\n PayrollLandingContextual,\n type PayrollFlowContextInterface,\n} from './PayrollFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { buildBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\n/**\n * Hub for running and managing all payrolls across a company's pay schedules.\n *\n * @remarks\n * Renders the payroll landing page and orchestrates the full run-payroll experience: selecting a payroll, configuring earnings and reimbursements, reviewing totals, submitting, and viewing receipts. Off-cycle, transition, and edit-employee steps are reachable from the same flow.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `runPayroll/selected` | A payroll is selected to run | `{ payrollId: string }` |\n * | `payroll/review` | A calculated payroll is opened for review | `{ payrollId: string }` |\n * | `runPayroll/calculated` | Payroll calculations complete | — |\n * | `runPayroll/edit` | The user returns to configuration to make changes | — |\n * | `runPayroll/employee/edit` | An employee row is opened for editing | `{ employeeId: string, firstName: string, lastName: string }` |\n * | `runPayroll/employee/saved` | Employee payroll changes are saved | `{ payrollPrepared: object, employee: object }` |\n * | `runPayroll/employee/cancelled` | Employee editing is cancelled | — |\n * | `runPayroll/submitted` | Payroll is successfully submitted | Response from the submit payroll endpoint |\n * | `runPayroll/processed` | Payroll processing completes | — |\n * | `runPayroll/processingFailed` | Payroll processing fails | Error details |\n * | `runPayroll/cancelled` | A submitted payroll is cancelled | `{ payrollId: string, result: object }` |\n * | `runPayroll/summary/viewed` | The summary screen is opened | `{ payrollId: string }` |\n * | `runPayroll/receipt/viewed` | The receipt screen is opened | `{ payrollId: string }` |\n * | `runPayroll/offCycle/start` | The user starts an off-cycle payroll | — |\n * | `transition/runPayroll` | The user starts a pending transition payroll | — |\n * | `payroll/saveAndExit` | The user clicks Save and Exit | — |\n *\n * @components\n * - {@link PayrollLanding}\n * - {@link PayrollExecutionFlow}\n * - {@link OffCycleFlow}\n * - {@link TransitionFlow}\n * - {@link PayrollBlockerList}\n * - {@link PayrollOverview}\n * - {@link PayrollReceipts}\n *\n * @param props - {@link PayrollFlowProps} with the company, optional reimbursements toggle, optional wire-details override, and event handler.\n * @returns The composed payroll flow.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { Payroll } from '@gusto/embedded-react-sdk'\n *\n * function RunPayrollPage() {\n * return <Payroll.PayrollFlow companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\" onEvent={() => {}} />\n * }\n * ```\n */\nexport const PayrollFlow = ({\n companyId,\n onEvent,\n withReimbursements = true,\n ConfirmWireDetailsComponent,\n}: PayrollFlowProps) => {\n const payrollFlow = useMemo(\n () =>\n createMachine(\n 'landing',\n payrollFlowMachine,\n (initialContext: PayrollFlowContextInterface) => ({\n ...initialContext,\n component: PayrollLandingContextual,\n companyId,\n header: {\n type: 'breadcrumbs' as const,\n breadcrumbs: buildBreadcrumbs(payrollFlowBreadcrumbsNodes),\n cta: SaveAndExitCta,\n },\n withReimbursements,\n ConfirmWireDetailsComponent,\n }),\n ),\n [companyId, withReimbursements, ConfirmWireDetailsComponent],\n )\n\n return <Flow machine={payrollFlow} onEvent={onEvent} />\n}\n"],"names":["PayrollFlow","companyId","onEvent","withReimbursements","ConfirmWireDetailsComponent","payrollFlow","useMemo","createMachine","payrollFlowMachine","initialContext","PayrollLandingContextual","buildBreadcrumbs","payrollFlowBreadcrumbsNodes","SaveAndExitCta","jsx","Flow"],"mappings":";;;;;;;AA4DO,MAAMA,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,6BAAAC;AACF,MAAwB;AACtB,QAAMC,IAAcC;AAAA,IAClB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAiD;AAAA,QAChD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAT;AAAA,QACA,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,aAAaU,EAAiBC,CAA2B;AAAA,UACzD,KAAKC;AAAA,QAAA;AAAA,QAEP,oBAAAV;AAAA,QACA,6BAAAC;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACH,GAAWE,GAAoBC,CAA2B;AAAA,EAAA;AAG7D,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAASV,GAAa,SAAAH,EAAA,CAAkB;AACvD;"}
1
+ {"version":3,"file":"PayrollFlow.js","sources":["../../../../src/components/Payroll/PayrollFlow/PayrollFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { payrollFlowBreadcrumbsNodes, payrollFlowMachine } from './payrollStateMachine'\nimport type { PayrollFlowProps } from './PayrollFlowComponents'\nimport {\n SaveAndExitCta,\n PayrollLandingContextual,\n type PayrollFlowContextInterface,\n} from './PayrollFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { buildBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\n/**\n * Hub for running and managing all payrolls across a company's pay schedules.\n *\n * @remarks\n * Renders the payroll landing page and orchestrates the full run-payroll experience: selecting a payroll, configuring earnings and reimbursements, reviewing totals, submitting, and viewing receipts. Off-cycle, transition, and edit-employee steps are reachable from the same flow.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `runPayroll/selected` | A payroll is selected to run | `{ payrollId: string }` |\n * | `payroll/review` | A calculated payroll is opened for review | `{ payrollId: string }` |\n * | `runPayroll/calculated` | Payroll calculations complete | — |\n * | `runPayroll/edit` | The user returns to configuration to make changes | — |\n * | `runPayroll/employee/edit` | An employee row is opened for editing | `{ employeeId: string, firstName: string, lastName: string }` |\n * | `runPayroll/employee/saved` | Employee payroll changes are saved | `{ payrollPrepared: object, employee: object }` |\n * | `runPayroll/employee/cancelled` | Employee editing is cancelled | — |\n * | `runPayroll/submitted` | Payroll is successfully submitted | Response from the submit payroll endpoint |\n * | `runPayroll/processed` | Payroll processing completes | — |\n * | `runPayroll/processingFailed` | Payroll processing fails | Error details |\n * | `runPayroll/cancelled` | A submitted payroll is cancelled | `{ payrollId: string, result: object }` |\n * | `runPayroll/summary/viewed` | The summary screen is opened | `{ payrollId: string }` |\n * | `runPayroll/receipt/viewed` | The receipt screen is opened | `{ payrollId: string }` |\n * | `runPayroll/offCycle/start` | The user starts an off-cycle payroll | — |\n * | `transition/runPayroll` | The user starts a pending transition payroll | — |\n * | `payroll/saveAndExit` | The user clicks Save and Exit | — |\n *\n * @components\n * - {@link PayrollLanding}\n * - {@link PayrollExecutionFlow}\n * - {@link OffCycleFlow}\n * - {@link TransitionFlow}\n * - {@link PayrollBlockerList}\n * - {@link PayrollOverview}\n * - {@link PayrollReceipts}\n *\n * @param props - {@link PayrollFlowProps} with the company, optional reimbursements toggle, optional wire-details override, and event handler.\n * @returns The composed payroll flow.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { Payroll } from '@gusto/embedded-react-sdk'\n *\n * function RunPayrollPage() {\n * return <Payroll.PayrollFlow companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\" onEvent={() => {}} />\n * }\n * ```\n */\nexport const PayrollFlow = ({\n companyId,\n onEvent,\n withReimbursements = true,\n withOffcyclePayroll = true,\n ConfirmWireDetailsComponent,\n}: PayrollFlowProps) => {\n const payrollFlow = useMemo(\n () =>\n createMachine(\n 'landing',\n payrollFlowMachine,\n (initialContext: PayrollFlowContextInterface) => ({\n ...initialContext,\n component: PayrollLandingContextual,\n companyId,\n header: {\n type: 'breadcrumbs' as const,\n breadcrumbs: buildBreadcrumbs(payrollFlowBreadcrumbsNodes),\n cta: SaveAndExitCta,\n },\n withReimbursements,\n withOffcyclePayroll,\n ConfirmWireDetailsComponent,\n }),\n ),\n [companyId, withReimbursements, withOffcyclePayroll, ConfirmWireDetailsComponent],\n )\n\n return <Flow machine={payrollFlow} onEvent={onEvent} />\n}\n"],"names":["PayrollFlow","companyId","onEvent","withReimbursements","withOffcyclePayroll","ConfirmWireDetailsComponent","payrollFlow","useMemo","createMachine","payrollFlowMachine","initialContext","PayrollLandingContextual","buildBreadcrumbs","payrollFlowBreadcrumbsNodes","SaveAndExitCta","jsx","Flow"],"mappings":";;;;;;;AA4DO,MAAMA,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,qBAAAC,IAAsB;AAAA,EACtB,6BAAAC;AACF,MAAwB;AACtB,QAAMC,IAAcC;AAAA,IAClB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAiD;AAAA,QAChD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAV;AAAA,QACA,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,aAAaW,EAAiBC,CAA2B;AAAA,UACzD,KAAKC;AAAA,QAAA;AAAA,QAEP,oBAAAX;AAAA,QACA,qBAAAC;AAAA,QACA,6BAAAC;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACJ,GAAWE,GAAoBC,GAAqBC,CAA2B;AAAA,EAAA;AAGlF,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAASV,GAAa,SAAAJ,EAAA,CAAkB;AACvD;"}
@@ -14,6 +14,8 @@ export interface PayrollFlowProps extends BaseComponentInterface<never> {
14
14
  companyId: string;
15
15
  /** Whether reimbursement fields are shown in the payroll configuration and overview. Defaults to `true`. */
16
16
  withReimbursements?: boolean;
17
+ /** Whether to show the off-cycle payroll call-to-action. Defaults to `true`. */
18
+ withOffcyclePayroll?: boolean;
17
19
  /** Optional custom component that replaces the default wire-details confirmation UI. */
18
20
  ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType;
19
21
  }
@@ -46,6 +48,7 @@ export interface PayrollFlowContextInterface extends FlowContextInterface {
46
48
  breadcrumbs?: BreadcrumbTrail;
47
49
  payPeriod?: PayrollPayPeriodType;
48
50
  withReimbursements: boolean;
51
+ withOffcyclePayroll: boolean;
49
52
  ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType;
50
53
  showPayrollCancelledAlert?: boolean;
51
54
  hasPayrollSubmissionStarted?: boolean;
@@ -2,36 +2,38 @@ import { jsx as i } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { PayrollLanding as c } from "../PayrollLanding/PayrollLanding.js";
4
4
  import { PayrollConfiguration as u } from "../PayrollConfiguration/PayrollConfiguration.js";
5
- import { PayrollOverview as s } from "../PayrollOverview/PayrollOverview.js";
6
- import { PayrollEditEmployee as y } from "../PayrollEditEmployee/PayrollEditEmployee.js";
5
+ import { PayrollOverview as y } from "../PayrollOverview/PayrollOverview.js";
6
+ import { PayrollEditEmployee as s } from "../PayrollEditEmployee/PayrollEditEmployee.js";
7
7
  import { PayrollReceipts as d } from "../PayrollReceipts/PayrollReceipts.js";
8
- import { useFlow as m } from "../../Flow/useFlow.js";
8
+ import { useFlow as a } from "../../Flow/useFlow.js";
9
9
  import { ensureRequired as r } from "../../../helpers/ensureRequired.js";
10
10
  import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
11
  import { useI18n as C } from "../../../i18n/I18n.js";
12
12
  import { componentEvents as I } from "../../../shared/constants.js";
13
- import { PayrollBlockerList as v } from "../PayrollBlocker/components/PayrollBlockerList.js";
13
+ import { PayrollBlockerList as P } from "../PayrollBlocker/components/PayrollBlockerList.js";
14
14
  function B() {
15
15
  const {
16
16
  companyId: n,
17
17
  onEvent: o,
18
18
  withReimbursements: t,
19
- ConfirmWireDetailsComponent: e,
20
- showPayrollCancelledAlert: l
21
- } = m();
19
+ withOffcyclePayroll: e,
20
+ ConfirmWireDetailsComponent: l,
21
+ showPayrollCancelledAlert: m
22
+ } = a();
22
23
  return /* @__PURE__ */ i(
23
24
  c,
24
25
  {
25
26
  onEvent: o,
26
27
  companyId: r(n),
27
28
  withReimbursements: t,
28
- ConfirmWireDetailsComponent: e,
29
- showPayrollCancelledAlert: l
29
+ withOffcyclePayroll: e,
30
+ ConfirmWireDetailsComponent: l,
31
+ showPayrollCancelledAlert: m
30
32
  }
31
33
  );
32
34
  }
33
35
  function W() {
34
- const { companyId: n, payrollUuid: o, onEvent: t, withReimbursements: e } = m();
36
+ const { companyId: n, payrollUuid: o, onEvent: t, withReimbursements: e } = a();
35
37
  return /* @__PURE__ */ i(
36
38
  u,
37
39
  {
@@ -49,24 +51,24 @@ function D() {
49
51
  onEvent: t,
50
52
  alerts: e,
51
53
  withReimbursements: l,
52
- ConfirmWireDetailsComponent: a
53
- } = m();
54
+ ConfirmWireDetailsComponent: m
55
+ } = a();
54
56
  return /* @__PURE__ */ i(
55
- s,
57
+ y,
56
58
  {
57
59
  onEvent: t,
58
60
  companyId: r(n),
59
61
  payrollId: r(o),
60
62
  alerts: e,
61
63
  withReimbursements: l,
62
- ConfirmWireDetailsComponent: a
64
+ ConfirmWireDetailsComponent: m
63
65
  }
64
66
  );
65
67
  }
66
68
  function F() {
67
- const { companyId: n, payrollUuid: o, employeeId: t, onEvent: e, withReimbursements: l } = m();
69
+ const { companyId: n, payrollUuid: o, employeeId: t, onEvent: e, withReimbursements: l } = a();
68
70
  return /* @__PURE__ */ i(
69
- y,
71
+ s,
70
72
  {
71
73
  onEvent: e,
72
74
  companyId: r(n),
@@ -77,7 +79,7 @@ function F() {
77
79
  );
78
80
  }
79
81
  function K() {
80
- const { payrollUuid: n, onEvent: o, withReimbursements: t } = m();
82
+ const { payrollUuid: n, onEvent: o, withReimbursements: t } = a();
81
83
  return /* @__PURE__ */ i(
82
84
  d,
83
85
  {
@@ -88,11 +90,11 @@ function K() {
88
90
  );
89
91
  }
90
92
  function T() {
91
- const { companyId: n, onEvent: o } = m();
92
- return /* @__PURE__ */ i(v, { onEvent: o, companyId: r(n) });
93
+ const { companyId: n, onEvent: o } = a();
94
+ return /* @__PURE__ */ i(P, { onEvent: o, companyId: r(n) });
93
95
  }
94
96
  function _() {
95
- const { onEvent: n, ctaConfig: o } = m(), { Button: t } = f(), e = o?.namespace || "common";
97
+ const { onEvent: n, ctaConfig: o } = a(), { Button: t } = f(), e = o?.namespace || "common";
96
98
  C([e]);
97
99
  const { t: l } = p(e);
98
100
  return o?.labelKey ? /* @__PURE__ */ i(
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollFlowComponents.js","sources":["../../../../src/components/Payroll/PayrollFlow/PayrollFlowComponents.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport { PayrollLanding } from '../PayrollLanding/PayrollLanding'\nimport { PayrollConfiguration } from '../PayrollConfiguration/PayrollConfiguration'\nimport { PayrollOverview } from '../PayrollOverview/PayrollOverview'\nimport { PayrollEditEmployee } from '../PayrollEditEmployee/PayrollEditEmployee'\nimport { PayrollReceipts } from '../PayrollReceipts/PayrollReceipts'\nimport { PayrollBlockerList } from '../PayrollBlocker'\nimport type { ConfirmWireDetailsComponentType } from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { BreadcrumbTrail } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props accepted by {@link PayrollFlow}.\n *\n * @public\n */\nexport interface PayrollFlowProps extends BaseComponentInterface<never> {\n /** Identifier of the company whose payroll is being run. */\n companyId: string\n /** Whether reimbursement fields are shown in the payroll configuration and overview. Defaults to `true`. */\n withReimbursements?: boolean\n /** Optional custom component that replaces the default wire-details confirmation UI. */\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n}\n\n/**\n * An alert banner rendered above payroll content in {@link PayrollOverview} and\n * {@link PayrollConfiguration}.\n *\n * @public\n */\nexport type PayrollFlowAlert = {\n /** Visual severity of the alert. */\n type: 'error' | 'info' | 'success'\n /** Short heading text displayed in the alert. */\n title: string\n /** Optional body content rendered below the title. */\n content?: ReactNode\n /** Called when the user dismisses the alert. When omitted, the alert is not dismissible. */\n onDismiss?: () => void\n /** Stable key used to track alert identity across renders (e.g. for animations or deduplication). */\n alertKey?: string\n}\n\n/** @internal */\nexport interface PayrollFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n employeeId?: string\n firstName?: string\n lastName?: string\n alerts?: PayrollFlowAlert[]\n breadcrumbs?: BreadcrumbTrail\n payPeriod?: PayrollPayPeriodType\n withReimbursements: boolean\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n showPayrollCancelledAlert?: boolean\n hasPayrollSubmissionStarted?: boolean\n executionInitialState?: 'configuration' | 'overview'\n transitionStartDate?: string\n transitionEndDate?: string\n transitionPayScheduleUuid?: string\n}\n\n/** @internal */\nexport function PayrollLandingContextual() {\n const {\n companyId,\n onEvent,\n withReimbursements,\n ConfirmWireDetailsComponent,\n showPayrollCancelledAlert,\n } = useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollLanding\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n withReimbursements={withReimbursements}\n ConfirmWireDetailsComponent={ConfirmWireDetailsComponent}\n showPayrollCancelledAlert={showPayrollCancelledAlert}\n />\n )\n}\n\n/** @internal */\nexport function PayrollConfigurationContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollConfiguration\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n withReimbursements={withReimbursements}\n />\n )\n}\n\n/** @internal */\nexport function PayrollOverviewContextual() {\n const {\n companyId,\n payrollUuid,\n onEvent,\n alerts,\n withReimbursements,\n ConfirmWireDetailsComponent,\n } = useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollOverview\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n alerts={alerts}\n withReimbursements={withReimbursements}\n ConfirmWireDetailsComponent={ConfirmWireDetailsComponent}\n />\n )\n}\n\n/** @internal */\nexport function PayrollEditEmployeeContextual() {\n const { companyId, payrollUuid, employeeId, onEvent, withReimbursements } =\n useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollEditEmployee\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n employeeId={ensureRequired(employeeId)}\n withReimbursements={withReimbursements}\n />\n )\n}\n\n/** @internal */\nexport function PayrollReceiptsContextual() {\n const { payrollUuid, onEvent, withReimbursements } = useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollReceipts\n onEvent={onEvent}\n payrollId={ensureRequired(payrollUuid)}\n withReimbursements={withReimbursements}\n />\n )\n}\n\n/** @internal */\nexport function PayrollBlockerContextual() {\n const { companyId, onEvent } = useFlow<PayrollFlowContextInterface>()\n return <PayrollBlockerList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\n/** @internal */\nexport function SaveAndExitCta() {\n const { onEvent, ctaConfig } = useFlow<PayrollFlowContextInterface>()\n const { Button } = useComponentContext()\n const namespace = ctaConfig?.namespace || 'common'\n useI18n([namespace])\n const { t } = useTranslation(namespace)\n\n if (!ctaConfig?.labelKey) return null\n\n return (\n <Button\n onClick={() => {\n onEvent(componentEvents.PAYROLL_EXIT_FLOW)\n }}\n variant=\"secondary\"\n >\n {t(ctaConfig.labelKey as never)}\n </Button>\n )\n}\n"],"names":["PayrollLandingContextual","companyId","onEvent","withReimbursements","ConfirmWireDetailsComponent","showPayrollCancelledAlert","useFlow","jsx","PayrollLanding","ensureRequired","PayrollConfigurationContextual","payrollUuid","PayrollConfiguration","PayrollOverviewContextual","alerts","PayrollOverview","PayrollEditEmployeeContextual","employeeId","PayrollEditEmployee","PayrollReceiptsContextual","PayrollReceipts","PayrollBlockerContextual","PayrollBlockerList","SaveAndExitCta","ctaConfig","Button","useComponentContext","namespace","useI18n","t","useTranslation","componentEvents"],"mappings":";;;;;;;;;;;;;AAwEO,SAASA,IAA2B;AACzC,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,2BAAAC;AAAA,EAAA,IACEC,EAAA;AACJ,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAN;AAAA,MACA,WAAWO,EAAeR,CAAS;AAAA,MACnC,oBAAAE;AAAA,MACA,6BAAAC;AAAA,MACA,2BAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAAiC;AAC/C,QAAM,EAAE,WAAAT,GAAW,aAAAU,GAAa,SAAAT,GAAS,oBAAAC,EAAA,IACvCG,EAAA;AACF,SACE,gBAAAC;AAAA,IAACK;AAAA,IAAA;AAAA,MACC,SAAAV;AAAA,MACA,WAAWO,EAAeR,CAAS;AAAA,MACnC,WAAWQ,EAAeE,CAAW;AAAA,MACrC,oBAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASU,IAA4B;AAC1C,QAAM;AAAA,IACJ,WAAAZ;AAAA,IACA,aAAAU;AAAA,IACA,SAAAT;AAAA,IACA,QAAAY;AAAA,IACA,oBAAAX;AAAA,IACA,6BAAAC;AAAA,EAAA,IACEE,EAAA;AACJ,SACE,gBAAAC;AAAA,IAACQ;AAAA,IAAA;AAA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6B,EAAgB,iBAAiB;AAAA,MAC3C;AAAA,MACA,SAAQ;AAAA,MAEP,UAAAF,EAAEL,EAAU,QAAiB;AAAA,IAAA;AAAA,EAAA,IATD;AAYnC;"}
1
+ {"version":3,"file":"PayrollFlowComponents.js","sources":["../../../../src/components/Payroll/PayrollFlow/PayrollFlowComponents.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport { PayrollLanding } from '../PayrollLanding/PayrollLanding'\nimport { PayrollConfiguration } from '../PayrollConfiguration/PayrollConfiguration'\nimport { PayrollOverview } from '../PayrollOverview/PayrollOverview'\nimport { PayrollEditEmployee } from '../PayrollEditEmployee/PayrollEditEmployee'\nimport { PayrollReceipts } from '../PayrollReceipts/PayrollReceipts'\nimport { PayrollBlockerList } from '../PayrollBlocker'\nimport type { ConfirmWireDetailsComponentType } from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { BreadcrumbTrail } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props accepted by {@link PayrollFlow}.\n *\n * @public\n */\nexport interface PayrollFlowProps extends BaseComponentInterface<never> {\n /** Identifier of the company whose payroll is being run. */\n companyId: string\n /** Whether reimbursement fields are shown in the payroll configuration and overview. Defaults to `true`. */\n withReimbursements?: boolean\n /** Whether to show the off-cycle payroll call-to-action. Defaults to `true`. */\n withOffcyclePayroll?: boolean\n /** Optional custom component that replaces the default wire-details confirmation UI. */\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n}\n\n/**\n * An alert banner rendered above payroll content in {@link PayrollOverview} and\n * {@link PayrollConfiguration}.\n *\n * @public\n */\nexport type PayrollFlowAlert = {\n /** Visual severity of the alert. */\n type: 'error' | 'info' | 'success'\n /** Short heading text displayed in the alert. */\n title: string\n /** Optional body content rendered below the title. */\n content?: ReactNode\n /** Called when the user dismisses the alert. When omitted, the alert is not dismissible. */\n onDismiss?: () => void\n /** Stable key used to track alert identity across renders (e.g. for animations or deduplication). */\n alertKey?: string\n}\n\n/** @internal */\nexport interface PayrollFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n employeeId?: string\n firstName?: string\n lastName?: string\n alerts?: PayrollFlowAlert[]\n breadcrumbs?: BreadcrumbTrail\n payPeriod?: PayrollPayPeriodType\n withReimbursements: boolean\n withOffcyclePayroll: boolean\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n showPayrollCancelledAlert?: boolean\n hasPayrollSubmissionStarted?: boolean\n executionInitialState?: 'configuration' | 'overview'\n transitionStartDate?: string\n transitionEndDate?: string\n transitionPayScheduleUuid?: string\n}\n\n/** @internal */\nexport function PayrollLandingContextual() {\n const {\n companyId,\n onEvent,\n withReimbursements,\n withOffcyclePayroll,\n ConfirmWireDetailsComponent,\n showPayrollCancelledAlert,\n } = useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollLanding\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n withReimbursements={withReimbursements}\n withOffcyclePayroll={withOffcyclePayroll}\n ConfirmWireDetailsComponent={ConfirmWireDetailsComponent}\n showPayrollCancelledAlert={showPayrollCancelledAlert}\n />\n )\n}\n\n/** @internal */\nexport function PayrollConfigurationContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollConfiguration\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n withReimbursements={withReimbursements}\n />\n )\n}\n\n/** @internal */\nexport function PayrollOverviewContextual() {\n const {\n companyId,\n payrollUuid,\n onEvent,\n alerts,\n withReimbursements,\n ConfirmWireDetailsComponent,\n } = useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollOverview\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n alerts={alerts}\n withReimbursements={withReimbursements}\n ConfirmWireDetailsComponent={ConfirmWireDetailsComponent}\n />\n )\n}\n\n/** @internal */\nexport function PayrollEditEmployeeContextual() {\n const { companyId, payrollUuid, employeeId, onEvent, withReimbursements } =\n useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollEditEmployee\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n employeeId={ensureRequired(employeeId)}\n withReimbursements={withReimbursements}\n />\n )\n}\n\n/** @internal */\nexport function PayrollReceiptsContextual() {\n const { payrollUuid, onEvent, withReimbursements } = useFlow<PayrollFlowContextInterface>()\n return (\n <PayrollReceipts\n onEvent={onEvent}\n payrollId={ensureRequired(payrollUuid)}\n withReimbursements={withReimbursements}\n />\n )\n}\n\n/** @internal */\nexport function PayrollBlockerContextual() {\n const { companyId, onEvent } = useFlow<PayrollFlowContextInterface>()\n return <PayrollBlockerList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\n/** @internal */\nexport function SaveAndExitCta() {\n const { onEvent, ctaConfig } = useFlow<PayrollFlowContextInterface>()\n const { Button } = useComponentContext()\n const namespace = ctaConfig?.namespace || 'common'\n useI18n([namespace])\n const { t } = useTranslation(namespace)\n\n if (!ctaConfig?.labelKey) return null\n\n return (\n <Button\n onClick={() => {\n onEvent(componentEvents.PAYROLL_EXIT_FLOW)\n }}\n variant=\"secondary\"\n >\n {t(ctaConfig.labelKey as never)}\n </Button>\n )\n}\n"],"names":["PayrollLandingContextual","companyId","onEvent","withReimbursements","withOffcyclePayroll","ConfirmWireDetailsComponent","showPayrollCancelledAlert","useFlow","jsx","PayrollLanding","ensureRequired","PayrollConfigurationContextual","payrollUuid","PayrollConfiguration","PayrollOverviewContextual","alerts","PayrollOverview","PayrollEditEmployeeContextual","employeeId","PayrollEditEmployee","PayrollReceiptsContextual","PayrollReceipts","PayrollBlockerContextual","PayrollBlockerList","SaveAndExitCta","ctaConfig","Button","useComponentContext","namespace","useI18n","t","useTranslation","componentEvents"],"mappings":";;;;;;;;;;;;;AA2EO,SAASA,IAA2B;AACzC,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,2BAAAC;AAAA,EAAA,IACEC,EAAA;AACJ,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAP;AAAA,MACA,WAAWQ,EAAeT,CAAS;AAAA,MACnC,oBAAAE;AAAA,MACA,qBAAAC;AAAA,MACA,6BAAAC;AAAA,MACA,2BAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAAiC;AAC/C,QAAM,EAAE,WAAAV,GAAW,aAAAW,GAAa,SAAAV,GAAS,oBAAAC,EAAA,IACvCI,EAAA;AACF,SACE,gBAAAC;AAAA,IAACK;AAAA,IAAA;AAAA,MACC,SAAAX;AAAA,MACA,WAAWQ,EAAeT,CAAS;AAAA,MACnC,WAAWS,EAAeE,CAAW;AAAA,MACrC,oBAAAT;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASW,IAA4B;AAC1C,QAAM;AAAA,IACJ,WAAAb;AAAA,IACA,aAAAW;AAAA,IACA,SAAAV;AAAA,IACA,QAAAa;AAAA,IACA,oBAAAZ;AAAA,IACA,6BAAAE;AAAA,EAAA,IACEE,EAAA;AACJ,SACE,gBAAAC;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,SAAAd;AAAA,MACA,WAAWQ,EAAeT,CAAS;AAAA,MACnC,WAAWS,EAAeE,CAAW;AAAA,MACrC,QAAAG;AAAA,MACA,oBAAAZ;AAAA,MACA,6BAAAE;AAAA,IAAA;AAAA,E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interface PayrollLandingProps extends BaseComponentInterface<'Payroll.Pay
10
10
  companyId: string;
11
11
  /** Whether to show reimbursement fields throughout the landing flow. Defaults to `true`. */
12
12
  withReimbursements?: boolean;
13
+ /** Whether to show the off-cycle payroll call-to-action. Defaults to `true`. */
14
+ withOffcyclePayroll?: boolean;
13
15
  /** Custom component that replaces the default wire details confirmation UI. */
14
16
  ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType;
15
17
  /** When `true`, displays a dismissible success alert indicating a payroll was cancelled. */