@gusto/embedded-react-sdk 0.56.2 → 0.56.4

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 (154) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/Common/FieldCaption/FieldCaption.js +19 -22
  3. package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
  4. package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js +6 -6
  5. package/dist/components/Common/PaginationControl/PaginationControl.js +66 -62
  6. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  7. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  8. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  9. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  10. package/dist/components/Company/PaySchedule/management/PaySchedule.js +60 -0
  11. package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -0
  12. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js +67 -0
  13. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js.map +1 -0
  14. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +59 -0
  15. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -0
  16. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +57 -0
  17. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -0
  18. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +46 -0
  19. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -0
  20. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +101 -0
  21. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -0
  22. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +81 -0
  23. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -0
  24. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js +18 -0
  25. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js.map +1 -0
  26. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +56 -0
  27. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -0
  28. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +34 -0
  29. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -0
  30. package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js +77 -0
  31. package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js.map +1 -0
  32. package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js +10 -0
  33. package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js.map +1 -0
  34. package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +66 -0
  35. package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -0
  36. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +75 -57
  37. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  38. package/dist/components/Company/StateTaxes/shared/requirementSetError.js +15 -0
  39. package/dist/components/Company/StateTaxes/shared/requirementSetError.js.map +1 -0
  40. package/dist/components/Company/exports/companyManagement.js +7 -0
  41. package/dist/components/Company/exports/companyManagement.js.map +1 -0
  42. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
  43. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
  44. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
  45. package/dist/components/Flow/Flow.js +1 -1
  46. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +28 -28
  47. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  48. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +51 -58
  49. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  50. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +12 -7
  51. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  52. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +87 -85
  53. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  54. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +1 -1
  55. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  56. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +55 -54
  57. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  58. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +66 -62
  59. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  60. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +129 -125
  61. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  62. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +30 -27
  63. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  64. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +41 -30
  65. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
  66. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
  67. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js +159 -152
  68. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js.map +1 -1
  69. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +61 -59
  70. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  71. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -31
  72. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  73. package/dist/components/Payroll/PayrollList/PayrollList.js +16 -16
  74. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  75. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  76. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +61 -61
  77. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  78. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +192 -193
  79. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  80. package/dist/components/Payroll/Transition/TransitionFlow.js +27 -22
  81. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
  82. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +55 -53
  83. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  84. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +44 -41
  85. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
  86. package/dist/components/Payroll/helpers.js +72 -67
  87. package/dist/components/Payroll/helpers.js.map +1 -1
  88. package/dist/components/Payroll/usePreparedPayrollData.js +34 -25
  89. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  90. package/dist/contexts/ApiProvider/ApiProvider.js +23 -22
  91. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  92. package/dist/contexts/ApiProvider/informationRequestEnumHook.js +30 -0
  93. package/dist/contexts/ApiProvider/informationRequestEnumHook.js.map +1 -0
  94. package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
  95. package/dist/helpers/dateFormatting.js.map +1 -1
  96. package/dist/helpers/formattedStrings.js +9 -8
  97. package/dist/helpers/formattedStrings.js.map +1 -1
  98. package/dist/i18n/I18n.js +2 -0
  99. package/dist/i18n/I18n.js.map +1 -1
  100. package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -0
  101. package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -0
  102. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +18 -0
  103. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -0
  104. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  105. package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -14
  106. package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
  107. package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
  108. package/dist/i18n/en/common.json.js +36 -38
  109. package/dist/i18n/en/common.json.js.map +1 -1
  110. package/dist/index.js +137 -135
  111. package/dist/index.js.map +1 -1
  112. package/dist/package.json.js +1 -1
  113. package/dist/shared/constants.js +39 -31
  114. package/dist/shared/constants.js.map +1 -1
  115. package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +24 -0
  116. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.d.ts +10 -0
  117. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.d.ts +11 -0
  118. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +9 -0
  119. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +35 -0
  120. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +29 -0
  121. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/index.d.ts +1 -0
  122. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.d.ts +7 -0
  123. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.d.ts +12 -0
  124. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +9 -0
  125. package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +20 -0
  126. package/dist/src/components/Company/PaySchedule/management/PayScheduleOverview.d.ts +11 -0
  127. package/dist/src/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.d.ts +18 -0
  128. package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -0
  129. package/dist/src/components/Company/PaySchedule/management/payScheduleManagementStateMachine.d.ts +12 -0
  130. package/dist/src/components/Company/StateTaxes/shared/requirementSetError.d.ts +18 -0
  131. package/dist/src/components/Company/StateTaxes/shared/requirementSetError.test.d.ts +1 -0
  132. package/dist/src/components/Company/exports/companyManagement.d.ts +2 -0
  133. package/dist/src/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +12 -0
  134. package/dist/src/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +6 -1
  135. package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.d.ts +2 -2
  136. package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +6 -1
  137. package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +7 -1
  138. package/dist/src/components/Payroll/helpers.d.ts +34 -0
  139. package/dist/src/components/Payroll/usePreparedPayrollData.d.ts +6 -1
  140. package/dist/src/components/index.d.ts +12 -0
  141. package/dist/src/contexts/ApiProvider/informationRequestEnumHook.d.ts +14 -0
  142. package/dist/src/contexts/ApiProvider/informationRequestEnumHook.test.d.ts +1 -0
  143. package/dist/src/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +2 -0
  144. package/dist/src/helpers/dateFormatting.d.ts +2 -2
  145. package/dist/src/helpers/formattedStrings.d.ts +15 -0
  146. package/dist/src/i18n/en/common.json.d.ts +0 -1
  147. package/dist/src/i18n/types.d.ts +96 -6
  148. package/dist/src/models/external.d.ts +12 -0
  149. package/dist/src/shared/constants.d.ts +16 -0
  150. package/dist/style.css +1 -1
  151. package/dist/types/sdkError.js +32 -21
  152. package/dist/types/sdkError.js.map +1 -1
  153. package/docs/guides/endpoint-inventory.json +59 -10
  154. package/package.json +7 -7
