@gusto/embedded-react-sdk 0.51.0 → 0.51.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 (530) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/Base/useBaseSubmit.js +4 -4
  3. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  4. package/dist/components/Common/DocumentList/DocumentList.d.ts +8 -1
  5. package/dist/components/Common/DocumentList/DocumentList.js +24 -21
  6. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  7. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +2 -2
  8. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  9. package/dist/components/Common/TaxInputs/TaxInputs.d.ts +2 -2
  10. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  11. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +5 -5
  12. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.d.ts +1 -1
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +9 -8
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +3 -3
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.d.ts +1 -1
  19. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +9 -8
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +11 -10
  22. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  23. package/dist/components/Company/BankAccount/BankAccount.js +1 -1
  24. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  25. package/dist/components/Company/BankAccount/BankAccountComponents.d.ts +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  27. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js +9 -8
  30. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  31. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
  32. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  33. package/dist/components/Company/BankAccount/BankAccountList/context.d.ts +1 -1
  34. package/dist/components/Company/BankAccount/BankAccountList/context.js.map +1 -1
  35. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  37. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  38. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  39. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.d.ts +2 -2
  40. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +9 -8
  41. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  42. package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
  43. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  44. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.d.ts +2 -2
  45. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  46. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +1 -1
  47. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +3 -3
  48. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -1
  49. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  50. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  51. package/dist/components/Company/FederalTaxes/Form.js +1 -1
  52. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  53. package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +1 -1
  54. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -11
  55. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  56. package/dist/components/Company/Industry/Context.js +12 -11
  57. package/dist/components/Company/Industry/Context.js.map +1 -1
  58. package/dist/components/Company/Industry/Industry.js +2 -2
  59. package/dist/components/Company/Industry/Industry.js.map +1 -1
  60. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -7
  61. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  62. package/dist/components/Company/Locations/LocationForm/LocationForm.js +46 -45
  63. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  64. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +9 -8
  65. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  66. package/dist/components/Company/Locations/LocationsList/LocationsList.js +1 -1
  67. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  68. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -1
  69. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +9 -8
  70. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  71. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +1 -1
  72. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  73. package/dist/components/Company/OnboardingOverview/context.d.ts +1 -1
  74. package/dist/components/Company/OnboardingOverview/context.js +9 -8
  75. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  76. package/dist/components/Company/PaySchedule/PaySchedule.js +1 -1
  77. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  78. package/dist/components/Company/PaySchedule/PayScheduleList.js +1 -1
  79. package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
  80. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +2 -2
  81. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +6 -6
  82. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
  83. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -3
  84. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  85. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +2 -2
  86. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  87. package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.d.ts +1 -1
  88. package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +1 -1
  89. package/dist/components/Company/StateTaxes/StateTaxesForm/context.d.ts +1 -1
  90. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +9 -8
  91. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  92. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +1 -1
  93. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  94. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
  95. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  96. package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -1
  97. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +9 -8
  98. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  99. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +2 -2
  100. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js +3 -3
  101. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js.map +1 -1
  102. package/dist/components/Contractor/ContractorList/index.js +1 -1
  103. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  104. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +1 -1
  105. package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
  106. package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
  107. package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.d.ts +1 -1
  108. package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  109. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.d.ts +3 -1
  110. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +64 -51
  111. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
  112. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.d.ts +1 -1
  113. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js +1 -1
  114. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -1
  115. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +201 -161
  116. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  117. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.d.ts +2 -2
  118. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +3 -3
  119. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
  120. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +1 -1
  121. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +55 -54
  122. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
  123. package/dist/components/Contractor/Landing/Landing.js +2 -2
  124. package/dist/components/Contractor/Landing/Landing.js.map +1 -1
  125. package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -2
  126. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  127. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.d.ts +1 -1
  128. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js +2 -2
  129. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js.map +1 -1
  130. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +1 -1
  131. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js +2 -2
  132. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js.map +1 -1
  133. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +5 -5
  134. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  135. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +2 -2
  136. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  137. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -2
  138. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  139. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +1 -1
  140. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -1
  141. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +4 -4
  142. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  143. package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +1 -1
  144. package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -1
  145. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  146. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +3 -3
  147. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  148. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +2 -2
  149. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  150. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +4 -4
  151. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
  152. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +3 -3
  153. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  154. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +3 -3
  155. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
  156. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +3 -3
  157. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  158. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +3 -3
  159. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  160. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +1 -1
  161. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  162. package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +1 -1
  163. package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +1 -1
  164. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +1 -1
  165. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
  166. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +1 -1
  167. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +3 -3
  168. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
  169. package/dist/components/Contractor/Submit/Submit.js +3 -3
  170. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  171. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +1 -1
  172. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
  173. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +1 -1
  174. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
  175. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +1 -1
  176. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
  177. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
  178. package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +2 -2
  179. package/dist/components/Employee/Compensation/onboarding/Compensation.js +1 -1
  180. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
  181. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +2 -2
  182. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -1
  183. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +2 -2
  184. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
  185. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +1 -1
  186. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
  188. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +1 -1
  189. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -1
  190. package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.d.ts +2 -2
  191. package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.js.map +1 -1
  192. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +3 -3
  193. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  194. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +4 -4
  195. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +7 -7
  196. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  197. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.d.ts +1 -1
  198. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js +4 -4
  199. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
  200. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +3 -3
  201. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +7 -7
  202. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  203. package/dist/components/Employee/Dashboard/Dashboard.js +1 -1
  204. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  205. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  206. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
  207. package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
  208. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +1 -1
  209. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
  210. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +1 -1
  211. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
  212. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -1
  213. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
  214. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +1 -1
  215. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
  216. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -1
  217. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
  218. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +1 -1
  219. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -1
  220. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +1 -1
  221. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -1
  222. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -1
  223. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +1 -1
  224. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
  225. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +1 -1
  226. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -1
  227. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +2 -2
  228. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +5 -5
  229. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
  230. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +1 -1
  231. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
  232. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +1 -1
  233. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -1
  234. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +1 -1
  235. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +3 -3
  236. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
  237. package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +1 -1
  238. package/dist/components/Employee/Deductions/shared/useDeductionsList.js +2 -2
  239. package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -1
  240. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +1 -1
  241. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -1
  242. package/dist/components/Employee/Documents/management/DocumentManager.js +2 -2
  243. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
  244. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  245. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +1 -1
  246. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  247. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -1
  248. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +9 -8
  249. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  250. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +2 -2
  251. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  252. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +3 -3
  253. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  254. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +1 -1
  255. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  256. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +1 -1
  257. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  258. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +1 -1
  259. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  260. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +1 -1
  261. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  262. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +2 -2
  263. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
  264. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.d.ts +1 -1
  265. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js +1 -1
  266. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js.map +1 -1
  267. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +1 -1
  268. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js +3 -3
  269. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
  270. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
  271. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +1 -1
  272. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
  273. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +3 -3
  274. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +3 -3
  275. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
  276. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js +1 -1
  277. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
  278. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +1 -1
  279. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js +2 -2
  280. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -1
  281. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.d.ts +1 -1
  282. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js +1 -1
  283. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js.map +1 -1
  284. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
  285. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +1 -1
  286. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  287. package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +1 -1
  288. package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -1
  289. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +1 -1
  290. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +3 -3
  291. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
  292. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.d.ts +1 -1
  293. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js +1 -1
  294. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js.map +1 -1
  295. package/dist/components/Employee/Landing/Landing.js +2 -2
  296. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  297. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +1 -1
  298. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
  299. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +2 -2
  300. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  301. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
  302. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  303. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +1 -1
  304. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
  305. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +1 -1
  306. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +1 -1
  307. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
  308. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +1 -1
  309. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +2 -2
  310. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
  311. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +2 -2
  312. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +4 -4
  313. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -1
  314. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +2 -2
  315. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +3 -3
  316. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
  317. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.d.ts +1 -1
  318. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js +3 -3
  319. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js.map +1 -1
  320. package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
  321. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
  322. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
  323. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +1 -1
  324. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +5 -5
  325. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
  326. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.d.ts +1 -1
  327. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js +1 -1
  328. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
  329. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js +1 -1
  330. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
  331. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +1 -1
  332. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +4 -4
  333. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
  334. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +1 -1
  335. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -1
  336. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js +1 -1
  337. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
  338. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +2 -2
  339. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +5 -5
  340. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
  341. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +1 -1
  342. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  343. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
  344. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/stateTaxesFixtures.d.ts +1 -1
  345. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/toWireFormat.d.ts +1 -1
  346. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +1 -1
  347. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -1
  348. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +1 -1
  349. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -1
  350. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +1 -1
  351. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
  352. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +1 -1
  353. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +2 -2
  354. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
  355. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.d.ts +1 -1
  356. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js +1 -1
  357. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js.map +1 -1
  358. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +9 -9
  359. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  360. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -1
  361. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  362. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +4 -4
  363. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
  364. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
  365. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +1 -1
  366. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  367. package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +2 -2
  368. package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -1
  369. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +1 -1
  370. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +3 -3
  371. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
  372. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.d.ts +1 -1
  373. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js +1 -1
  374. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
  375. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +4 -4
  376. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  377. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +2 -2
  378. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  379. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +1 -1
  380. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  381. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -2
  382. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  383. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +3 -3
  384. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  385. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +2 -2
  386. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  387. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +1 -1
  388. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
  389. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +4 -4
  390. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
  391. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +8 -7
  392. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  393. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +1 -1
  394. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  395. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +4 -4
  396. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  397. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +1 -1
  398. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  399. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +1 -1
  400. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js +1 -1
  401. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  402. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +4 -4
  403. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  404. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +2 -2
  405. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  406. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +7 -7
  407. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  408. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -5
  409. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  410. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +4 -4
  411. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +5 -5
  412. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  413. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +3 -3
  414. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  415. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -4
  416. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +1 -1
  417. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  418. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +2 -2
  419. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  420. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +1 -1
  421. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  422. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  423. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +1 -1
  424. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
  425. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -1
  426. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  427. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +2 -2
  428. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
  429. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  430. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +4 -4
  431. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  432. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
  433. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  434. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +2 -2
  435. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  436. package/dist/components/Payroll/PayrollList/PayrollList.js +8 -8
  437. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  438. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -3
  439. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
  440. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  441. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +7 -7
  442. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  443. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -4
  444. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  445. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
  446. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  447. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -1
  448. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
  449. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +1 -1
  450. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  451. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -1
  452. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  453. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +1 -1
  454. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +2 -2
  455. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
  456. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
  457. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  458. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +2 -2
  459. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  460. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +1 -1
  461. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
  462. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +4 -4
  463. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  464. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +3 -3
  465. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  466. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +1 -1
  467. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
  468. package/dist/components/Payroll/helpers.d.ts +6 -6
  469. package/dist/components/Payroll/helpers.js +1 -1
  470. package/dist/components/Payroll/helpers.js.map +1 -1
  471. package/dist/components/Payroll/payrollTypes.js +1 -1
  472. package/dist/components/Payroll/payrollTypes.js.map +1 -1
  473. package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
  474. package/dist/components/Payroll/usePreparedPayrollData.js +16 -15
  475. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  476. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.d.ts +1 -1
  477. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +3 -3
  478. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
  479. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +3 -3
  480. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
  481. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +3 -3
  482. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  483. package/dist/components/TimeOff/PolicyList/PolicyList.js +6 -6
  484. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  485. package/dist/components/TimeOff/PolicySettings/PolicySettings.js +30 -29
  486. package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
  487. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +1 -1
  488. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
  489. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -1
  490. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -1
  491. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +27 -26
  492. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  493. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +2 -2
  494. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  495. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -1
  496. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +69 -68
  497. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  498. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +3 -3
  499. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  500. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +67 -66
  501. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  502. package/dist/contexts/ApiProvider/ApiProvider.js +3 -3
  503. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  504. package/dist/contexts/ApiProvider/apiVersion.d.ts +23 -0
  505. package/dist/contexts/ApiProvider/apiVersion.js +6 -0
  506. package/dist/contexts/ApiProvider/apiVersion.js.map +1 -0
  507. package/dist/contexts/ApiProvider/apiVersionHook.js +3 -2
  508. package/dist/contexts/ApiProvider/apiVersionHook.js.map +1 -1
  509. package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +1 -1
  510. package/dist/contexts/ApiProvider/createSdkQueryClient.js +7 -6
  511. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -1
  512. package/dist/helpers/apiErrorToList.d.ts +1 -1
  513. package/dist/helpers/apiErrorToList.js.map +1 -1
  514. package/dist/helpers/formattedStrings.d.ts +2 -2
  515. package/dist/helpers/formattedStrings.js.map +1 -1
  516. package/dist/hooks/useCompanyPaymentSpeed.d.ts +1 -1
  517. package/dist/hooks/useCompanyPaymentSpeed.js +1 -1
  518. package/dist/hooks/useCompanyPaymentSpeed.js.map +1 -1
  519. package/dist/i18n/en/Contractor.DocumentsList.json.js +20 -16
  520. package/dist/i18n/en/Contractor.DocumentsList.json.js.map +1 -1
  521. package/dist/i18n/types.d.ts +4 -0
  522. package/dist/models/external.d.ts +204 -204
  523. package/dist/shared/constants.d.ts +1 -1
  524. package/dist/shared/constants.js +2 -2
  525. package/dist/shared/constants.js.map +1 -1
  526. package/dist/types/hooks.d.ts +1 -1
  527. package/dist/types/sdkError.js +3 -3
  528. package/dist/types/sdkError.js.map +1 -1
  529. package/docs/guides/endpoint-inventory.json +1201 -297
  530. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"getPendingFutureWorkAddress.js","sources":["../../../../../src/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.ts"],"sourcesContent":["import type { Location } from '@gusto/embedded-api-v-2026-02-01/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2026-02-01/models/components/employeeworkaddress'\nimport { normalizeToDate } from '@/helpers/dateFormatting'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nconst startOfLocalDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate())\n\n/** @internal */\nexport function getPendingFutureWorkAddress(\n addresses: EmployeeWorkAddress[] | undefined,\n now: Date = new Date(),\n): EmployeeWorkAddress | undefined {\n if (!addresses?.length) {\n return undefined\n }\n\n const todayStart = startOfLocalDay(now)\n\n const pending = addresses.filter(address => {\n if (address.active === true) {\n return false\n }\n const raw = address.effectiveDate\n if (!raw) {\n return false\n }\n const parsed = normalizeToDate(raw)\n if (!parsed) {\n return false\n }\n return startOfLocalDay(parsed) > todayStart\n })\n\n if (pending.length === 0) {\n return undefined\n }\n\n pending.sort((a, b) => {\n const as = a.effectiveDate ?? ''\n const bs = b.effectiveDate ?? ''\n return as.localeCompare(bs)\n })\n\n return pending[0]\n}\n\n/** @internal */\nexport function formatPendingWorkAddressLine(\n address: EmployeeWorkAddress,\n companyLocations: Location[] | undefined,\n): string {\n if (address.locationUuid && companyLocations?.length) {\n const location = companyLocations.find(loc => loc.uuid === address.locationUuid)\n if (location) {\n return addressInline(location)\n }\n }\n const streetLine = [address.street1, address.street2].filter(Boolean).join(', ')\n const cityStateZip = [address.city, [address.state, address.zip].filter(Boolean).join(' ')]\n .filter(Boolean)\n .join(', ')\n const country = address.country.trim()\n return [streetLine, cityStateZip, country].filter(Boolean).join(', ')\n}\n"],"names":["startOfLocalDay","d","getPendingFutureWorkAddress","addresses","now","todayStart","pending","address","raw","parsed","normalizeToDate","a","b","as","bs","formatPendingWorkAddressLine","companyLocations","location","loc","addressInline","streetLine","cityStateZip","country"],"mappings":";;AAKA,MAAMA,IAAkB,CAACC,MAAY,IAAI,KAAKA,EAAE,eAAeA,EAAE,SAAA,GAAYA,EAAE,SAAS;AAGjF,SAASC,EACdC,GACAC,IAAY,oBAAI,QACiB;AACjC,MAAI,CAACD,GAAW;AACd;AAGF,QAAME,IAAaL,EAAgBI,CAAG,GAEhCE,IAAUH,EAAU,OAAO,CAAAI,MAAW;AAC1C,QAAIA,EAAQ,WAAW;AACrB,aAAO;AAET,UAAMC,IAAMD,EAAQ;AACpB,QAAI,CAACC;AACH,aAAO;AAET,UAAMC,IAASC,EAAgBF,CAAG;AAClC,WAAKC,IAGET,EAAgBS,CAAM,IAAIJ,IAFxB;AAAA,EAGX,CAAC;AAED,MAAIC,EAAQ,WAAW;AAIvB,WAAAA,EAAQ,KAAK,CAACK,GAAGC,MAAM;AACrB,YAAMC,IAAKF,EAAE,iBAAiB,IACxBG,IAAKF,EAAE,iBAAiB;AAC9B,aAAOC,EAAG,cAAcC,CAAE;AAAA,IAC5B,CAAC,GAEMR,EAAQ,CAAC;AAClB;AAGO,SAASS,EACdR,GACAS,GACQ;AACR,MAAIT,EAAQ,gBAAgBS,GAAkB,QAAQ;AACpD,UAAMC,IAAWD,EAAiB,KAAK,OAAOE,EAAI,SAASX,EAAQ,YAAY;AAC/E,QAAIU;AACF,aAAOE,EAAcF,CAAQ;AAAA,EAEjC;AACA,QAAMG,IAAa,CAACb,EAAQ,SAASA,EAAQ,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI,GACzEc,IAAe,CAACd,EAAQ,MAAM,CAACA,EAAQ,OAAOA,EAAQ,GAAG,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC,EACvF,OAAO,OAAO,EACd,KAAK,IAAI,GACNe,IAAUf,EAAQ,QAAQ,KAAA;AAChC,SAAO,CAACa,GAAYC,GAAcC,CAAO,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AACtE;"}
