@gusto/embedded-react-sdk 0.55.3 → 0.55.5

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 (99) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
  6. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  7. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  8. package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
  9. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  10. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
  11. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
  12. package/dist/components/Common/DataView/DataView.js +18 -17
  13. package/dist/components/Common/DataView/DataView.js.map +1 -1
  14. package/dist/components/Company/Locations/LocationsList/List.js +27 -25
  15. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  16. package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
  17. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  18. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  19. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  20. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
  21. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
  22. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  23. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
  24. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  25. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
  26. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
  27. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
  28. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
  29. package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
  30. package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
  31. package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
  32. package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
  33. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
  34. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
  35. package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
  36. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
  37. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  38. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
  39. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  40. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
  41. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  42. package/dist/components/Flow/Flow.js +22 -22
  43. package/dist/components/Flow/Flow.js.map +1 -1
  44. package/dist/components/Flow/useFlow.js +3 -3
  45. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
  46. package/dist/components/InformationRequests/InformationRequests.js +66 -52
  47. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  48. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +52 -50
  49. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  50. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  51. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
  52. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  53. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
  54. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
  55. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
  56. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
  57. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
  58. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
  59. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  60. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
  61. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
  62. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
  63. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
  64. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
  65. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  66. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +193 -191
  67. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  68. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
  69. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +31 -31
  70. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  71. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
  72. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  73. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
  74. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  75. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
  76. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  77. package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
  78. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  79. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
  80. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  81. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +176 -167
  82. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  83. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  84. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -164
  85. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  86. package/dist/helpers/openPdfInNewTab.d.ts +15 -0
  87. package/dist/helpers/openPdfInNewTab.js +28 -0
  88. package/dist/helpers/openPdfInNewTab.js.map +1 -0
  89. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  90. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
  91. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  92. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
  93. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
  94. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  95. package/dist/i18n/en/Payroll.PayrollOverview.json.js +43 -41
  96. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  97. package/dist/i18n/types.d.ts +20 -0
  98. package/dist/style.css +1 -1
  99. package/package.json +17 -17
@@ -1,196 +1,198 @@
1
- import { jsx as f, jsxs as fe, Fragment as Ce } from "react/jsx-runtime";
2
- import { useState as y, useRef as B, useMemo as q, useEffect as D } from "react";
3
- import { useQueryClient as Pe } from "@tanstack/react-query";
4
- import { usePayrollsGetSuspense as Ue } from "@gusto/embedded-api/react-query/payrollsGet";
5
- import { payrollsCalculate as Le } from "@gusto/embedded-api/funcs/payrollsCalculate";
6
- import { useGustoEmbeddedContext as ge } from "@gusto/embedded-api/react-query/_context";
1
+ import { jsx as C, jsxs as Pe, Fragment as Ue } from "react/jsx-runtime";
2
+ import { useState as f, useRef as D, useMemo as q, useEffect as O } from "react";
3
+ import { usePayrollsGetSuspense as ge } from "@gusto/embedded-api/react-query/payrollsGet";
4
+ import { payrollsCalculate as he } from "@gusto/embedded-api/funcs/payrollsCalculate";
5
+ import { useGustoEmbeddedContext as Le } from "@gusto/embedded-api/react-query/_context";
7
6
  import { PayrollProcessingRequestStatus as E } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
