@gusto/embedded-react-sdk 0.27.0 → 0.29.0

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 (304) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +4 -2
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +52 -32
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -2
  6. package/dist/components/Common/DataView/DataTable/DataTable.js +68 -53
  7. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  8. package/dist/components/Common/DataView/DataView.d.ts +4 -2
  9. package/dist/components/Common/DataView/DataView.js +28 -18
  10. package/dist/components/Common/DataView/DataView.js.map +1 -1
  11. package/dist/components/Common/DataView/useDataView.d.ts +6 -1
  12. package/dist/components/Common/DataView/useDataView.js +34 -19
  13. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  14. package/dist/components/Common/Fields/PercentageField/PercentageField.d.ts +8 -0
  15. package/dist/components/Common/Fields/PercentageField/PercentageField.js +58 -0
  16. package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -0
  17. package/dist/components/Common/Fields/PercentageField/index.d.ts +2 -0
  18. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  19. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  20. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
  21. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  22. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -8
  23. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  24. package/dist/components/Common/TaxInputs/TaxInputs.js +125 -98
  25. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  26. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  27. package/dist/components/Common/UI/Card/Card.d.ts +1 -1
  28. package/dist/components/Common/UI/Card/Card.js +10 -20
  29. package/dist/components/Common/UI/Card/Card.js.map +1 -1
  30. package/dist/components/Common/UI/Card/CardTypes.d.ts +4 -4
  31. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  32. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  33. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +5 -5
  34. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  35. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -4
  36. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  38. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  40. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +17 -16
  41. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  43. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  45. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  47. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -5
  48. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  49. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/TitleSelect.js +1 -1
  52. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  53. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  55. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  56. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  57. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  58. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  60. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  61. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  63. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  64. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  65. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  66. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  67. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  68. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  69. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  70. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  71. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
  72. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  73. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  74. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  75. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  76. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  77. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  78. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  79. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  80. package/dist/components/Company/Industry/Actions.js +7 -8
  81. package/dist/components/Company/Industry/Actions.js.map +1 -1
  82. package/dist/components/Company/Industry/Context.js +6 -8
  83. package/dist/components/Company/Industry/Context.js.map +1 -1
  84. package/dist/components/Company/Industry/Edit.js +2 -3
  85. package/dist/components/Company/Industry/Edit.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  87. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
  89. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  90. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  91. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  92. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  93. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  94. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationsList/List.js +6 -7
  96. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationsList/LocationsList.js +39 -56
  98. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  100. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  101. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  102. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  103. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  104. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  105. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  106. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  107. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  108. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  109. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  110. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  111. package/dist/components/Company/PaySchedule/_parts/Edit.js +24 -23
  112. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  113. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  114. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  115. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  116. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  117. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -7
  118. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  119. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  120. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  121. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +60 -67
  122. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  123. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  124. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  125. package/dist/components/Company/StateTaxes/StateTaxesForm/index.d.ts +2 -0
  126. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  127. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  129. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  131. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxesList/index.d.ts +2 -0
  133. package/dist/components/Company/index.d.ts +2 -0
  134. package/dist/components/Company/index.js +21 -17
  135. package/dist/components/Company/index.js.map +1 -1
  136. package/dist/components/Contractor/Address/Address.js +2 -2
  137. package/dist/components/Contractor/Address/Form.js +11 -10
  138. package/dist/components/Contractor/Address/Form.js.map +1 -1
  139. package/dist/components/Contractor/Address/useAddress.js +5 -7
  140. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  141. package/dist/components/Contractor/ContractorList/index.js +17 -17
  142. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +8 -8
  143. package/dist/components/Contractor/ContractorList/useContractorList.js +9 -25
  144. package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
  145. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -12
  146. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  147. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -2
  148. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -3
  149. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  150. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +23 -22
  151. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  152. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -8
  153. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  154. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
  155. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +1 -0
  156. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +38 -24
  157. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  158. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
  159. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +95 -60
  160. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  161. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  162. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  163. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -7
  164. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  165. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -3
  166. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  167. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +67 -42
  168. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  169. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +3 -1
  170. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +40 -36
  171. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  172. package/dist/components/Contractor/Payments/types.d.ts +2 -0
  173. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  174. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  175. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  176. package/dist/components/Contractor/Submit/Submit.js +1 -1
  177. package/dist/components/Employee/Compensation/Actions.js +1 -1
  178. package/dist/components/Employee/Compensation/Edit.js +14 -14
  179. package/dist/components/Employee/Compensation/List.js +22 -23
  180. package/dist/components/Employee/Compensation/List.js.map +1 -1
  181. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -12
  182. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  183. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -13
  184. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  185. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -13
  186. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  187. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  188. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  189. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  190. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
  191. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  192. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  193. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  194. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  195. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  196. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  197. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  198. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
  199. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  200. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  201. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  202. package/dist/components/Employee/EmployeeList/EmployeeList.js +77 -95
  203. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  204. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  205. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  206. package/dist/components/Employee/EmployeeList/List.js +12 -12
  207. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -5
  208. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  209. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  210. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  211. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -12
  212. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  213. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -5
  214. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  215. package/dist/components/Employee/Landing/Landing.js +8 -8
  216. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  217. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  218. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  219. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -3
  220. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -6
  221. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -2
  222. package/dist/components/Employee/PaymentMethod/Split.js +9 -9
  223. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -7
  224. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  225. package/dist/components/Employee/Profile/Actions.js +5 -6
  226. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  227. package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -6
  228. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  229. package/dist/components/Employee/Profile/HomeAddress.js +10 -9
  230. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  231. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +3 -3
  232. package/dist/components/Employee/Profile/useProfile.js +3 -5
  233. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  234. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  235. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  236. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -5
  237. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  238. package/dist/components/Employee/Taxes/Actions.js +6 -7
  239. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  240. package/dist/components/Employee/Taxes/FederalForm.js +13 -14
  241. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  242. package/dist/components/Employee/Taxes/useTaxes.js +3 -5
  243. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  244. package/dist/components/Flow/Flow.js +2 -3
  245. package/dist/components/Flow/Flow.js.map +1 -1
  246. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -16
  247. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  248. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +20 -20
  249. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  250. package/dist/components/InformationRequests/InformationRequests.js +1 -1
  251. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  252. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +11 -12
  253. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -1
  254. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +2 -3
  255. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  256. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
  257. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +3 -2
  258. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  259. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +50 -68
  260. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  261. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +39 -38
  262. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  263. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +17 -18
  264. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  265. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
  266. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  267. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +2 -3
  268. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  269. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
  270. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  271. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  272. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  273. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
  274. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  275. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
  276. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -6
  277. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
  278. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  279. package/dist/components/Payroll/usePreparedPayrollData.js +5 -7
  280. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  281. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
  282. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  283. package/dist/helpers/formattedStrings.js +11 -12
  284. package/dist/helpers/formattedStrings.js.map +1 -1
  285. package/dist/helpers/percentageConversion.d.ts +3 -0
  286. package/dist/helpers/percentageConversion.js +27 -0
  287. package/dist/helpers/percentageConversion.js.map +1 -0
  288. package/dist/helpers/percentageConversion.test.d.ts +1 -0
  289. package/dist/hooks/usePagination/usePagination.d.ts +15 -0
  290. package/dist/hooks/usePagination/usePagination.js +37 -0
  291. package/dist/hooks/usePagination/usePagination.js.map +1 -0
  292. package/dist/hooks/usePagination/usePagination.test.d.ts +1 -0
  293. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  294. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +28 -28
  295. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -16
  296. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
  297. package/dist/i18n/en/common.json.d.ts +3 -1
  298. package/dist/i18n/en/common.json.js +1 -1
  299. package/dist/shared/constants.d.ts +2 -0
  300. package/dist/shared/constants.js +11 -10
  301. package/dist/shared/constants.js.map +1 -1
  302. package/dist/style.css +1 -1
  303. package/dist/types/i18next.d.ts +8 -0
  304. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"useDataView.js","sources":["../../../../src/components/Common/DataView/useDataView.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype DataViewColumn<T> =\n | {\n key: keyof T\n title: string | React.ReactNode\n render?: (item: T) => React.ReactNode\n }\n | {\n key?: string\n title: string | React.ReactNode\n render: (item: T) => React.ReactNode\n }\n\n// Type for footer object keys - allows data keys and custom string keys\ntype FooterKeys<T> = keyof T | string\n\nexport type useDataViewProp<T> = {\n columns: DataViewColumn<T>[]\n data: T[]\n pagination?: PaginationControlProps\n itemMenu?: (item: T) => React.ReactNode\n onSelect?: (item: T, checked: boolean) => void\n emptyState?: () => React.ReactNode\n footer?: () => Partial<Record<FooterKeys<T>, React.ReactNode>>\n isFetching?: boolean\n}\n\nexport type useDataViewPropReturn<T> = {\n pagination?: PaginationControlProps\n data: T[]\n columns: DataViewColumn<T>[]\n itemMenu?: (item: T) => React.ReactNode\n onSelect?: (item: T, checked: boolean) => void\n emptyState?: () => React.ReactNode\n footer?: () => Partial<Record<FooterKeys<T>, React.ReactNode>>\n isFetching?: boolean\n}\n\nexport const useDataView = <T>({\n columns,\n data,\n itemMenu,\n onSelect,\n pagination,\n emptyState,\n footer,\n isFetching,\n}: useDataViewProp<T>): useDataViewPropReturn<T> => {\n const dataViewProps = useMemo(() => {\n return {\n pagination,\n data,\n columns,\n itemMenu,\n onSelect,\n emptyState,\n footer,\n isFetching,\n }\n }, [pagination, data, columns, itemMenu, onSelect, emptyState, footer, isFetching])\n\n return dataViewProps\n}\n"],"names":["useDataView","columns","data","itemMenu","onSelect","pagination","emptyState","footer","isFetching","useMemo"],"mappings":";AAwCO,MAAMA,IAAc,CAAI;AAAA,EAC7B,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AACF,MACwBC,EAAQ,OACrB;AAAA,EACL,YAAAJ;AAAA,EACA,MAAAH;AAAA,EACA,SAAAD;AAAA,EACA,UAAAE;AAAA,EACA,UAAAC;AAAA,EACA,YAAAE;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,IAED,CAACH,GAAYH,GAAMD,GAASE,GAAUC,GAAUE,GAAYC,GAAQC,CAAU,CAAC;"}
