@gusto/embedded-react-sdk 0.12.0 → 0.12.3

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 (337) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/dist/_virtual/dynamic-import-helper.js +1 -8
  3. package/dist/_virtual/dynamic-import-helper.js.map +1 -1
  4. package/dist/components/Base/Base.js +4 -4
  5. package/dist/components/Common/ReorderableList/DropZone.js +1 -1
  6. package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
  7. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  8. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  9. package/dist/components/Common/SignatureForm/SignatureForm.js +2 -2
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  11. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  12. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +1 -1
  13. package/dist/components/Common/UI/DatePicker/DatePicker.js +1 -1
  14. package/dist/components/Common/UI/ProgressBar/ProgressBar.d.ts +1 -1
  15. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +19 -9
  16. package/dist/components/Common/UI/ProgressBar/ProgressBar.js.map +1 -1
  17. package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +4 -0
  18. package/dist/components/Common/hooks/useNumberFormatter.js +1 -1
  19. package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -7
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -8
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -7
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +9 -10
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -11
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -7
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -9
  40. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  41. package/dist/components/Company/BankAccount/BankAccount.js +7 -7
  42. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  44. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +8 -8
  45. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -8
  47. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  48. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -7
  49. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
  51. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +4 -4
  53. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  55. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  56. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +2 -2
  57. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  58. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  59. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  60. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  61. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -11
  62. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  63. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -7
  64. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  65. package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
  66. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -10
  67. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  68. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -7
  69. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  70. package/dist/components/Company/FederalTaxes/Actions.js +6 -5
  71. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  72. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -16
  73. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  74. package/dist/components/Company/FederalTaxes/Form.js +5 -4
  75. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  76. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -15
  77. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  78. package/dist/components/Company/Industry/Actions.js +3 -2
  79. package/dist/components/Company/Industry/Actions.js.map +1 -1
  80. package/dist/components/Company/Industry/Context.js +6 -10
  81. package/dist/components/Company/Industry/Context.js.map +1 -1
  82. package/dist/components/Company/Industry/Edit.js +5 -4
  83. package/dist/components/Company/Industry/Edit.js.map +1 -1
  84. package/dist/components/Company/Industry/Industry.js +2 -2
  85. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  86. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  87. package/dist/components/Company/Locations/LocationForm/Form.js +5 -6
  88. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  89. package/dist/components/Company/Locations/LocationForm/LocationForm.js +14 -15
  90. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  91. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -7
  92. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  93. package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
  94. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationsList/List.js +3 -2
  96. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -8
  98. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -7
  100. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  101. package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
  102. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  103. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -6
  104. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  105. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -4
  106. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  107. package/dist/components/Company/OnboardingOverview/context.js +3 -7
  108. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  109. package/dist/components/Company/PaySchedule/PaySchedule.js +38 -39
  110. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  111. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -9
  112. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  113. package/dist/components/Company/PaySchedule/_parts/Edit.js +16 -17
  114. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  115. package/dist/components/Company/PaySchedule/_parts/Head.js +7 -6
  116. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  117. package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
  118. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  119. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -10
  120. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  121. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  122. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  123. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +3 -3
  124. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -7
  125. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  126. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  127. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  129. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -7
  132. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  133. package/dist/components/Contractor/Address/Address.js +8 -9
  134. package/dist/components/Contractor/Address/Address.js.map +1 -1
  135. package/dist/components/Contractor/Address/Form.js +3 -4
  136. package/dist/components/Contractor/Address/Form.js.map +1 -1
  137. package/dist/components/Contractor/Address/useAddress.js +5 -9
  138. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  139. package/dist/components/Contractor/ContractorList/index.js +18 -18
  140. package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
  141. package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -3
  142. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +12 -11
  143. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
  144. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
  145. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +42 -22
  146. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  147. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +5 -5
  148. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +34 -16
  149. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  150. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -5
  151. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +86 -85
  153. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  154. package/dist/components/Contractor/Profile/ContractorProfile.js +23 -16
  155. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  156. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +3 -1
  157. package/dist/components/Contractor/Profile/ContractorProfileForm.js +68 -65
  158. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
  159. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +16 -16
  160. package/dist/components/Contractor/Profile/useContractorProfile.js +110 -107
  161. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  162. package/dist/components/Contractor/Submit/Submit.js +38 -38
  163. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  164. package/dist/components/Employee/Compensation/Actions.js +1 -1
  165. package/dist/components/Employee/Compensation/Compensation.js +10 -10
  166. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  167. package/dist/components/Employee/Compensation/Edit.js +12 -12
  168. package/dist/components/Employee/Compensation/List.js +23 -22
  169. package/dist/components/Employee/Compensation/List.js.map +1 -1
  170. package/dist/components/Employee/Compensation/useCompensation.js +1 -1
  171. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  172. package/dist/components/Employee/Deductions/Deductions.js +1 -1
  173. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  174. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +12 -12
  175. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +3 -3
  176. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +9 -9
  177. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
  178. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  179. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -9
  180. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  181. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  182. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  183. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -7
  184. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  185. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +12 -13
  186. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  187. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -7
  188. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  189. package/dist/components/Employee/EmployeeList/Actions.js +3 -2
  190. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  191. package/dist/components/Employee/EmployeeList/EmployeeList.js +6 -7
  192. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  193. package/dist/components/Employee/EmployeeList/Head.js +6 -5
  194. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  195. package/dist/components/Employee/EmployeeList/List.js +12 -12
  196. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -7
  197. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  198. package/dist/components/Employee/FederalTaxes/Actions.d.ts +1 -0
  199. package/dist/components/Employee/FederalTaxes/Actions.js +15 -0
  200. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -0
  201. package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +29 -0
  202. package/dist/components/Employee/FederalTaxes/FederalForm.js +110 -0
  203. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -0
  204. package/dist/components/Employee/FederalTaxes/FederalTaxes.d.ts +6 -0
  205. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +72 -0
  206. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -0
  207. package/dist/components/Employee/FederalTaxes/Head.d.ts +1 -0
  208. package/dist/components/Employee/FederalTaxes/Head.js +24 -0
  209. package/dist/components/Employee/FederalTaxes/Head.js.map +1 -0
  210. package/dist/components/Employee/FederalTaxes/index.d.ts +2 -0
  211. package/dist/components/Employee/FederalTaxes/useFederalTaxes.d.ts +5 -0
  212. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +16 -0
  213. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -0
  214. package/dist/components/Employee/Landing/Landing.js +10 -10
  215. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +1 -19
  216. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  217. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +22 -0
  218. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +18 -0
  219. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -0
  220. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +2 -1
  221. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +72 -63
  222. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  223. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +9 -9
  224. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  225. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  226. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  227. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
  228. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -8
  229. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  230. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +8 -8
  231. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  232. package/dist/components/Employee/PaymentMethod/Split.js +9 -9
  233. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +9 -13
  234. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  235. package/dist/components/Employee/Profile/Actions.js +7 -6
  236. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  237. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +6 -6
  238. package/dist/components/Employee/Profile/HomeAddress.js +5 -6
  239. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  240. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  241. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +21 -22
  242. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  243. package/dist/components/Employee/Profile/Profile.js +13 -13
  244. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  245. package/dist/components/Employee/Profile/useProfile.js +3 -7
  246. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  247. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +2 -1
  248. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +37 -24
  249. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  250. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +2 -1
  251. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +31 -19
  252. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  253. package/dist/components/Employee/StateTaxes/Actions.d.ts +1 -0
  254. package/dist/components/Employee/StateTaxes/Actions.js +15 -0
  255. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -0
  256. package/dist/components/Employee/StateTaxes/StateForm.d.ts +10 -0
  257. package/dist/components/Employee/StateTaxes/StateForm.js +34 -0
  258. package/dist/components/Employee/StateTaxes/StateForm.js.map +1 -0
  259. package/dist/components/Employee/StateTaxes/StateTaxes.d.ts +7 -0
  260. package/dist/components/Employee/StateTaxes/StateTaxes.js +90 -0
  261. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -0
  262. package/dist/components/Employee/StateTaxes/index.d.ts +2 -0
  263. package/dist/components/Employee/StateTaxes/useStateTaxes.d.ts +8 -0
  264. package/dist/components/Employee/StateTaxes/useStateTaxes.js +16 -0
  265. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -0
  266. package/dist/components/Employee/Taxes/Actions.js +9 -8
  267. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  268. package/dist/components/Employee/Taxes/FederalForm.js +13 -12
  269. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  270. package/dist/components/Employee/Taxes/Taxes.d.ts +5 -0
  271. package/dist/components/Employee/Taxes/Taxes.js +73 -85
  272. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  273. package/dist/components/Employee/Taxes/useTaxes.js +3 -7
  274. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  275. package/dist/components/Employee/index.d.ts +3 -1
  276. package/dist/components/Employee/index.js +16 -12
  277. package/dist/components/Employee/index.js.map +1 -1
  278. package/dist/components/Flow/Flow.js +15 -13
  279. package/dist/components/Flow/Flow.js.map +1 -1
  280. package/dist/components/Flow/useFlow.d.ts +1 -0
  281. package/dist/components/Flow/useFlow.js.map +1 -1
  282. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
  283. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +41 -0
  284. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
  285. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +11 -0
  286. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +80 -0
  287. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -0
  288. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +6 -0
  289. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +19 -0
  290. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -0
  291. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -0
  292. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +23 -0
  293. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -0
  294. package/dist/components/Payroll/PayrollList/PayrollList.d.ts +6 -0
  295. package/dist/components/Payroll/PayrollList/PayrollList.js +17 -0
  296. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -0
  297. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +9 -0
  298. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +51 -0
  299. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -0
  300. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +7 -0
  301. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +32 -0
  302. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -0
  303. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +6 -0
  304. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +70 -0
  305. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -0
  306. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.d.ts +16 -0
  307. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js +55 -0
  308. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js.map +1 -0
  309. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.d.ts +6 -0
  310. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js +20 -0
  311. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js.map +1 -0
  312. package/dist/components/Payroll/index.d.ts +6 -0
  313. package/dist/components/Payroll/index.js +13 -0
  314. package/dist/components/Payroll/index.js.map +1 -0
  315. package/dist/components/index.d.ts +1 -0
  316. package/dist/contexts/ApiProvider/ApiProvider.js +4 -4
  317. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  318. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  319. package/dist/contexts/ThemeProvider/ThemeProvider.js +7 -7
  320. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  321. package/dist/i18n/I18n.js +1 -1
  322. package/dist/i18n/I18n.js.map +1 -1
  323. package/dist/i18n/en/Contractor.ContractorList.json.js +13 -11
  324. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  325. package/dist/i18n/en/Contractor.Profile.json.js +1 -1
  326. package/dist/i18n/en/Employee.FederalTaxes.json.js +46 -0
  327. package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -0
  328. package/dist/i18n/en/Employee.StateTaxes.json.js +6 -10
  329. package/dist/i18n/en/Employee.StateTaxes.json.js.map +1 -1
  330. package/dist/i18n/en/Employee.Taxes.json.js +7 -7
  331. package/dist/index.js +11 -9
  332. package/dist/index.js.map +1 -1
  333. package/dist/shared/constants.d.ts +30 -2
  334. package/dist/shared/constants.js +75 -47
  335. package/dist/shared/constants.js.map +1 -1
  336. package/dist/types/i18next.d.ts +29 -7
  337. package/package.json +12 -13
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/FederalTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.FederalTaxes')\n const { isPending } = useFederalTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useFederalTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/FederalTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.FederalTaxes')\n const { isPending } = useFederalTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useFederalTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as y, Fragment as g } from "react/jsx-runtime";
2
- import { useFederalTaxDetailsUpdateMutation as D } from "@gusto/embedded-api/react-query/federalTaxDetailsUpdate";
3
- import { useFederalTaxDetailsGetSuspense as h } from "@gusto/embedded-api/react-query/federalTaxDetailsGet";
2
+ import { useFederalTaxDetailsUpdateMutation as D } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/federalTaxDetailsUpdate.js";
3
+ import { useFederalTaxDetailsGetSuspense as h } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/federalTaxDetailsGet.js";
4
4
  import { useForm as E, FormProvider as P } from "react-hook-form";