@@ -1,36 +1,36 @@
1
1
  import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
- import { useForm as ee, useFieldArray as Ae, useWatch as Me, FormProvider as ne } from "react-hook-form";
3
- import { useRef as Oe, useMemo as $, useState as ve } from "react";
4
- import Re from "classnames";
2
+ import { useForm as ne, useFieldArray as Me, useWatch as Oe, FormProvider as te } from "react-hook-form";
3
+ import { useRef as ve, useMemo as V, useState as Re } from "react";
4
+ import xe from "classnames";
5
5
  import { PayrollEmployeeCompensationsTypePaymentMethod as M } from "@gusto/embedded-api/models/components/payrollemployeecompensationstype";
6
- import { useTranslation as xe } from "react-i18next";
6
+ import { useTranslation as Se } from "react-i18next";
7
7
  import { z as s } from "zod";
8
- import { zodResolver as te } from "@hookform/resolvers/zod";
8
+ import { zodResolver as ie } from "@hookform/resolvers/zod";
9
9
  import c from "./PayrollEditEmployeePresentation.module.scss.js";
10
- import { TimeOffField as Se, PayoutTimeOffField as Ie } from "./TimeOffField.js";
10
+ import { TimeOffField as Ie, PayoutTimeOffField as Fe } from "./TimeOffField.js";
11
11
  import { Flex as P } from "../../Common/Flex/Flex.js";
12
12
  import { Grid as x } from "../../Common/Grid/Grid.js";