1
+ {"version":3,"file":"getPendingFutureWorkAddress.js","sources":["../../../../../src/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.ts"],"sourcesContent":["import type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { normalizeToDate } from '@/helpers/dateFormatting'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nconst startOfLocalDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate())\n\n/** @internal */\nexport function getPendingFutureWorkAddress(\n addresses: EmployeeWorkAddress[] | undefined,\n now: Date = new Date(),\n): EmployeeWorkAddress | undefined {\n if (!addresses?.length) {\n return undefined\n }\n\n const todayStart = startOfLocalDay(now)\n\n const pending = addresses.filter(address => {\n if (address.active === true) {\n return false\n }\n const raw = address.effectiveDate\n if (!raw) {\n return false\n }\n const parsed = normalizeToDate(raw)\n if (!parsed) {\n return false\n }\n return startOfLocalDay(parsed) > todayStart\n })\n\n if (pending.length === 0) {\n return undefined\n }\n\n pending.sort((a, b) => {\n const as = a.effectiveDate ?? ''\n const bs = b.effectiveDate ?? ''\n return as.localeCompare(bs)\n })\n\n return pending[0]\n}\n\n/** @internal */\nexport function formatPendingWorkAddressLine(\n address: EmployeeWorkAddress,\n companyLocations: Location[] | undefined,\n): string {\n if (address.locationUuid && companyLocations?.length) {\n const location = companyLocations.find(loc => loc.uuid === address.locationUuid)\n if (location) {\n return addressInline(location)\n }\n }\n const streetLine = [address.street1, address.street2].filter(Boolean).join(', ')\n const cityStateZip = [address.city, [address.state, address.zip].filter(Boolean).join(' ')]\n .filter(Boolean)\n .join(', ')\n const country = address.country.trim()\n return [streetLine, cityStateZip, country].filter(Boolean).join(', ')\n}\n"],"names":["startOfLocalDay","d","getPendingFutureWorkAddress","addresses","now","todayStart","pending","address","raw","parsed","normalizeToDate","a","b","as","bs","formatPendingWorkAddressLine","companyLocations","location","loc","addressInline","streetLine","cityStateZip","country"],"mappings":";;AAKA,MAAMA,IAAkB,CAACC,MAAY,IAAI,KAAKA,EAAE,eAAeA,EAAE,SAAA,GAAYA,EAAE,SAAS;AAGjF,SAASC,EACdC,GACAC,IAAY,oBAAI,QACiB;AACjC,MAAI,CAACD,GAAW;AACd;AAGF,QAAME,IAAaL,EAAgBI,CAAG,GAEhCE,IAAUH,EAAU,OAAO,CAAAI,MAAW;AAC1C,QAAIA,EAAQ,WAAW;AACrB,aAAO;AAET,UAAMC,IAAMD,EAAQ;AACpB,QAAI,CAACC;AACH,aAAO;AAET,UAAMC,IAASC,EAAgBF,CAAG;AAClC,WAAKC,IAGET,EAAgBS,CAAM,IAAIJ,IAFxB;AAAA,EAGX,CAAC;AAED,MAAIC,EAAQ,WAAW;AAIvB,WAAAA,EAAQ,KAAK,CAACK,GAAGC,MAAM;AACrB,YAAMC,IAAKF,EAAE,iBAAiB,IACxBG,IAAKF,EAAE,iBAAiB;AAC9B,aAAOC,EAAG,cAAcC,CAAE;AAAA,IAC5B,CAAC,GAEMR,EAAQ,CAAC;AAClB;AAGO,SAASS,EACdR,GACAS,GACQ;AACR,MAAIT,EAAQ,gBAAgBS,GAAkB,QAAQ;AACpD,UAAMC,IAAWD,EAAiB,KAAK,OAAOE,EAAI,SAASX,EAAQ,YAAY;AAC/E,QAAIU;AACF,aAAOE,EAAcF,CAAQ;AAAA,EAEjC;AACA,QAAMG,IAAa,CAACb,EAAQ,SAASA,EAAQ,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI,GACzEc,IAAe,CAACd,EAAQ,MAAM,CAACA,EAAQ,OAAOA,EAAQ,GAAG,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC,EACvF,OAAO,OAAO,EACd,KAAK,IAAI,GACNe,IAAUf,EAAQ,QAAQ,KAAA;AAChC,SAAO,CAACa,GAAYC,GAAcC,CAAO,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AACtE;"}
@@ -1,4 +1,4 @@
1
- import { EmployeeWorkAddress } from '@gusto/embedded-api-v-2026-02-01/models/components/employeeworkaddress';
1
+ import { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress';
2
2
  import { OnEventType } from '../../../Base/useBase';
3
3
  import { UseWorkAddressFormReady, UseWorkAddressFormResult } from '../../Profile/shared/useWorkAddressForm';
4
4
  import { BaseHookReady, HookLoadingResult } from '../../../../partner-hook-utils/types';
@@ -1,7 +1,7 @@
1
1
  import { useState as H, useMemo as g } from "react";
2
- import { useEmployeeAddressesDeleteWorkAddressMutation as C } from "@gusto/embedded-api-v-2026-02-01/react-query/employeeAddressesDeleteWorkAddress";
3
- import { useEmployeeAddressesGetWorkAddresses as G } from "@gusto/embedded-api-v-2026-02-01/react-query/employeeAddressesGetWorkAddresses";
4
- import { useEmployeesGet as K } from "@gusto/embedded-api-v-2026-02-01/react-query/employeesGet";
2
+ import { useEmployeeAddressesDeleteWorkAddressMutation as C } from "@gusto/embedded-api/react-query/employeeAddressesDeleteWorkAddress";
3
+ import { useEmployeeAddressesGetWorkAddresses as G } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
4
+ import { useEmployeesGet as K } from "@gusto/embedded-api/react-query/employeesGet";
5
5
  import { useBaseSubmit as O } from "../../../Base/useBaseSubmit.js";
6
6
  import { useWorkAddressForm as h } from "../../Profile/shared/useWorkAddressForm/useWorkAddressForm.js";
7
7
  import { composeErrorHandler as Q } from "../../../../partner-hook-utils/composeErrorHandler.js";
@@ -1 +1 @@
1
- {"version":3,"file":"useWorkAddressManagement.js","sources":["../../../../../src/components/Employee/WorkAddress/management/useWorkAddressManagement.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2026-02-01/models/components/employeeworkaddress'\nimport { useEmployeeAddressesDeleteWorkAddressMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/employeeAddressesDeleteWorkAddress'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2026-02-01/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2026-02-01/react-query/employeesGet'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { useWorkAddressForm } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport type {\n UseWorkAddressFormReady,\n UseWorkAddressFormResult,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseHookReady,\n HookErrorHandling,\n HookLoadingResult,\n} from '@/partner-hook-utils/types'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { normalizeToSDKError, SDKInternalError } from '@/types/sdkError'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Params for {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport interface UseWorkAddressManagementParams {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a work address is deleted. */\n onEvent: OnEventType<EventType, unknown>\n}\n\ninterface UseWorkAddressManagementDataPendingForms extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormResult\n changeWorkAddressForm: UseWorkAddressFormResult\n}\n\ninterface UseWorkAddressManagementDataReady extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n}\n\ninterface UseWorkAddressManagementStatusEmployeeError extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: true\n}\n\ninterface UseWorkAddressManagementStatusSuccess extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: false\n}\n\ninterface UseWorkAddressManagementActions {\n setEditTargetUuid: (workAddressUuid: string | undefined) => void\n confirmDeleteWorkAddress: (workAddressUuid: string) => Promise<boolean>\n}\n\ninterface UseWorkAddressManagementReadyEmployeeError extends BaseHookReady<\n UseWorkAddressManagementDataPendingForms,\n UseWorkAddressManagementStatusEmployeeError\n> {\n actions: UseWorkAddressManagementActions\n}\n\n/**\n * Ready state of {@link useWorkAddressManagement} when the employee was fetched successfully.\n *\n * @public\n */\nexport interface UseWorkAddressManagementReadySuccess extends BaseHookReady<\n UseWorkAddressManagementDataReady,\n UseWorkAddressManagementStatusSuccess\n> {\n /** Actions for changing the edit target and confirming work address deletion. */\n actions: UseWorkAddressManagementActions\n}\n\ntype UseWorkAddressManagementReady =\n UseWorkAddressManagementReadyEmployeeError | UseWorkAddressManagementReadySuccess\n\n/**\n * Return type of {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport type UseWorkAddressManagementResult = HookLoadingResult | UseWorkAddressManagementReady\n\n/**\n * Type guard for the success branch of {@link useWorkAddressManagement}.\n *\n * @param value - The hook result to narrow.\n * @returns `true` when the hook has finished loading and the employee fetch succeeded.\n * @public\n */\nexport function isUseWorkAddressManagementSuccess(\n value: UseWorkAddressManagementResult,\n): value is UseWorkAddressManagementReadySuccess {\n if (value.isLoading) {\n return false\n }\n return !value.status.isEmployeeError\n}\n\nfunction workAddressFormsReady(\n editWorkAddressForm: UseWorkAddressFormResult,\n changeWorkAddressForm: UseWorkAddressFormResult,\n): Pick<UseWorkAddressManagementDataReady, 'editWorkAddressForm' | 'changeWorkAddressForm'> {\n if (editWorkAddressForm.isLoading) {\n throw new SDKInternalError('Edit work address form is still loading')\n }\n if (changeWorkAddressForm.isLoading) {\n throw new SDKInternalError('Change work address form is still loading')\n }\n return {\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n}\n\n/**\n * Headless hook for managing an employee's work addresses.\n *\n * @remarks\n * Fetches the employee and their work addresses, exposes edit and change form hooks\n * for the address modal, and provides an action to delete a non-active address.\n * Use {@link isUseWorkAddressManagementSuccess} to narrow the ready state when the\n * employee fetch succeeded.\n *\n * @param params - {@link UseWorkAddressManagementParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state once data is available.\n * @public\n */\nexport function useWorkAddressManagement({\n employeeId,\n onEvent,\n}: UseWorkAddressManagementParams): UseWorkAddressManagementResult {\n const {\n baseSubmitHandler,\n error: rootSubmitError,\n setError: setRootSubmitError,\n } = useBaseSubmit('Employee.Management.WorkAddress')\n const deleteWorkAddressMutation = useEmployeeAddressesDeleteWorkAddressMutation()\n const [editTargetUuid, setEditTargetUuid] = useState<string | undefined>(undefined)\n\n const employeeQuery = useEmployeesGet({ employeeId }, { enabled: !!employeeId })\n const companyId = employeeQuery.data?.employee?.companyUuid\n\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { enabled: !!employeeId && !!companyId },\n )\n\n const employeeWorkAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n\n const currentWorkAddress = useMemo<EmployeeWorkAddress | null>(() => {\n if (!employeeWorkAddresses?.length) {\n return null\n }\n return employeeWorkAddresses.find(w => w.active) ?? employeeWorkAddresses[0] ?? null\n }, [employeeWorkAddresses])\n\n const workAddressUuidForEdit = editTargetUuid ?? currentWorkAddress?.uuid\n\n const editInactiveRow = useMemo(() => {\n if (!editTargetUuid || !employeeWorkAddresses) {\n return undefined\n }\n return employeeWorkAddresses.find(w => w.uuid === editTargetUuid)\n }, [editTargetUuid, employeeWorkAddresses])\n\n const editingWorkAddressRow = workAddressUuidForEdit\n ? employeeWorkAddresses?.find(w => w.uuid === workAddressUuidForEdit)\n : undefined\n\n const withEffectiveDateOnEdit = editInactiveRow ? editInactiveRow.active !== true : false\n\n const editWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n workAddressUuid: workAddressUuidForEdit,\n initialAddress: editingWorkAddressRow,\n withEffectiveDateField: withEffectiveDateOnEdit,\n })\n\n const changeWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField: true,\n })\n\n const employeeDisplayName = useMemo(() => {\n const employee = employeeQuery.data?.employee\n if (!employee) {\n return ''\n }\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }).trim()\n }, [employeeQuery.data?.employee])\n\n const isMissingCompany = !!employeeQuery.data?.employee && !companyId\n\n const errorHandling: HookErrorHandling = composeErrorHandler(\n [\n employeeQuery,\n workAddressesQuery,\n editWorkAddressForm,\n changeWorkAddressForm,\n ...(isMissingCompany\n ? [\n {\n errorHandling: {\n errors: [\n normalizeToSDKError(\n new SDKInternalError(\n 'Employee record is missing companyUuid, which is required to load work address locations.',\n ),\n ),\n ],\n retryQueries: () => {},\n clearSubmitError: () => {},\n },\n },\n ]\n : []),\n ],\n { submitError: rootSubmitError, setSubmitError: setRootSubmitError },\n )\n\n const confirmDeleteWorkAddress = async (workAddressUuid: string): Promise<boolean> => {\n const snapshot = employeeWorkAddresses?.find(w => w.uuid === workAddressUuid) ?? null\n\n let succeeded = false\n await baseSubmitHandler(\n { workAddressUuid, snapshot },\n async ({ workAddressUuid: uuid, snapshot: snap }) => {\n const target = employeeWorkAddresses?.find(w => w.uuid === uuid)\n if (!target) {\n throw new SDKInternalError('Work address not found')\n }\n if (target.active === true) {\n throw new SDKInternalError('Cannot delete the active work address')\n }\n\n await deleteWorkAddressMutation.mutateAsync({\n request: { workAddressUuid: uuid },\n })\n succeeded = true\n if (snap) {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED, snap)\n }\n },\n )\n return succeeded\n }\n\n const actions: UseWorkAddressManagementActions = {\n setEditTargetUuid,\n confirmDeleteWorkAddress,\n }\n\n const dataPayloadPendingForms: UseWorkAddressManagementDataPendingForms = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n\n if (employeeQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n if (employeeQuery.isError || isMissingCompany) {\n return {\n isLoading: false,\n data: dataPayloadPendingForms,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: true,\n },\n errorHandling,\n actions,\n }\n }\n\n if (workAddressesQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const isFormsLoading = editWorkAddressForm.isLoading || changeWorkAddressForm.isLoading\n if (isFormsLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const { editWorkAddressForm: editReady, changeWorkAddressForm: changeReady } =\n workAddressFormsReady(editWorkAddressForm, changeWorkAddressForm)\n\n const dataReady: UseWorkAddressManagementDataReady = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm: editReady,\n changeWorkAddressForm: changeReady,\n }\n\n return {\n isLoading: false,\n data: dataReady,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: false,\n },\n errorHandling,\n actions,\n }\n}\n"],"names":["isUseWorkAddressManagementSuccess","value","workAddressFormsReady","editWorkAddressForm","changeWorkAddressForm","SDKInternalError","useWorkAddressManagement","employeeId","onEvent","baseSubmitHandler","rootSubmitError","setRootSubmitError","useBaseSubmit","deleteWorkAddressMutation","useEmployeeAddressesDeleteWorkAddressMutation","editTargetUuid","setEditTargetUuid","useState","employeeQuery","useEmployeesGet","companyId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","employeeWorkAddresses","currentWorkAddress","useMemo","w","workAddressUuidForEdit","editInactiveRow","editingWorkAddressRow","withEffectiveDateOnEdit","useWorkAddressForm","employeeDisplayName","employee","firstLastName","isMissingCompany","errorHandling","composeErrorHandler","normalizeToSDKError","actions","workAddressUuid","snapshot","succeeded","uuid","snap","target","componentEvents","dataPayloadPendingForms","editReady","changeReady"],"mappings":";;;;;;;;;;AAsGO,SAASA,GACdC,GAC+C;AAC/C,SAAIA,EAAM,YACD,KAEF,CAACA,EAAM,OAAO;AACvB;AAEA,SAASC,EACPC,GACAC,GAC0F;AAC1F,MAAID,EAAoB;AACtB,UAAM,IAAIE,EAAiB,yCAAyC;AAEtE,MAAID,EAAsB;AACxB,UAAM,IAAIC,EAAiB,2CAA2C;AAExE,SAAO;AAAA,IACL,qBAAAF;AAAA,IACA,uBAAAC;AAAA,EAAA;AAEJ;AAeO,SAASE,GAAyB;AAAA,EACvC,YAAAC;AAAA,EACA,SAAAC;AACF,GAAmE;AACjE,QAAM;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,iCAAiC,GAC7CC,IAA4BC,EAAA,GAC5B,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,MAAS,GAE5EC,IAAgBC,EAAgB,EAAE,YAAAZ,EAAA,GAAc,EAAE,SAAS,CAAC,CAACA,GAAY,GACzEa,IAAYF,EAAc,MAAM,UAAU,aAE1CG,IAAqBC;AAAA,IACzB,EAAE,YAAAf,EAAA;AAAA,IACF,EAAE,SAAS,CAAC,CAACA,KAAc,CAAC,CAACa,EAAA;AAAA,EAAU,GAGnCG,IAAwBF,EAAmB,MAAM,2BAEjDG,IAAqBC,EAAoC,MACxDF,GAAuB,SAGrBA,EAAsB,KAAK,CAAAG,MAAKA,EAAE,MAAM,KAAKH,EAAsB,CAAC,KAAK,OAFvE,MAGR,CAACA,CAAqB,CAAC,GAEpBI,IAAyBZ,KAAkBS,GAAoB,MAE/DI,IAAkBH,EAAQ,MAAM;AACpC,QAAI,GAACV,KAAkB,CAACQ;AAGxB,aAA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AUlE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,MAVmD;AAAA,MACnD,qBAAA4B;AAAA,MACA,uBAAAT;AAAA,MACA,gBAAAR;AAAA,MACA,qBAAqBiC;AAAA,MACrB,uBAAuBC;AAAA,IAAA;AAAA,IAMvB,QAAQ;AAAA,MACN,iBAAiBpC,EAA0B;AAAA,MAC3C,iBAAiB;AAAA,IAAA;AAAA,IAEnB,eAAAuB;AAAA,IACA,SAAAG;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useWorkAddressManagement.js","sources":["../../../../../src/components/Employee/WorkAddress/management/useWorkAddressManagement.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesDeleteWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesDeleteWorkAddress'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { useWorkAddressForm } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport type {\n UseWorkAddressFormReady,\n UseWorkAddressFormResult,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseHookReady,\n HookErrorHandling,\n HookLoadingResult,\n} from '@/partner-hook-utils/types'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { normalizeToSDKError, SDKInternalError } from '@/types/sdkError'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Params for {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport interface UseWorkAddressManagementParams {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a work address is deleted. */\n onEvent: OnEventType<EventType, unknown>\n}\n\ninterface UseWorkAddressManagementDataPendingForms extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormResult\n changeWorkAddressForm: UseWorkAddressFormResult\n}\n\ninterface UseWorkAddressManagementDataReady extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n}\n\ninterface UseWorkAddressManagementStatusEmployeeError extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: true\n}\n\ninterface UseWorkAddressManagementStatusSuccess extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: false\n}\n\ninterface UseWorkAddressManagementActions {\n setEditTargetUuid: (workAddressUuid: string | undefined) => void\n confirmDeleteWorkAddress: (workAddressUuid: string) => Promise<boolean>\n}\n\ninterface UseWorkAddressManagementReadyEmployeeError extends BaseHookReady<\n UseWorkAddressManagementDataPendingForms,\n UseWorkAddressManagementStatusEmployeeError\n> {\n actions: UseWorkAddressManagementActions\n}\n\n/**\n * Ready state of {@link useWorkAddressManagement} when the employee was fetched successfully.\n *\n * @public\n */\nexport interface UseWorkAddressManagementReadySuccess extends BaseHookReady<\n UseWorkAddressManagementDataReady,\n UseWorkAddressManagementStatusSuccess\n> {\n /** Actions for changing the edit target and confirming work address deletion. */\n actions: UseWorkAddressManagementActions\n}\n\ntype UseWorkAddressManagementReady =\n UseWorkAddressManagementReadyEmployeeError | UseWorkAddressManagementReadySuccess\n\n/**\n * Return type of {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport type UseWorkAddressManagementResult = HookLoadingResult | UseWorkAddressManagementReady\n\n/**\n * Type guard for the success branch of {@link useWorkAddressManagement}.\n *\n * @param value - The hook result to narrow.\n * @returns `true` when the hook has finished loading and the employee fetch succeeded.\n * @public\n */\nexport function isUseWorkAddressManagementSuccess(\n value: UseWorkAddressManagementResult,\n): value is UseWorkAddressManagementReadySuccess {\n if (value.isLoading) {\n return false\n }\n return !value.status.isEmployeeError\n}\n\nfunction workAddressFormsReady(\n editWorkAddressForm: UseWorkAddressFormResult,\n changeWorkAddressForm: UseWorkAddressFormResult,\n): Pick<UseWorkAddressManagementDataReady, 'editWorkAddressForm' | 'changeWorkAddressForm'> {\n if (editWorkAddressForm.isLoading) {\n throw new SDKInternalError('Edit work address form is still loading')\n }\n if (changeWorkAddressForm.isLoading) {\n throw new SDKInternalError('Change work address form is still loading')\n }\n return {\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n}\n\n/**\n * Headless hook for managing an employee's work addresses.\n *\n * @remarks\n * Fetches the employee and their work addresses, exposes edit and change form hooks\n * for the address modal, and provides an action to delete a non-active address.\n * Use {@link isUseWorkAddressManagementSuccess} to narrow the ready state when the\n * employee fetch succeeded.\n *\n * @param params - {@link UseWorkAddressManagementParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state once data is available.\n * @public\n */\nexport function useWorkAddressManagement({\n employeeId,\n onEvent,\n}: UseWorkAddressManagementParams): UseWorkAddressManagementResult {\n const {\n baseSubmitHandler,\n error: rootSubmitError,\n setError: setRootSubmitError,\n } = useBaseSubmit('Employee.Management.WorkAddress')\n const deleteWorkAddressMutation = useEmployeeAddressesDeleteWorkAddressMutation()\n const [editTargetUuid, setEditTargetUuid] = useState<string | undefined>(undefined)\n\n const employeeQuery = useEmployeesGet({ employeeId }, { enabled: !!employeeId })\n const companyId = employeeQuery.data?.employee?.companyUuid\n\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { enabled: !!employeeId && !!companyId },\n )\n\n const employeeWorkAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n\n const currentWorkAddress = useMemo<EmployeeWorkAddress | null>(() => {\n if (!employeeWorkAddresses?.length) {\n return null\n }\n return employeeWorkAddresses.find(w => w.active) ?? employeeWorkAddresses[0] ?? null\n }, [employeeWorkAddresses])\n\n const workAddressUuidForEdit = editTargetUuid ?? currentWorkAddress?.uuid\n\n const editInactiveRow = useMemo(() => {\n if (!editTargetUuid || !employeeWorkAddresses) {\n return undefined\n }\n return employeeWorkAddresses.find(w => w.uuid === editTargetUuid)\n }, [editTargetUuid, employeeWorkAddresses])\n\n const editingWorkAddressRow = workAddressUuidForEdit\n ? employeeWorkAddresses?.find(w => w.uuid === workAddressUuidForEdit)\n : undefined\n\n const withEffectiveDateOnEdit = editInactiveRow ? editInactiveRow.active !== true : false\n\n const editWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n workAddressUuid: workAddressUuidForEdit,\n initialAddress: editingWorkAddressRow,\n withEffectiveDateField: withEffectiveDateOnEdit,\n })\n\n const changeWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField: true,\n })\n\n const employeeDisplayName = useMemo(() => {\n const employee = employeeQuery.data?.employee\n if (!employee) {\n return ''\n }\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }).trim()\n }, [employeeQuery.data?.employee])\n\n const isMissingCompany = !!employeeQuery.data?.employee && !companyId\n\n const errorHandling: HookErrorHandling = composeErrorHandler(\n [\n employeeQuery,\n workAddressesQuery,\n editWorkAddressForm,\n changeWorkAddressForm,\n ...(isMissingCompany\n ? [\n {\n errorHandling: {\n errors: [\n normalizeToSDKError(\n new SDKInternalError(\n 'Employee record is missing companyUuid, which is required to load work address locations.',\n ),\n ),\n ],\n retryQueries: () => {},\n clearSubmitError: () => {},\n },\n },\n ]\n : []),\n ],\n { submitError: rootSubmitError, setSubmitError: setRootSubmitError },\n )\n\n const confirmDeleteWorkAddress = async (workAddressUuid: string): Promise<boolean> => {\n const snapshot = employeeWorkAddresses?.find(w => w.uuid === workAddressUuid) ?? null\n\n let succeeded = false\n await baseSubmitHandler(\n { workAddressUuid, snapshot },\n async ({ workAddressUuid: uuid, snapshot: snap }) => {\n const target = employeeWorkAddresses?.find(w => w.uuid === uuid)\n if (!target) {\n throw new SDKInternalError('Work address not found')\n }\n if (target.active === true) {\n throw new SDKInternalError('Cannot delete the active work address')\n }\n\n await deleteWorkAddressMutation.mutateAsync({\n request: { workAddressUuid: uuid },\n })\n succeeded = true\n if (snap) {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED, snap)\n }\n },\n )\n return succeeded\n }\n\n const actions: UseWorkAddressManagementActions = {\n setEditTargetUuid,\n confirmDeleteWorkAddress,\n }\n\n const dataPayloadPendingForms: UseWorkAddressManagementDataPendingForms = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n\n if (employeeQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n if (employeeQuery.isError || isMissingCompany) {\n return {\n isLoading: false,\n data: dataPayloadPendingForms,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: true,\n },\n errorHandling,\n actions,\n }\n }\n\n if (workAddressesQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const isFormsLoading = editWorkAddressForm.isLoading || changeWorkAddressForm.isLoading\n if (isFormsLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const { editWorkAddressForm: editReady, changeWorkAddressForm: changeReady } =\n workAddressFormsReady(editWorkAddressForm, changeWorkAddressForm)\n\n const dataReady: UseWorkAddressManagementDataReady = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm: editReady,\n changeWorkAddressForm: changeReady,\n }\n\n return {\n isLoading: false,\n data: dataReady,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: false,\n },\n errorHandling,\n actions,\n }\n}\n"],"names":["isUseWorkAddressManagementSuccess","value","workAddressFormsReady","editWorkAddressForm","changeWorkAddressForm","SDKInternalError","useWorkAddressManagement","employeeId","onEvent","baseSubmitHandler","rootSubmitError","setRootSubmitError","useBaseSubmit","deleteWorkAddressMutation","useEmployeeAddressesDeleteWorkAddressMutation","editTargetUuid","setEditTargetUuid","useState","employeeQuery","useEmployeesGet","companyId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","employeeWorkAddresses","currentWorkAddress","useMemo","w","workAddressUuidForEdit","editInactiveRow","editingWorkAddressRow","withEffectiveDateOnEdit","useWorkAddressForm","employeeDisplayName","employee","firstLastName","isMissingCompany","errorHandling","composeErrorHandler","normalizeToSDKError","actions","workAddressUuid","snapshot","succeeded","uuid","snap","target","componentEvents","dataPayloadPendingForms","editReady","changeReady"],"mappings":";;;;;;;;;;AAsGO,SAASA,GACdC,GAC+C;AAC/C,SAAIA,EAAM,YACD,KAEF,CAACA,EAAM,OAAO;AACvB;AAEA,SAASC,EACPC,GACAC,GAC0F;AAC1F,MAAID,EAAoB;AACtB,UAAM,IAAIE,EAAiB,yCAAyC;AAEtE,MAAID,EAAsB;AACxB,UAAM,IAAIC,EAAiB,2CAA2C;AAExE,SAAO;AAAA,IACL,qBAAAF;AAAA,IACA,uBAAAC;AAAA,EAAA;AAEJ;AAeO,SAASE,GAAyB;AAAA,EACvC,YAAAC;AAAA,EACA,SAAAC;AACF,GAAmE;AACjE,QAAM;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,iCAAiC,GAC7CC,IAA4BC,EAAA,GAC5B,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,MAAS,GAE5EC,IAAgBC,EAAgB,EAAE,YAAAZ,EAAA,GAAc,EAAE,SAAS,CAAC,CAACA,GAAY,GACzEa,IAAYF,EAAc,MAAM,UAAU,aAE1CG,IAAqBC;AAAA,IACzB,EAAE,YAAAf,EAAA;AAAA,IACF,EAAE,SAAS,CAAC,CAACA,KAAc,CAAC,CAACa,EAAA;AAAA,EAAU,GAGnCG,IAAwBF,EAAmB,MAAM,2BAEjDG,IAAqBC,EAAoC,MACxDF,GAAuB,SAGrBA,EAAsB,KAAK,CAAAG,MAAKA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AM,eAAAe,EAAA;AAI5B,MADuBjC,EAAoB,aAAaC,EAAsB;AAE5E,WAAO,EAAE,WAAW,IAAM,eAAAgC,EAAA;AAG5B,QAAM,EAAE,qBAAqBY,GAAW,uBAAuBC,MAC7D/C,EAAsBC,GAAqBC,CAAqB;AAUlE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,MAVmD;AAAA,MACnD,qBAAA4B;AAAA,MACA,uBAAAT;AAAA,MACA,gBAAAR;AAAA,MACA,qBAAqBiC;AAAA,MACrB,uBAAuBC;AAAA,IAAA;AAAA,IAMvB,QAAQ;AAAA,MACN,iBAAiBpC,EAA0B;AAAA,MAC3C,iBAAiB;AAAA,IAAA;AAAA,IAEnB,eAAAuB;AAAA,IACA,SAAAG;AAAA,EAAA;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { EmployeeWorkAddress } from '@gusto/embedded-api-v-2026-02-01/models/components/employeeworkaddress';
1
+ import { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress';
2
2
  import { BaseHookReady, HookLoadingResult } from '../../../../../partner-hook-utils/types';
3
3
  /**
4
4
  * Params for {@link useEmployeeWorkAddressSummary}.
@@ -1,4 +1,4 @@
1
- import { useEmployeeAddressesGetWorkAddresses as t } from "@gusto/embedded-api-v-2026-02-01/react-query/employeeAddressesGetWorkAddresses";
1
+ import { useEmployeeAddressesGetWorkAddresses as t } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
2
2
  import { composeErrorHandler as i } from "../../../../../partner-hook-utils/composeErrorHandler.js";
3
3
  function m({
4
4
  employeeId: o
@@ -1 +1 @@
1
- {"version":3,"file":"useEmployeeWorkAddressSummary.js","sources":["../../../../../../src/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.tsx"],"sourcesContent":["import { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2026-02-01/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2026-02-01/models/components/employeeworkaddress'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult } from '@/partner-hook-utils/types'\n\n/**\n * Params for {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport interface UseEmployeeWorkAddressSummaryParams {\n /** The associated employee identifier. */\n employeeId: string\n}\n\ntype UseEmployeeWorkAddressSummaryReady = BaseHookReady<\n { currentWorkAddress: EmployeeWorkAddress | undefined },\n { isFetching: boolean; isPending: boolean }\n>\n\n/**\n * Return type of {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport type UseEmployeeWorkAddressSummaryResult =\n HookLoadingResult | UseEmployeeWorkAddressSummaryReady\n\n/**\n * Read-only data hook for the employee work address summary card.\n *\n * @remarks\n * Fetches the employee's work addresses and selects the active row.\n *\n * @param params - {@link UseEmployeeWorkAddressSummaryParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state with `currentWorkAddress` once data is available.\n * @public\n */\nexport function useEmployeeWorkAddressSummary({\n employeeId,\n}: UseEmployeeWorkAddressSummaryParams): UseEmployeeWorkAddressSummaryResult {\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { staleTime: Infinity },\n )\n\n const errorHandling = composeErrorHandler([workAddressesQuery])\n\n const workAddressesList = workAddressesQuery.data?.employeeWorkAddressesList\n\n if (workAddressesQuery.isLoading || !workAddressesList) {\n return { isLoading: true, errorHandling }\n }\n\n const currentWorkAddress = workAddressesList.find(address => address.active)\n\n return {\n isLoading: false,\n data: { currentWorkAddress },\n status: {\n isFetching: workAddressesQuery.isFetching,\n isPending: false,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeWorkAddressSummary","employeeId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","errorHandling","composeErrorHandler","workAddressesList","address"],"mappings":";;AAsCO,SAASA,EAA8B;AAAA,EAC5C,YAAAC;AACF,GAA6E;AAC3E,QAAMC,IAAqBC;AAAA,IACzB,EAAE,YAAAF,EAAA;AAAA,IACF,EAAE,WAAW,MAAA;AAAA,EAAS,GAGlBG,IAAgBC,EAAoB,CAACH,CAAkB,CAAC,GAExDI,IAAoBJ,EAAmB,MAAM;AAEnD,SAAIA,EAAmB,aAAa,CAACI,IAC5B,EAAE,WAAW,IAAM,eAAAF,EAAA,IAKrB;AAAA,IACL,WAAW;AAAA,IACX,MAAM,EAAE,oBAJiBE,EAAkB,KAAK,CAAAC,MAAWA,EAAQ,MAAM,EAIjE;AAAA,IACR,QAAQ;AAAA,MACN,YAAYL,EAAmB;AAAA,MAC/B,WAAW;AAAA,IAAA;AAAA,IAEb,eAAAE;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useEmployeeWorkAddressSummary.js","sources":["../../../../../../src/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.tsx"],"sourcesContent":["import { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult } from '@/partner-hook-utils/types'\n\n/**\n * Params for {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport interface UseEmployeeWorkAddressSummaryParams {\n /** The associated employee identifier. */\n employeeId: string\n}\n\ntype UseEmployeeWorkAddressSummaryReady = BaseHookReady<\n { currentWorkAddress: EmployeeWorkAddress | undefined },\n { isFetching: boolean; isPending: boolean }\n>\n\n/**\n * Return type of {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport type UseEmployeeWorkAddressSummaryResult =\n HookLoadingResult | UseEmployeeWorkAddressSummaryReady\n\n/**\n * Read-only data hook for the employee work address summary card.\n *\n * @remarks\n * Fetches the employee's work addresses and selects the active row.\n *\n * @param params - {@link UseEmployeeWorkAddressSummaryParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state with `currentWorkAddress` once data is available.\n * @public\n */\nexport function useEmployeeWorkAddressSummary({\n employeeId,\n}: UseEmployeeWorkAddressSummaryParams): UseEmployeeWorkAddressSummaryResult {\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { staleTime: Infinity },\n )\n\n const errorHandling = composeErrorHandler([workAddressesQuery])\n\n const workAddressesList = workAddressesQuery.data?.employeeWorkAddressesList\n\n if (workAddressesQuery.isLoading || !workAddressesList) {\n return { isLoading: true, errorHandling }\n }\n\n const currentWorkAddress = workAddressesList.find(address => address.active)\n\n return {\n isLoading: false,\n data: { currentWorkAddress },\n status: {\n isFetching: workAddressesQuery.isFetching,\n isPending: false,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeWorkAddressSummary","employeeId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","errorHandling","composeErrorHandler","workAddressesList","address"],"mappings":";;AAsCO,SAASA,EAA8B;AAAA,EAC5C,YAAAC;AACF,GAA6E;AAC3E,QAAMC,IAAqBC;AAAA,IACzB,EAAE,YAAAF,EAAA;AAAA,IACF,EAAE,WAAW,MAAA;AAAA,EAAS,GAGlBG,IAAgBC,EAAoB,CAACH,CAAkB,CAAC,GAExDI,IAAoBJ,EAAmB,MAAM;AAEnD,SAAIA,EAAmB,aAAa,CAACI,IAC5B,EAAE,WAAW,IAAM,eAAAF,EAAA,IAKrB;AAAA,IACL,WAAW;AAAA,IACX,MAAM,EAAE,oBAJiBE,EAAkB,KAAK,CAAAC,MAAWA,EAAQ,MAAM,EAIjE;AAAA,IACR,QAAQ;AAAA,MACN,YAAYL,EAAmB;AAAA,MAC/B,WAAW;AAAA,IAAA;AAAA,IAEb,eAAAE;AAAA,EAAA;AAEJ;"}
@@ -5,10 +5,10 @@ import { useForm as W, FormProvider as H } from "react-hook-form";
5
5
  import { zodResolver as G } from "@hookform/resolvers/zod";
6
6
  import { z as f } from "zod";
7
7
  import { useIsMutating as K } from "@tanstack/react-query";
8
- import { useInformationRequestsGetInformationRequestsSuspense as _ } from "@gusto/embedded-api-v-2026-02-01/react-query/informationRequestsGetInformationRequests";
9
- import { useInformationRequestsSubmitMutation as V, mutationKeyInformationRequestsSubmit as X } from "@gusto/embedded-api-v-2026-02-01/react-query/informationRequestsSubmit";
10
- import { ResponseType as u } from "@gusto/embedded-api-v-2026-02-01/models/components/informationrequest";
11
- import { ResponseType as U } from "@gusto/embedded-api-v-2026-02-01/models/operations/submitinformationrequest";
8
+ import { useInformationRequestsGetInformationRequestsSuspense as _ } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
9
+ import { useInformationRequestsSubmitMutation as V, mutationKeyInformationRequestsSubmit as X } from "@gusto/embedded-api/react-query/informationRequestsSubmit";
10
+ import { ResponseType as u } from "@gusto/embedded-api/models/components/informationrequest";
11
+ import { ResponseType as U } from "@gusto/embedded-api/models/operations/submitinformationrequest";
12
12
  import i from "./InformationRequestForm.module.scss.js";
13
13
  import { BaseComponent as Y } from "../../Base/Base.js";
14
14
  import { useBase as $ } from "../../Base/useBase.js";
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api-v-2026-02-01/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api-v-2026-02-01/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api-v-2026-02-01/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api-v-2026-02-01/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\nconst dompurifyConfig = {\n ALLOWED_TAGS: ['a', 'b', 'strong'],\n ALLOWED_ATTR: ['target', 'href', 'rel'],\n}\n\n/* API does not enforce an upper limit, so set a reasonable character max for a single-line input. */\nconst MAX_TEXT_RESPONSE = 5000\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\n/**\n * Props for {@link InformationRequestForm}.\n *\n * @public\n */\nexport interface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n /** The associated company identifier. */\n companyId: string\n /** The identifier of the information request to respond to. */\n requestId: string\n /** Event handler invoked when the form is submitted or cancelled. See the events table in {@link InformationRequestForm}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Dynamic response form for a single information request.\n *\n * Renders supported question types (text and document upload) based on the request's\n * `requiredQuestions` payload and submits responses to the Submit information request\n * endpoint. Use this component directly when you have built your own list or routing\n * surface and need to host the form — typically inside a modal or page you control.\n *\n * Requests with unsupported response types (e.g. `persona`-driven identity verification)\n * display a guidance message instead of the form; in those cases the user must complete\n * the request through your own integration with the underlying provider.\n *\n * Text inputs accept up to 5,000 characters. Document uploads are restricted to JPEG,\n * PNG, or PDF.\n *\n * @remarks\n * Events emitted via `onEvent`:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |\n * | `informationRequest/form/cancel` | Fired when the user cancels the form | — |\n *\n * @param props - See {@link InformationRequestFormProps}.\n * @returns The rendered information request response form.\n * @public\n */\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(question => !SUPPORTED_RESPONSE_TYPES.includes(question.responseType))\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text size=\"sm\" weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text size=\"sm\" variant=\"supporting\">\n {/* SECURITY: XSS mitigated via DOMPurify with strict allowlist. Pattern matches TaxInputs.tsx */}\n <span\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(question.questionText, dompurifyConfig),\n }}\n />\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n maxLength={MAX_TEXT_RESPONSE}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === selectedRequestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n\nInformationRequestForm.Footer = Footer\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","dompurifyConfig","MAX_TEXT_RESPONSE","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","DOMPurify","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAA8B,sCAC9BC,KAAsB,CAAC,cAAc,aAAa,iBAAiB,GACnEC,KAAkB;AAAA,EACtB,cAAc,CAAC,KAAK,KAAK,QAAQ;AAAA,EACjC,cAAc,CAAC,UAAU,QAAQ,KAAK;AACxC,GAGMC,KAAoB,KAEpBC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AA8CO,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,KAAuB,CAACC,MACrB,IAAI,QAAgB,CAACC,GAASC,MAAW;AAC9C,QAAMC,IAAS,IAAI,WAAA;AACnB,EAAAA,EAAO,SAAS,MAAM;AACpB,IAAAF,EAAQE,EAAO,MAAgB;AAAA,EACjC,GACAA,EAAO,UAAUD,GACjBC,EAAO,cAAcH,CAAI;AAC3B,CAAC,GAGGI,KAA2C,CAACC,EAAa,MAAMA,EAAa,QAAQ;AAE1F,SAASC,EAA4BC,GAAgC;AACnE,SAAOA,EAAU,KAAK,CAAAC,MAAY,CAACJ,GAAyB,SAASI,EAAS,YAAY,CAAC;AAC7F;AAEA,SAASC,GAAuBF,GAAgC;AAC9D,SAAOA,EAAU,KAAK,CAAAC,MAAYA,EAAS,iBAAiBH,EAAa,OAAO;AAClF;AAEA,SAASP,GAAK,E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EA,gBAAAlC,EAAC8D,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAClC,UAAArD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACM,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAlD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAM1E;AAAA,QACN,WAAW6E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAvE,GAAuB,SAASmE;"}
1
+ {"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\nconst dompurifyConfig = {\n ALLOWED_TAGS: ['a', 'b', 'strong'],\n ALLOWED_ATTR: ['target', 'href', 'rel'],\n}\n\n/* API does not enforce an upper limit, so set a reasonable character max for a single-line input. */\nconst MAX_TEXT_RESPONSE = 5000\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\n/**\n * Props for {@link InformationRequestForm}.\n *\n * @public\n */\nexport interface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n /** The associated company identifier. */\n companyId: string\n /** The identifier of the information request to respond to. */\n requestId: string\n /** Event handler invoked when the form is submitted or cancelled. See the events table in {@link InformationRequestForm}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Dynamic response form for a single information request.\n *\n * Renders supported question types (text and document upload) based on the request's\n * `requiredQuestions` payload and submits responses to the Submit information request\n * endpoint. Use this component directly when you have built your own list or routing\n * surface and need to host the form — typically inside a modal or page you control.\n *\n * Requests with unsupported response types (e.g. `persona`-driven identity verification)\n * display a guidance message instead of the form; in those cases the user must complete\n * the request through your own integration with the underlying provider.\n *\n * Text inputs accept up to 5,000 characters. Document uploads are restricted to JPEG,\n * PNG, or PDF.\n *\n * @remarks\n * Events emitted via `onEvent`:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |\n * | `informationRequest/form/cancel` | Fired when the user cancels the form | — |\n *\n * @param props - See {@link InformationRequestFormProps}.\n * @returns The rendered information request response form.\n * @public\n */\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(question => !SUPPORTED_RESPONSE_TYPES.includes(question.responseType))\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text size=\"sm\" weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text size=\"sm\" variant=\"supporting\">\n {/* SECURITY: XSS mitigated via DOMPurify with strict allowlist. Pattern matches TaxInputs.tsx */}\n <span\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(question.questionText, dompurifyConfig),\n }}\n />\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n maxLength={MAX_TEXT_RESPONSE}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === selectedRequestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n\nInformationRequestForm.Footer = Footer\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","dompurifyConfig","MAX_TEXT_RESPONSE","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","DOMPurify","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;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W,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAlD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAM1E;AAAA,QACN,WAAW6E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAvE,GAAuB,SAASmE;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
2
  import { useTranslation as b } from "react-i18next";
3
- import { useInformationRequestsGetInformationRequestsSuspense as P } from "@gusto/embedded-api-v-2026-02-01/react-query/informationRequestsGetInformationRequests";
4
- import { InformationRequestStatus as r, InformationRequestType as i } from "@gusto/embedded-api-v-2026-02-01/models/components/informationrequest";
3
+ import { useInformationRequestsGetInformationRequestsSuspense as P } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
4
+ import { InformationRequestStatus as r, InformationRequestType as i } from "@gusto/embedded-api/models/components/informationrequest";
5
5
  import { BaseComponent as w } from "../../Base/Base.js";
6
6
  import "../../Base/useBase.js";
7
7
  import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api-v-2026-02-01/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\n/**\n * Props for {@link InformationRequestList}.\n *\n * @public\n */\nexport interface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n /** The associated company identifier. */\n companyId: string\n /** Event callback. See the events table on {@link InformationRequestList} for emitted events. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Displays the list of outstanding information requests for a company with a \"Respond\" CTA on each open request.\n *\n * @remarks\n * Renders status badges for each request and an extra \"Payroll blocking\" badge when the request is currently blocking payroll. Approved requests are filtered out of the list. Used as the top-level surface of `InformationRequests.InformationRequestsFlow`, but can be rendered directly when you want to host the response form yourself (e.g. in a custom modal or page).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/respond` | Fired when the user clicks \"Respond\" on an open request | `{ requestId: string }` |\n *\n * @param props - See {@link InformationRequestListProps}.\n * @returns The rendered information request list.\n * @public\n */\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequests ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;;AA2CO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAwC;AAC7E,EAAAC,EAAuB,8CAA8CF,CAAU,GAC/EG,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaZ;AAAA,EAAA,CACd,GAIKa,KAFsBF,EAAK,uBAAuB,CAAA,GAEZ;AAAA,IAC1C,CAAAG,MAAWA,EAAQ,WAAWC,EAAyB;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAA6C;AACjE,YAAQA,GAAA;AAAA,MACN,KAAKC,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,sBAAsB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EJ;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAK,MACkBA,EAAQ,WAAWC,EAAyB,kBAKpE,gBAAAlB;AAAA,MAACW;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAN,EAAQ2B,EAAyB,6BAA6B;AAAA,YAC5D,WAAWf,EAAQ;AAAA,UAAA,CACpB;AAAA,QACH;AAAA,QAEC,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAA/B,EAACS,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECuB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
1
+ {"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\n/**\n * Props for {@link InformationRequestList}.\n *\n * @public\n */\nexport interface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n /** The associated company identifier. */\n companyId: string\n /** Event callback. See the events table on {@link InformationRequestList} for emitted events. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Displays the list of outstanding information requests for a company with a \"Respond\" CTA on each open request.\n *\n * @remarks\n * Renders status badges for each request and an extra \"Payroll blocking\" badge when the request is currently blocking payroll. Approved requests are filtered out of the list. Used as the top-level surface of `InformationRequests.InformationRequestsFlow`, but can be rendered directly when you want to host the response form yourself (e.g. in a custom modal or page).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/respond` | Fired when the user clicks \"Respond\" on an open request | `{ requestId: string }` |\n *\n * @param props - See {@link InformationRequestListProps}.\n * @returns The rendered information request list.\n * @public\n */\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequests ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;;AA2CO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAwC;AAC7E,EAAAC,EAAuB,8CAA8CF,CAAU,GAC/EG,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaZ;AAAA,EAAA,CACd,GAIKa,KAFsBF,EAAK,uBAAuB,CAAA,GAEZ;AAAA,IAC1C,CAAAG,MAAWA,EAAQ,WAAWC,EAAyB;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAA6C;AACjE,YAAQA,GAAA;AAAA,MACN,KAAKC,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,sBAAsB;AAAA,MACjC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,oBAAoB;AAAA,MAC/B;AACE,eAAO,EAAE,eAAe;AAAA,IAAA;AAAA,EAE9B,GAEMC,IAAmB,CAACC,MAAwD;AAChF,Y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,SAAS,MAAM;AACb,UAAAN,EAAQ2B,EAAyB,6BAA6B;AAAA,YAC5D,WAAWf,EAAQ;AAAA,UAAA,CACpB;AAAA,QACH;AAAA,QAEC,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAA/B,EAACS,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECuB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as S } from "react/jsx-runtime";
2
2
  import { createMachine as M } from "robot3";
3
3
  import { useMachine as T } from "react-robot";
4
4
  import { useState as v, useRef as x, useMemo as d, Suspense as N } from "react";
5
- import { useWireInRequestsListSuspense as F } from "@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsList";
5
+ import { useWireInRequestsListSuspense as F } from "@gusto/embedded-api/react-query/wireInRequestsList";
6
6
  import { confirmWireDetailsMachine as D } from "./confirmWireDetailsStateMachine.js";
7
7
  import P from "./ConfirmWireDetails.module.scss.js";
8
8
  import { BaseComponent as Y, BaseBoundaries as q } from "../../Base/Base.js";
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\n/**\n * Wire transfer confirmation workflow for payroll funding.\n *\n * Displays a banner when wire transfers are awaiting funds and walks the user\n * through viewing wire instructions and confirming transfer details via a modal.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `payroll/wire/startTransfer` | User initiates the wire transfer flow | — |\n * | `payroll/wire/instructions/select` | User selects a wire-in request from the instructions screen | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/done` | User completes viewing wire instructions | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/cancel` | User cancels viewing wire instructions | — |\n * | `payroll/wire/form/done` | User completes the wire confirmation form | `{ wireInRequest: WireInRequest }` |\n * | `payroll/wire/form/cancel` | User cancels the wire confirmation form | — |\n *\n * @param props - {@link ConfirmWireDetailsProps}\n * @returns The wire confirmation banner and modal flow.\n * @public\n *\n * @example\n * ```tsx\n * import { Payroll } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <Payroll.ConfirmWireDetails\n * companyId=\"your-company-id\"\n * wireInId=\"your-wire-in-id\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function ConfirmWireDetails({ onEvent, ...props }: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense\n fallback={\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n }\n >\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","Suspense","styles"],"mappings":";;;;;;;;;;;;;AAkDO,SAASA,EAAmB,EAAE,SAAAC,GAAS,GAAGC,KAAkC;AACjF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAN,KAAoC;AACvE,QAAM,EAAE,OAAAO,GAAO,gBAAAC,EAAA,IAAmBC,EAAA,GAC5B,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9CC,IAAoBC,EAAuB,IAAI,GAE/C,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaX;AAAA,EAAA,CACd,GAEKY,KAAwBF,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAG,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAmBC,EAAQ,MAC3Bd,KAIGW,EAAqB,CAAC,GAAG,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cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAhC,EAACoC,GAAA,EACC,UAAA,gBAAApC;AAAA,cAACqC;AAAA,cAAA;AAAA,gBACC,UACE,gBAAArC,EAAC,OAAA,EAAI,WAAWsC,EAAO,QACrB,UAAA,gBAAAtC,EAACM,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAN,EAACgC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA,GAElC;AAAA,YAIH,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\n/**\n * Wire transfer confirmation workflow for payroll funding.\n *\n * Displays a banner when wire transfers are awaiting funds and walks the user\n * through viewing wire instructions and confirming transfer details via a modal.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `payroll/wire/startTransfer` | User initiates the wire transfer flow | — |\n * | `payroll/wire/instructions/select` | User selects a wire-in request from the instructions screen | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/done` | User completes viewing wire instructions | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/cancel` | User cancels viewing wire instructions | — |\n * | `payroll/wire/form/done` | User completes the wire confirmation form | `{ wireInRequest: WireInRequest }` |\n * | `payroll/wire/form/cancel` | User cancels the wire confirmation form | — |\n *\n * @param props - {@link ConfirmWireDetailsProps}\n * @returns The wire confirmation banner and modal flow.\n * @public\n *\n * @example\n * ```tsx\n * import { Payroll } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <Payroll.ConfirmWireDetails\n * companyId=\"your-company-id\"\n * wireInId=\"your-wire-in-id\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function ConfirmWireDetails({ onEvent, ...props }: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense\n fallback={\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n }\n >\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","Suspense","sty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tBX,EAAQ4B,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAA0B,MAAM;AACpC,IAAAP,EAAYM,EAAkB,2BAA2B;AAAA,EAC3D,GAEME,IAAmB,MAAM;AAC7B,IAAArB,EAAe,EAAK;AAAA,EACtB,GAEMsB,IAAmBR,EAAQ,QAAQ,WACnCS,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAtB;AAAA,UAACmC;AAAA,UAAA;AAAA,YACC,WAAAhC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqByB;AAAA,YACrB,SAAA/B;AAAA,YACA,mBAAmByB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAvB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAhC,EAACoC,GAAA,EACC,UAAA,gBAAApC;AAAA,cAACqC;AAAA,cAAA;AAAA,gBACC,UACE,gBAAArC,EAAC,OAAA,EAAI,WAAWsC,EAAO,QACrB,UAAA,gBAAAtC,EAACM,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAN,EAACgC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA,GAElC;AAAA,YAIH,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
2
  import { useTranslation as v } from "react-i18next";
3
- import { useWireInRequestsListSuspense as M } from "@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsList";
4
- import { usePayrollsListSuspense as N } from "@gusto/embedded-api-v-2026-02-01/react-query/payrollsList";
3
+ import { useWireInRequestsListSuspense as M } from "@gusto/embedded-api/react-query/wireInRequestsList";
4
+ import { usePayrollsListSuspense as N } from "@gusto/embedded-api/react-query/payrollsList";
5
5
  import { useState as Z, useEffect as _ } from "react";
6
6
  import { BaseComponent as j } from "../../../Base/Base.js";
7
7
  import "../../../Base/useBase.js";
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetailsBanner.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/payrollsList'\nimport { useState, useEffect } from 'react'\nimport type { ConfirmationAlert } from '../types'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\ninterface ConfirmWireDetailsBannerProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsBanner'> {\n wireInId?: string\n companyId: string\n confirmationAlert?: ConfirmationAlert\n onStartWireTransfer: () => void\n}\n\n/** @internal */\nexport function ConfirmWireDetailsBanner(props: ConfirmWireDetailsBannerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n confirmationAlert,\n onStartWireTransfer,\n}: ConfirmWireDetailsBannerProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsBanner', dictionary)\n useI18n('Payroll.ConfirmWireDetailsBanner')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsBanner')\n const { Alert, Banner, Button, UnorderedList, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [isConfirmationAlertDismissed, setIsConfirmationAlertDismissed] = useState(false)\n const currencyFormatter = useNumberFormatter('currency')\n\n useEffect(() => {\n if (confirmationAlert) {\n setIsConfirmationAlertDismissed(false)\n }\n }, [confirmationAlert])\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n request => request.status === 'awaiting_funds',\n )\n const wireInRequests = wireInId\n ? activeWireInRequests.filter(request => request.uuid === wireInId)\n : activeWireInRequests\n\n const payrolls = payrollsData.payrollList || []\n\n const wireInRequestsWithPayrolls = wireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(payroll.payPeriod.startDate, payroll.payPeriod.endDate)\n : ''\n return {\n wireInRequest,\n payroll,\n payrollRange,\n paymentType: wireInRequest.paymentType,\n requestedAmount: wireInRequest.requestedAmount ?? '',\n }\n })\n\n const shouldShowBanner =\n wireInRequestsWithPayrolls.length > 0 &&\n (wireInRequestsWithPayrolls.length > 1 || wireInRequestsWithPayrolls[0]?.wireInRequest)\n\n const shouldShowConfirmationAlert = !isConfirmationAlertDismissed && confirmationAlert\n\n if (!shouldShowBanner && !shouldShowConfirmationAlert) {\n return null\n }\n\n const formatDeadline = (deadline: string) => {\n const date = new Date(deadline)\n\n const timeRaw = date.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: date.getMinutes() === 0 ? undefined : '2-digit',\n hour12: true,\n timeZone: 'America/Los_Angeles',\n timeZoneName: 'short',\n })\n\n const time = timeRaw.replace(/\\s?(AM|PM)/i, match => match.trim().toLowerCase())\n\n const dateString = date.toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'America/Los_Angeles',\n })\n\n return { time, date: dateString }\n }\n\n const getBannerTitle = () => {\n const isSingleWireInRequest = wireInRequestsWithPayrolls.length === 1\n const { wireInRequest, payrollRange } = wireInRequestsWithPayrolls[0] || {}\n\n if (isSingleWireInRequest) {\n if (wireInId && wireInRequest?.wireInDeadline) {\n const { time, date } = formatDeadline(wireInRequest.wireInDeadline)\n return t('banner.title', { time, date })\n }\n return t('banner.titleWithPayroll', { payrollRange })\n }\n return t('banner.titleMultiple', { count: wireInRequestsWithPayrolls.length })\n }\n\n const getBannerContent = () => {\n if (wireInRequestsWithPayrolls.length > 1) {\n return (\n <UnorderedList\n items={wireInRequestsWithPayrolls.map(\n ({ paymentType, payrollRange, requestedAmount }, index) =>\n paymentType === 'Payroll' ? (\n <Text key={index}>{t('banner.requestLabelPayroll', { payrollRange })}</Text>\n ) : (\n <Text key={index}>\n {t('banner.requestLabelContractorPaymentGroup', {\n requestedAmount: currencyFormatter(Number(requestedAmount)),\n })}\n </Text>\n ),\n )}\n />\n )\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {shouldShowConfirmationAlert && (\n <Alert\n status=\"success\"\n label={confirmationAlert.title}\n onDismiss={() => {\n setIsConfirmationAlertDismissed(true)\n }}\n >\n {confirmationAlert.content}\n </Alert>\n )}\n {shouldShowBanner && (\n <Banner status=\"warning\" title={getBannerTitle()}>\n <Flex flexDirection=\"column\" gap={16} alignItems=\"flex-start\">\n <div>{t('banner.description')}</div>\n {getBannerContent()}\n <Button variant=\"secondary\" onClick={onStartWireTransfer}>\n {t('cta.startWireTransfer')}\n </Button>\n </Flex>\n </Banner>\n )}\n </Flex>\n )\n}\n"],"names":["ConfirmWireDetailsBanner","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","confirmationAlert","onStartWireTransfer","useComponentDictionary","useI18n","t","useTranslation","Alert","Banner","Button","UnorderedList","Text","useComponentContext","dateFormatter","useDateFormatter","isConfirmationAlertDismissed","setIsConfirmationAlertDismissed","useState","currencyFormatter","useNumberFormatter","useEffect","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","request","wireInRequests","payrolls","wireInRequestsWithPayrolls","wireInRequest","payroll","p","payrollRange","shouldShowBanner","shouldShowConfirmationAlert","formatDeadline","deadline","date","time","match","dateString","getBannerTitle","isSingleWireInRequest","getBannerContent","paymentType","requestedAmount","index","jsxs","Flex"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,GAAyBC,GAAsC;AAC7E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC;AACF,MAAqC;AACnC,EAAAC,EAAuB,oCAAoCH,CAAU,GACrEI,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,OAAAC,GAAO,QAAAC,GAAQ,QAAAC,GAAQ,eAAAC,GAAe,MAAAC,EAAA,IAASC,EAAA,GACjDC,IAAgBC,EAAA,GAChB,CAACC,GAA8BC,CAA+B,IAAIC,EAAS,EAAK,GAChFC,IAAoBC,EAAmB,UAAU;AAEvD,EAAAC,EAAU,MAAM;AACd,IAAInB,KACFe,EAAgC,EAAK;AAAA,EAEzC,GAAG,CAACf,CAAiB,CAAC;AAEtB,QAAM,EAAE,MAAMoB,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAavB;AAAA,EAAA,CACd,GAEK,EAAE,MAAMwB,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAzB;AAAA,IACA,WAAW;AAAA,E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AO,QAAO,WAAU,OAAOkC,EAAA,GAC9B,UAAA,gBAAAM,EAACC,KAAK,eAAc,UAAS,KAAK,IAAI,YAAW,cAC/C,UAAA;AAAA,MAAA,gBAAAtD,EAAC,OAAA,EAAK,UAAAU,EAAE,oBAAoB,EAAA,CAAE;AAAA,MAC7BuC,EAAA;AAAA,MACD,gBAAAjD,EAACc,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"ConfirmWireDetailsBanner.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { useState, useEffect } from 'react'\nimport type { ConfirmationAlert } from '../types'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\ninterface ConfirmWireDetailsBannerProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsBanner'> {\n wireInId?: string\n companyId: string\n confirmationAlert?: ConfirmationAlert\n onStartWireTransfer: () => void\n}\n\n/** @internal */\nexport function ConfirmWireDetailsBanner(props: ConfirmWireDetailsBannerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n confirmationAlert,\n onStartWireTransfer,\n}: ConfirmWireDetailsBannerProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsBanner', dictionary)\n useI18n('Payroll.ConfirmWireDetailsBanner')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsBanner')\n const { Alert, Banner, Button, UnorderedList, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [isConfirmationAlertDismissed, setIsConfirmationAlertDismissed] = useState(false)\n const currencyFormatter = useNumberFormatter('currency')\n\n useEffect(() => {\n if (confirmationAlert) {\n setIsConfirmationAlertDismissed(false)\n }\n }, [confirmationAlert])\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n request => request.status === 'awaiting_funds',\n )\n const wireInRequests = wireInId\n ? activeWireInRequests.filter(request => request.uuid === wireInId)\n : activeWireInRequests\n\n const payrolls = payrollsData.payrollList || []\n\n const wireInRequestsWithPayrolls = wireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(payroll.payPeriod.startDate, payroll.payPeriod.endDate)\n : ''\n return {\n wireInRequest,\n payroll,\n payrollRange,\n paymentType: wireInRequest.paymentType,\n requestedAmount: wireInRequest.requestedAmount ?? '',\n }\n })\n\n const shouldShowBanner =\n wireInRequestsWithPayrolls.length > 0 &&\n (wireInRequestsWithPayrolls.length > 1 || wireInRequestsWithPayrolls[0]?.wireInRequest)\n\n const shouldShowConfirmationAlert = !isConfirmationAlertDismissed && confirmationAlert\n\n if (!shouldShowBanner && !shouldShowConfirmationAlert) {\n return null\n }\n\n const formatDeadline = (deadline: string) => {\n const date = new Date(deadline)\n\n const timeRaw = date.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: date.getMinutes() === 0 ? undefined : '2-digit',\n hour12: true,\n timeZone: 'America/Los_Angeles',\n timeZoneName: 'short',\n })\n\n const time = timeRaw.replace(/\\s?(AM|PM)/i, match => match.trim().toLowerCase())\n\n const dateString = date.toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'America/Los_Angeles',\n })\n\n return { time, date: dateString }\n }\n\n const getBannerTitle = () => {\n const isSingleWireInRequest = wireInRequestsWithPayrolls.length === 1\n const { wireInRequest, payrollRange } = wireInRequestsWithPayrolls[0] || {}\n\n if (isSingleWireInRequest) {\n if (wireInId && wireInRequest?.wireInDeadline) {\n const { time, date } = formatDeadline(wireInRequest.wireInDeadline)\n return t('banner.title', { time, date })\n }\n return t('banner.titleWithPayroll', { payrollRange })\n }\n return t('banner.titleMultiple', { count: wireInRequestsWithPayrolls.length })\n }\n\n const getBannerContent = () => {\n if (wireInRequestsWithPayrolls.length > 1) {\n return (\n <UnorderedList\n items={wireInRequestsWithPayrolls.map(\n ({ paymentType, payrollRange, requestedAmount }, index) =>\n paymentType === 'Payroll' ? (\n <Text key={index}>{t('banner.requestLabelPayroll', { payrollRange })}</Text>\n ) : (\n <Text key={index}>\n {t('banner.requestLabelContractorPaymentGroup', {\n requestedAmount: currencyFormatter(Number(requestedAmount)),\n })}\n </Text>\n ),\n )}\n />\n )\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {shouldShowConfirmationAlert && (\n <Alert\n status=\"success\"\n label={confirmationAlert.title}\n onDismiss={() => {\n setIsConfirmationAlertDismissed(true)\n }}\n >\n {confirmationAlert.content}\n </Alert>\n )}\n {shouldShowBanner && (\n <Banner status=\"warning\" title={getBannerTitle()}>\n <Flex flexDirection=\"column\" gap={16} alignItems=\"flex-start\">\n <div>{t('banner.description')}</div>\n {getBannerContent()}\n <Button variant=\"secondary\" onClick={onStartWireTransfer}>\n {t('cta.startWireTransfer')}\n </Button>\n </Flex>\n </Banner>\n )}\n </Flex>\n )\n}\n"],"names":["ConfirmWireDetailsBanner","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","confirmationAlert","onStartWireTransfer","useComponentDictionary","useI18n","t","useTranslation","Alert","Banner","Button","UnorderedList","Text","useComponentContext","dateFormatter","useDateFormatter","isConfirmationAlertDismissed","setIsConfirmationAlertDismissed","useState","currencyFormatter","useNumberFormatter","useEffect","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","request","wireInRequests","payrolls","wireInRequestsWithPayrolls","wireInRequest","payroll","p","payrollRange","shouldShowBanner","shouldShowConfirmationAlert","formatDeadline","deadline","date","time","match","dateString","getBannerTitle","isSingleWireInRequest","getBannerContent","paymentType","requestedAmount","index","jsxs","Flex"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,GAAyBC,GAAsC;AAC7E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC;AACF,MAAqC;AACnC,EAAAC,EAAuB,oCAAoCH,CAAU,GACrEI,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,OAAAC,GAAO,QAAAC,GAAQ,QAAAC,GAAQ,eAAAC,GAAe,MAAAC,EAAA,IAASC,EAAA,GACjDC,IAAgBC,EAAA,GAChB,CAACC,GAA8BC,CAA+B,IAAIC,EAAS,EAAK,GAChFC,IAAoBC,EAAmB,UAAU;AAEvD,EAAAC,EAAU,MAAM;AACd,IAAInB,KACFe,EAAgC,EAAK;AAAA,EAEzC,GAAG,CAACf,CAAiB,CAAC;AAEtB,QAAM,EAAE,MAAMoB,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAavB;AAAA,EAAA,CACd,GAEK,EAAE,MAAMwB,EAAA,IAAiBC,EAAwB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;AAAA,IAGtBiC,KACC,gBAAAvC,EAACa,GAAA,EAAO,QAAO,WAAU,OAAOkC,EAAA,GAC9B,UAAA,gBAAAM,EAACC,KAAK,eAAc,UAAS,KAAK,IAAI,YAAW,cAC/C,UAAA;AAAA,MAAA,gBAAAtD,EAAC,OAAA,EAAK,UAAAU,EAAE,oBAAoB,EAAA,CAAE;AAAA,MAC7BuC,EAAA;AAAA,MACD,gBAAAjD,EAACc,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -4,9 +4,9 @@ import r from "zod";
4
4
  import { useForm as _, FormProvider as O } from "react-hook-form";
5
5
  import { zodResolver as T } from "@hookform/resolvers/zod";
6
6
  import { useIsMutating as E } from "@tanstack/react-query";
7
- import { useWireInRequestsSubmitMutation as U, mutationKeyWireInRequestsSubmit as j } from "@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsSubmit";
8
- import { useWireInRequestsGetSuspense as B } from "@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsGet";
9
- import { usePayrollsListSuspense as G } from "@gusto/embedded-api-v-2026-02-01/react-query/payrollsList";
7
+ import { useWireInRequestsSubmitMutation as U, mutationKeyWireInRequestsSubmit as j } from "@gusto/embedded-api/react-query/wireInRequestsSubmit";
8
+ import { useWireInRequestsGetSuspense as B } from "@gusto/embedded-api/react-query/wireInRequestsGet";
9
+ import { usePayrollsListSuspense as G } from "@gusto/embedded-api/react-query/payrollsList";
10
10
  import d from "./ConfirmWireDetailsForm.module.scss.js";
11
11
  import { Form as H } from "../../../Common/Form/Form.js";
12
12
  import { BaseComponent as K } from "../../../Base/Base.js";
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api-v-2026-02-01/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nconst ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().min(1),\n additionalNotes: z.string().optional(),\n})\n\ntype ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['wireInRequestUpdateRequestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\n/** @internal */\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n wireInRequestUpdateRequestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EAC5C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,UAAUA,EAAE,KAAA;AAAA,EACZ,UAAUA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,GAIKC,IAAuB,6BAEvBC,KAA6B,CACjCC,OAEO;AAAA,EACL,YAAY,OAAOA,EAAK,UAAU;AAAA,EAClC,UAAUA,EAAK,SAAS,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,EACvD,UAAUA,EAAK;AAAA,EACf,iBAAiBA,EAAK,mBAAmB;AAAA;AAKtC,SAASC,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AA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
1
+ {"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nconst ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().min(1),\n additionalNotes: z.string().optional(),\n})\n\ntype ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['wireInRequestUpdateRequestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\n/** @internal */\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n wireInRequestUpdateRequestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EAC5C,YAAYA,EAAE,OAAA,EAAS,S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;AAE/B,SACE,gBAAAhB,EAACC,GAAA,EAAK,KAAK,IAAI,gBAAe,gBAC5B,UAAA;AAAA,IAAA,gBAAAtC,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAzC,EAAQ2B,EAAkB,wBAAwB;AAAA,QACpD;AAAA,QACA,YAAYe;AAAA,QACZ,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,GAElB;AAAA,IACA,gBAAA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
2
  import { useMemo as k } from "react";
3
3
  import { useTranslation as v } from "react-i18next";
4
- import { useWireInRequestsListSuspense as _ } from "@gusto/embedded-api-v-2026-02-01/react-query/wireInRequestsList";
5
- import { usePayrollsListSuspense as E } from "@gusto/embedded-api-v-2026-02-01/react-query/payrollsList";
4
+ import { useWireInRequestsListSuspense as _ } from "@gusto/embedded-api/react-query/wireInRequestsList";
5
+ import { usePayrollsListSuspense as E } from "@gusto/embedded-api/react-query/payrollsList";
6
6
  import u from "./WireInstructions.module.scss.js";
7
7
  import { BaseComponent as O } from "../../../Base/Base.js";
8
8
  import "../../../Base/useBase.js";