5
- import { zodResolver as v } from "@hookform/resolvers/zod";
5
+ import { zodResolver as v } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
6
6
  import { FederalTaxFormSchema as A, FederalTaxesProvider as N } from "./useFederalTaxes.js";
7
7
  import { Form as S } from "../../Common/Form/Form.js";
8
8
  import { Form as C } from "./Form.js";
@@ -12,15 +12,14 @@ import { useI18n as R, useComponentDictionary as M } from "../../../i18n/I18n.js
12
12
  import { BaseComponent as B } from "../../Base/Base.js";
13
13
  import { useBase as O } from "../../Base/useBase.js";
14
14
  import { Flex as j } from "../../Common/Flex/Flex.js";
15
- import "react-i18next";
16
15
  import "classnames";
17
16
  import { companyEvents as l } from "../../../shared/constants.js";
18
- function ee(o) {
19
- return /* @__PURE__ */ e(B, { ...o, children: /* @__PURE__ */ e(q, { ...o, children: o.children }) });
17
+ function V(a) {
18
+ return /* @__PURE__ */ e(B, { ...a, children: /* @__PURE__ */ e(q, { ...a, children: a.children }) });
20
19
  }
21
- function q({ companyId: o, children: t, className: s, defaultValues: i, dictionary: d }) {
20
+ function q({ companyId: a, children: t, className: s, defaultValues: i, dictionary: d }) {
22
21
  R("Company.FederalTaxes"), M("Company.FederalTaxes", d);
23
- const { onEvent: m, baseSubmitHandler: f } = O(), { data: p } = h({ companyId: o }), r = p.federalTaxDetails, { mutateAsync: c, isPending: F } = D(), n = E({
22
+ const { onEvent: m, baseSubmitHandler: f } = O(), { data: c } = h({ companyId: a }), r = c.federalTaxDetails, { mutateAsync: p, isPending: F } = D(), n = E({
24
23
  resolver: v(A),
25
24
  defaultValues: {
26
25
  federalEin: r.hasEin ? void 0 : "",
@@ -29,15 +28,15 @@ function q({ companyId: o, children: t, className: s, defaultValues: i, dictiona
29
28
  legalName: r.legalName ?? i?.legalName
30
29
  }
31
30
  }), x = async (u) => {
32
- await f(u, async (a) => {
33
- const T = await c({
31
+ await f(u, async (o) => {
32
+ const T = await p({
34
33
  request: {
35
- companyId: o,
34
+ companyId: a,
36
35
  requestBody: {
37
- ein: a.federalEin,
38
- taxPayerType: a.taxPayerType,
39
- filingForm: a.filingForm,
40
- legalName: a.legalName,
36
+ ein: o.federalEin,
37
+ taxPayerType: o.taxPayerType,
38
+ filingForm: o.filingForm,
39
+ legalName: o.legalName,
41
40
  version: r.version
42
41
  }
43
42
  }
@@ -64,6 +63,6 @@ function q({ companyId: o, children: t, className: s, defaultValues: i, dictiona
64
63
  ) });
65
64
  }
66
65
  export {
67
- ee as FederalTaxes
66
+ V as FederalTaxes
68
67
  };
69
68
  //# sourceMappingURL=FederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;AA+BO,SAASA,GAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,YAAAC,KAAiC;AAC9F,EAAAC,EAAQ,sBAAsB,GAC9BC,EAAuB,wBAAwBF,CAAU;AACzD,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAAgC,EAAE,WAAAX,GAAW,GACxDY,IAAoBF,EAAK,mBAEzB,EAAE,aAAaG,GAAyB,WAAAC,EAAA,IAAcC,EAAA,GAEtDC,IAAcC,EAA8B;AAAA,IAChD,UAAUC,EAAYC,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,YAAYP,EAAkB,SAAS,SAAY;AAAA,MACnD,cAAcA,EAAkB,eAC3BA,EAAkB,eACnBT,GAAe;AAAA,MACnB,YAAYS,EAAkB,aACzBA,EAAkB,aACnBT,GAAe;AAAA,MACnB,WAAWS,EAAkB,aAAaT,GAAe;AAAA,IAAA;AAAA,EAC3D,CACD,GAEKiB,IAAe,OAAOV,MAA+B;AACzD,UAAMF,EAAkBE,GAAM,OAAMW,MAAW;AAC7C,YAAMC,IAAkC,MAAMT,EAAwB;AAAA,QACpE,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,KAAKqB,EAAQ;AAAA,YACb,cAAcA,EAAQ;AAAA,YACtB,YAAYA,EAAQ;AAAA,YACpB,WAAWA,EAAQ;AAAA,YACnB,SAAST,EAAkB;AAAA,UAAA;AAAA,QAC7B;AAAA,MACF,CACD;AAED,MAAAL;AAAA,QACEgB,EAAc;AAAA,QACdD,EAAgC;AAAA,MAAA,GAElCf,EAAQgB,EAAc,0BAA0B;AAAA,IAClD,CAAC;AAAA,EACH;AAEA,SACE,gBAAA1B,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAAC2B;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAV;AAAA,QACA,mBAAAF;AAAA,MAAA;AAAA,MAGF,4BAACa,GAAA,EAAc,GAAGT,GAChB,UAAA,gBAAAnB,EAAC6B,GAAA,EAAS,UAAUV,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAAvB,EAAC8B,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA1B,KAGC,gBAAA2B,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhC,EAACiC,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;AA+BO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,YAAAC,KAAiC;AAC9F,EAAAC,EAAQ,sBAAsB,GAC9BC,EAAuB,wBAAwBF,CAAU;AACzD,QAAM,EAAE,SAAAG,GAAS,mB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1B,KAGC,gBAAA2B,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhC,EAACiC,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,15 +1,16 @@
1
1
  import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
2
  import { useMemo as n } from "react";
3
3
  import { useTranslation as c, Trans as t } from "react-i18next";
4
- import { TaxPayerType as _, FilingForm as y } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
4
+ import { TaxPayerType as _, FilingForm as y } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/operations/putv1companiescompanyidfederaltaxdetails.js";
5
5
  import { useFederalTaxes as u } from "./useFederalTaxes.js";
6
6
  import { Flex as b } from "../../Common/Flex/Flex.js";
7
7
  import "classnames";
8
+ import "../../../shared/constants.js";
9
+ import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
8
10
  import { usePlaceholderEin as g, normalizeEin as x } from "../../../helpers/federalEin.js";
9
11
  import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
11
12
  import { SelectField as a } from "../../Common/Fields/SelectField/SelectField.js";
12
- function R() {
13
+ function v() {
13
14
  const { t: e } = c("Company.FederalTaxes"), { federalTaxDetails: s } = u(), i = F(), m = g(s?.hasEin), p = n(
14
15
  () => Object.values(_).map((o) => ({
15
16
  value: o,
@@ -100,6 +101,6 @@ function R() {
100
101
  ] });
101
102
  }
102
103
  export {
103
- R as Form
104
+ v as Form
104
105
  };
105
106
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAaC,EAAA,GAEbC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAAC,OAAU;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA,GAGEY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAAF,OAAU;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,mBAAmB;AAAA,QAC5B,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,WACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,YAAU;AAAA,QACV,WAAWe;AAAA,QACX,aAAab;AAAA,MAAA;AAAA,IAAA;AAAA,IAEf,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,QAC1C,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,2BAA2B;AAAA,QACpC,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,SACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAaC,EAAA,GAEbC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAAC,OAAU;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA,GAGEY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAAF,OAAU;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,mBAAmB;AAAA,QAC5B,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,WACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,YAAU;AAAA,QACV,WAAWe;AAAA,QACX,aAAab;AAAA,MAAA;AAAA,IAAA;AAAA,IAEf,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,QAC1C,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,2BAA2B;AAAA,QACpC,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,SACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
@@ -1,30 +1,26 @@
1
- import { z as o } from "zod";
2
- import { FilingForm as r, TaxPayerType as e } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
1
+ import { z as e } from "zod";
2
+ import { FilingForm as o, TaxPayerType as r } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/operations/putv1companiescompanyidfederaltaxdetails.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "react-error-boundary";
6
6
  import "react-i18next";
7
- import "@gusto/embedded-api/models/errors/apierror";
8
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
9
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
10
- import "@tanstack/react-query";
11
7
  import "../../Base/useBase.js";
12
8
  import "../../../shared/constants.js";
13
9
  import "classnames";
14
10
  import "dompurify";
15
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
16
12
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
17
- const C = o.object({
18
- federalEin: o.string().optional(),
19
- taxPayerType: o.enum(Object.values(e)).optional(),
20
- filingForm: o.enum(Object.values(r)).optional(),
21
- legalName: o.string().min(1)
22
- }), [b, j] = t(
13
+ const u = e.object({
14
+ federalEin: e.string().optional(),
15
+ taxPayerType: e.enum(Object.values(r)).optional(),
16
+ filingForm: e.enum(Object.values(o)).optional(),
17
+ legalName: e.string().min(1)
18
+ }), [f, g] = t(
23
19
  "CompanyFederalTaxesContext"
24
20
  );
25
21
  export {
26
- C as FederalTaxFormSchema,
27
- j as FederalTaxesProvider,
28
- b as useFederalTaxes
22
+ u as FederalTaxFormSchema,
23
+ g as FederalTaxesProvider,
24
+ f as useFederalTaxes
29
25
  };
30
26
  //# sourceMappingURL=useFederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
@@ -2,13 +2,14 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
3
  import { useIndustryApiState as s } from "./Context.js";
4
4
  import "classnames";
5
+ import "../../../shared/constants.js";
5
6
  import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const y = () => {
8
+ const C = () => {
8
9
  const { t: o } = i("Company.Industry"), { isPending: n } = s(), r = e();
9
10
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
10
11
  };
11
12
  export {
12
- y as Actions
13
+ C as Actions
13
14
  };
14
15
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
@@ -2,25 +2,21 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
- import "@tanstack/react-query";
9
5
  import "../../Base/useBase.js";
10
6
  import "../../../shared/constants.js";
11
7
  import "classnames";
12
8
  import "dompurify";
13
9
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
10
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
15
- const [A, P] = t("IndustryItems", {
11
+ const [I, y] = t("IndustryItems", {
16
12
  items: []
17
- }), [f, v] = t("IndustryApi", {
13
+ }), [a, c] = t("IndustryApi", {
18
14
  isPending: !1
19
15
  });
20
16
  export {
21
- v as IndustryApiStateProvider,
22
- P as IndustryItemsProvider,
23
- f as useIndustryApiState,
24
- A as useIndustryItems
17
+ c as IndustryApiStateProvider,
18
+ y as IndustryItemsProvider,
19
+ a as useIndustryApiState,
20
+ I as useIndustryItems
25
21
  };
26
22
  //# sourceMappingURL=Context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
1
+ {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
@@ -2,11 +2,12 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as e } from "react-i18next";
3
3
  import { useIndustryItems as m } from "./Context.js";
4
4
  import "classnames";
5
- import { ComboBoxField as s } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
6
- const d = () => {
5
+ import "../../../shared/constants.js";
6
+ import { ComboBoxField as i } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
7
+ const c = () => {
7
8
  const { t: o } = e("Company.Industry"), { items: r } = m();
8
9
  return /* @__PURE__ */ t(
9
- s,
10
+ i,
10
11
  {
11
12
  isRequired: !0,
12
13
  options: r,
@@ -17,6 +18,6 @@ const d = () => {
17
18
  );
18
19
  };
19
20
  export {
20
- d as Edit
21
+ c as Edit
21
22
  };
22
23
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAAA;AAGlC;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAAA;AAGlC;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useCallback as f } from "react";
3
- import { useIndustrySelectionGetSuspense as l } from "@gusto/embedded-api/react-query/industrySelectionGet";
4
- import { useIndustrySelectionUpdateMutation as C } from "@gusto/embedded-api/react-query/industrySelectionUpdate";
3
+ import { useIndustrySelectionGetSuspense as l } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/industrySelectionGet.js";
4
+ import { useIndustrySelectionUpdateMutation as C } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/industrySelectionUpdate.js";
5
5
  import { IndustryApiStateProvider as I } from "./Context.js";
6
6
  import { IndustrySelect as S } from "./IndustrySelect.js";
7
7
  import { componentEvents as E } from "../../../shared/constants.js";
@@ -2,16 +2,17 @@ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useLocationsForm as e } from "./useLocationForm.js";
4
4
  import "classnames";
5
- import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const h = () => {
8
- const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
9
- return /* @__PURE__ */ r(c, { children: [
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ const x = () => {
9
+ const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = c();
10
+ return /* @__PURE__ */ r(m, { children: [
10
11
  /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
11
12
  /* @__PURE__ */ n(t.Button, { type: "submit", isLoading: s, "data-testid": "location-submit", children: o("saveCta") })
12
13
  ] });
13
14
  };
14
15
  export {
15
- h as Actions
16
+ x as Actions
16
17
  };
17
18
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAAH,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAAH,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
@@ -4,13 +4,12 @@ import { useTranslation as l } from "react-i18next";
4
4
  import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
5
5
  import { Flex as d } from "../../../Common/Flex/Flex.js";
6
6
  import { Grid as p } from "../../../Common/Grid/Grid.js";
7
- import "classnames";
7
+ import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
8
8
  import { STATES_ABBR as c } from "../../../../shared/constants.js";
9
9
  import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
10
- import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
11
10
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
12
11
  import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
13
- const k = i.object({
12
+ const q = i.object({
14
13
  phoneNumber: m,
15
14
  street1: i.string().min(1),
16
15
  street2: i.string().optional(),
@@ -19,7 +18,7 @@ const k = i.object({
19
18
  zip: n,
20
19
  addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
21
20
  });
22
- function S() {
21
+ function k() {
23
22
  const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
24
23
  return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
25
24
  /* @__PURE__ */ t(
@@ -105,7 +104,7 @@ function S() {
105
104
  ] });
106
105
  }
107
106
  export {
108
- S as Form,
109
- k as LocationFormSchema
107
+ k as Form,
108
+ q as LocationFormSchema
110
109
  };
111
110
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;AAOO,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,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AAOZ,EAAE,YAAY;AAAA,cACrB,aAAaA,EAAE,kBAAkB;AAAA,cACjC,cAAcA,EAAE,mBAAmB;AAAA,cACnC,YAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,UAAU;AAAA,cACnB,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEnC,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,kBAAkB;AAAA,cAC3B,cAAcA,EAAE,mBAAmB;AAAA,cACnC,WAAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAM;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAAA;AAAA,UAE5C;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;AAOO,MAAM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AI,EAAE,IAAI,UAAU;AAAA,gBACpD,OAAOA;AAAA,cAAA,EACP;AAAA,cACF,OAAOZ,EAAE,YAAY;AAAA,cACrB,aAAaA,EAAE,kBAAkB;AAAA,cACjC,cAAcA,EAAE,mBAAmB;AAAA,cACnC,YAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,UAAU;AAAA,cACnB,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEnC,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,kBAAkB;AAAA,cAC3B,cAAcA,EAAE,mBAAmB;AAAA,cACnC,WAAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAM;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAAA;AAAA,UAE5C;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
@@ -1,21 +1,20 @@
1
1
  import { jsx as o, jsxs as T, Fragment as b } from "react/jsx-runtime";
2
2
  import { useForm as D, FormProvider as E } from "react-hook-form";
3
- import { zodResolver as N } from "@hookform/resolvers/zod";
4
- import { useLocationsUpdateMutation as O } from "@gusto/embedded-api/react-query/locationsUpdate";
5
- import { useLocationsRetrieveSuspense as S } from "@gusto/embedded-api/react-query/locationsRetrieve";
6
- import { useLocationsCreateMutation as x } from "@gusto/embedded-api/react-query/locationsCreate";
3
+ import { zodResolver as N } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
4
+ import { useLocationsUpdateMutation as O } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/locationsUpdate.js";
5
+ import { useLocationsRetrieveSuspense as S } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/locationsRetrieve.js";
6
+ import { useLocationsCreateMutation as x } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/locationsCreate.js";
7
7
  import { Head as R } from "./Head.js";
8
8
  import { LocationFormSchema as q, Form as B } from "./Form.js";
9
9
  import { Actions as I } from "./Actions.js";
10
10
  import { LocationsFormProvider as M } from "./useLocationForm.js";
11
11
  import { Form as _ } from "../../../Common/Form/Form.js";
12
12
  import { Flex as w } from "../../../Common/Flex/Flex.js";
13
- import "react-i18next";
14
13
  import "classnames";
14
+ import { componentEvents as a } from "../../../../shared/constants.js";
15
15
  import { BaseComponent as z } from "../../../Base/Base.js";
16
16
  import { useBase as U } from "../../../Base/useBase.js";
17
17
  import { useI18n as j } from "../../../../i18n/I18n.js";
18
- import { componentEvents as a } from "../../../../shared/constants.js";
19
18
  function H(t) {
20
19
  const {
21
20
  data: { location: e }
@@ -25,7 +24,7 @@ function H(t) {
25
24
  function p({
26
25
  companyId: t,
27
26
  location: e,
28
- className: i,
27
+ className: n,
29
28
  children: r
30
29
  }) {
31
30
  j("Company.Locations");
@@ -38,12 +37,12 @@ function p({
38
37
  street2: e?.street2 ?? "",
39
38
  state: e?.state ?? "",
40
39
  zip: e?.zip ?? "",
41
- addressType: L.filter((n) => e?.[n] ?? !1)
40
+ addressType: L.filter((i) => e?.[i] ?? !1)
42
41
  }
43
42
  }), v = () => {
44
43
  s(a.CANCEL);
45
- }, C = async (n) => {
46
- await f(n, async (F) => {
44
+ }, C = async (i) => {
45
+ await f(i, async (F) => {
47
46
  const { addressType: c, ...P } = F, u = {
48
47
  ...P,
49
48
  mailingAddress: c?.includes("mailingAddress"),
@@ -68,7 +67,7 @@ function p({
68
67
  }
69
68
  });
70
69
  };
71
- return /* @__PURE__ */ o("section", { className: i, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
70
+ return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
72
71
  M,
73
72
  {
74
73
  value: { handleCancel: v, isPending: A || y },
@@ -80,16 +79,16 @@ function p({
80
79
  }
81
80
  ) }) }) });
82
81
  }
83
- function me({
82
+ function ie({
84
83
  companyId: t,
85
84
  locationId: e,
86
- className: i,
85
+ className: n,
87
86
  children: r,
88
87
  ...s
89
88
  }) {
90
- return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: i, children: r }) });
89
+ return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: n, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: n, children: r }) });
91
90
  }
92
91
  export {
93
- me as LocationForm
92
+ ie as LocationForm
94
93
  };
95
94
  //# sourceMappingURL=LocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AAC9E,QAAM;AAAA,IACJ,MAAM,EAAE,UAAA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AiB,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,GACH,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AAC9E,QAAM;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAO,gBAAAG,EAACC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAA,CAAoB;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;AAC9C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAAA,GAC9D,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAAA,GAC9DC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMtB,GAAU,QAAQ;AAAA,MACxB,aAAaA,GAAU,eAAe;AAAA,MACtC,SAASA,GAAU,WAAW;AAAA,MAC9B,SAASA,GAAU,WAAW;AAAA,MAC9B,OAAOA,GAAU,SAAS;AAAA,MAC1B,KAAKA,GAAU,OAAO;AAAA,MACtB,aAAaiB,EAAY,OAAO,OAAOjB,IAAWuB,CAAG,KAAK,EAAK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EACE,UAAA;AAAA,QAAA,gBAAAnC,EAACoC,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;AAEO,SAASC,GAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAA,EAAe,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAA,EAAiB,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,GACH,GAEJ;AAEJ;"}
@@ -2,21 +2,17 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
- import "@tanstack/react-query";
9
5
  import "../../../Base/useBase.js";
10
6
  import "../../../../shared/constants.js";
11
7
  import "classnames";
12
8
  import "dompurify";
13
9
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
10
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
15
- const [d, L] = o(
11
+ const [C, u] = o(
16
12
  "CompanyDocumentFormContext"
17
13
  );
18
14
  export {
19
- L as LocationsFormProvider,
20
- d as useLocationsForm
15
+ u as LocationsFormProvider,
16
+ C as useLocationsForm
21
17
  };
22
18
  //# sourceMappingURL=useLocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}