8
- import { useTranslation as he } from "react-i18next";
9
- import { usePayrollsUpdateMutation as Se } from "@gusto/embedded-api/react-query/payrollsUpdate";
10
- import { usePayrollsCalculateGrossUpMutation as Ae } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
11
- import { usePayrollsGetBlockersSuspense as _e } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
12
- import { payrollSubmitHandler as we } from "../PayrollBlocker/payrollHelpers.js";
13
- import { PayrollOverview as Re } from "../PayrollOverview/PayrollOverview.js";
14
- import { PayrollConfigurationPresentation as De } from "./PayrollConfigurationPresentation.js";
7
+ import { useTranslation as Se } from "react-i18next";
8
+ import { usePayrollsUpdateMutation as we } from "@gusto/embedded-api/react-query/payrollsUpdate";
9
+ import { usePayrollsCalculateGrossUpMutation as Re } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
10
+ import { usePayrollsGetBlockersSuspense as Ae } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
11
+ import { payrollSubmitHandler as _e } from "../PayrollBlocker/payrollHelpers.js";
12
+ import { PayrollOverview as De } from "../PayrollOverview/PayrollOverview.js";
13
+ import { PayrollConfigurationPresentation as Oe } from "./PayrollConfigurationPresentation.js";
15
14
  import { usePayrollConfigurationData as Ee } from "./usePayrollConfigurationData.js";
16
- import { isGrossUpEligible as Oe, getGrossUpTargetCompensationName as Te } from "./grossUpHelpers.js";
17
- import { BaseComponent as xe } from "../../Base/Base.js";
15
+ import { isGrossUpEligible as Te, getGrossUpTargetCompensationName as xe } from "./grossUpHelpers.js";
16
+ import { BaseComponent as be } from "../../Base/Base.js";
18
17
  import { componentEvents as l } from "../../../shared/constants.js";
19
- import { useComponentDictionary as be, useI18n as ke } from "../../../i18n/I18n.js";
18
+ import { useComponentDictionary as ke, useI18n as Ge } from "../../../i18n/I18n.js";
20
19
  import { useBase as Ne } from "../../Base/useBase.js";
21
- import { useDateFormatter as Ge } from "../../../hooks/useDateFormatter.js";
22
- import { SDKInternalError as F } from "../../../types/sdkError.js";
23
- import { API_QUERY_NAMESPACE as Ye } from "../../../contexts/ApiProvider/apiVersion.js";
20
+ import { useDateFormatter as Ye } from "../../../hooks/useDateFormatter.js";
21
+ import { SDKInternalError as W } from "../../../types/sdkError.js";
24
22
  import { GrossUpModal as Me } from "../GrossUpModal/GrossUpModal.js";