13
- import { EmptyData as Fe } from "../../Common/EmptyData/EmptyData.js";
14
- import { useComponentContext as De } from "../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import { useI18n as _e } from "../../../i18n/I18n.js";
16
- import { Form as Le } from "../../Common/Form/Form.js";
17
- import { formatNumberAsCurrency as ie, firstLastName as ke } from "../../../helpers/formattedStrings.js";
18
- import { getAdditionalEarningsCompensations as Ue, calculateGrossPay as re } from "../helpers.js";
19
- import { PayrollCategory as F, isOffCyclePayroll as me } from "../payrollTypes.js";
20
- import { COMPENSATION_NAME_REIMBURSEMENT as S, HOURS_COMPENSATION_NAMES as se, EXCLUDED_ADDITIONAL_EARNINGS as je, COMPENSATION_NAME_DOUBLE_OVERTIME as Ge, COMPENSATION_NAME_OVERTIME as He, COMPENSATION_NAME_REGULAR_HOURS as we, COMPENSATION_NAME_CASH_TIPS as $e, COMPENSATION_NAME_COMMISSION as Ve, COMPENSATION_NAME_CORRECTION_PAYMENT as Be, COMPENSATION_NAME_PAYCHECK_TIPS as ze, COMPENSATION_NAME_BONUS as We } from "../../../shared/constants.js";
21
- import qe from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
22
- import oe from "../../../assets/icons/plus-circle.svg.js";
23
- import Ye from "../../../assets/icons/trashcan.svg.js";
13
+ import { EmptyData as De } from "../../Common/EmptyData/EmptyData.js";
14
+ import { useComponentContext as _e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import { useI18n as Le } from "../../../i18n/I18n.js";
16
+ import { Form as ke } from "../../Common/Form/Form.js";
17
+ import { formatNumberAsCurrency as re, firstLastName as Ue, stripLeadingZeros as k } from "../../../helpers/formattedStrings.js";
18
+ import { getAdditionalEarningsCompensations as je, calculateGrossPay as se } from "../helpers.js";
19
+ import { PayrollCategory as F, isOffCyclePayroll as ue } from "../payrollTypes.js";
20
+ import { COMPENSATION_NAME_REIMBURSEMENT as S, HOURS_COMPENSATION_NAMES as oe, EXCLUDED_ADDITIONAL_EARNINGS as Ge, COMPENSATION_NAME_DOUBLE_OVERTIME as He, COMPENSATION_NAME_OVERTIME as we, COMPENSATION_NAME_REGULAR_HOURS as $e, COMPENSATION_NAME_CASH_TIPS as Ve, COMPENSATION_NAME_COMMISSION as Be, COMPENSATION_NAME_CORRECTION_PAYMENT as ze, COMPENSATION_NAME_PAYCHECK_TIPS as We, COMPENSATION_NAME_BONUS as qe } from "../../../shared/constants.js";
21
+ import Ye from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
22
+ import ae from "../../../assets/icons/plus-circle.svg.js";
23
+ import Ke from "../../../assets/icons/trashcan.svg.js";
24
24
  import { TextInputField as I } from "../../Common/Fields/TextInputField/TextInputField.js";
25
- import { RadioGroupField as Ke } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
26
- import { useDataView as Xe } from "../../Common/DataView/useDataView.js";
25
+ import { RadioGroupField as Xe } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
26
+ import { useDataView as Ze } from "../../Common/DataView/useDataView.js";
27
27
  import { DataView as Qe } from "../../Common/DataView/DataView.js";
28
- const Ze = s.object({
28
+ const Je = s.object({
29
29
  uuid: s.string().nullable().optional(),
30
30
  description: s.string(),
31
31
  amount: s.string(),
32
32
  recurring: s.boolean().optional()
33
- }), Je = s.object({
33
+ }), en = s.object({
34
34
  description: s.string(),
35
35
  amount: s.string().refine(
36
36
  (l) => {
@@ -39,14 +39,14 @@ const Ze = s.object({
39
39
  },
40
40
  { message: "validations.reimbursementAmount" }
41
41
  )
42
- }), en = s.string().optional().refine((l) => !l || parseFloat(l) >= 0, { message: "validations.negativeAmount" }), nn = s.object({
42
+ }), nn = s.string().optional().refine((l) => !l || parseFloat(l) >= 0, { message: "validations.negativeAmount" }), tn = s.object({
43
43
  hourlyCompensations: s.record(s.string(), s.record(s.string(), s.string().optional())),
44
44
  timeOffCompensations: s.record(s.string(), s.string().optional()),
45
45
  finalPayoutCompensations: s.record(s.string(), s.string().optional()),
46
- fixedCompensations: s.record(s.string(), en),
47
- reimbursements: s.array(Ze),
46
+ fixedCompensations: s.record(s.string(), nn),
47
+ reimbursements: s.array(Je),
48
48
  paymentMethod: s.enum(M).optional()
49
- }), ae = (l, C, k, p, o = F.Regular) => {
49
+ }), me = (l, C, U, p, o = F.Regular) => {
50
50
  const y = {
51
51
  ...C,
52
52
  paymentMethod: l.paymentMethod
@@ -59,7 +59,7 @@ const Ze = s.object({
59
59
  hours: m
60
60
  } : r;
61
61
  }
62
- ), y.paidTimeOff = k.map((r) => {
62
+ ), y.paidTimeOff = U.map((r) => {
63
63
  const m = o === F.Dismissal, { finalPayoutUnusedHoursInput: O, ...h } = r;
64
64
  if (m) {
65
65
  const u = l.finalPayoutCompensations[r.name] ?? r.finalPayoutUnusedHoursInput;
@@ -74,12 +74,12 @@ const Ze = s.object({
74
74
  hours: l.timeOffCompensations[r.name] || "0"
75
75
  };
76
76
  });
77
- const D = !me(o), T = [];
77
+ const D = !ue(o), T = [];
78
78
  return Object.entries(l.fixedCompensations).forEach(([r, m]) => {
79
79
  if (r.toLowerCase() === S.toLowerCase() && D)
80
80
  return;
81
81
  const h = C?.fixedCompensations?.find(
82
- (U) => U.name?.toLowerCase() === r.toLowerCase()
82
+ (j) => j.name?.toLowerCase() === r.toLowerCase()
83
83
  ), u = m === "" && h ? "0" : m;
84
84
  u !== void 0 && u !== "" && (h ? T.push({
85
85
  name: h.name,
@@ -96,10 +96,10 @@ const Ze = s.object({
96
96
  uuid: r.uuid ?? null,
97
97
  recurring: r.recurring
98
98
  })) : y.reimbursements = [], y;
99
- }, In = ({
99
+ }, Fn = ({
100
100
  className: l,
101
101
  onSave: C,
102
- onCancel: k,
102
+ onCancel: U,
103
103
  employee: p,
104
104
  employeeCompensation: o,
105
105
  isPending: y = !1,
@@ -110,70 +110,70 @@ const Ze = s.object({
110
110
  withReimbursements: O = !0,
111
111
  hasDirectDepositSetup: h = !0
112
112
  }) => {
113
- const { Button: u, ButtonIcon: U, Heading: f, Text: V } = De(), { t: n } = xe("Payroll.PayrollEditEmployee");
114
- _e("Payroll.PayrollEditEmployee");
115
- const b = p.jobs?.find((e) => e.primary), ue = o?.hourlyCompensations?.some(
113
+ const { Button: u, ButtonIcon: j, Heading: f, Text: B } = _e(), { t: n } = Se("Payroll.PayrollEditEmployee");
114
+ Le("Payroll.PayrollEditEmployee");
115
+ const b = p.jobs?.find((e) => e.primary), le = o?.hourlyCompensations?.some(
116
116
  (e) => e.jobUuid === b?.uuid
117
- ), v = b && ue ? [b] : [], B = Oe(null), g = qe({
118
- ref: B
117
+ ), v = b && le ? [b] : [], z = ve(null), g = Ye({
118
+ ref: z
119
119
  }).includes("small");
120
120
  o?.hourlyCompensations?.forEach((e) => {
121
121
  const i = p.jobs?.find((d) => d.uuid === e.jobUuid);
122
122
  i && !v.find((d) => d.uuid === i.uuid) && v.push(i);
123
123
  });
124
- const A = (o?.paidTimeOff || []).filter((e) => e.name), j = Ue({
124
+ const A = (o?.paidTimeOff || []).filter((e) => e.name), G = je({
125
125
  flsaStatus: b?.compensations?.[0]?.flsaStatus,
126
126
  existingFixedCompensations: o?.fixedCompensations || [],
127
127
  primaryJobUuid: b?.uuid,
128
128
  fixedCompensationTypes: D,
129
- excludedTypes: je
130
- }), _ = !me(m), le = $(
129
+ excludedTypes: Ge
130
+ }), _ = !ue(m), de = V(
131
131
  () => O && _ ? o?.reimbursements ?? [] : [],
132
132
  [O, _, o?.reimbursements]
133
- ), de = $(
133
+ ), ce = V(
134
134
  () => o?.fixedCompensations?.find(
135
135
  (e) => e.name?.toLowerCase() === S.toLowerCase()
136
136
  ),
137
137
  [o?.fixedCompensations]
138
- ), z = O && !_ && !!b?.uuid, W = (e, i) => o?.hourlyCompensations?.find(
138
+ ), W = O && !_ && !!b?.uuid, q = (e, i) => o?.hourlyCompensations?.find(
139
139
  (d) => d.jobUuid === e && d.name?.toLowerCase() === i.toLowerCase()
140
- ), ce = (e) => {
140
+ ), pe = (e) => {
141
141
  switch (e) {
142
- case we:
142
+ case $e:
143
143
  return n("compensationNames.regularHours");
144
- case He:
144
+ case we:
145
145
  return n("compensationNames.overtime");
146
- case Ge:
146
+ case He:
147
147
  return n("compensationNames.doubleOvertime");
148
148
  default:
149
149
  return e;
150
150
  }
151
- }, q = (e) => {
151
+ }, Y = (e) => {
152
152
  switch (e) {
153
- case We:
153
+ case qe:
154
154
  return n("fixedCompensationNames.bonus");
155
- case ze:
155
+ case We:
156
156
  return n("fixedCompensationNames.paycheckTips");
157
- case Be:
157
+ case ze:
158
158
  return n("fixedCompensationNames.correctionPayment");
159
- case Ve:
159
+ case Be:
160
160
  return n("fixedCompensationNames.commission");
161
- case $e:
161
+ case Ve:
162
162
  return n("fixedCompensationNames.cashTips");
163
163
  case S:
164
164
  return n("fixedCompensationNames.reimbursement");
165
165
  default:
166
166
  return e;
167
167
  }
168
- }, pe = () => {
168
+ }, fe = () => {
169
169
  const e = o?.paymentMethod;
170
170
  return e ? !h && e === M.DirectDeposit ? M.Check : e : h ? M.DirectDeposit : M.Check;
171
- }, fe = {
171
+ }, he = {
172
172
  hourlyCompensations: (() => {
173
173
  const e = {};
174
174
  return v.forEach((i) => {
175
- se.forEach((d) => {
176
- const R = W(i.uuid, d);
175
+ oe.forEach((d) => {
176
+ const R = q(i.uuid, d);
177
177
  R && (e[i.uuid] || (e[i.uuid] = {}), e[i.uuid][R.name] = R.hours ? parseFloat(R.hours).toString() : "");
178
178
  });
179
179
  }), e;
@@ -192,46 +192,46 @@ const Ze = s.object({
192
192
  })(),
193
193
  fixedCompensations: (() => {
194
194
  const e = {};
195
- return j.forEach((i) => {
195
+ return G.forEach((i) => {
196
196
  e[i.name] = i.amount ?? "";
197
- }), z && (e[S] = de?.amount ?? "0.00"), e;
197
+ }), W && (e[S] = ce?.amount ?? "0.00"), e;
198
198
  })(),
199
- reimbursements: le.map((e) => ({
199
+ reimbursements: de.map((e) => ({
200
200
  uuid: e.uuid ?? null,
201
201
  description: e.description ?? "",
202
202
  amount: e.amount,
203
203
  recurring: e.recurring ?? !1
204
204
  })),
205
- paymentMethod: pe()
206
- }, L = ee({
207
- resolver: te(nn),
208
- defaultValues: fe
205
+ paymentMethod: fe()
206
+ }, L = ne({
207
+ resolver: ie(tn),
208
+ defaultValues: he
209
209
  }), {
210
- fields: Y,
211
- append: he,
212
- remove: be,
213
- update: ge
214
- } = Ae({
210
+ fields: K,
211
+ append: be,
212
+ remove: ge,
213
+ update: Ce
214
+ } = Me({
215
215
  control: L.control,
216
216
  name: "reimbursements"
217
- }), Ce = (e) => {
218
- const i = Y[e];
219
- i && (i.uuid ? ge(e, { ...i, amount: "0" }) : be(e));
220
- }, G = Y.map((e, i) => ({ ...e, originalIndex: i })).filter((e) => parseFloat(e.amount || "0") !== 0), [K, H] = ve(!1), w = ee({
221
- resolver: te(Je),
217
+ }), ye = (e) => {
218
+ const i = K[e];
219
+ i && (i.uuid ? Ce(e, { ...i, amount: "0" }) : ge(e));
220
+ }, H = K.map((e, i) => ({ ...e, originalIndex: i })).filter((e) => parseFloat(e.amount || "0") !== 0), [X, w] = Re(!1), $ = ne({
221
+ resolver: ie(en),
222
222
  defaultValues: { description: "", amount: "" }
223
- }), X = () => {
224
- H(!1), w.reset();
225
- }, ye = (e) => {
223
+ }), Z = () => {
224
+ w(!1), $.reset();
225
+ }, Ne = (e) => {
226
226
  const i = parseFloat(e.amount);
227
- he({
227
+ be({
228
228
  uuid: null,
229
229
  description: e.description.trim(),
230
230
  amount: i.toFixed(2),
231
231
  recurring: !1
232
- }), X();
233
- }, Ne = Xe({
234
- data: G,
232
+ }), Z();
233
+ }, Ee = Ze({
234
+ data: H,
235
235
  columns: [
236
236
  {
237
237
  key: "description",
@@ -242,7 +242,7 @@ const Ze = s.object({
242
242
  key: "amount",
243
243
  title: n("reimbursementAmountColumn"),
244
244
  justify: "end",
245
- render: (e) => ie(parseFloat(e.amount || "0"))
245
+ render: (e) => re(parseFloat(e.amount || "0"))
246
246
  },
247
247
  {
248
248
  key: "recurring",
@@ -254,35 +254,35 @@ const Ze = s.object({
254
254
  if (e.recurring) return null;
255
255
  const i = e.description.trim() || n("reimbursementUnnamedFallback");
256
256
  return /* @__PURE__ */ t(
257
- U,
257
+ j,
258
258
  {
259
259
  variant: "tertiary",
260
260
  onClick: () => {
261
- Ce(e.originalIndex);
261
+ ye(e.originalIndex);
262
262
  },
263
263
  "aria-label": n("removeReimbursementLabel", { description: i }),
264
- children: /* @__PURE__ */ t(Ye, { "aria-hidden": !0 })
264
+ children: /* @__PURE__ */ t(Ke, { "aria-hidden": !0 })
265
265
  }
266
266
  );
267
267
  },
268
- emptyState: () => /* @__PURE__ */ t(Fe, { title: n("reimbursementEmptyTitle"), children: /* @__PURE__ */ t(
268
+ emptyState: () => /* @__PURE__ */ t(De, { title: n("reimbursementEmptyTitle"), children: /* @__PURE__ */ t(
269
269
  u,
270
270
  {
271
271
  variant: "secondary",
272
272
  onClick: () => {
273
- H(!0);
273
+ w(!0);
274
274
  },
275
- icon: /* @__PURE__ */ t(oe, { "aria-hidden": !0 }),
275
+ icon: /* @__PURE__ */ t(ae, { "aria-hidden": !0 }),
276
276
  children: n("addReimbursementCta")
277
277
  }
278
278
  ) })
279
- }), N = Me({
279
+ }), N = Oe({
280
280
  control: L.control
281
- }), Ee = $(() => {
281
+ }), Pe = V(() => {
282
282
  try {
283
283
  const e = {};
284
- N.hourlyCompensations && Object.entries(N.hourlyCompensations).forEach(([E, J]) => {
285
- J && (e[E] = J);
284
+ N.hourlyCompensations && Object.entries(N.hourlyCompensations).forEach(([E, ee]) => {
285
+ ee && (e[E] = ee);
286
286
  });
287
287
  const i = (N.reimbursements ?? []).map((E) => ({
288
288
  uuid: E.uuid ?? null,
@@ -296,14 +296,14 @@ const Ze = s.object({
296
296
  fixedCompensations: N.fixedCompensations || {},
297
297
  reimbursements: i,
298
298
  paymentMethod: N.paymentMethod
299
- }, R = ae(
299
+ }, R = me(
300
300
  d,
301
301
  o,
302
302
  (o?.paidTimeOff || []).filter((E) => E.name),
303
303
  b?.uuid,
304
304
  m
305
305
  );
306
- return re(
306
+ return se(
307
307
  R,
308
308
  p,
309
309
  T,
@@ -311,7 +311,7 @@ const Ze = s.object({
311
311
  m
312
312
  );
313
313
  } catch {
314
- return o ? re(
314
+ return o ? se(
315
315
  o,
316
316
  p,
317
317
  T,
@@ -327,11 +327,11 @@ const Ze = s.object({
327
327
  T,
328
328
  r,
329
329
  m
330
- ]), Pe = ke({
330
+ ]), Te = Ue({
331
331
  first_name: p.firstName,
332
332
  last_name: p.lastName
333
- }), Te = (e) => {
334
- const i = ae(
333
+ }), Ae = (e) => {
334
+ const i = me(
335
335
  e,
336
336
  o,
337
337
  A,
@@ -339,7 +339,7 @@ const Ze = s.object({
339
339
  m
340
340
  );
341
341
  C(i);
342
- }, Q = ie(Ee || 0), Z = /* @__PURE__ */ a(
342
+ }, Q = re(Pe || 0), J = /* @__PURE__ */ a(
343
343
  P,
344
344
  {
345
345
  flexDirection: g ? "row" : "column",
@@ -347,11 +347,11 @@ const Ze = s.object({
347
347
  alignItems: g ? "flex-start" : "stretch",
348
348
  gap: 12,
349
349
  children: [
350
- /* @__PURE__ */ t(u, { variant: "secondary", onClick: k, title: n("cancelCta"), children: n("cancelCta") }),
350
+ /* @__PURE__ */ t(u, { variant: "secondary", onClick: U, title: n("cancelCta"), children: n("cancelCta") }),
351
351
  /* @__PURE__ */ t(
352
352
  u,
353
353
  {
354
- onClick: L.handleSubmit(Te),
354
+ onClick: L.handleSubmit(Ae),
355
355
  title: n("saveCta"),
356
356
  isLoading: y,
357
357
  children: n("saveCta")
@@ -360,31 +360,31 @@ const Ze = s.object({
360
360
  ]
361
361
  }
362
362
  );
363
- return /* @__PURE__ */ a("div", { ref: B, className: Re(c.container, l), children: [
363
+ return /* @__PURE__ */ a("div", { ref: z, className: xe(c.container, l), children: [
364
364
  /* @__PURE__ */ t(
365
365
  "div",
366
366
  {
367
367
  className: `${c.headerSection} ${g ? "" : c.headerSectionSticky}`,
368
368
  children: /* @__PURE__ */ a(P, { justifyContent: "space-between", children: [
369
369
  /* @__PURE__ */ a(P, { flexDirection: "column", alignItems: "stretch", gap: g ? 8 : 2, children: [
370
- /* @__PURE__ */ t(f, { as: "h1", styledAs: g ? "h2" : "h4", children: n("pageTitle", { employeeName: Pe }) }),
370
+ /* @__PURE__ */ t(f, { as: "h1", styledAs: g ? "h2" : "h4", children: n("pageTitle", { employeeName: Te }) }),
371
371
  g ? /* @__PURE__ */ a(P, { flexDirection: "column", gap: 6, children: [
372
372
  /* @__PURE__ */ t(f, { as: "h2", styledAs: "h3", children: Q }),
373
- /* @__PURE__ */ t(V, { className: c.grossPayLabel, children: n("grossPayLabel") })
373
+ /* @__PURE__ */ t(B, { className: c.grossPayLabel, children: n("grossPayLabel") })
374
374
  ] }) : /* @__PURE__ */ t(f, { as: "h2", styledAs: "h6", className: c.grossPayLabel, children: n("grossPayLabelMobile", { grossPay: Q }) })
375
375
  ] }),
376
- g && Z
376
+ g && J
377
377
  ] })
378
378
  }
379
379
  ),
380
- /* @__PURE__ */ a(ne, { ...L, children: [
381
- /* @__PURE__ */ a(Le, { children: [
380
+ /* @__PURE__ */ a(te, { ...L, children: [
381
+ /* @__PURE__ */ a(ke, { children: [
382
382
  v.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
383
383
  /* @__PURE__ */ t(f, { as: "h3", children: n("regularHoursTitle") }),
384
384
  v.map((e) => /* @__PURE__ */ a(P, { flexDirection: "column", gap: 8, children: [
385
385
  v.length > 1 && /* @__PURE__ */ t(f, { as: "h4", children: e.title }),
386
- /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: se.map((i) => {
387
- const d = W(
386
+ /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: oe.map((i) => {
387
+ const d = q(
388
388
  e.uuid,
389
389
  i
390
390
  );
@@ -394,8 +394,9 @@ const Ze = s.object({
394
394
  {
395
395
  type: "number",
396
396
  min: 0,
397
+ transform: k,
397
398
  adornmentEnd: n("hoursUnit"),
398
- label: ce(i),
399
+ label: pe(i),
399
400
  name: `hourlyCompensations.${e.uuid}.${d.name}`
400
401
  },
401
402
  i
@@ -406,7 +407,7 @@ const Ze = s.object({
406
407
  A.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
407
408
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: m === F.Dismissal ? n("timeOffTitleDismissal") : n("timeOffTitle") }),
408
409
  /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: A.map((e) => /* @__PURE__ */ t(
409
- Se,
410
+ Ie,
410
411
  {
411
412
  timeOff: e,
412
413
  employee: p
@@ -417,10 +418,10 @@ const Ze = s.object({
417
418
  m === F.Dismissal && A.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
418
419
  /* @__PURE__ */ a(P, { flexDirection: "column", gap: 4, children: [
419
420
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("finalPayoutTitle") }),
420
- /* @__PURE__ */ t(V, { variant: "supporting", children: n("finalPayoutDescription") })
421
+ /* @__PURE__ */ t(B, { variant: "supporting", children: n("finalPayoutDescription") })
421
422
  ] }),
422
423
  /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: A.map((e) => /* @__PURE__ */ t(
423
- Ie,
424
+ Fe,
424
425
  {
425
426
  timeOff: e,
426
427
  employee: p
@@ -428,20 +429,21 @@ const Ze = s.object({
428
429
  `payout-${e.name}`
429
430
  )) })
430
431
  ] }),
431
- j.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
432
+ G.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
432
433
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("additionalEarningsTitle") }),
433
434
  /* @__PURE__ */ t(
434
435
  x,
435
436
  {
436
437
  gridTemplateColumns: { base: "1fr", small: [320, 320], large: [320, 320, 320] },
437
438
  gap: 20,
438
- children: j.map((e) => /* @__PURE__ */ t(
439
+ children: G.map((e) => /* @__PURE__ */ t(
439
440
  I,
440
441
  {
441
442
  type: "number",
442
443
  min: 0,
444
+ transform: k,
443
445
  adornmentStart: "$",
444
- label: q(e.name),
446
+ label: Y(e.name),
445
447
  name: `fixedCompensations.${e.name}`,
446
448
  errorMessage: n("validations.negativeAmount")
447
449
  },
@@ -450,15 +452,16 @@ const Ze = s.object({
450
452
  }
451
453
  )
452
454
  ] }),
453
- z && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
455
+ W && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
454
456
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("reimbursementTitle") }),
455
457
  /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ t(
456
458
  I,
457
459
  {
458
460
  type: "number",
459
461
  min: 0,
462
+ transform: k,
460
463
  adornmentStart: "$",
461
- label: q(S),
464
+ label: Y(S),
462
465
  name: `fixedCompensations.${S}`,
463
466
  errorMessage: n("validations.negativeAmount")
464
467
  }
@@ -466,8 +469,8 @@ const Ze = s.object({
466
469
  ] }),
467
470
  O && _ && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
468
471
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("reimbursementTitle") }),
469
- !(G.length === 0 && K) && /* @__PURE__ */ t(Qe, { label: n("reimbursementsTableLabel"), ...Ne }),
470
- K ? /* @__PURE__ */ t(ne, { ...w, children: /* @__PURE__ */ a(P, { flexDirection: "column", gap: 12, children: [
472
+ !(H.length === 0 && X) && /* @__PURE__ */ t(Qe, { label: n("reimbursementsTableLabel"), ...Ee }),
473
+ X ? /* @__PURE__ */ t(te, { ...$, children: /* @__PURE__ */ a(P, { flexDirection: "column", gap: 12, children: [
471
474
  /* @__PURE__ */ a(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: [
472
475
  /* @__PURE__ */ t(
473
476
  I,
@@ -483,6 +486,7 @@ const Ze = s.object({
483
486
  name: "amount",
484
487
  type: "number",
485
488
  min: 0,
489
+ transform: k,
486
490
  adornmentStart: "$",
487
491
  isRequired: !0,
488
492
  label: n("reimbursementAmountLabel"),
@@ -491,18 +495,18 @@ const Ze = s.object({
491
495
  )
492
496
  ] }),
493
497
  /* @__PURE__ */ a(P, { gap: 12, children: [
494
- /* @__PURE__ */ t(u, { onClick: w.handleSubmit(ye), children: n("saveReimbursementCta") }),
495
- /* @__PURE__ */ t(u, { variant: "secondary", onClick: X, children: n("cancelReimbursementCta") })
498
+ /* @__PURE__ */ t(u, { onClick: $.handleSubmit(Ne), children: n("saveReimbursementCta") }),
499
+ /* @__PURE__ */ t(u, { variant: "secondary", onClick: Z, children: n("cancelReimbursementCta") })
496
500
  ] })
497
- ] }) }) : G.length > 0 && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
501
+ ] }) }) : H.length > 0 && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
498
502
  u,
499
503
  {
500
504
  variant: "secondary",
501
505
  onClick: () => {
502
- H(!0);
506
+ w(!0);
503
507
  },
504
508
  title: n("addReimbursementLink"),
505
- icon: /* @__PURE__ */ t(oe, { "aria-hidden": !0 }),
509
+ icon: /* @__PURE__ */ t(ae, { "aria-hidden": !0 }),
506
510
  children: n("addReimbursementLink")
507
511
  }
508
512
  ) })
@@ -510,7 +514,7 @@ const Ze = s.object({
510
514
  h && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
511
515
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("paymentMethodTitle") }),
512
516
  /* @__PURE__ */ t(
513
- Ke,
517
+ Xe,
514
518
  {
515
519
  name: "paymentMethod",
516
520
  isRequired: !0,
@@ -530,11 +534,11 @@ const Ze = s.object({
530
534
  )
531
535
  ] })
532
536
  ] }),
533
- !g && Z
537
+ !g && J
534
538
  ] })
535
539
  ] });
536
540
  };
537
541
  export {
538
- In as PayrollEditEmployeePresentation
542
+ Fn as PayrollEditEmployeePresentation
539
543
  };
540
544
  //# sourceMappingURL=PayrollEditEmployeePresentation.js.map