1
+ {"version":3,"file":"useDataView.js","sources":["../../../../src/components/Common/DataView/useDataView.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\nexport type SelectionMode = 'multiple' | 'single'\n\ntype DataViewColumn<T> =\n | {\n key: keyof T\n title: string | React.ReactNode\n render?: (item: T) => React.ReactNode\n }\n | {\n key?: string\n title: string | React.ReactNode\n render: (item: T) => React.ReactNode\n }\n\ntype FooterKeys<T> = keyof T | string\n\nexport type useDataViewProp<T> = {\n columns: DataViewColumn<T>[]\n data: T[]\n pagination?: PaginationControlProps\n itemMenu?: (item: T) => React.ReactNode\n onSelect?: (item: T, checked: boolean) => void\n isItemSelected?: (item: T, index: number) => boolean\n emptyState?: () => React.ReactNode\n footer?: () => Partial<Record<FooterKeys<T>, React.ReactNode>>\n isFetching?: boolean\n selectionMode?: SelectionMode\n}\n\nexport type useDataViewPropReturn<T> = {\n pagination?: PaginationControlProps\n data: T[]\n columns: DataViewColumn<T>[]\n itemMenu?: (item: T) => React.ReactNode\n onSelect?: (item: T, checked: boolean) => void\n isItemSelected?: (item: T, index: number) => boolean\n emptyState?: () => React.ReactNode\n footer?: () => Partial<Record<FooterKeys<T>, React.ReactNode>>\n isFetching?: boolean\n selectionMode?: SelectionMode\n}\n\nexport const useDataView = <T>({\n columns,\n data,\n itemMenu,\n onSelect,\n isItemSelected,\n pagination,\n emptyState,\n footer,\n isFetching,\n selectionMode,\n}: useDataViewProp<T>): useDataViewPropReturn<T> => {\n const dataViewProps = useMemo(() => {\n return {\n pagination,\n data,\n columns,\n itemMenu,\n onSelect,\n isItemSelected,\n emptyState,\n footer,\n isFetching,\n selectionMode,\n }\n }, [\n pagination,\n data,\n columns,\n itemMenu,\n onSelect,\n isItemSelected,\n emptyState,\n footer,\n isFetching,\n selectionMode,\n ])\n\n return dataViewProps\n}\n"],"names":["useDataView","columns","data","itemMenu","onSelect","isItemSelected","pagination","emptyState","footer","isFetching","selectionMode","useMemo"],"mappings":";AA6CO,MAAMA,IAAc,CAAI;AAAA,EAC7B,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AACF,MACwBC,EAAQ,OACrB;AAAA,EACL,YAAAL;AAAA,EACA,MAAAJ;AAAA,EACA,SAAAD;AAAA,EACA,UAAAE;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAE;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,IAED;AAAA,EACDJ;AAAA,EACAJ;AAAA,EACAD;AAAA,EACAE;AAAA,EACAC;AAAA,EACAC;AAAA,EACAE;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,CACD;"}
@@ -0,0 +1,8 @@
1
+ import { NumberInputProps } from '../../UI/NumberInput/NumberInputTypes';
2
+ export interface PercentageFieldProps extends Pick<NumberInputProps, 'isDisabled' | 'className' | 'label' | 'isRequired' | 'description' | 'errorMessage'> {
3
+ name: string;
4
+ decimalValue?: string | number | boolean | null;
5
+ decimalMin?: string;
6
+ decimalMax?: string;
7
+ }
8
+ export declare function PercentageField({ decimalValue, decimalMin, decimalMax, ...props }: PercentageFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { jsx as N } from "react/jsx-runtime";
2
+ import { useMemo as d } from "react";
3
+ import { useTranslation as C } from "react-i18next";
4
+ import { useField as F } from "../hooks/useField.js";
5
+ import { useComponentContext as b } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ import { decimalToPercent as u, percentToDecimal as h } from "../../../../helpers/percentageConversion.js";
7
+ function x(t) {
8
+ if (!(t == null || typeof t == "boolean"))
9
+ return String(t);
10
+ }
11
+ function I({
12
+ decimalValue: t,
13
+ decimalMin: o,
14
+ decimalMax: n,
15
+ ...a
16
+ }) {
17
+ const f = b(), { t: i } = C("common"), p = d(() => {
18
+ const r = {};
19
+ if (o !== void 0) {
20
+ const m = parseFloat(o);
21
+ r.min = (s) => {
22
+ const e = Number(s);
23
+ return isNaN(e) ? !0 : e >= m || i("validations.percentageMin", { min: u(o) });
24
+ };
25
+ }
26
+ if (n !== void 0) {
27
+ const m = parseFloat(n);
28
+ r.max = (s) => {
29
+ const e = Number(s);
30
+ return isNaN(e) ? !0 : e <= m || i("validations.percentageMax", { max: u(n) });
31
+ };
32
+ }
33
+ return r;
34
+ }, [o, n, i]), { value: c, onChange: l, ...g } = F({
35
+ ...a,
36
+ defaultValue: x(t),
37
+ rules: { validate: p }
38
+ }), v = (r) => {
39
+ l(h(r));
40
+ };
41
+ return /* @__PURE__ */ N(
42
+ f.NumberInput,
43
+ {
44
+ ...a,
45
+ ...g,
46
+ value: u(c),
47
+ onChange: v,
48
+ min: o ? u(o) : void 0,
49
+ max: n ? u(n) : void 0,
50
+ format: "percent",
51
+ maximumFractionDigits: 4
52
+ }
53
+ );
54
+ }
55
+ export {
56
+ I as PercentageField
57
+ };
58
+ //# sourceMappingURL=PercentageField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PercentageField.js","sources":["../../../../../src/components/Common/Fields/PercentageField/PercentageField.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { useField } from '@/components/Common/Fields/hooks/useField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { decimalToPercent, percentToDecimal } from '@/helpers/percentageConversion'\n\nexport interface PercentageFieldProps extends Pick<\n NumberInputProps,\n 'isDisabled' | 'className' | 'label' | 'isRequired' | 'description' | 'errorMessage'\n> {\n name: string\n decimalValue?: string | number | boolean | null\n decimalMin?: string\n decimalMax?: string\n}\n\nfunction toDefaultString(value?: string | number | boolean | null): string | undefined {\n if (value === null || value === undefined || typeof value === 'boolean') return undefined\n return String(value)\n}\n\nexport function PercentageField({\n decimalValue,\n decimalMin,\n decimalMax,\n ...props\n}: PercentageFieldProps) {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n\n const validationRules = useMemo(() => {\n const rules: Record<string, (value: string) => string | true> = {}\n\n if (decimalMin !== undefined) {\n const minNum = parseFloat(decimalMin)\n rules.min = (value: string) => {\n const num = Number(value)\n if (isNaN(num)) return true\n return (\n num >= minNum || t('validations.percentageMin', { min: decimalToPercent(decimalMin) })\n )\n }\n }\n\n if (decimalMax !== undefined) {\n const maxNum = parseFloat(decimalMax)\n rules.max = (value: string) => {\n const num = Number(value)\n if (isNaN(num)) return true\n return (\n num <= maxNum || t('validations.percentageMax', { max: decimalToPercent(decimalMax) })\n )\n }\n }\n\n return rules\n }, [decimalMin, decimalMax, t])\n\n const { value, onChange, ...fieldProps } = useField({\n ...props,\n defaultValue: toDefaultString(decimalValue),\n rules: { validate: validationRules },\n })\n\n const handleChange = (percentValue: number) => {\n onChange(percentToDecimal(percentValue))\n }\n\n return (\n <Components.NumberInput\n {...props}\n {...fieldProps}\n value={decimalToPercent(value)}\n onChange={handleChange}\n min={decimalMin ? decimalToPercent(decimalMin) : undefined}\n max={decimalMax ? decimalToPercent(decimalMax) : undefined}\n format=\"percent\"\n maximumFractionDigits={4}\n />\n )\n}\n"],"names":["toDefaultString","value","PercentageField","decimalValue","decimalMin","decimalMax","props","Components","useComponentContext","t","useTranslation","validationRules","useMemo","rules","minNum","num","decimalToPercent","maxNum","onChange","fieldProps","useField","handleChange","percentValue","percentToDecimal","jsx"],"mappings":";;;;;;AAiBA,SAASA,EAAgBC,GAA8D;AACrF,MAAI,EAAAA,KAAU,QAA+B,OAAOA,KAAU;AAC9D,WAAO,OAAOA,CAAK;AACrB;AAEO,SAASC,EAAgB;AAAA,EAC9B,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,GAAyB;AACvB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAE/BC,IAAkBC,EAAQ,MAAM;AACpC,UAAMC,IAA0D,CAAA;AAEhE,QAAIT,MAAe,QAAW;AAC5B,YAAMU,IAAS,WAAWV,CAAU;AACpC,MAAAS,EAAM,MAAM,CAACZ,MAAkB;AAC7B,cAAMc,IAAM,OAAOd,CAAK;AACxB,eAAI,MAAMc,CAAG,IAAU,KAErBA,KAAOD,KAAUL,EAAE,6BAA6B,EAAE,KAAKO,EAAiBZ,CAAU,GAAG;AAAA,MAEzF;AAAA,IACF;AAEA,QAAIC,MAAe,QAAW;AAC5B,YAAMY,IAAS,WAAWZ,CAAU;AACpC,MAAAQ,EAAM,MAAM,CAACZ,MAAkB;AAC7B,cAAMc,IAAM,OAAOd,CAAK;AACxB,eAAI,MAAMc,CAAG,IAAU,KAErBA,KAAOE,KAAUR,EAAE,6BAA6B,EAAE,KAAKO,EAAiBX,CAAU,GAAG;AAAA,MAEzF;AAAA,IACF;AAEA,WAAOQ;AAAA,EACT,GAAG,CAACT,GAAYC,GAAYI,CAAC,CAAC,GAExB,EAAE,OAAAR,GAAO,UAAAiB,GAAU,GAAGC,EAAA,IAAeC,EAAS;AAAA,IAClD,GAAGd;AAAA,IACH,cAAcN,EAAgBG,CAAY;AAAA,IAC1C,OAAO,EAAE,UAAUQ,EAAA;AAAA,EAAgB,CACpC,GAEKU,IAAe,CAACC,MAAyB;AAC7C,IAAAJ,EAASK,EAAiBD,CAAY,CAAC;AAAA,EACzC;AAEA,SACE,gBAAAE;AAAA,IAACjB,EAAW;AAAA,IAAX;AAAA,MACE,GAAGD;AAAA,MACH,GAAGa;AAAA,MACJ,OAAOH,EAAiBf,CAAK;AAAA,MAC7B,UAAUoB;AAAA,MACV,KAAKjB,IAAaY,EAAiBZ,CAAU,IAAI;AAAA,MACjD,KAAKC,IAAaW,EAAiBX,CAAU,IAAI;AAAA,MACjD,QAAO;AAAA,MACP,uBAAuB;AAAA,IAAA;AAAA,EAAA;AAG7B;"}
@@ -0,0 +1,2 @@
1
+ import "./types/i18next.d.ts"
2
+ export { PercentageField, type PercentageFieldProps } from './PercentageField';
@@ -2,30 +2,29 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { z as o } from "zod";
3
3
  import { useForm as s, FormProvider as a } from "react-hook-form";
4
4
  import { zodResolver as l } from "@hookform/resolvers/zod";
5
- import e from "./SignatureForm.module.scss.js";
5
+ import t from "./SignatureForm.module.scss.js";
6
6
  import { Form as u } from "../Form/Form.js";
7
7
  import { Flex as c } from "../Flex/Flex.js";
8
- import "classnames";
9
- import "../../../shared/constants.js";
10
8
  import "react-i18next";
9
+ import "classnames";
11
10
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
11
  import "react";
13
- const p = o.object({
12
+ const f = o.object({
14
13
  signature: o.string().min(1),
15
14
  confirmSignature: o.literal(!0)
16
- }), f = {
15
+ }), p = {
17
16
  signature: ""
18
17
  };
19
- function V({ onSubmit: m, children: i, formProps: n }) {
20
- const t = s({
21
- resolver: l(p),
22
- defaultValues: f,
18
+ function N({ onSubmit: m, children: i, formProps: n }) {
19
+ const e = s({
20
+ resolver: l(f),
21
+ defaultValues: p,
23
22
  ...n
24
23
  });
25
- return /* @__PURE__ */ r(a, { ...t, children: /* @__PURE__ */ r(u, { onSubmit: t.handleSubmit(m), className: e.container, children: /* @__PURE__ */ r("div", { className: e.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
24
+ return /* @__PURE__ */ r(a, { ...e, children: /* @__PURE__ */ r(u, { onSubmit: e.handleSubmit(m), className: t.container, children: /* @__PURE__ */ r("div", { className: t.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
26
25
  }
27
26
  export {
28
- V as SignatureForm,
29
- p as SignatureFormSchema
27
+ N as SignatureForm,
28
+ f as SignatureFormSchema
30
29
  };
31
30
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
@@ -1,11 +1,10 @@
1
1
  import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import "../../../shared/constants.js";
2
+ import "react-i18next";
3
3
  import "classnames";
4
4
  import { ActionsLayout as p } from "../ActionsLayout/ActionsLayout.js";
5
- import "react-i18next";
6
5
  import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
6
  import "react";
8
- function y({
7
+ function x({
9
8
  onBack: t,
10
9
  backLabel: r,
11
10
  submitLabel: i,
@@ -18,6 +17,6 @@ function y({
18
17
  ] });
19
18
  }
20
19
  export {
21
- y as SignatureFormActions
20
+ x as SignatureFormActions
22
21
  };
23
22
  //# sourceMappingURL=SignatureFormActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,12 +1,11 @@
1
1
  import { jsxs as n, Fragment as s, jsx as r } from "react/jsx-runtime";
2
- import "../../../shared/constants.js";
3
- import "classnames";
4
- import { TextInputField as p } from "../Fields/TextInputField/TextInputField.js";
5
2
  import "react-i18next";
3
+ import "classnames";
6
4
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
5
  import "react";
8
- import { CheckboxField as a } from "../Fields/CheckboxField/CheckboxField.js";
9
- function b({
6
+ import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
7
+ import { CheckboxField as p } from "../Fields/CheckboxField/CheckboxField.js";
8
+ function F({
10
9
  signatureLabel: e,
11
10
  signatureDescription: i = "",
12
11
  signatureError: t = "",
@@ -15,7 +14,7 @@ function b({
15
14
  }) {
16
15
  return /* @__PURE__ */ n(s, { children: [
17
16
  /* @__PURE__ */ r(
18
- p,
17
+ a,
19
18
  {
20
19
  name: "signature",
21
20
  label: e,
@@ -25,7 +24,7 @@ function b({
25
24
  }
26
25
  ),
27
26
  /* @__PURE__ */ r(
28
- a,
27
+ p,
29
28
  {
30
29
  name: "confirmSignature",
31
30
  isRequired: !0,
@@ -36,6 +35,6 @@ function b({
36
35
  ] });
37
36
  }
38
37
  export {
39
- b as SignatureFormFields
38
+ F as SignatureFormFields
40
39
  };
41
40
  //# sourceMappingURL=SignatureFormFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
@@ -1,178 +1,205 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import b from "dompurify";
3
- import { useTranslation as y } from "react-i18next";
4
- import { SelectField as p } from "../Fields/SelectField/SelectField.js";
5
- import { TextInputField as w } from "../Fields/TextInputField/TextInputField.js";
6
- import { NumberInputField as k } from "../Fields/NumberInputField/NumberInputField.js";
7
- import { RadioGroupField as R } from "../Fields/RadioGroupField/RadioGroupField.js";
8
- import { DatePickerField as _ } from "../Fields/DatePickerField/DatePickerField.js";
9
- import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { useMaskedTransform as D } from "../../../helpers/mask.js";
11
- const T = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["target", "href"] };
12
- function M({
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import k from "dompurify";
3
+ import { useTranslation as D } from "react-i18next";
4
+ import { SelectField as w } from "../Fields/SelectField/SelectField.js";
5
+ import { TextInputField as R } from "../Fields/TextInputField/TextInputField.js";
6
+ import { NumberInputField as x } from "../Fields/NumberInputField/NumberInputField.js";
7
+ import { RadioGroupField as _ } from "../Fields/RadioGroupField/RadioGroupField.js";
8
+ import { DatePickerField as T } from "../Fields/DatePickerField/DatePickerField.js";
9
+ import { PercentageField as b } from "../Fields/PercentageField/PercentageField.js";
10
+ import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { useLocale as C } from "../../../contexts/LocaleProvider/useLocale.js";
12
+ import { useMaskedTransform as I } from "../../../helpers/mask.js";
13
+ import { formatPercentLabel as g } from "../../../helpers/percentageConversion.js";
14
+ const F = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["target", "href"] };
15
+ function B({
13
16
  questionType: e,
14
- ...t
17
+ ...a
15
18
  }) {
16
19
  switch (e.toLowerCase()) {
17
20
  case "date":
18
- return /* @__PURE__ */ a(I, { ...t });
21
+ return /* @__PURE__ */ t(N, { ...a });
19
22
  case "radio":
20
- return /* @__PURE__ */ a(C, { ...t });
23
+ return /* @__PURE__ */ t(L, { ...a });
21
24
  case "text":
22
25
  case "account_number":
23
- return /* @__PURE__ */ a(d, { ...t });
26
+ return /* @__PURE__ */ t(y, { ...a });
24
27
  case "select":
25
- return /* @__PURE__ */ a(h, { ...t });
28
+ return /* @__PURE__ */ t(E, { ...a });
26
29
  case "number":
27
- return /* @__PURE__ */ a(m, { ...t });
30
+ return /* @__PURE__ */ t(p, { ...a });
28
31
  case "workers_compensation_rate":
29
- return /* @__PURE__ */ a(m, { ...t, isPercent: t.requirement?.metadata?.rateType === "percent" });
32
+ return /* @__PURE__ */ t(p, { ...a, isPercent: a.requirement?.metadata?.rateType === "percent" });
30
33
  case "percent":
31
34
  case "tax_rate":
32
- return /* @__PURE__ */ a(g, { ...t });
35
+ return /* @__PURE__ */ t(S, { ...a });
33
36
  case "currency":
34
- return /* @__PURE__ */ a(m, { ...t, isCurrency: !0 });
37
+ return /* @__PURE__ */ t(p, { ...a, isCurrency: !0 });
35
38
  default:
36
- return /* @__PURE__ */ a(d, { ...t });
39
+ return /* @__PURE__ */ t(y, { ...a });
37
40
  }
38
41
  }
39
- function h({ question: e, requirement: t, isDisabled: l = !1 }) {
40
- const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value, u = e ? e.inputQuestionFormat : t.metadata;
41
- if (!u?.options) throw new Error("Select input must have options");
42
- return r ? /* @__PURE__ */ a(
43
- p,
42
+ function E({ question: e, requirement: a, isDisabled: i = !1 }) {
43
+ const { key: r, label: u, description: o } = e || a, n = e ? e.answers[0]?.value : a.value, c = e ? e.inputQuestionFormat : a.metadata;
44
+ if (!c?.options) throw new Error("Select input must have options");
45
+ return r ? /* @__PURE__ */ t(
46
+ w,
44
47
  {
45
48
  isRequired: !0,
46
49
  name: r,
47
50
  defaultValue: n,
48
- label: s,
51
+ label: u,
49
52
  description: o,
50
- isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : l,
51
- options: u.options.map((i, c) => ({
52
- value: i.value,
53
- label: i.label
53
+ isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : i,
54
+ options: c.options.map((s, l) => ({
55
+ value: s.value,
56
+ label: s.label
54
57
  }))
55
58
  }
56
59
  ) : null;
57
60
  }
58
- function d({
61
+ function y({
59
62
  question: e,
60
- requirement: t,
61
- isDisabled: l = !1,
63
+ requirement: a,
64
+ isDisabled: i = !1,
62
65
  type: r = "text",
63
- isPercent: s = !1
66
+ isPercent: u = !1
64
67
  }) {
65
- const { key: o, label: n, description: u } = e || t, i = e ? e.answers[0]?.value : t.value, c = t?.metadata?.mask ?? null, f = D(c);
66
- return o ? /* @__PURE__ */ a(
67
- w,
68
+ const { key: o, label: n, description: c } = e || a, s = e ? e.answers[0]?.value : a.value, l = a?.metadata?.mask ?? null, d = I(l);
69
+ return o ? /* @__PURE__ */ t(
70
+ R,
68
71
  {
69
72
  isRequired: !0,
70
73
  name: o,
71
74
  label: n,
72
- defaultValue: i,
73
- description: u,
74
- isDisabled: l,
75
- transform: c ? f : void 0,
76
- placeholder: c || void 0,
75
+ defaultValue: s,
76
+ description: c,
77
+ isDisabled: i,
78
+ transform: l ? d : void 0,
79
+ placeholder: l || void 0,
77
80
  type: r,
78
- adornmentEnd: s ? "%" : void 0
81
+ adornmentEnd: u ? "%" : void 0
79
82
  }
80
83
  ) : null;
81
84
  }
82
- function m({
85
+ function p({
83
86
  question: e,
84
- requirement: t,
85
- isCurrency: l,
87
+ requirement: a,
88
+ isCurrency: i,
86
89
  isPercent: r,
87
- isDisabled: s = !1
90
+ isDisabled: u = !1
88
91
  }) {
89
- const { t: o } = y("common"), { key: n, label: u, description: i } = e || t, c = e ? e.answers[0]?.value : t.value;
92
+ const { t: o } = D("common"), { key: n, label: c, description: s } = e || a, l = e ? e.answers[0]?.value : a.value;
90
93
  if (!n) return null;
91
- const f = t?.metadata?.type === "workers_compensation_rate" && t.metadata.riskClassCode !== void 0 ? `${t.metadata.riskClassCode}: ${t.metadata.riskClassDescription}` : null, v = t?.metadata?.rateType === "currency_per_hour" ? o("inputs.workersCompensationRatePerHourAdornment") : void 0;
92
- return /* @__PURE__ */ a(
93
- k,
94
+ const d = a?.metadata?.type === "workers_compensation_rate" && a.metadata.riskClassCode !== void 0 ? `${a.metadata.riskClassCode}: ${a.metadata.riskClassDescription}` : null, m = a?.metadata?.rateType === "currency_per_hour" ? o("inputs.workersCompensationRatePerHourAdornment") : void 0;
95
+ return /* @__PURE__ */ t(
96
+ x,
94
97
  {
95
98
  isRequired: !0,
96
99
  name: n,
97
- label: u,
98
- description: i ?? f,
99
- defaultValue: typeof c < "u" ? Number(c) : void 0,
100
- format: l ? "currency" : r ? "percent" : "decimal",
101
- isDisabled: s,
100
+ label: c,
101
+ description: s ?? d,
102
+ defaultValue: typeof l < "u" ? Number(l) : void 0,
103
+ format: i ? "currency" : r ? "percent" : "decimal",
104
+ isDisabled: u,
102
105
  maximumFractionDigits: r ? 4 : void 0,
103
- adornmentEnd: v
106
+ adornmentEnd: m
104
107
  }
105
108
  );
106
109
  }
107
- function C({ question: e, requirement: t, isDisabled: l = !1 }) {
108
- const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value, { Text: u } = x(), i = e ? e.inputQuestionFormat : t.metadata;
109
- if (!i?.options) throw new Error(`RadioInput must have options:${JSON.stringify(e)}`);
110
- return r ? /* @__PURE__ */ a(
111
- R,
110
+ function L({ question: e, requirement: a, isDisabled: i = !1 }) {
111
+ const { key: r, label: u, description: o } = e || a, n = e ? e.answers[0]?.value : a.value, { Text: c } = h(), s = e ? e.inputQuestionFormat : a.metadata;
112
+ if (!s?.options) throw new Error(`RadioInput must have options:${JSON.stringify(e)}`);
113
+ return r ? /* @__PURE__ */ t(
114
+ _,
112
115
  {
113
116
  isRequired: !0,
114
117
  name: r,
115
- isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : l,
116
- description: o && /* @__PURE__ */ a(u, { as: "span", children: /* @__PURE__ */ a(
118
+ isDisabled: r.includes("fileNewHireReport") ? n !== void 0 : i,
119
+ description: o && /* @__PURE__ */ t(c, { as: "span", children: /* @__PURE__ */ t(
117
120
  "span",
118
121
  {
119
- dangerouslySetInnerHTML: { __html: b.sanitize(o, T) }
122
+ dangerouslySetInnerHTML: { __html: k.sanitize(o, F) }
120
123
  }
121
124
  ) }),
122
- label: s,
123
- options: i.options.map((c) => ({
124
- value: c.value,
125
- label: c.label
125
+ label: u,
126
+ options: s.options.map((l) => ({
127
+ value: l.value,
128
+ label: l.label
126
129
  }))
127
130
  }
128
131
  ) : null;
129
132
  }
130
- function I({
133
+ function N({
131
134
  question: e,
132
- requirement: t,
133
- isDisabled: l = !1
135
+ requirement: a,
136
+ isDisabled: i = !1
134
137
  }) {
135
- const { key: r, label: s, description: o } = e || t, n = e ? e.answers[0]?.value : t.value;
138
+ const { key: r, label: u, description: o } = e || a, n = e ? e.answers[0]?.value : a.value;
136
139
  if (typeof n != "string" && typeof n < "u")
137
140
  throw new Error("Expecting value to be string for DateInput");
138
- return r ? /* @__PURE__ */ a(
139
- _,
141
+ return r ? /* @__PURE__ */ t(
142
+ T,
140
143
  {
141
144
  isRequired: !0,
142
145
  name: r,
143
146
  defaultValue: n ? new Date(n) : null,
144
- label: s,
147
+ label: u,
145
148
  description: o,
146
- isDisabled: l
149
+ isDisabled: i
147
150
  }
148
151
  ) : null;
149
152
  }
150
- function g({ requirement: e, question: t, ...l }) {
153
+ function S({ requirement: e, question: a, ...i }) {
154
+ const { locale: r } = C();
151
155
  if (e) {
152
- const { key: r, metadata: s, label: o, description: n } = e, { validation: u } = s || {};
153
- return u?.type === "one_of" ? /* @__PURE__ */ a(
154
- p,
156
+ const { key: s, metadata: l, label: d, description: m } = e, { validation: f } = l || {};
157
+ return f?.type === "one_of" ? /* @__PURE__ */ t(
158
+ w,
155
159
  {
156
160
  isRequired: !0,
157
- name: r || "",
158
- label: o || "",
159
- description: n,
160
- options: u.rates?.map((i) => ({
161
- value: i,
162
- label: i
161
+ name: s || "",
162
+ label: d || "",
163
+ description: m,
164
+ options: f.rates?.map((v) => ({
165
+ value: v,
166
+ label: g(v, r)
163
167
  })) || []
164
168
  }
165
- ) : /* @__PURE__ */ a(d, { requirement: e, ...l, type: "number", isPercent: !0 });
169
+ ) : /* @__PURE__ */ t(
170
+ b,
171
+ {
172
+ isRequired: !0,
173
+ name: s || "",
174
+ label: d || "",
175
+ description: m,
176
+ decimalValue: e.value,
177
+ decimalMin: f?.min,
178
+ decimalMax: f?.max,
179
+ isDisabled: i.isDisabled
180
+ }
181
+ );
166
182
  }
167
- return /* @__PURE__ */ a(d, { question: t, ...l, type: "number", isPercent: !0 });
183
+ const { key: u, label: o, description: n, answers: c } = a;
184
+ return /* @__PURE__ */ t(
185
+ b,
186
+ {
187
+ isRequired: !0,
188
+ name: u || "",
189
+ label: o || "",
190
+ description: n,
191
+ decimalValue: c[0]?.value,
192
+ isDisabled: i.isDisabled
193
+ }
194
+ );
168
195
  }
169
196
  export {
170
- I as DateField,
171
- m as NumberInput,
172
- M as QuestionInput,
173
- C as RadioInput,
174
- h as SelectInput,
175
- g as TaxRateInput,
176
- d as TextInput
197
+ N as DateField,
198
+ p as NumberInput,
199
+ B as QuestionInput,
200
+ L as RadioInput,
201
+ E as SelectInput,
202
+ S as TaxRateInput,
203
+ y as TextInput
177
204
  };
178
205
  //# sourceMappingURL=TaxInputs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaxInputs.js","sources":["../../../../src/components/Common/TaxInputs/TaxInputs.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api/models/components/employeestatetaxquestion'\nimport { type TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { useTranslation } from 'react-i18next'\nimport { SelectField } from '../Fields/SelectField/SelectField'\nimport { TextInputField } from '../Fields/TextInputField/TextInputField'\nimport { NumberInputField } from '../Fields/NumberInputField/NumberInputField'\nimport { RadioGroupField } from '../Fields/RadioGroupField/RadioGroupField'\nimport { DatePickerField } from '../Fields/DatePickerField/DatePickerField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useMaskedTransform } from '@/helpers/mask'\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['target', 'href'] }\n\ninterface EmpQ {\n question: NonNullable<EmployeeStateTaxQuestion>\n requirement?: never\n isDisabled?: boolean\n}\ninterface CompR {\n requirement: TaxRequirement\n question?: never\n isDisabled?: boolean\n}\n\ntype NumberFieldProps = { isCurrency?: boolean; isPercent?: boolean }\n\ntype TextInputProps = { type?: string; isPercent?: boolean }\n\nexport function QuestionInput({\n questionType,\n ...props\n}: (EmpQ | CompR) & {\n questionType: string\n}) {\n switch (questionType.toLowerCase()) {\n case 'date':\n return <DateField {...props} />\n case 'radio':\n return <RadioInput {...props} />\n case 'text':\n case 'account_number': //TODO: temporary - need special handling for account numbers\n return <TextInput {...props} />\n case 'select':\n return <SelectInput {...props} />\n case 'number':\n return <NumberInput {...props} />\n case 'workers_compensation_rate':\n return (\n <NumberInput {...props} isPercent={props.requirement?.metadata?.rateType === 'percent'} />\n )\n case 'percent':\n case 'tax_rate':\n return <TaxRateInput {...props} />\n case 'currency':\n return <NumberInput {...props} isCurrency />\n default:\n return <TextInput {...props} />\n // return null\n }\n}\n\nexport function SelectInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error('Select input must have options')\n\n if (!key) return null\n\n return (\n <SelectField\n isRequired\n name={key}\n defaultValue={value}\n label={label as string}\n description={description}\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n options={meta.options.map((item, _) => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n\nexport function TextInput({\n question,\n requirement,\n isDisabled = false,\n type = 'text',\n isPercent = false,\n}: (EmpQ | CompR) & TextInputProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const mask = requirement?.metadata?.mask ?? null\n const transform = useMaskedTransform(mask)\n\n if (!key) return null\n return (\n <TextInputField\n isRequired\n name={key}\n label={label}\n // @ts-expect-error HACK value is insufficiently narrowed here\n defaultValue={value}\n description={description}\n isDisabled={isDisabled}\n transform={mask ? transform : undefined}\n placeholder={mask ? mask : undefined}\n type={type}\n adornmentEnd={isPercent ? '%' : undefined}\n />\n )\n}\n\nexport function NumberInput({\n question,\n requirement,\n isCurrency,\n isPercent,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { t } = useTranslation('common')\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n if (!key) return null\n\n const wcDescription =\n requirement?.metadata?.type === 'workers_compensation_rate' &&\n requirement.metadata.riskClassCode !== undefined\n ? `${requirement.metadata.riskClassCode}: ${requirement.metadata.riskClassDescription}`\n : null\n const adornmentEnd =\n requirement?.metadata?.rateType === 'currency_per_hour'\n ? t('inputs.workersCompensationRatePerHourAdornment')\n : undefined\n\n return (\n <NumberInputField\n isRequired\n name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={typeof value !== 'undefined' ? Number(value) : undefined}\n format={isCurrency ? 'currency' : isPercent ? 'percent' : 'decimal'}\n isDisabled={isDisabled}\n maximumFractionDigits={isPercent ? 4 : undefined}\n adornmentEnd={adornmentEnd}\n />\n )\n}\n\nexport function RadioInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const { Text } = useComponentContext()\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error(`RadioInput must have options:${JSON.stringify(question)}`)\n\n if (!key) return null\n\n return (\n <RadioGroupField\n isRequired\n name={key}\n //File new hire report setting cannot be changed after it has been configured.\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n description={\n description && (\n <Text as=\"span\">\n <span\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description, dompurifyConfig) }}\n />\n </Text>\n )\n }\n label={label as string}\n options={meta.options.map(item => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n//TODO: This type is untested as of yet\nexport function DateField({\n question,\n requirement,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n if (typeof value !== 'string' && typeof value !== 'undefined')\n throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\n isRequired\n name={key}\n defaultValue={value ? new Date(value) : null}\n label={label as string}\n description={description}\n isDisabled={isDisabled}\n />\n )\n}\n\nexport function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR) {\n if (requirement) {\n // Covers case for tax rate where the rate is a one_of option and must be submitted as a string\n // of enumerated rate values provided\n const { key, metadata, label, description } = requirement\n const { validation } = metadata || {}\n return validation?.type === 'one_of' ? (\n <SelectField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n options={\n validation.rates?.map(rate => ({\n value: rate,\n label: rate,\n })) || []\n }\n />\n ) : (\n <TextInput requirement={requirement} {...props} type=\"number\" isPercent />\n )\n }\n\n return <TextInput question={question} {...props} type=\"number\" isPercent />\n}\n"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","TaxRateInput","question","requirement","isDisabled","key","label","description","value","meta","SelectField","item","_","type","isPercent","mask","transform","useMaskedTransform","TextInputField","isCurrency","t","useTranslation","wcDescription","adornmentEnd","NumberInputField","Text","useComponentContext","RadioGroupField","DOMPurify","DatePickerField","metadata","validation","rate"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,UAAU,MAAM,EAAA;AAiBtF,SAASC,EAAc;AAAA,EAC5B,cAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACD,UAAQD,EAAa,eAAY;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAE,EAACC,GAAA,EAAW,GAAGF,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACE,GAAA,EAAY,GAAGH,EAAA,CAAO;AAAA,IAChC,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACG,GAAA,EAAW,GAAGJ,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACI,GAAA,EAAa,GAAGL,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aACE,gBAAAC,EAACK,KAAa,GAAGN,GAAO,WAAWA,EAAM,aAAa,UAAU,aAAa,UAAA,CAAW;AAAA,IAE5F,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACM,GAAA,EAAc,GAAGP,EAAA,CAAO;AAAA,IAClC,KAAK;AACH,aAAO,gBAAAC,EAACK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AF;AAAA,MACA,aAAAC;AAAA,MACA,YAAAH;AAAA,IAAA;AAAA,EAAA,IATa;AAYnB;AAEO,SAASH,EAAa,EAAE,aAAAE,GAAa,UAAAD,GAAU,GAAGR,KAAuB;AAC9E,MAAIS,GAAa;AAGf,UAAM,EAAE,KAAAE,GAAK,UAAAyB,GAAU,OAAAxB,GAAO,aAAAC,MAAgBJ,GACxC,EAAE,YAAA4B,MAAeD,KAAY,CAAA;AACnC,WAAOC,GAAY,SAAS,WAC1B,gBAAApC;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,YAAU;AAAA,QACV,MAAML,KAAO;AAAA,QACb,OAAOC,KAAS;AAAA,QAChB,aAAAC;AAAA,QACA,SACEwB,EAAW,OAAO,IAAI,CAAAC,OAAS;AAAA,UAC7B,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA,EACP,KAAK,CAAA;AAAA,MAAC;AAAA,IAAA,sBAIXlC,GAAA,EAAU,aAAAK,GAA2B,GAAGT,GAAO,MAAK,UAAS,WAAS,IAAC;AAAA,EAE5E;AAEA,SAAO,gBAAAC,EAACG,KAAU,UAAAI,GAAqB,GAAGR,GAAO,MAAK,UAAS,WAAS,IAAC;AAC3E;"}
1
+ {"version":3,"file":"TaxInputs.js","sources":["../../../../src/components/Common/TaxInputs/TaxInputs.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api/models/components/employeestatetaxquestion'\nimport { type TaxRequirement } from '@gusto/embedded-api/models/components/taxrequirement'\nimport { useTranslation } from 'react-i18next'\nimport { SelectField } from '../Fields/SelectField/SelectField'\nimport { TextInputField } from '../Fields/TextInputField/TextInputField'\nimport { NumberInputField } from '../Fields/NumberInputField/NumberInputField'\nimport { RadioGroupField } from '../Fields/RadioGroupField/RadioGroupField'\nimport { DatePickerField } from '../Fields/DatePickerField/DatePickerField'\nimport { PercentageField } from '../Fields/PercentageField/PercentageField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { useMaskedTransform } from '@/helpers/mask'\nimport { formatPercentLabel } from '@/helpers/percentageConversion'\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['target', 'href'] }\n\ninterface EmpQ {\n question: NonNullable<EmployeeStateTaxQuestion>\n requirement?: never\n isDisabled?: boolean\n}\ninterface CompR {\n requirement: TaxRequirement\n question?: never\n isDisabled?: boolean\n}\n\ntype NumberFieldProps = { isCurrency?: boolean; isPercent?: boolean }\n\ntype TextInputProps = { type?: string; isPercent?: boolean }\n\nexport function QuestionInput({\n questionType,\n ...props\n}: (EmpQ | CompR) & {\n questionType: string\n}) {\n switch (questionType.toLowerCase()) {\n case 'date':\n return <DateField {...props} />\n case 'radio':\n return <RadioInput {...props} />\n case 'text':\n case 'account_number': //TODO: temporary - need special handling for account numbers\n return <TextInput {...props} />\n case 'select':\n return <SelectInput {...props} />\n case 'number':\n return <NumberInput {...props} />\n case 'workers_compensation_rate':\n return (\n <NumberInput {...props} isPercent={props.requirement?.metadata?.rateType === 'percent'} />\n )\n case 'percent':\n case 'tax_rate':\n return <TaxRateInput {...props} />\n case 'currency':\n return <NumberInput {...props} isCurrency />\n default:\n return <TextInput {...props} />\n // return null\n }\n}\n\nexport function SelectInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error('Select input must have options')\n\n if (!key) return null\n\n return (\n <SelectField\n isRequired\n name={key}\n defaultValue={value}\n label={label as string}\n description={description}\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n options={meta.options.map((item, _) => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n\nexport function TextInput({\n question,\n requirement,\n isDisabled = false,\n type = 'text',\n isPercent = false,\n}: (EmpQ | CompR) & TextInputProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const mask = requirement?.metadata?.mask ?? null\n const transform = useMaskedTransform(mask)\n\n if (!key) return null\n return (\n <TextInputField\n isRequired\n name={key}\n label={label}\n // @ts-expect-error HACK value is insufficiently narrowed here\n defaultValue={value}\n description={description}\n isDisabled={isDisabled}\n transform={mask ? transform : undefined}\n placeholder={mask ? mask : undefined}\n type={type}\n adornmentEnd={isPercent ? '%' : undefined}\n />\n )\n}\n\nexport function NumberInput({\n question,\n requirement,\n isCurrency,\n isPercent,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { t } = useTranslation('common')\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n if (!key) return null\n\n const wcDescription =\n requirement?.metadata?.type === 'workers_compensation_rate' &&\n requirement.metadata.riskClassCode !== undefined\n ? `${requirement.metadata.riskClassCode}: ${requirement.metadata.riskClassDescription}`\n : null\n const adornmentEnd =\n requirement?.metadata?.rateType === 'currency_per_hour'\n ? t('inputs.workersCompensationRatePerHourAdornment')\n : undefined\n\n return (\n <NumberInputField\n isRequired\n name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={typeof value !== 'undefined' ? Number(value) : undefined}\n format={isCurrency ? 'currency' : isPercent ? 'percent' : 'decimal'}\n isDisabled={isDisabled}\n maximumFractionDigits={isPercent ? 4 : undefined}\n adornmentEnd={adornmentEnd}\n />\n )\n}\n\nexport function RadioInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const { Text } = useComponentContext()\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error(`RadioInput must have options:${JSON.stringify(question)}`)\n\n if (!key) return null\n\n return (\n <RadioGroupField\n isRequired\n name={key}\n //File new hire report setting cannot be changed after it has been configured.\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n description={\n description && (\n <Text as=\"span\">\n <span\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description, dompurifyConfig) }}\n />\n </Text>\n )\n }\n label={label as string}\n options={meta.options.map(item => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n//TODO: This type is untested as of yet\nexport function DateField({\n question,\n requirement,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n if (typeof value !== 'string' && typeof value !== 'undefined')\n throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\n isRequired\n name={key}\n defaultValue={value ? new Date(value) : null}\n label={label as string}\n description={description}\n isDisabled={isDisabled}\n />\n )\n}\n\nexport function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR) {\n const { locale } = useLocale()\n\n if (requirement) {\n const { key, metadata, label, description } = requirement\n const { validation } = metadata || {}\n\n if (validation?.type === 'one_of') {\n return (\n <SelectField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n options={\n validation.rates?.map(rate => ({\n value: rate,\n label: formatPercentLabel(rate, locale),\n })) || []\n }\n />\n )\n }\n\n return (\n <PercentageField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n decimalValue={requirement.value}\n decimalMin={validation?.min}\n decimalMax={validation?.max}\n isDisabled={props.isDisabled}\n />\n )\n }\n\n const { key, label, description, answers } = question\n return (\n <PercentageField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n decimalValue={answers[0]?.value}\n isDisabled={props.isDisabled}\n />\n )\n}\n"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","TaxRateInput","question","requirement","isDisabled","key","label","description","value","meta","SelectField","item","_","type","isPercent","mask","transform","useMaskedTransform","TextInputField","isCurrency","t","useTranslation","wcDescription","adornmentEnd","NumberInputField","Text","useComponentContext","RadioGroupField","DOMPurify","DatePickerField","locale","useLocale","metadata","validation","rate","formatPercentLabel","PercentageField","answers"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,UAAU,MAAM,EAAA;AAiBtF,SAASC,EAAc;AAAA,EAC5B,cAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACD,UAAQD,EAAa,eAAY;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAE,EAACC,GAAA,EAAW,GAAGF,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACE,GAAA,EAAY,GAAGH,EAAA,CAAO;AAAA,IAChC,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACG,GAAA,EAAW,GAAGJ,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACI,GAAA,EAAa,GAAGL,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aACE,gBAAAC,EAACK,KAAa,GAAGN,GAAO,WAAWA,EAAM,aAAa,UAAU,aAAa,UAAA,CAAW;AAAA,IAE5F,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACM,GAAA,EAAc,GAAGP,EAAA,CAAO;AAAA,IAClC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,GAAO,YAAU,IAAC;AAAA,IAC5C;AACE,aAAO,gBAAAC,EAACG,GAAA,EAAW,GAAGJ,EAAA,CAAO;AAAA,EAAA;AAGnC;AAEO,SAASK,EAAY,EAAE,UAAAG,GAAU,aAAAC,GAAa,YAAAC,IAAa,MAAuB;AACvF,QAAM,EAAE,KAAAC,GAAK,OAAAC,GAAO,aAAAC,EAAA,IAAgBL,KAAsBC,GACpDK,IAAQN,IAAWA,EAAS,QAAQ,CAA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