25
- const Be = (t) => t?.status === E.Calculating, qe = (t, u) => u != null && (t?.status === E.CalculateSuccess || t == null);
26
- function mo(t) {
27
- return /* @__PURE__ */ f(xe, { ...t, children: /* @__PURE__ */ f(Fe, { ...t, children: t.children }) });
23
+ const v = (o) => o?.status === E.Calculating, Be = (o, n) => n != null && (o?.status === E.CalculateSuccess || o == null);
24
+ function ut(o) {
25
+ return /* @__PURE__ */ C(be, { ...o, children: /* @__PURE__ */ C(Fe, { ...o, children: o.children }) });
28
26
  }
29
27
  const Fe = ({
30
- onEvent: t,
31
- companyId: u,
28
+ onEvent: o,
29
+ companyId: n,
32
30
  payrollId: i,
33
- dictionary: j,
34
- alerts: v,
35
- withReimbursements: O = !0
31
+ dictionary: K,
32
+ alerts: H,
33
+ withReimbursements: T = !0
36
34
  }) => {
37
- be("Payroll.PayrollConfiguration", j), ke("Payroll.PayrollConfiguration");
38
- const { t: c } = he("Payroll.PayrollConfiguration"), { baseSubmitHandler: C } = Ne(), p = Ge(), [n, m] = y(!1), [U, T] = y(!1), L = B(null), W = ge(), K = Pe(), { data: s } = Ue(
35
+ ke("Payroll.PayrollConfiguration", K), Ge("Payroll.PayrollConfiguration");
36
+ const { t: c } = Se("Payroll.PayrollConfiguration"), { baseSubmitHandler: P } = Ne(), m = Ye(), [u, d] = f(!1), [x, b] = f(!1), g = D(null), p = D(!1), V = Le(), { data: a } = ge(
39
37
  {
40
- companyId: u,
38
+ companyId: n,
41
39
  payrollId: i,
42
40
  include: ["taxes", "benefits", "deductions", "payroll_status_meta"]
43
41
  },
44
- { refetchInterval: n ? 5e3 : !1 }
45
- ), H = q(
46
- () => s.payrollShow?.employeeCompensations?.filter((e) => e.excluded).map((e) => e.employeeUuid).filter(Boolean) ?? [],
47
- [s.payrollShow?.employeeCompensations]
48
- ), {
49
- employeeDetails: V,
50
- employeeCompensations: x,
51
- paySchedule: I,
42
+ { refetchInterval: u ? 5e3 : !1 }
43
+ ), I = q(
44
+ () => a.payrollShow?.employeeCompensations?.filter((e) => e.excluded).map((e) => e.employeeUuid).filter(Boolean) ?? [],
45
+ [a.payrollShow?.employeeCompensations]
46
+ );
47
+ v(a.payrollShow?.processingRequest) && (p.current = !0);
48
+ const k = x || u || p.current, {
49
+ employeeDetails: J,
50
+ employeeCompensations: G,
51
+ paySchedule: z,
52
52
  payPeriod: Q,
53
- payrollCategory: g,
54
- pagination: J,
55
- isLoading: z,
56
- isAlreadyProcessed: h,
53
+ payrollCategory: h,
54
+ pagination: X,
55
+ isLoading: Z,
56
+ isAlreadyProcessed: L,
57
57
  refetch: S
58
58
  } = Ee({
59
- companyId: u,
59
+ companyId: n,
60
60
  payrollId: i,
61
- isCalculating: n || U,
62
- excludedEmployeeUuids: H
63
- }), A = q(
61
+ // Don't prepare while calculating, or once we've seen it calculate. If the payroll was already
62
+ // calculated when we opened (e.g. clicking Edit), we do prepare so it can be edited.
63
+ disablePrepare: u || x || p.current,
64
+ excludedEmployeeUuids: I
65
+ }), w = q(
64
66
  () => ({
65
67
  type: "error",
66
68
  title: c("alerts.alreadyProcessed"),
67
69
  alertKey: "alreadyProcessed"
68
70
  }),
69
71
  [c]
70
- ), _ = B(!1);
71
- D(() => {
72
- if (!h) {
73
- _.current = !1;
72
+ ), R = D(!1);
73
+ O(() => {
74
+ if (!L) {
75
+ R.current = !1;
74
76
  return;
75
77
  }
76
- _.current || (_.current = !0, t(l.RUN_PAYROLL_ALREADY_PROCESSED, {
78
+ R.current || (R.current = !0, o(l.RUN_PAYROLL_ALREADY_PROCESSED, {
77
79
  payrollId: i,
78
- alert: A,
79
- payPeriod: s.payrollShow?.payPeriod
80
+ alert: w,
81
+ payPeriod: a.payrollShow?.payPeriod
80
82
  }));
81
83
  }, [
82
- h,
83
- t,
84
+ L,
85
+ o,
84
86
  i,
85
- A,
86
- s.payrollShow?.payPeriod
87
+ w,
88
+ a.payrollShow?.payPeriod
87
89
  ]);
88
- const { mutateAsync: b, isPending: X } = Se(), { mutateAsync: Z } = Ae(), [d, k] = y(null), [$, w] = y(!1), N = Oe(g), P = Te(g), ee = (e) => {
89
- k(e), w(!0), t(l.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
90
- }, oe = async (e) => {
91
- if (!d) return null;
92
- let o = null;
93
- return await C(null, async () => {
94
- o = (await Z({
90
+ const { mutateAsync: N, isPending: $ } = we(), { mutateAsync: ee } = Re(), [y, Y] = f(null), [te, A] = f(!1), M = Te(h), U = xe(h), oe = (e) => {
91
+ Y(e), A(!0), o(l.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
92
+ }, ae = async (e) => {
93
+ if (!y) return null;
94
+ let t = null;
95
+ return await P(null, async () => {
96
+ t = (await ee({
95
97
  request: {
96
98
  payrollUuid: i,
97
99
  payrollGrossUpRequest: {
98
- employeeUuid: d,
100
+ employeeUuid: y,
99
101
  netPay: e.toString()
100
102
  }
101
103
  }
102
- })).payrollGrossUpResponse?.grossUp ?? null, o && t(l.RUN_PAYROLL_GROSS_UP_CALCULATED, {
103
- grossUp: o,
104
+ })).payrollGrossUpResponse?.grossUp ?? null, t && o(l.RUN_PAYROLL_GROSS_UP_CALCULATED, {
105
+ grossUp: t,
104
106
  netPay: e,
105
- employeeUuid: d
107
+ employeeUuid: y
106
108
  });
107
- }), o;
108
- }, te = async (e) => {
109
- if (!d || !P)
110
- throw new F(
109
+ }), t;
110
+ }, se = async (e) => {
111
+ if (!y || !U)
112
+ throw new W(
111
113
  "Unable to apply gross-up: missing employee or target compensation."
112
114
  );
113
- const o = x.find((a) => a.employeeUuid === d);
114
- if (!o)
115
- throw new F("Unable to apply gross-up: employee compensation not found.");
116
- const r = o.fixedCompensations ?? [], pe = r.some(
117
- (a) => a.name?.toLowerCase() === P.toLowerCase()
118
- ), M = r.map((a) => ({
119
- name: a.name,
120
- jobUuid: a.jobUuid,
121
- amount: a.name?.toLowerCase() === P.toLowerCase() ? e : "0"
115
+ const t = G.find((s) => s.employeeUuid === y);
116
+ if (!t)
117
+ throw new W("Unable to apply gross-up: employee compensation not found.");
118
+ const r = t.fixedCompensations ?? [], de = r.some(
119
+ (s) => s.name?.toLowerCase() === U.toLowerCase()
120
+ ), j = r.map((s) => ({
121
+ name: s.name,
122
+ jobUuid: s.jobUuid,
123
+ amount: s.name?.toLowerCase() === U.toLowerCase() ? e : "0"
122
124
  }));
123
- if (!pe) {
124
- const a = o.hourlyCompensations?.[0]?.jobUuid ?? r[0]?.jobUuid ?? "";
125
- M.push({
126
- name: P,
127
- jobUuid: a,
125
+ if (!de) {
126
+ const s = t.hourlyCompensations?.[0]?.jobUuid ?? r[0]?.jobUuid ?? "";
127
+ j.push({
128
+ name: U,
129
+ jobUuid: s,
128
130
  amount: e
129
131
  });
130
132
  }
131
- const me = (o.hourlyCompensations ?? []).map((a) => ({
132
- name: a.name,
133
- jobUuid: a.jobUuid,
133
+ const ye = (t.hourlyCompensations ?? []).map((s) => ({
134
+ name: s.name,
135
+ jobUuid: s.jobUuid,
134
136
  hours: "0"
135
- })), de = (o.paidTimeOff ?? []).map((a) => ({
136
- name: a.name,
137
+ })), fe = (t.paidTimeOff ?? []).map((s) => ({
138
+ name: s.name,
137
139
  hours: "0"
138
- })), ye = Y({
139
- ...o,
140
- fixedCompensations: M,
141
- hourlyCompensations: me,
142
- paidTimeOff: de
140
+ })), Ce = F({
141
+ ...t,
142
+ fixedCompensations: j,
143
+ hourlyCompensations: ye,
144
+ paidTimeOff: fe
143
145
  });
144
- await C({}, async () => {
145
- const a = await b({
146
+ await P({}, async () => {
147
+ const s = await N({
146
148
  request: {
147
- companyId: u,
149
+ companyId: n,
148
150
  payrollId: i,
149
151
  payrollUpdate: {
150
- employeeCompensations: [{ ...ye, excluded: !1 }]
152
+ employeeCompensations: [{ ...Ce, excluded: !1 }]
151
153
  }
152
154
  }
153
155
  });
154
- t(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
155
- payrollPrepared: a.payrollPrepared
156
+ o(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
157
+ payrollPrepared: s.payrollPrepared
156
158
  }), await S();
157
- }), k(null), w(!1);
158
- }, ae = async (e) => {
159
+ }), Y(null), A(!1);
160
+ }, re = async (e) => {
159
161
  try {
160
- await te(e);
162
+ await se(e);
161
163
  } catch {
162
164
  }
163
- }, { data: se } = _e({
164
- companyUuid: u
165
- }), G = (se.payrollBlockers ?? []).map((e) => ({
165
+ }, { data: le } = Ae({
166
+ companyUuid: n
167
+ }), B = (le.payrollBlockers ?? []).map((e) => ({
166
168
  key: e.key,
167
169
  message: e.message
168
- })), [re, R] = y(G), le = async () => {
169
- R([]), L.current = s.payrollShow?.calculatedAt?.getTime() ?? null, await C({}, async () => {
170
- const e = await we(async () => {
171
- T(!0);
170
+ })), [ie, _] = f(B), ne = async () => {
171
+ _([]), p.current = !0, g.current = a.payrollShow?.calculatedAt?.getTime() ?? null, await P({}, async () => {
172
+ const e = await _e(async () => {
173
+ b(!0);
172
174
  try {
173
- const o = await Le(W, {
174
- companyId: u,
175
+ const t = await he(V, {
176
+ companyId: n,
175
177
  payrollId: i
176
178
  });
177
- if (!o.ok)
178
- throw o.error;
179
- K.invalidateQueries({ queryKey: [Ye] }), m(!0);
179
+ if (!t.ok)
180
+ throw t.error;
181
+ d(!0);
180
182
  } finally {
181
- T(!1);
183
+ b(!1);
182
184
  }
183
185
  });
184
- !e.success && e.blockers.length > 0 && R(e.blockers);
186
+ !e.success && e.blockers.length > 0 && _(e.blockers);
185
187
  });
186
- }, ie = (e) => {
187
- t(l.RUN_PAYROLL_EMPLOYEE_EDIT, {
188
+ }, ue = (e) => {
189
+ o(l.RUN_PAYROLL_EMPLOYEE_EDIT, {
188
190
  employeeId: e.uuid,
189
191
  firstName: e.firstName,
190
192
  lastName: e.lastName
191
193
  });
192
- }, Y = (e) => {
193
- const { paymentMethod: o } = e;
194
+ }, F = (e) => {
195
+ const { paymentMethod: t } = e;
194
196
  return {
195
197
  employeeUuid: e.employeeUuid,
196
198
  version: e.version,
@@ -199,133 +201,133 @@ const Fe = ({
199
201
  hourlyCompensations: e.hourlyCompensations,
200
202
  paidTimeOff: e.paidTimeOff,
201
203
  deductions: e.deductions,
202
- ...o && o !== "Historical" ? { paymentMethod: o } : {},
204
+ ...t && t !== "Historical" ? { paymentMethod: t } : {},
203
205
  memo: e.memo || void 0
204
206
  };
205
- }, ne = async (e) => {
206
- t(l.RUN_PAYROLL_EMPLOYEE_SKIP, {
207
+ }, ce = async (e) => {
208
+ o(l.RUN_PAYROLL_EMPLOYEE_SKIP, {
207
209
  employeeId: e.employeeUuid
208
- }), await C({}, async () => {
209
- const o = Y(e), r = await b({
210
+ }), await P({}, async () => {
211
+ const t = F(e), r = await N({
210
212
  request: {
211
- companyId: u,
213
+ companyId: n,
212
214
  payrollId: i,
213
215
  payrollUpdate: {
214
216
  employeeCompensations: [
215
- { ...o, excluded: !o.excluded }
217
+ { ...t, excluded: !t.excluded }
216
218
  ]
217
219
  }
218
220
  }
219
221
  });
220
- t(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
222
+ o(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
221
223
  payrollPrepared: r.payrollPrepared
222
224
  }), await S();
223
225
  });
224
- }, ue = () => {
225
- t(l.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
226
+ }, pe = () => {
227
+ o(l.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
226
228
  };
227
- D(() => {
228
- Be(s.payrollShow?.processingRequest) && !n && (L.current = s.payrollShow?.calculatedAt?.getTime() ?? null, m(!0));
229
- const e = s.payrollShow?.calculatedAt, o = e?.getTime() !== L.current;
230
- n && o && qe(s.payrollShow?.processingRequest, e) && (t(l.RUN_PAYROLL_CALCULATED, {
229
+ O(() => {
230
+ v(a.payrollShow?.processingRequest) && !u && (g.current = a.payrollShow?.calculatedAt?.getTime() ?? null, d(!0));
231
+ const e = a.payrollShow?.calculatedAt, t = e?.getTime() !== g.current;
232
+ u && t && Be(a.payrollShow?.processingRequest, e) && (o(l.RUN_PAYROLL_CALCULATED, {
231
233
  payrollId: i,
232
234
  alert: {
233
235
  type: "success",
234
236
  title: c("alerts.progressSaved"),
235
237
  alertKey: "progressSaved"
236
238
  },
237
- payPeriod: s.payrollShow?.payPeriod
238
- }), R([]), m(!1)), n && s.payrollShow?.processingRequest?.status === E.ProcessingFailed && (t(l.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
239
+ payPeriod: a.payrollShow?.payPeriod
240
+ }), _([]), d(!1)), u && a.payrollShow?.processingRequest?.status === E.ProcessingFailed && (o(l.RUN_PAYROLL_PROCESSING_FAILED), d(!1), p.current = !1);
239
241
  }, [
240
- s.payrollShow?.processingRequest?.status,
241
- s.payrollShow?.calculatedAt,
242
- n,
243
- t,
242
+ a.payrollShow?.processingRequest?.status,
243
+ a.payrollShow?.calculatedAt,
244
+ u,
245
+ o,
244
246
  c,
245
247
  i
246
- ]), D(() => {
247
- if (!n) return;
248
- const e = 180 * 1e3, o = setTimeout(() => {
249
- t(l.RUN_PAYROLL_PROCESSING_FAILED), m(!1);
248
+ ]), O(() => {
249
+ if (!u) return;
250
+ const e = 180 * 1e3, t = setTimeout(() => {
251
+ o(l.RUN_PAYROLL_PROCESSING_FAILED), d(!1), p.current = !1;
250
252
  }, e);
251
253
  return () => {
252
- clearTimeout(o);
254
+ clearTimeout(t);
253
255
  };
254
- }, [n, t]);
255
- const ce = (() => {
256
- const e = s.payrollShow?.payrollStatusMeta;
256
+ }, [u, o]);
257
+ const me = (() => {
258
+ const e = a.payrollShow?.payrollStatusMeta;
257
259
  if (e?.payrollLate && e.initialCheckDate && e.expectedDebitTime && e.expectedCheckDate)
258
260
  return {
259
261
  label: c("alerts.payrollLate", {
260
- initialCheckDate: p.formatShortWithWeekday(e.initialCheckDate)
262
+ initialCheckDate: m.formatShortWithWeekday(e.initialCheckDate)
261
263
  }),
262
264
  content: c("alerts.payrollLateText", {
263
- ...p.formatWithTime(e.expectedDebitTime),
264
- newCheckDate: p.formatShortWithWeekday(e.expectedCheckDate)
265
+ ...m.formatWithTime(e.expectedDebitTime),
266
+ newCheckDate: m.formatShortWithWeekday(e.expectedCheckDate)
265
267
  }),
266
268
  variant: "warning"
267
269
  };
268
- const { payrollShow: r } = s;
270
+ const { payrollShow: r } = a;
269
271
  if (r?.checkDate && r.payrollDeadline)
270
272
  return {
271
273
  label: c("alerts.directDepositDeadline", {
272
- payDate: p.formatShortWithWeekday(r.checkDate),
273
- ...p.formatWithTime(r.payrollDeadline)
274
+ payDate: m.formatShortWithWeekday(r.checkDate),
275
+ ...m.formatWithTime(r.payrollDeadline)
274
276
  }),
275
277
  content: c("alerts.directDepositDeadlineText"),
276
278
  variant: "info"
277
279
  };
278
280
  })();
279
- return h ? /* @__PURE__ */ f(
280
- Re,
281
+ return L ? /* @__PURE__ */ C(
282
+ De,
281
283
  {
282
- companyId: u,
284
+ companyId: n,
283
285
  payrollId: i,
284
- onEvent: (o, r) => {
285
- o === l.RUN_PAYROLL_CANCELLED && S(), t(o, r);
286
+ onEvent: (t, r) => {
287
+ t === l.RUN_PAYROLL_CANCELLED && S(), o(t, r);
286
288
  },
287
- withReimbursements: O,
288
- alerts: [A]
289
+ withReimbursements: T,
290
+ alerts: [w]
289
291
  }
290
- ) : /* @__PURE__ */ fe(Ce, { children: [
291
- /* @__PURE__ */ f(
292
- De,
292
+ ) : /* @__PURE__ */ Pe(Ue, { children: [
293
+ /* @__PURE__ */ C(
294
+ Oe,
293
295
  {
294
- onCalculatePayroll: le,
295
- isCalculateDisabled: G.length > 0,
296
- onEdit: ie,
297
- onToggleExclude: ne,
298
- onViewBlockers: ue,
299
- employeeCompensations: x,
300
- employeeDetails: V,
296
+ onCalculatePayroll: ne,
297
+ isCalculateDisabled: B.length > 0,
298
+ onEdit: ue,
299
+ onToggleExclude: ce,
300
+ onViewBlockers: pe,
301
+ employeeCompensations: G,
302
+ employeeDetails: J,
301
303
  payPeriod: Q,
302
- paySchedule: I,
303
- payrollCategory: g,
304
- alerts: v,
305
- payrollAlert: ce,
306
- isPending: n || z || X || U,
307
- isCalculating: U || n,
308
- payrollBlockers: re,
309
- pagination: J,
310
- withReimbursements: O,
311
- grossUpEnabled: N,
312
- onGrossUpSelect: ee
304
+ paySchedule: z,
305
+ payrollCategory: h,
306
+ alerts: H,
307
+ payrollAlert: me,
308
+ isPending: k || Z || $,
309
+ isCalculating: k,
310
+ payrollBlockers: ie,
311
+ pagination: X,
312
+ withReimbursements: T,
313
+ grossUpEnabled: M,
314
+ onGrossUpSelect: oe
313
315
  }
314
316
  ),
315
- N && /* @__PURE__ */ f(
317
+ M && /* @__PURE__ */ C(
316
318
  Me,
317
319
  {
318
- isOpen: $,
319
- onCalculateGrossUp: oe,
320
- onApply: ae,
320
+ isOpen: te,
321
+ onCalculateGrossUp: ae,
322
+ onApply: re,
321
323
  onCancel: () => {
322
- w(!1);
324
+ A(!1);
323
325
  }
324
326
  }
325
327
  )
326
328
  ] });
327
329
  };
328
330
  export {
329
- mo as PayrollConfiguration
331
+ ut as PayrollConfiguration
330
332
  };
331
333
  //# sourceMappingURL=PayrollConfiguration.js.map