@remoteoss/remote-flows 0.20.1 → 0.21.1

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 (354) hide show
  1. package/README.md +14 -13
  2. package/dist/{chunk-MGOT272R.js → chunk-2GCMLKO2.js} +2 -2
  3. package/dist/{chunk-4KA5AP7X.js → chunk-3GDPOMQP.js} +2 -2
  4. package/dist/{chunk-R4LFNFC2.js → chunk-3MS7FYSY.js} +2 -2
  5. package/dist/{chunk-QFZ3XVDT.js → chunk-3T43ERBA.js} +2 -2
  6. package/dist/chunk-47A5JNKX.js +2 -0
  7. package/dist/chunk-47A5JNKX.js.map +1 -0
  8. package/dist/{chunk-2QGDCMCE.js → chunk-4NLAHGUV.js} +2 -2
  9. package/dist/chunk-4Q7KTWXP.js +2 -0
  10. package/dist/chunk-4Q7KTWXP.js.map +1 -0
  11. package/dist/{chunk-FCRW2EG3.js → chunk-56D2YDS2.js} +2 -2
  12. package/dist/{chunk-BITHG5X4.js → chunk-5EP45OQV.js} +2 -2
  13. package/dist/{chunk-B3WXLC2R.js → chunk-5JGYNS2O.js} +2 -2
  14. package/dist/{chunk-A7ZEA2WU.js → chunk-A6QURRVL.js} +2 -2
  15. package/dist/chunk-AIN5YFNL.js +2 -0
  16. package/dist/{chunk-ASKKS4Z3.js → chunk-AKHJDD35.js} +2 -2
  17. package/dist/chunk-AWK7AF5V.js +2 -0
  18. package/dist/chunk-AWK7AF5V.js.map +1 -0
  19. package/dist/{chunk-CWEPL5J3.js → chunk-AXES4NFY.js} +2 -2
  20. package/dist/{chunk-6O6CNAMF.js → chunk-B25LAMRX.js} +2 -2
  21. package/dist/{chunk-GGXKORRZ.js → chunk-BCSSGG6E.js} +2 -2
  22. package/dist/{chunk-GGXKORRZ.js.map → chunk-BCSSGG6E.js.map} +1 -1
  23. package/dist/chunk-C535PFLI.js +2 -0
  24. package/dist/chunk-C535PFLI.js.map +1 -0
  25. package/dist/{chunk-X4GAGLFN.js → chunk-CCW6FKQ3.js} +2 -2
  26. package/dist/{chunk-OZCQ6AOF.js → chunk-CKHZP3O3.js} +2 -2
  27. package/dist/{chunk-LCIBPBLY.js → chunk-CLW7CVDG.js} +2 -2
  28. package/dist/chunk-DKFUZO5P.js +1 -0
  29. package/dist/chunk-DKFUZO5P.js.map +1 -0
  30. package/dist/chunk-DPIKH7BI.js +2 -0
  31. package/dist/chunk-DPIKH7BI.js.map +1 -0
  32. package/dist/{chunk-K4VWUMNO.js → chunk-EAIJKDY4.js} +2 -2
  33. package/dist/{chunk-MORMQBAF.js → chunk-EKK7R3M6.js} +2 -2
  34. package/dist/{chunk-7IHBNPZK.js → chunk-FCAGJMPU.js} +2 -2
  35. package/dist/{chunk-5CGII7CZ.js → chunk-G2NIQGHZ.js} +2 -2
  36. package/dist/chunk-G2NIQGHZ.js.map +1 -0
  37. package/dist/{chunk-CKVQ4PIK.js → chunk-G343WOO7.js} +2 -2
  38. package/dist/{chunk-RUMP764Z.js → chunk-GFNIN6CJ.js} +2 -2
  39. package/dist/{chunk-5T25IMZ3.js → chunk-GSNOUE4L.js} +2 -2
  40. package/dist/{chunk-CVDZ35YA.js → chunk-H6G4PPLM.js} +2 -2
  41. package/dist/chunk-HC56JKI2.js +2 -0
  42. package/dist/chunk-HC56JKI2.js.map +1 -0
  43. package/dist/{chunk-A76UTPRW.js → chunk-HH4YP6QX.js} +2 -2
  44. package/dist/{chunk-A76UTPRW.js.map → chunk-HH4YP6QX.js.map} +1 -1
  45. package/dist/{chunk-ZTVYWMBY.js → chunk-HTCONTKZ.js} +2 -2
  46. package/dist/{chunk-ATC4YO7K.js → chunk-I2URNHWK.js} +2 -2
  47. package/dist/{chunk-V2PBVCRH.js → chunk-IQ2HRDC4.js} +2 -2
  48. package/dist/{chunk-HRA6BY3O.js → chunk-ISWLTY4E.js} +2 -2
  49. package/dist/{chunk-GNZJOPIS.js → chunk-JE2MYS37.js} +2 -2
  50. package/dist/{chunk-76VMCRDE.js → chunk-JNPIBIHZ.js} +2 -2
  51. package/dist/{chunk-MDQ6YJMV.js → chunk-KRL5QCOA.js} +2 -2
  52. package/dist/{chunk-OIBVTGB4.js → chunk-KSHPBRPW.js} +2 -2
  53. package/dist/chunk-L2GYSHXS.js +2 -0
  54. package/dist/chunk-L2GYSHXS.js.map +1 -0
  55. package/dist/{chunk-WL3IJ7WA.js → chunk-L5CORHOG.js} +2 -2
  56. package/dist/chunk-LJ36642G.js +2 -0
  57. package/dist/chunk-LJ36642G.js.map +1 -0
  58. package/dist/{chunk-MCAK5KPI.js → chunk-LSGVE623.js} +2 -2
  59. package/dist/chunk-MISHDUB2.js +2 -0
  60. package/dist/chunk-MISHDUB2.js.map +1 -0
  61. package/dist/{chunk-UBLE2J7V.js → chunk-ODI4OPN7.js} +2 -2
  62. package/dist/{chunk-JWZIWG4T.js → chunk-OEEUSIOB.js} +2 -2
  63. package/dist/{chunk-OJNWWRD5.js → chunk-ORBIA4S3.js} +2 -2
  64. package/dist/chunk-OUO2RTM4.js +2 -0
  65. package/dist/chunk-OUO2RTM4.js.map +1 -0
  66. package/dist/{chunk-XVW2URFK.js → chunk-PAZGF4C3.js} +2 -2
  67. package/dist/chunk-PTACLZHT.js +2 -0
  68. package/dist/chunk-PTACLZHT.js.map +1 -0
  69. package/dist/{chunk-3PCSFTM3.js → chunk-QBEJBOGL.js} +2 -2
  70. package/dist/{chunk-A42AGGNH.js → chunk-QMUSEX2P.js} +2 -2
  71. package/dist/chunk-QP36XXCQ.js +2 -0
  72. package/dist/chunk-QP36XXCQ.js.map +1 -0
  73. package/dist/chunk-R2MHAPWD.js +2 -0
  74. package/dist/chunk-R2MHAPWD.js.map +1 -0
  75. package/dist/{chunk-RNNZ5ZKE.js → chunk-RLLBHQWS.js} +2 -2
  76. package/dist/chunk-RVEQJNZI.js +2 -0
  77. package/dist/chunk-RVEQJNZI.js.map +1 -0
  78. package/dist/{chunk-R2VVXLL7.js → chunk-S2AQQVM7.js} +2 -2
  79. package/dist/chunk-SDIBOMMT.js +2 -0
  80. package/dist/chunk-SDIBOMMT.js.map +1 -0
  81. package/dist/{chunk-EGVWFZBR.js → chunk-SFX34GRA.js} +2 -2
  82. package/dist/{chunk-XGMQPLVG.js → chunk-SV2PWH6Y.js} +2 -2
  83. package/dist/{chunk-JB6XA3P6.js → chunk-TK6JU3ZG.js} +2 -2
  84. package/dist/chunk-TOA3JILU.js +2 -0
  85. package/dist/chunk-TOA3JILU.js.map +1 -0
  86. package/dist/{chunk-GS5NA664.js → chunk-U3XZWSEU.js} +2 -2
  87. package/dist/chunk-U6RM2N4A.js +2 -0
  88. package/dist/chunk-U6RM2N4A.js.map +1 -0
  89. package/dist/{chunk-4C6O4QTI.js → chunk-UCLVNY25.js} +2 -2
  90. package/dist/{chunk-ZJ3JHILJ.js → chunk-VHJFIDOX.js} +2 -2
  91. package/dist/{chunk-SERAGBDA.js → chunk-VOJHAIEH.js} +2 -2
  92. package/dist/{chunk-PLWXRCGQ.js → chunk-VOW6W24S.js} +2 -2
  93. package/dist/chunk-VSUEF4AY.js +2 -0
  94. package/dist/chunk-VSUEF4AY.js.map +1 -0
  95. package/dist/chunk-VXPJXQP3.js +2 -0
  96. package/dist/chunk-VXPJXQP3.js.map +1 -0
  97. package/dist/chunk-W676SMID.js +2 -0
  98. package/dist/chunk-W676SMID.js.map +1 -0
  99. package/dist/{chunk-M4EVWRWB.js → chunk-WPMPTV76.js} +2 -2
  100. package/dist/{chunk-QIN5BLVI.js → chunk-WY3KCHHG.js} +2 -2
  101. package/dist/{chunk-BP2JYRI7.js → chunk-X5F5HHFQ.js} +2 -2
  102. package/dist/{chunk-U23SN7CM.js → chunk-XASIKHZL.js} +2 -2
  103. package/dist/{chunk-M6ATR43P.js → chunk-XGPCOHUF.js} +2 -2
  104. package/dist/chunk-XQ5TL23G.js +2 -0
  105. package/dist/chunk-XQ5TL23G.js.map +1 -0
  106. package/dist/{chunk-YFEIQZGJ.js → chunk-XRB4Y7WT.js} +2 -2
  107. package/dist/chunk-XRU2O525.js +2 -0
  108. package/dist/chunk-XRU2O525.js.map +1 -0
  109. package/dist/{chunk-2I5DIIJP.js → chunk-Z2G2XC43.js} +2 -2
  110. package/dist/{chunk-KN4F5TMS.js → chunk-ZXA3CCPB.js} +2 -2
  111. package/dist/{chunk-756MHC7A.js → chunk-ZZ6MU7PF.js} +2 -2
  112. package/dist/{chunk-UQYM3PBZ.js → chunk-ZZNI7IY2.js} +2 -2
  113. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  114. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  115. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  116. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  117. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  118. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  119. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  120. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  121. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  122. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  123. package/dist/flows/ContractAmendment/hooks.js +1 -1
  124. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  125. package/dist/flows/ContractAmendment/index.js +1 -1
  126. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  127. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +26 -0
  128. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +2 -0
  129. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js.map +1 -0
  130. package/dist/flows/ContractorOnboarding/api.d.ts +114 -0
  131. package/dist/flows/ContractorOnboarding/api.js +2 -0
  132. package/dist/flows/ContractorOnboarding/api.js.map +1 -0
  133. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +30 -0
  134. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +2 -0
  135. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js.map +1 -0
  136. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +22 -0
  137. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +2 -0
  138. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js.map +1 -0
  139. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +22 -0
  140. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +2 -0
  141. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js.map +1 -0
  142. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +32 -0
  143. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +2 -0
  144. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js.map +1 -0
  145. package/dist/flows/ContractorOnboarding/components/OnboardingBack.d.ts +7 -0
  146. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +2 -0
  147. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js.map +1 -0
  148. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +27 -0
  149. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +2 -0
  150. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js.map +1 -0
  151. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.d.ts +6 -0
  152. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +2 -0
  153. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js.map +1 -0
  154. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +22 -0
  155. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +2 -0
  156. package/dist/flows/ContractorOnboarding/components/PricingPlan.js.map +1 -0
  157. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +30 -0
  158. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +2 -0
  159. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js.map +1 -0
  160. package/dist/flows/ContractorOnboarding/context.d.ts +93 -0
  161. package/dist/flows/ContractorOnboarding/context.js +2 -0
  162. package/dist/flows/ContractorOnboarding/context.js.map +1 -0
  163. package/dist/flows/ContractorOnboarding/hooks.d.ts +22 -0
  164. package/dist/flows/ContractorOnboarding/hooks.js +2 -0
  165. package/dist/flows/ContractorOnboarding/hooks.js.map +1 -0
  166. package/dist/flows/ContractorOnboarding/index.d.ts +23 -0
  167. package/dist/flows/ContractorOnboarding/index.js +2 -0
  168. package/dist/flows/ContractorOnboarding/index.js.map +1 -0
  169. package/dist/flows/ContractorOnboarding/json-schemas/signature.d.ts +16 -0
  170. package/dist/flows/ContractorOnboarding/json-schemas/signature.js +2 -0
  171. package/dist/flows/ContractorOnboarding/json-schemas/signature.js.map +1 -0
  172. package/dist/flows/ContractorOnboarding/types.d.ts +22 -0
  173. package/dist/flows/ContractorOnboarding/types.js +1 -0
  174. package/dist/flows/ContractorOnboarding/types.js.map +1 -0
  175. package/dist/flows/ContractorOnboarding/utils.d.ts +9 -0
  176. package/dist/flows/ContractorOnboarding/utils.js +2 -0
  177. package/dist/flows/ContractorOnboarding/utils.js.map +1 -0
  178. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  179. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  180. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  181. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  182. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  183. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  184. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  185. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  186. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  187. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  188. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  189. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  190. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  191. package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.js +1 -1
  192. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  193. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  194. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
  195. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
  196. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  197. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.js +1 -1
  198. package/dist/flows/CostCalculator/api.d.ts +1 -1
  199. package/dist/flows/CostCalculator/api.js +1 -1
  200. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  201. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  202. package/dist/flows/CostCalculator/context.d.ts +5 -5
  203. package/dist/flows/CostCalculator/hooks.d.ts +5 -5
  204. package/dist/flows/CostCalculator/hooks.js +1 -1
  205. package/dist/flows/CostCalculator/index.d.ts +3 -3
  206. package/dist/flows/CostCalculator/index.js +1 -1
  207. package/dist/flows/CostCalculator/types.d.ts +1 -1
  208. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  209. package/dist/flows/CostCalculator/utils.js +1 -1
  210. package/dist/flows/Onboarding/OnboardingFlow.d.ts +11 -55
  211. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  212. package/dist/flows/Onboarding/api.d.ts +15 -7
  213. package/dist/flows/Onboarding/api.js +1 -1
  214. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  215. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  216. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +14 -21
  217. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  218. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +12 -38
  219. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  220. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +14 -21
  221. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  222. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  223. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +12 -5
  224. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  225. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  226. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  227. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  228. package/dist/flows/Onboarding/components/ReviewStep.d.ts +16 -37
  229. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  230. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +14 -21
  231. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  232. package/dist/flows/Onboarding/context.d.ts +12 -9
  233. package/dist/flows/Onboarding/hooks.d.ts +15 -181
  234. package/dist/flows/Onboarding/hooks.js +1 -1
  235. package/dist/flows/Onboarding/index.d.ts +8 -15
  236. package/dist/flows/Onboarding/index.js +1 -1
  237. package/dist/flows/Onboarding/types.d.ts +16 -86
  238. package/dist/flows/Onboarding/utils.d.ts +15 -19
  239. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
  240. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  241. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
  242. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  243. package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
  244. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  245. package/dist/flows/Termination/TerminationBack.js +1 -1
  246. package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
  247. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  248. package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  249. package/dist/flows/Termination/TerminationFlow.d.ts +3 -3
  250. package/dist/flows/Termination/TerminationFlow.js +1 -1
  251. package/dist/flows/Termination/TerminationForm.d.ts +1 -1
  252. package/dist/flows/Termination/TerminationForm.js +1 -1
  253. package/dist/flows/Termination/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +1 -1
  254. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  255. package/dist/flows/Termination/TimeOff.d.ts +1 -1
  256. package/dist/flows/Termination/TimeOff.js +1 -1
  257. package/dist/flows/Termination/context.d.ts +4 -4
  258. package/dist/flows/Termination/hooks.d.ts +4 -4
  259. package/dist/flows/Termination/hooks.js +1 -1
  260. package/dist/flows/Termination/index.d.ts +3 -3
  261. package/dist/flows/Termination/index.js +1 -1
  262. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  263. package/dist/flows/Termination/types.d.ts +1 -1
  264. package/dist/flows/api.d.ts +1 -1
  265. package/dist/flows/api.js +1 -1
  266. package/dist/flows/types.d.ts +1 -0
  267. package/dist/index.css +1 -1
  268. package/dist/index.css.map +1 -1
  269. package/dist/index.d.ts +15 -16
  270. package/dist/index.js +1 -1
  271. package/dist/index.js.map +1 -1
  272. package/dist/internals.d.ts +2 -2
  273. package/dist/internals.js +1 -1
  274. package/dist/{mutations-BHTJydCx.d.ts → mutations-B7htnE-g.d.ts} +1 -1
  275. package/dist/{remoteFlows-bfHFRZSe.d.ts → remoteFlows-DR6mSxki.d.ts} +1 -1
  276. package/dist/types-DEybNxfT.d.ts +410 -0
  277. package/dist/types-XaAblF6e.d.ts +287 -0
  278. package/dist/{types.gen-BWjuA7VH.d.ts → types.gen-N_N1mlfc.d.ts} +59 -1
  279. package/package.json +5 -5
  280. package/dist/chunk-54KJP7WD.js +0 -2
  281. package/dist/chunk-54KJP7WD.js.map +0 -1
  282. package/dist/chunk-5CGII7CZ.js.map +0 -1
  283. package/dist/chunk-5TUFZVWO.js +0 -2
  284. package/dist/chunk-5TUFZVWO.js.map +0 -1
  285. package/dist/chunk-663AKXTN.js +0 -2
  286. package/dist/chunk-663AKXTN.js.map +0 -1
  287. package/dist/chunk-FHHAGWU5.js +0 -2
  288. package/dist/chunk-FHHAGWU5.js.map +0 -1
  289. package/dist/chunk-NO2TRS5O.js +0 -2
  290. package/dist/chunk-NO2TRS5O.js.map +0 -1
  291. package/dist/chunk-QGGKDM3N.js +0 -2
  292. package/dist/chunk-QGGKDM3N.js.map +0 -1
  293. package/dist/chunk-UH3E6HSQ.js +0 -2
  294. package/dist/chunk-Y7QVIBFX.js +0 -2
  295. package/dist/chunk-Y7QVIBFX.js.map +0 -1
  296. /package/dist/{chunk-MGOT272R.js.map → chunk-2GCMLKO2.js.map} +0 -0
  297. /package/dist/{chunk-4KA5AP7X.js.map → chunk-3GDPOMQP.js.map} +0 -0
  298. /package/dist/{chunk-R4LFNFC2.js.map → chunk-3MS7FYSY.js.map} +0 -0
  299. /package/dist/{chunk-QFZ3XVDT.js.map → chunk-3T43ERBA.js.map} +0 -0
  300. /package/dist/{chunk-2QGDCMCE.js.map → chunk-4NLAHGUV.js.map} +0 -0
  301. /package/dist/{chunk-FCRW2EG3.js.map → chunk-56D2YDS2.js.map} +0 -0
  302. /package/dist/{chunk-BITHG5X4.js.map → chunk-5EP45OQV.js.map} +0 -0
  303. /package/dist/{chunk-B3WXLC2R.js.map → chunk-5JGYNS2O.js.map} +0 -0
  304. /package/dist/{chunk-A7ZEA2WU.js.map → chunk-A6QURRVL.js.map} +0 -0
  305. /package/dist/{chunk-UH3E6HSQ.js.map → chunk-AIN5YFNL.js.map} +0 -0
  306. /package/dist/{chunk-ASKKS4Z3.js.map → chunk-AKHJDD35.js.map} +0 -0
  307. /package/dist/{chunk-CWEPL5J3.js.map → chunk-AXES4NFY.js.map} +0 -0
  308. /package/dist/{chunk-6O6CNAMF.js.map → chunk-B25LAMRX.js.map} +0 -0
  309. /package/dist/{chunk-X4GAGLFN.js.map → chunk-CCW6FKQ3.js.map} +0 -0
  310. /package/dist/{chunk-OZCQ6AOF.js.map → chunk-CKHZP3O3.js.map} +0 -0
  311. /package/dist/{chunk-LCIBPBLY.js.map → chunk-CLW7CVDG.js.map} +0 -0
  312. /package/dist/{chunk-K4VWUMNO.js.map → chunk-EAIJKDY4.js.map} +0 -0
  313. /package/dist/{chunk-MORMQBAF.js.map → chunk-EKK7R3M6.js.map} +0 -0
  314. /package/dist/{chunk-7IHBNPZK.js.map → chunk-FCAGJMPU.js.map} +0 -0
  315. /package/dist/{chunk-CKVQ4PIK.js.map → chunk-G343WOO7.js.map} +0 -0
  316. /package/dist/{chunk-RUMP764Z.js.map → chunk-GFNIN6CJ.js.map} +0 -0
  317. /package/dist/{chunk-5T25IMZ3.js.map → chunk-GSNOUE4L.js.map} +0 -0
  318. /package/dist/{chunk-CVDZ35YA.js.map → chunk-H6G4PPLM.js.map} +0 -0
  319. /package/dist/{chunk-ZTVYWMBY.js.map → chunk-HTCONTKZ.js.map} +0 -0
  320. /package/dist/{chunk-ATC4YO7K.js.map → chunk-I2URNHWK.js.map} +0 -0
  321. /package/dist/{chunk-V2PBVCRH.js.map → chunk-IQ2HRDC4.js.map} +0 -0
  322. /package/dist/{chunk-HRA6BY3O.js.map → chunk-ISWLTY4E.js.map} +0 -0
  323. /package/dist/{chunk-GNZJOPIS.js.map → chunk-JE2MYS37.js.map} +0 -0
  324. /package/dist/{chunk-76VMCRDE.js.map → chunk-JNPIBIHZ.js.map} +0 -0
  325. /package/dist/{chunk-MDQ6YJMV.js.map → chunk-KRL5QCOA.js.map} +0 -0
  326. /package/dist/{chunk-OIBVTGB4.js.map → chunk-KSHPBRPW.js.map} +0 -0
  327. /package/dist/{chunk-WL3IJ7WA.js.map → chunk-L5CORHOG.js.map} +0 -0
  328. /package/dist/{chunk-MCAK5KPI.js.map → chunk-LSGVE623.js.map} +0 -0
  329. /package/dist/{chunk-UBLE2J7V.js.map → chunk-ODI4OPN7.js.map} +0 -0
  330. /package/dist/{chunk-JWZIWG4T.js.map → chunk-OEEUSIOB.js.map} +0 -0
  331. /package/dist/{chunk-OJNWWRD5.js.map → chunk-ORBIA4S3.js.map} +0 -0
  332. /package/dist/{chunk-XVW2URFK.js.map → chunk-PAZGF4C3.js.map} +0 -0
  333. /package/dist/{chunk-3PCSFTM3.js.map → chunk-QBEJBOGL.js.map} +0 -0
  334. /package/dist/{chunk-A42AGGNH.js.map → chunk-QMUSEX2P.js.map} +0 -0
  335. /package/dist/{chunk-RNNZ5ZKE.js.map → chunk-RLLBHQWS.js.map} +0 -0
  336. /package/dist/{chunk-R2VVXLL7.js.map → chunk-S2AQQVM7.js.map} +0 -0
  337. /package/dist/{chunk-EGVWFZBR.js.map → chunk-SFX34GRA.js.map} +0 -0
  338. /package/dist/{chunk-XGMQPLVG.js.map → chunk-SV2PWH6Y.js.map} +0 -0
  339. /package/dist/{chunk-JB6XA3P6.js.map → chunk-TK6JU3ZG.js.map} +0 -0
  340. /package/dist/{chunk-GS5NA664.js.map → chunk-U3XZWSEU.js.map} +0 -0
  341. /package/dist/{chunk-4C6O4QTI.js.map → chunk-UCLVNY25.js.map} +0 -0
  342. /package/dist/{chunk-ZJ3JHILJ.js.map → chunk-VHJFIDOX.js.map} +0 -0
  343. /package/dist/{chunk-SERAGBDA.js.map → chunk-VOJHAIEH.js.map} +0 -0
  344. /package/dist/{chunk-PLWXRCGQ.js.map → chunk-VOW6W24S.js.map} +0 -0
  345. /package/dist/{chunk-M4EVWRWB.js.map → chunk-WPMPTV76.js.map} +0 -0
  346. /package/dist/{chunk-QIN5BLVI.js.map → chunk-WY3KCHHG.js.map} +0 -0
  347. /package/dist/{chunk-BP2JYRI7.js.map → chunk-X5F5HHFQ.js.map} +0 -0
  348. /package/dist/{chunk-U23SN7CM.js.map → chunk-XASIKHZL.js.map} +0 -0
  349. /package/dist/{chunk-M6ATR43P.js.map → chunk-XGPCOHUF.js.map} +0 -0
  350. /package/dist/{chunk-YFEIQZGJ.js.map → chunk-XRB4Y7WT.js.map} +0 -0
  351. /package/dist/{chunk-2I5DIIJP.js.map → chunk-Z2G2XC43.js.map} +0 -0
  352. /package/dist/{chunk-KN4F5TMS.js.map → chunk-ZXA3CCPB.js.map} +0 -0
  353. /package/dist/{chunk-756MHC7A.js.map → chunk-ZZ6MU7PF.js.map} +0 -0
  354. /package/dist/{chunk-UQYM3PBZ.js.map → chunk-ZZNI7IY2.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx"],"sourcesContent":["import {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n useGetShowContractDocument,\n useSignContractDocument,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCountriesSchemaField,\n useCreateEmployment,\n useEmployment,\n useJSONSchemaForm,\n} from '@/src/flows/Onboarding/api';\nimport {\n disabledInviteButtonEmploymentStatus,\n reviewStepAllowedEmploymentStatus,\n} from '@/src/flows/Onboarding/utils';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { Step, useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport { $TSFixMe, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n pricing_plan: null,\n contract_preview: null,\n review: null,\n};\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n};\n\nexport const useContractorOnboarding = ({\n countryCode,\n externalId,\n employmentId,\n skipSteps,\n options,\n initialValues: onboardingInitialValues,\n}: useContractorOnboardingProps) => {\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalContractDocumentId, setInternalContractDocumentId] = useState<\n string | undefined\n >(undefined);\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n contract_preview: Meta;\n pricing_plan: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n });\n\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n );\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmployment(internalEmploymentId);\n\n const { status: employmentStatus } = employment || {};\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const invitedStatus: 'invited' | 'not_invited' = useMemo(() => {\n const isInvited = employmentStatus === 'invited';\n\n return isInvited ? 'invited' : 'not_invited';\n }, [employmentStatus]);\n\n const createEmploymentMutation = useCreateEmployment(options);\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const signContractDocumentMutation = useSignContractDocument();\n\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n\n const { mutateAsync: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsync: signContractDocumentMutationAsync } = mutationToPromise(\n signContractDocumentMutation,\n );\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'employment_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n jsonSchemaVersion?: FlowOptions['jsonSchemaVersion'];\n };\n query?: Record<string, string>;\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractorOnboardingDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'employment_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: options?.jsfModify?.contract_details,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: stepState.currentStep.name === 'contract_preview',\n },\n },\n });\n const { data: documentPreviewPdf, isLoading: isLoadingDocumentPreviewForm } =\n useGetShowContractDocument({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n options: {\n queryOptions: {\n enabled: Boolean(internalContractDocumentId),\n },\n },\n });\n\n const stepFields: Record<keyof typeof STEPS, Fields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractorOnboardingDetailsForm?.fields,\n signatureSchemaForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n pricing_plan: null,\n contract_details: contractorOnboardingDetailsForm?.meta['x-jsf-fieldsets'],\n contract_preview: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const contractPreviewInitialValues = useMemo(() => {\n // TODO: TBD not sure if contract preview needs to be populated with anything\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: {},\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n ]);\n\n const isNavigatingToReview = useMemo(() => {\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !isLoadingEmployment &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0,\n );\n }, [\n employmentId,\n isEmploymentReadOnly,\n isLoadingEmployment,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepState.currentStep.name,\n ]);\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n // TODO: TBD\n contract_preview: {},\n // TODO: TBD\n pricing_plan: {},\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: {},\n pricing_plan: {},\n review: {},\n });\n goToStep('review');\n }\n }, [\n isNavigatingToReview,\n goToStep,\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n setStepValues,\n stepFields.select_country,\n stepFields.basic_information,\n stepFields.contract_details,\n ]);\n\n const goTo = (step: keyof typeof STEPS) => {\n goToStep(step);\n };\n\n const parseFormValues = (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n return parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return values;\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n const parsedValues = parseFormValues(values);\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n setInternalEmploymentId(employmentId);\n\n return response;\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n // TODO: Provisional it seems you cannot update a contractor employment\n return Promise.resolve({\n data: { employmentId: internalEmploymentId },\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response: $TSFixMe =\n await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n\n const contractDocumentId = response.data?.data?.contract_document?.id;\n setInternalContractDocumentId(contractDocumentId);\n return response;\n }\n\n case 'contract_preview': {\n return signContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n payload: {\n signature: values.signature,\n },\n });\n }\n\n case 'pricing_plan': {\n // TODO: TBD\n return Promise.resolve({ data: { pricingPlan: values } });\n }\n\n default: {\n throw new Error('Invalid step state');\n }\n }\n }\n\n const isLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingDocumentPreviewForm;\n\n return {\n /**\n * Loading state indicating if the flow is loading data\n */\n isLoading,\n\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back: previousStep,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next: nextStep,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo: goTo,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: FieldValues) => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractorOnboardingDetailsForm?.handleValidation(parsedValues);\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n signatureSchemaForm?.fields,\n { isPartialValidation: false },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return {\n formErrors: {},\n yupError: null,\n };\n }\n\n return null;\n },\n\n /**\n * Initial form values\n */\n initialValues,\n\n /**\n * Employment id\n */\n employmentId: internalEmploymentId,\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment: refetchEmployment,\n\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending,\n\n /**\n * Document preview PDF data\n */\n documentPreviewPdf,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n /**\n * let's the user know if the employment is invited or not\n * @returns {'invited' | 'not_invited'}\n */\n invitedStatus,\n\n /**\n * Employment data\n * @returns {Employment}\n */\n employment,\n };\n};\n"],"mappings":"qbAqCA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAQrD,IAAMC,GAGF,CACF,eAAgB,KAChB,kBAAmB,+BACnB,iBAAkB,KAClB,aAAc,KACd,iBAAkB,KAClB,OAAQ,IACV,EAEMC,GAEF,CACF,6BAA8B,mBAChC,EAEaC,GAA0BC,EAAA,CAAC,CACtC,YAAAC,GACA,WAAAC,GACA,aAAAC,EACA,UAAAC,GACA,QAAAC,EACA,cAAeC,CACjB,IAAoC,CAClC,GAAM,CAACC,EAAqBC,CAAsB,EAAIC,EACpDR,IAAe,IACjB,EACM,CAACS,EAAsBC,EAAuB,EAAIF,EAEtDN,CAAY,EACR,CAACS,EAA4BC,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B,aACES,EAAyB,WACzBE,EAAyC,WACzCE,EAA6B,UAK/B,mBAAA2B,GAMA,UAAAnC,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAT,CACF,CACF,EArrBuC","names":["useEffect","useMemo","useRef","useState","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","employment","isLoadingEmployment","refetchEmployment","useEmployment","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","useMemo","createEmploymentMutation","useCreateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","signContractDocumentMutation","useSignContractDocument","createEmploymentMutationAsync","mutationToPromise","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","selectCountryForm","isLoadingCountries","useCountriesSchemaField","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","basicInformationForm","isLoadingBasicInformationForm","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","signatureSchemaForm","useGetContractDocumentSignatureSchema","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","isNavigatingToReview","useEffect","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","contractDocumentId"]}
@@ -1,2 +1,2 @@
1
- import{a as X}from"./chunk-M6ATR43P.js";import{a as G}from"./chunk-VFRHMNLJ.js";import{a as I,b as z,c as Q,f as W}from"./chunk-BITHG5X4.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as K}from"./chunk-CFIJKJXD.js";import{c as Y}from"./chunk-5TUFZVWO.js";import{a as Z}from"./chunk-7XRPOR7L.js";import{c as V}from"./chunk-PAQW5BFW.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Te,object as oe}from"yup";import{createHeadlessForm as Ve,modify as je}from"@remoteoss/json-schema-form";import{useCallback as Re,useEffect as ee,useMemo as Pe,useRef as we,useState as j}from"react";import{string as te,ValidationError as ne}from"yup";import{jsx as re}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},xe=o(t=>{let{schema:i}=je(G.data.schema,t?.jsfModify||{});return Ve(i)},"useStaticSchema");function Be(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(Be,"getSalaryTitle");var Qe=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let c=we({fields:{}}),[k,E]=j(t),[R,P]=j(),[m,q]=j(),[H,se]=j(),{data:_,isLoading:le}=I({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=z(),ue=k||R?.value,{data:w,isLoading:me}=W(ue,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=Q(),{mutateAsync:de}=Z(U),b=R?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Re(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,fe=Pe(()=>{let{from:e,to:r,shouldSwapOrder:u}=L(),g=Be(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>re(X,{...y,shouldSwapOrder:u,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>re(Y,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=xe({jsfModify:{fields:{...n?.jsfModify?.fields,...fe?.fields}}});ee(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&P(e)}},[t,_]),ee(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ge(e){return de(ae(e,s,a))}o(ge,"onSubmit");function ye(e){let r=_?.find(({value:u})=>u===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),P(r)}o(ye,"onCountryChange");function pe(e){E(e)}o(pe,"onRegionChange");function Ce(e){se(e.target.value)}o(Ce,"onHiringBudgetChange");function _e(e){let r=d?.find(u=>u.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(_e,"onChangeCurrency");let S=f.fields.find(e=>e.name==="region");if(S){let e=R?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];S.options=e,S.isVisible=e.length>0,S.required=e.length>0,S.onChange=pe,S.schema=e.length>0?te().transform(r=>typeof r=="string"?r:"").required("Region is required"):te()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=_e)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=Ce),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=ye)}let be=o(()=>{P(void 0),E(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...w?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ie(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let u=V(e,D);try{await N.validate(u,{abortEarly:!1}),r={formErrors:{},yupError:new ne([],e)}}catch(h){let B=K(h);r={formErrors:Object.entries(B).reduce((T,[A,M])=>({...T,[A]:M.message}),{}),yupError:h}}let g=w?.handleValidation(u),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new ne(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(e=>{let{country:r,region:u,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:h,management:B,estimation_title:T,...A}=e,M=e.salary;y==="salary_conversion"&&(M=h);let he=V({country:r,region:u,salary:M,salary_converted:y,salary_conversion:h,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Ee=V(A,w?.fields||[]),Fe={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Ee,...Fe}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:le&&ce&&me,onSubmit:ge,resetForm:be,currencies:d,meta:{fields:c.current?.fields}}},"useCostCalculator");function ie(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(c=>c===a.name,"is"),then:o(c=>c.required("Required field"),"then"),otherwise:o(c=>c.optional(),"otherwise")}):a.name==="management"?n[a.name]=oe({management_fee:Te().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return oe(s)}o(ie,"buildValidationSchema");function Ae(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let c={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,c]},[])}o(Ae,"formatBenefits");function Oe(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Ae(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...ke(t,l)}}o(Oe,"mapValueToEmployment");function ke(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(ke,"getSalaryFields");function ae(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Oe(n,i,l))}}o(ae,"buildPayload");export{ie as a,ae as b,O as c,Qe as d};
2
- //# sourceMappingURL=chunk-YFEIQZGJ.js.map
1
+ import{a as X}from"./chunk-XGPCOHUF.js";import{a as G}from"./chunk-VFRHMNLJ.js";import{a as I,b as z,c as Q,f as W}from"./chunk-5EP45OQV.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as K}from"./chunk-CFIJKJXD.js";import{c as Y}from"./chunk-OUO2RTM4.js";import{a as Z}from"./chunk-7XRPOR7L.js";import{c as V}from"./chunk-PAQW5BFW.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Te,object as oe}from"yup";import{createHeadlessForm as Ve,modify as je}from"@remoteoss/json-schema-form";import{useCallback as Re,useEffect as ee,useMemo as Pe,useRef as we,useState as j}from"react";import{string as te,ValidationError as ne}from"yup";import{jsx as re}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},xe=o(t=>{let{schema:i}=je(G.data.schema,t?.jsfModify||{});return Ve(i)},"useStaticSchema");function Be(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(Be,"getSalaryTitle");var Qe=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let c=we({fields:{}}),[k,E]=j(t),[R,P]=j(),[m,q]=j(),[H,se]=j(),{data:_,isLoading:le}=I({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=z(),ue=k||R?.value,{data:w,isLoading:me}=W(ue,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=Q(),{mutateAsync:de}=Z(U),b=R?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Re(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,fe=Pe(()=>{let{from:e,to:r,shouldSwapOrder:u}=L(),g=Be(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>re(X,{...y,shouldSwapOrder:u,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>re(Y,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=xe({jsfModify:{fields:{...n?.jsfModify?.fields,...fe?.fields}}});ee(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&P(e)}},[t,_]),ee(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ge(e){return de(ae(e,s,a))}o(ge,"onSubmit");function ye(e){let r=_?.find(({value:u})=>u===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),P(r)}o(ye,"onCountryChange");function pe(e){E(e)}o(pe,"onRegionChange");function Ce(e){se(e.target.value)}o(Ce,"onHiringBudgetChange");function _e(e){let r=d?.find(u=>u.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(_e,"onChangeCurrency");let S=f.fields.find(e=>e.name==="region");if(S){let e=R?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];S.options=e,S.isVisible=e.length>0,S.required=e.length>0,S.onChange=pe,S.schema=e.length>0?te().transform(r=>typeof r=="string"?r:"").required("Region is required"):te()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=_e)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=Ce),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=ye)}let be=o(()=>{P(void 0),E(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...w?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ie(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let u=V(e,D);try{await N.validate(u,{abortEarly:!1}),r={formErrors:{},yupError:new ne([],e)}}catch(h){let B=K(h);r={formErrors:Object.entries(B).reduce((T,[A,M])=>({...T,[A]:M.message}),{}),yupError:h}}let g=w?.handleValidation(u),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new ne(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(e=>{let{country:r,region:u,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:h,management:B,estimation_title:T,...A}=e,M=e.salary;y==="salary_conversion"&&(M=h);let he=V({country:r,region:u,salary:M,salary_converted:y,salary_conversion:h,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Ee=V(A,w?.fields||[]),Fe={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Ee,...Fe}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:le&&ce&&me,onSubmit:ge,resetForm:be,currencies:d,meta:{fields:c.current?.fields}}},"useCostCalculator");function ie(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(c=>c===a.name,"is"),then:o(c=>c.required("Required field"),"then"),otherwise:o(c=>c.optional(),"otherwise")}):a.name==="management"?n[a.name]=oe({management_fee:Te().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return oe(s)}o(ie,"buildValidationSchema");function Ae(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let c={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,c]},[])}o(Ae,"formatBenefits");function Oe(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Ae(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...ke(t,l)}}o(Oe,"mapValueToEmployment");function ke(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(ke,"getSalaryFields");function ae(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Oe(n,i,l))}}o(ae,"buildPayload");export{ie as a,ae as b,O as c,Qe as d};
2
+ //# sourceMappingURL=chunk-XRB4Y7WT.js.map
@@ -0,0 +1,2 @@
1
+ import{a as s}from"./chunk-W676SMID.js";import{b as i}from"./chunk-TOA3JILU.js";import{b as n}from"./chunk-7XRPOR7L.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:d,onSuccess:l,onError:a}){let{contractorOnboardingBag:o}=i(),c=t(async e=>{try{await d?.(o.parseFormValues(e));let r=await o.onSubmit(e);if(r?.data){await l?.(r?.data),o?.next();return}if(r?.error){let p=n(r?.fieldErrors||[],o.meta?.fields?.contract_details);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),m=o.stepState.values?.contract_details||o.initialValues.contract_details;return u(s,{defaultValues:m,onSubmit:c})}t(F,"ContractDetailsStep");export{F as a};
2
+ //# sourceMappingURL=chunk-XRU2O525.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/components/ContractDetailsStep.tsx"],"sourcesContent":["import { $TSFixMe } from '@/src/types/remoteFlows';\nimport {\n normalizeFieldErrors,\n NormalizedFieldError,\n} from '@/src/lib/mutations';\nimport { useContractorOnboardingContext } from '@/src/flows/ContractorOnboarding/context';\nimport { ContractorOnboardingForm } from '@/src/flows/ContractorOnboarding/components/ContractorOnboardingForm';\nimport {\n ContractorOnboardingContractDetailsFormPayload,\n ContractorOnboardingContractDetailsResponse,\n} from '@/src/flows/ContractorOnboarding/types';\n\ntype ContractDetailsStepProps = {\n /*\n * The function is called when the form is submitted. It receives the form values as an argument.\n */\n onSubmit?: (\n payload: ContractorOnboardingContractDetailsFormPayload,\n ) => void | Promise<void>;\n /*\n * The function is called when the form submission is successful.\n */\n onSuccess?: (\n data: ContractorOnboardingContractDetailsResponse,\n ) => void | Promise<void>;\n /*\n * The function is called when an error occurs during form submission.\n */\n onError?: ({\n error,\n rawError,\n fieldErrors,\n }: {\n error: Error;\n rawError: Record<string, unknown>;\n fieldErrors: NormalizedFieldError[];\n }) => void;\n};\n\nexport function ContractDetailsStep({\n onSubmit,\n onSuccess,\n onError,\n}: ContractDetailsStepProps) {\n const { contractorOnboardingBag } = useContractorOnboardingContext();\n\n const handleSubmit = async (payload: $TSFixMe) => {\n try {\n await onSubmit?.(\n contractorOnboardingBag.parseFormValues(payload) as $TSFixMe, // TODO: add type\n );\n const response = await contractorOnboardingBag.onSubmit(payload);\n if (response?.data) {\n await onSuccess?.(response?.data as $TSFixMe); // TODO: add type\n contractorOnboardingBag?.next();\n return;\n }\n if (response?.error) {\n const normalizedFieldErrors = normalizeFieldErrors(\n response?.fieldErrors || [],\n contractorOnboardingBag.meta?.fields?.contract_details,\n );\n\n onError?.({\n error: response?.error,\n rawError: response?.rawError,\n fieldErrors: normalizedFieldErrors,\n });\n }\n } catch (error: unknown) {\n onError?.({\n error: error as Error,\n rawError: error as Record<string, unknown>,\n fieldErrors: [],\n });\n }\n };\n\n const initialValues =\n contractorOnboardingBag.stepState.values?.contract_details ||\n contractorOnboardingBag.initialValues.contract_details;\n\n return (\n <ContractorOnboardingForm\n defaultValues={initialValues}\n onSubmit={handleSubmit}\n />\n );\n}\n"],"mappings":"gKAmFI,cAAAA,MAAA,oBA5CG,SAASC,EAAoB,CAClC,SAAAC,EACA,UAAAC,EACA,QAAAC,CACF,EAA6B,CAC3B,GAAM,CAAE,wBAAAC,CAAwB,EAAIC,EAA+B,EAE7DC,EAAeC,EAAA,MAAOC,GAAsB,CAChD,GAAI,CACF,MAAMP,IACJG,EAAwB,gBAAgBI,CAAO,CACjD,EACA,IAAMC,EAAW,MAAML,EAAwB,SAASI,CAAO,EAC/D,GAAIC,GAAU,KAAM,CAClB,MAAMP,IAAYO,GAAU,IAAgB,EAC5CL,GAAyB,KAAK,EAC9B,MACF,CACA,GAAIK,GAAU,MAAO,CACnB,IAAMC,EAAwBC,EAC5BF,GAAU,aAAe,CAAC,EAC1BL,EAAwB,MAAM,QAAQ,gBACxC,EAEAD,IAAU,CACR,MAAOM,GAAU,MACjB,SAAUA,GAAU,SACpB,YAAaC,CACf,CAAC,CACH,CACF,OAASE,EAAgB,CACvBT,IAAU,CACR,MAAOS,EACP,SAAUA,EACV,YAAa,CAAC,CAChB,CAAC,CACH,CACF,EA9BqB,gBAgCfC,EACJT,EAAwB,UAAU,QAAQ,kBAC1CA,EAAwB,cAAc,iBAExC,OACEL,EAACe,EAAA,CACC,cAAeD,EACf,SAAUP,EACZ,CAEJ,CAjDgBC,EAAAP,EAAA","names":["jsx","ContractDetailsStep","onSubmit","onSuccess","onError","contractorOnboardingBag","useContractorOnboardingContext","handleSubmit","__name","payload","response","normalizedFieldErrors","normalizeFieldErrors","error","initialValues","ContractorOnboardingForm"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-54KJP7WD.js";import{a as s}from"./chunk-P37U34EQ.js";import*as n from"react";import{Drawer as r}from"vaul";import{jsx as a,jsxs as l}from"react/jsx-runtime";var d=s(({shouldScaleBackground:e=!0,...t})=>a(r.Root,{shouldScaleBackground:e,...t}),"Drawer");d.displayName="Drawer";var N=r.Trigger,f=r.Portal,P=r.Close,m=n.forwardRef(({className:e,...t},o)=>a(r.Overlay,{ref:o,className:i("fixed inset-0 z-50 bg-black/80",e),...t}));m.displayName=r.Overlay.displayName;var D=n.forwardRef(({className:e,children:t,showHandle:o=!0,...c},p)=>l(f,{children:[a(m,{}),l(r.Content,{ref:p,className:i("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...c,children:[o&&a("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));D.displayName="DrawerContent";var w=s(({className:e,...t})=>a("div",{className:i("grid gap-1.5 p-4 text-center sm:text-left",e),...t}),"DrawerHeader");w.displayName="DrawerHeader";var R=s(({className:e,...t})=>a("div",{className:i("mt-auto flex flex-col gap-2 p-4",e),...t}),"DrawerFooter");R.displayName="DrawerFooter";var u=n.forwardRef(({className:e,...t},o)=>a(r.Title,{ref:o,className:i("text-lg font-semibold leading-none tracking-tight",e),...t}));u.displayName=r.Title.displayName;var g=n.forwardRef(({className:e,...t},o)=>a(r.Description,{ref:o,className:i("text-sm text-muted-foreground",e),...t}));g.displayName=r.Description.displayName;export{d as a,N as b,P as c,D as d,w as e,u as f,g};
2
- //# sourceMappingURL=chunk-2I5DIIJP.js.map
1
+ import{a as i}from"./chunk-HC56JKI2.js";import{a as s}from"./chunk-P37U34EQ.js";import*as n from"react";import{Drawer as r}from"vaul";import{jsx as a,jsxs as l}from"react/jsx-runtime";var d=s(({shouldScaleBackground:e=!0,...t})=>a(r.Root,{shouldScaleBackground:e,...t}),"Drawer");d.displayName="Drawer";var N=r.Trigger,f=r.Portal,P=r.Close,m=n.forwardRef(({className:e,...t},o)=>a(r.Overlay,{ref:o,className:i("fixed inset-0 z-50 bg-black/80",e),...t}));m.displayName=r.Overlay.displayName;var D=n.forwardRef(({className:e,children:t,showHandle:o=!0,...c},p)=>l(f,{children:[a(m,{}),l(r.Content,{ref:p,className:i("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...c,children:[o&&a("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));D.displayName="DrawerContent";var w=s(({className:e,...t})=>a("div",{className:i("grid gap-1.5 p-4 text-center sm:text-left",e),...t}),"DrawerHeader");w.displayName="DrawerHeader";var R=s(({className:e,...t})=>a("div",{className:i("mt-auto flex flex-col gap-2 p-4",e),...t}),"DrawerFooter");R.displayName="DrawerFooter";var u=n.forwardRef(({className:e,...t},o)=>a(r.Title,{ref:o,className:i("text-lg font-semibold leading-none tracking-tight",e),...t}));u.displayName=r.Title.displayName;var g=n.forwardRef(({className:e,...t},o)=>a(r.Description,{ref:o,className:i("text-sm text-muted-foreground",e),...t}));g.displayName=r.Description.displayName;export{d as a,N as b,P as c,D as d,w as e,u as f,g};
2
+ //# sourceMappingURL=chunk-Z2G2XC43.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-54KJP7WD.js";import{a as n}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as o,jsxs as t}from"react/jsx-runtime";var a=[{label:"Misconduct",description:"The employee is being dismissed due to unacceptable or improper behavior."},{label:"Performance",description:"When dismissing an employee for poor performance, employers are required by law to do so fairly. This means giving the employee reasonable opportunity to improve their performance prior to termination."},{label:"Workforce reduction",description:"The employee\u2019s position is being made redundant, and a layoff is underway."},{label:"Values",description:"The employee is misaligned with the company\u2019s values."},{label:"Compliance issue",description:"Use this option if the employee violated key policies, processes or procedures. For example, they failed to comply with their employment agreement\u2019s confidentiality clause."},{label:"Incapacity to perform inherent duties",description:"Use this option if the employee is physically or mentally unable to fulfill the work requirements of their role."},{label:"Mutual agreement",description:"Employee and employer made a mutual decision to end the relationship."},{label:"Decision to cancel hiring before the employee started",description:"Use this option only if the employee has not started work yet."},{label:"Job abandonment",description:"The employee has failed to appear for work; the Employer has been unsuccessful in establishing communications with the employee and does not know the employee\u2019s whereabouts."},{label:"Dissatisfaction with EOR service",description:t("span",{children:["We\u2019re sorry to see you go. If there is anything we can do to improve or if there is any remaining feedback you want to give us, please reach out to"," ",o("a",{href:"mailto:help@remote.com",target:"_blank",rel:"noopener noreferrer",children:"help@remote.com"}),"."]})},{label:"End of fixed-term contract",description:"Use this option when the employee fixed-term contract is coming to an end and will not be renewed or extended."}],r=n(()=>t(s,{children:[t("h3",{className:e("RemoteFlows__TerminationReasonsDetailContent__Title"),children:[" ","Why is this important?"]}),o("p",{className:e("RemoteFlows__TerminationReasonsDetailContent__Description"),children:"We're here to help you follow all applicable labor laws when terminating an employee. Here are all the legal reasons for termination. Please read them to make sure you enter the correct reason in the platform."}),o("h4",{className:e("RemoteFlows__TerminationReasonsDetailContent__Subtitle"),children:"Termination Reasons"}),o("ul",{className:e("RemoteFlows__TerminationReasonsDetailContent__List list-disc list-inside"),children:a.map(i=>t("li",{className:e("RemoteFlows__TerminationReasonsDetailContent__ListItem"),children:[o("span",{className:e("RemoteFlows__TerminationReasonsDetailContent__ListItemLabel"),children:i.label}),o("span",{className:e("RemoteFlows__TerminationReasonsDetailContent__ListItemDescription"),children:i.description})]},i.label))})]}),"TerminationReasonsDetailContent");export{r as a};
2
- //# sourceMappingURL=chunk-KN4F5TMS.js.map
1
+ import{a as e}from"./chunk-HC56JKI2.js";import{a as n}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as o,jsxs as t}from"react/jsx-runtime";var a=[{label:"Misconduct",description:"The employee is being dismissed due to unacceptable or improper behavior."},{label:"Performance",description:"When dismissing an employee for poor performance, employers are required by law to do so fairly. This means giving the employee reasonable opportunity to improve their performance prior to termination."},{label:"Workforce reduction",description:"The employee\u2019s position is being made redundant, and a layoff is underway."},{label:"Values",description:"The employee is misaligned with the company\u2019s values."},{label:"Compliance issue",description:"Use this option if the employee violated key policies, processes or procedures. For example, they failed to comply with their employment agreement\u2019s confidentiality clause."},{label:"Incapacity to perform inherent duties",description:"Use this option if the employee is physically or mentally unable to fulfill the work requirements of their role."},{label:"Mutual agreement",description:"Employee and employer made a mutual decision to end the relationship."},{label:"Decision to cancel hiring before the employee started",description:"Use this option only if the employee has not started work yet."},{label:"Job abandonment",description:"The employee has failed to appear for work; the Employer has been unsuccessful in establishing communications with the employee and does not know the employee\u2019s whereabouts."},{label:"Dissatisfaction with EOR service",description:t("span",{children:["We\u2019re sorry to see you go. If there is anything we can do to improve or if there is any remaining feedback you want to give us, please reach out to"," ",o("a",{href:"mailto:help@remote.com",target:"_blank",rel:"noopener noreferrer",children:"help@remote.com"}),"."]})},{label:"End of fixed-term contract",description:"Use this option when the employee fixed-term contract is coming to an end and will not be renewed or extended."}],r=n(()=>t(s,{children:[t("h3",{className:e("RemoteFlows__TerminationReasonsDetailContent__Title"),children:[" ","Why is this important?"]}),o("p",{className:e("RemoteFlows__TerminationReasonsDetailContent__Description"),children:"We're here to help you follow all applicable labor laws when terminating an employee. Here are all the legal reasons for termination. Please read them to make sure you enter the correct reason in the platform."}),o("h4",{className:e("RemoteFlows__TerminationReasonsDetailContent__Subtitle"),children:"Termination Reasons"}),o("ul",{className:e("RemoteFlows__TerminationReasonsDetailContent__List list-disc list-inside"),children:a.map(i=>t("li",{className:e("RemoteFlows__TerminationReasonsDetailContent__ListItem"),children:[o("span",{className:e("RemoteFlows__TerminationReasonsDetailContent__ListItemLabel"),children:i.label}),o("span",{className:e("RemoteFlows__TerminationReasonsDetailContent__ListItemDescription"),children:i.description})]},i.label))})]}),"TerminationReasonsDetailContent");export{r as a};
2
+ //# sourceMappingURL=chunk-ZXA3CCPB.js.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-QFZ3XVDT.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as e}from"./chunk-32GSS4UM.js";import{a}from"./chunk-A76UTPRW.js";import{b as n}from"./chunk-2QGDCMCE.js";import{b as s}from"./chunk-54KJP7WD.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as y,jsx as r,jsxs as t}from"react/jsx-runtime";function N({grossSalary:l,currency:p,hasExtraStatutoryPayment:c=!1}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[t("div",{className:"flex items-center gap-2",children:[r("h3",{className:"font-medium text-primary-foreground",children:"Gross Salary"}),c&&r(m,{content:t(y,{children:[r("span",{children:"This country respects extra payments on top of the gross salary."})," ",r(a,{zendeskId:e.extraPayments,children:"Learn more"})]}),children:t(n,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 mt-2",children:[r(f,{className:"h-3 w-3 text-gray-400"}),r("span",{className:"sr-only",children:"Info"})]})})]}),r("span",{className:"font-semibold text-lg",children:s(l,p)})]}),r(i,{})]})}o(N,"CostCalculatorGrossSalary");export{N as a};
2
- //# sourceMappingURL=chunk-756MHC7A.js.map
1
+ import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as i}from"./chunk-3T43ERBA.js";import{a as e}from"./chunk-32GSS4UM.js";import{a}from"./chunk-HH4YP6QX.js";import{b as n}from"./chunk-4NLAHGUV.js";import{b as s}from"./chunk-HC56JKI2.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as y,jsx as r,jsxs as t}from"react/jsx-runtime";function N({grossSalary:l,currency:p,hasExtraStatutoryPayment:c=!1}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[t("div",{className:"flex items-center gap-2",children:[r("h3",{className:"font-medium text-primary-foreground",children:"Gross Salary"}),c&&r(m,{content:t(y,{children:[r("span",{children:"This country respects extra payments on top of the gross salary."})," ",r(a,{zendeskId:e.extraPayments,children:"Learn more"})]}),children:t(n,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 mt-2",children:[r(f,{className:"h-3 w-3 text-gray-400"}),r("span",{className:"sr-only",children:"Info"})]})})]}),r("span",{className:"font-semibold text-lg",children:s(l,p)})]}),r(i,{})]})}o(N,"CostCalculatorGrossSalary");export{N as a};
2
+ //# sourceMappingURL=chunk-ZZ6MU7PF.js.map
@@ -1,2 +1,2 @@
1
- import{b as i}from"./chunk-2QGDCMCE.js";import{b as u}from"./chunk-3ZWDIEEM.js";import{b as c}from"./chunk-TVZAFTPT.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as C}from"react/jsx-runtime";function d({children:o,...t}){let{contractAmendment:{back:r}}=c(),{components:s}=u(),e=s?.button;return e?C(e,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o}):C(i,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o})}m(d,"ContractAmendmentBack");export{d as a};
2
- //# sourceMappingURL=chunk-UQYM3PBZ.js.map
1
+ import{b as i}from"./chunk-4NLAHGUV.js";import{b as u}from"./chunk-3ZWDIEEM.js";import{b as c}from"./chunk-TVZAFTPT.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as C}from"react/jsx-runtime";function d({children:o,...t}){let{contractAmendment:{back:r}}=c(),{components:s}=u(),e=s?.button;return e?C(e,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o}):C(i,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o})}m(d,"ContractAmendmentBack");export{d as a};
2
+ //# sourceMappingURL=chunk-ZZNI7IY2.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-UQYM3PBZ.js";import"../../chunk-2QGDCMCE.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-54KJP7WD.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
1
+ import{a}from"../../chunk-ZZNI7IY2.js";import"../../chunk-4NLAHGUV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
2
2
  //# sourceMappingURL=ContractAmendmentBack.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { d as PostCreateContractAmendmentError, c as ContractAmendmentResponse } from '../../types.gen-BWjuA7VH.js';
2
+ import { d as PostCreateContractAmendmentError, c as ContractAmendmentResponse } from '../../types.gen-N_N1mlfc.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentConfirmationFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-B3WXLC2R.js";import"../../chunk-U23SN7CM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-XVW2URFK.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-54KJP7WD.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
1
+ import{a}from"../../chunk-5JGYNS2O.js";import"../../chunk-XASIKHZL.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-PAZGF4C3.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
2
2
  //# sourceMappingURL=ContractAmendmentConfirmationForm.js.map
@@ -5,11 +5,11 @@ import { ContractAmendmentForm } from './ContractAmendmentForm.js';
5
5
  import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
6
6
  import { useContractAmendment } from './hooks.js';
7
7
  import { ContractAmendmentParams } from './types.js';
8
- import '../../types.gen-BWjuA7VH.js';
8
+ import '../../types.gen-N_N1mlfc.js';
9
9
  import 'react-hook-form';
10
10
  import 'react';
11
- import '../../mutations-BHTJydCx.js';
12
- import '../../remoteFlows-bfHFRZSe.js';
11
+ import '../../mutations-B7htnE-g.js';
12
+ import '../../remoteFlows-DR6mSxki.js';
13
13
  import 'yup';
14
14
  import '../../types-Zg1n_9wh.js';
15
15
  import '@remoteoss/json-schema-form';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-4C6O4QTI.js";import"../../chunk-4KA5AP7X.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-XGMQPLVG.js";import"../../chunk-5TUFZVWO.js";import"../../chunk-ZJ3JHILJ.js";import"../../chunk-JWZIWG4T.js";import"../../chunk-MGOT272R.js";import"../../chunk-ZTVYWMBY.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-GGXKORRZ.js";import"../../chunk-R2VVXLL7.js";import"../../chunk-7IHBNPZK.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-FHHAGWU5.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-UQYM3PBZ.js";import"../../chunk-2QGDCMCE.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-B3WXLC2R.js";import"../../chunk-U23SN7CM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-XVW2URFK.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-54KJP7WD.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-UCLVNY25.js";import"../../chunk-3GDPOMQP.js";import"../../chunk-SV2PWH6Y.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-OUO2RTM4.js";import"../../chunk-VHJFIDOX.js";import"../../chunk-OEEUSIOB.js";import"../../chunk-2GCMLKO2.js";import"../../chunk-HTCONTKZ.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-BCSSGG6E.js";import"../../chunk-S2AQQVM7.js";import"../../chunk-FCAGJMPU.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-ZZNI7IY2.js";import"../../chunk-4NLAHGUV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-5JGYNS2O.js";import"../../chunk-XASIKHZL.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-PAZGF4C3.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
2
2
  //# sourceMappingURL=ContractAmendmentFlow.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as PostAutomatableContractAmendmentError, a as ContractAmendmentAutomatableResponse } from '../../types.gen-BWjuA7VH.js';
2
+ import { b as PostAutomatableContractAmendmentError, a as ContractAmendmentAutomatableResponse } from '../../types.gen-N_N1mlfc.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-4KA5AP7X.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-XGMQPLVG.js";import"../../chunk-5TUFZVWO.js";import"../../chunk-ZJ3JHILJ.js";import"../../chunk-GGXKORRZ.js";import"../../chunk-R2VVXLL7.js";import"../../chunk-7IHBNPZK.js";import"../../chunk-2QGDCMCE.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-U23SN7CM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-XVW2URFK.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-54KJP7WD.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-3GDPOMQP.js";import"../../chunk-SV2PWH6Y.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-OUO2RTM4.js";import"../../chunk-VHJFIDOX.js";import"../../chunk-BCSSGG6E.js";import"../../chunk-S2AQQVM7.js";import"../../chunk-FCAGJMPU.js";import"../../chunk-4NLAHGUV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-XASIKHZL.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-PAZGF4C3.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-JWZIWG4T.js";import"../../chunk-2QGDCMCE.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-54KJP7WD.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
1
+ import{a}from"../../chunk-OEEUSIOB.js";import"../../chunk-4NLAHGUV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
2
2
  //# sourceMappingURL=ContractAmendmentSubmit.js.map
@@ -1,8 +1,8 @@
1
- import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-BWjuA7VH.js';
1
+ import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-N_N1mlfc.js';
2
2
  import * as React from 'react';
3
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-BHTJydCx.js';
3
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B7htnE-g.js';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
- import '../../remoteFlows-bfHFRZSe.js';
5
+ import '../../remoteFlows-DR6mSxki.js';
6
6
  import * as react_hook_form from 'react-hook-form';
7
7
  import { useContractAmendment } from './hooks.js';
8
8
  import { Step } from '../useStepState.js';
@@ -1,11 +1,11 @@
1
- import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-BWjuA7VH.js';
2
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-BHTJydCx.js';
1
+ import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-N_N1mlfc.js';
2
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B7htnE-g.js';
3
3
  import * as React from 'react';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
5
  import { Step } from '../useStepState.js';
6
6
  import { ContractAmendmentParams } from './types.js';
7
7
  import { FieldValues } from 'react-hook-form';
8
- import '../../remoteFlows-bfHFRZSe.js';
8
+ import '../../remoteFlows-DR6mSxki.js';
9
9
  import 'yup';
10
10
  import '../../types-Zg1n_9wh.js';
11
11
  import '../types.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-MGOT272R.js";import"../../chunk-ZTVYWMBY.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-FHHAGWU5.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
1
+ import{a}from"../../chunk-2GCMLKO2.js";import"../../chunk-HTCONTKZ.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -4,15 +4,15 @@ export { ContractAmendmentForm } from './ContractAmendmentForm.js';
4
4
  export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
5
5
  export { useContractAmendment } from './hooks.js';
6
6
  import 'react/jsx-runtime';
7
- import '../../types.gen-BWjuA7VH.js';
7
+ import '../../types.gen-N_N1mlfc.js';
8
8
  import 'react-hook-form';
9
9
  import './ContractAmendmentBack.js';
10
10
  import 'react';
11
11
  import './types.js';
12
12
  import '../types.js';
13
13
  import '@remoteoss/json-schema-form';
14
- import '../../mutations-BHTJydCx.js';
15
- import '../../remoteFlows-bfHFRZSe.js';
14
+ import '../../mutations-B7htnE-g.js';
15
+ import '../../remoteFlows-DR6mSxki.js';
16
16
  import 'yup';
17
17
  import '../../types-Zg1n_9wh.js';
18
18
  import '../useStepState.js';
@@ -1,2 +1,2 @@
1
- import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-4C6O4QTI.js";import{a as b}from"../../chunk-4KA5AP7X.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-XGMQPLVG.js";import"../../chunk-5TUFZVWO.js";import"../../chunk-ZJ3JHILJ.js";import{a as c}from"../../chunk-JWZIWG4T.js";import{a as d}from"../../chunk-MGOT272R.js";import"../../chunk-ZTVYWMBY.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-GGXKORRZ.js";import"../../chunk-R2VVXLL7.js";import"../../chunk-7IHBNPZK.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-FHHAGWU5.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-UQYM3PBZ.js";import"../../chunk-2QGDCMCE.js";import"../../chunk-3ZWDIEEM.js";import{a}from"../../chunk-B3WXLC2R.js";import"../../chunk-U23SN7CM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-XVW2URFK.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-54KJP7WD.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
1
+ import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-UCLVNY25.js";import{a as b}from"../../chunk-3GDPOMQP.js";import"../../chunk-SV2PWH6Y.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-OUO2RTM4.js";import"../../chunk-VHJFIDOX.js";import{a as c}from"../../chunk-OEEUSIOB.js";import{a as d}from"../../chunk-2GCMLKO2.js";import"../../chunk-HTCONTKZ.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-BCSSGG6E.js";import"../../chunk-S2AQQVM7.js";import"../../chunk-FCAGJMPU.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-ZZNI7IY2.js";import"../../chunk-4NLAHGUV.js";import"../../chunk-3ZWDIEEM.js";import{a}from"../../chunk-5JGYNS2O.js";import"../../chunk-XASIKHZL.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-PAZGF4C3.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { E as EmploymentShowResponse } from '../../types.gen-BWjuA7VH.js';
1
+ import { E as EmploymentShowResponse } from '../../types.gen-N_N1mlfc.js';
2
2
  import { Fields } from '@remoteoss/json-schema-form';
3
3
  import { Step } from '../useStepState.js';
4
4
  import 'react';
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { a as ContractorOnboardingFlowProps } from '../../types-XaAblF6e.js';
3
+ import '../../types.gen-N_N1mlfc.js';
4
+ import './components/OnboardingBack.js';
5
+ import 'react';
6
+ import './components/OnboardingSubmit.js';
7
+ import '../../mutations-B7htnE-g.js';
8
+ import '../../remoteFlows-DR6mSxki.js';
9
+ import 'react-hook-form';
10
+ import 'yup';
11
+ import '../../types-Zg1n_9wh.js';
12
+ import '@tanstack/query-core';
13
+ import '@remoteoss/json-schema-form';
14
+ import './utils.js';
15
+ import '../useStepState.js';
16
+ import './components/BasicInformationStep.js';
17
+ import '../../types-DEybNxfT.js';
18
+ import '../Onboarding/components/OnboardingBack.js';
19
+ import '../Onboarding/components/OnboardingInvite.js';
20
+ import '../Onboarding/components/OnboardingSubmit.js';
21
+ import '../types.js';
22
+ import '../Onboarding/components/SaveDraftButton.js';
23
+
24
+ declare const ContractorOnboardingFlow: ({ render, employmentId, externalId, countryCode, skipSteps, initialValues, options, }: ContractorOnboardingFlowProps) => react_jsx_runtime.JSX.Element;
25
+
26
+ export { ContractorOnboardingFlow };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-DPIKH7BI.js";import"../../chunk-L2GYSHXS.js";import"../../chunk-AWK7AF5V.js";import"../../chunk-C535PFLI.js";import"../../chunk-VSUEF4AY.js";import"../../chunk-XRU2O525.js";import"../../chunk-SDIBOMMT.js";import"../../chunk-W676SMID.js";import"../../chunk-RVEQJNZI.js";import"../../chunk-4Q7KTWXP.js";import"../../chunk-TOA3JILU.js";import"../../chunk-XQ5TL23G.js";import"../../chunk-QP36XXCQ.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-VXPJXQP3.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-SV2PWH6Y.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-OUO2RTM4.js";import"../../chunk-VHJFIDOX.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-BCSSGG6E.js";import"../../chunk-S2AQQVM7.js";import"../../chunk-FCAGJMPU.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-4NLAHGUV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-XASIKHZL.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-PAZGF4C3.js";import"../../chunk-HC56JKI2.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
2
+ //# sourceMappingURL=ContractorOnboarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,114 @@
1
+ import { S as SuccessResponse, e as PostSignContractDocumentError, f as SignContractDocument, F as File, g as CreateContractDocumentResponse, h as PostCreateContractDocumentError, i as CreateContractDocument } from '../../types.gen-N_N1mlfc.js';
2
+ import * as _tanstack_react_query from '@tanstack/react-query';
3
+ import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
4
+ import { FlowOptions } from '../types.js';
5
+ import { J as JSFFieldset } from '../../remoteFlows-DR6mSxki.js';
6
+ import { FieldValues } from 'react-hook-form';
7
+ import 'react';
8
+ import 'yup';
9
+ import '../../types-Zg1n_9wh.js';
10
+
11
+ /**
12
+ * Get the contract document signature schema
13
+ * @param fieldValues - The field values
14
+ * @param options - The options
15
+ * @returns The contract document signature schema
16
+ */
17
+ declare const useGetContractDocumentSignatureSchema: ({ fieldValues, options, }: {
18
+ fieldValues: FieldValues;
19
+ options?: {
20
+ queryOptions?: {
21
+ enabled?: boolean;
22
+ };
23
+ };
24
+ }) => _tanstack_react_query.UseQueryResult<_remoteoss_json_schema_form.HeadlessFormOutput, Error>;
25
+ /**
26
+ * Signs the contract document
27
+ * @param employmentId - The employment ID
28
+ * @param contractDocumentId - The contract document ID
29
+ * @param payload - The payload
30
+ * @returns The signed contract document
31
+ */
32
+ declare const useSignContractDocument: () => _tanstack_react_query.UseMutationResult<({
33
+ data: SuccessResponse;
34
+ error: undefined;
35
+ } | {
36
+ data: undefined;
37
+ error: PostSignContractDocumentError;
38
+ }) & {
39
+ request: Request;
40
+ response: Response;
41
+ }, Error, {
42
+ employmentId: string;
43
+ contractDocumentId: string;
44
+ payload: SignContractDocument;
45
+ }, unknown>;
46
+ /**
47
+ * Get the contract document for a given employment and contract document ID
48
+ * @param employmentId - The employment ID
49
+ * @param contractDocumentId - The contract document ID
50
+ * @returns The contract document
51
+ */
52
+ declare const useGetShowContractDocument: ({ employmentId, contractDocumentId, options, }: {
53
+ employmentId: string;
54
+ contractDocumentId: string;
55
+ options?: {
56
+ queryOptions?: {
57
+ enabled?: boolean;
58
+ };
59
+ };
60
+ }) => _tanstack_react_query.UseQueryResult<{
61
+ contract_document: {
62
+ content: Blob | File;
63
+ name: string;
64
+ };
65
+ } | undefined, Error>;
66
+ /**
67
+ * Saves the contractor details data
68
+ * @param employmentId - The employment ID
69
+ * @param payload - The payload
70
+ * @returns The contractor contract document
71
+ */
72
+ declare const useCreateContractorContractDocument: () => _tanstack_react_query.UseMutationResult<({
73
+ data: CreateContractDocumentResponse;
74
+ error: undefined;
75
+ } | {
76
+ data: undefined;
77
+ error: PostCreateContractDocumentError;
78
+ }) & {
79
+ request: Request;
80
+ response: Response;
81
+ }, Error, {
82
+ employmentId: string;
83
+ payload: CreateContractDocument;
84
+ }, unknown>;
85
+ /**
86
+ * Get the contractor onboarding details schema for a given country
87
+ * @param countryCode - The country code
88
+ * @param fieldValues - The field values
89
+ * @param options - The options
90
+ * @returns The contractor onboarding details schema
91
+ */
92
+ declare const useContractorOnboardingDetailsSchema: ({ countryCode, fieldValues, options, }: {
93
+ countryCode: string;
94
+ fieldValues: FieldValues;
95
+ options?: FlowOptions & {
96
+ queryOptions?: {
97
+ enabled?: boolean;
98
+ };
99
+ };
100
+ query?: Record<string, unknown>;
101
+ }) => _tanstack_react_query.UseQueryResult<{
102
+ fields: _remoteoss_json_schema_form.Fields;
103
+ handleValidation: (values: Record<string, unknown>) => {
104
+ yupError: _remoteoss_json_schema_form.$TSFixMe;
105
+ formErrors: _remoteoss_json_schema_form.$TSFixMe;
106
+ };
107
+ isError: boolean;
108
+ error?: Error;
109
+ meta: {
110
+ 'x-jsf-fieldsets': JSFFieldset;
111
+ };
112
+ }, Error>;
113
+
114
+ export { useContractorOnboardingDetailsSchema, useCreateContractorContractDocument, useGetContractDocumentSignatureSchema, useGetShowContractDocument, useSignContractDocument };
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"../../chunk-QP36XXCQ.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{e as useContractorOnboardingDetailsSchema,d as useCreateContractorContractDocument,a as useGetContractDocumentSignatureSchema,c as useGetShowContractDocument,b as useSignContractDocument};
2
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { B as BasicInformationFormPayload } from '../../../types-DEybNxfT.js';
3
+ import { n as EmploymentCreationResponse } from '../../../types.gen-N_N1mlfc.js';
4
+ import { N as NormalizedFieldError } from '../../../mutations-B7htnE-g.js';
5
+ import '../../Onboarding/components/OnboardingBack.js';
6
+ import 'react';
7
+ import '../../Onboarding/components/OnboardingInvite.js';
8
+ import '../../../remoteFlows-DR6mSxki.js';
9
+ import 'react-hook-form';
10
+ import 'yup';
11
+ import '../../../types-Zg1n_9wh.js';
12
+ import '../../Onboarding/components/OnboardingSubmit.js';
13
+ import '@tanstack/query-core';
14
+ import '@remoteoss/json-schema-form';
15
+ import '../../useStepState.js';
16
+ import '../../types.js';
17
+ import '../../Onboarding/components/SaveDraftButton.js';
18
+
19
+ type BasicInformationStepProps = {
20
+ onSubmit?: (payload: BasicInformationFormPayload) => void | Promise<void>;
21
+ onSuccess?: (data: EmploymentCreationResponse) => void | Promise<void>;
22
+ onError?: ({ error, rawError, fieldErrors, }: {
23
+ error: Error;
24
+ rawError: Record<string, unknown>;
25
+ fieldErrors: NormalizedFieldError[];
26
+ }) => void;
27
+ };
28
+ declare function BasicInformationStep({ onSubmit, onSuccess, onError, }: BasicInformationStepProps): react_jsx_runtime.JSX.Element;
29
+
30
+ export { BasicInformationStep };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../../chunk-VSUEF4AY.js";import"../../../chunk-W676SMID.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-SV2PWH6Y.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-OUO2RTM4.js";import"../../../chunk-VHJFIDOX.js";import"../../../chunk-7XRPOR7L.js";import"../../../chunk-BCSSGG6E.js";import"../../../chunk-S2AQQVM7.js";import"../../../chunk-FCAGJMPU.js";import"../../../chunk-4NLAHGUV.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-XASIKHZL.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-PAZGF4C3.js";import"../../../chunk-HC56JKI2.js";import"../../../chunk-P37U34EQ.js";export{a as BasicInformationStep};
2
+ //# sourceMappingURL=BasicInformationStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,22 @@
1
+ import 'react/jsx-runtime';
2
+ import '../../../mutations-B7htnE-g.js';
3
+ export { h as ContractDetailsStep } from '../../../types-XaAblF6e.js';
4
+ import '../../../remoteFlows-DR6mSxki.js';
5
+ import 'react-hook-form';
6
+ import 'react';
7
+ import 'yup';
8
+ import '../../../types.gen-N_N1mlfc.js';
9
+ import '../../../types-Zg1n_9wh.js';
10
+ import './OnboardingBack.js';
11
+ import './OnboardingSubmit.js';
12
+ import '@tanstack/query-core';
13
+ import '@remoteoss/json-schema-form';
14
+ import '../utils.js';
15
+ import '../../useStepState.js';
16
+ import './BasicInformationStep.js';
17
+ import '../../../types-DEybNxfT.js';
18
+ import '../../Onboarding/components/OnboardingBack.js';
19
+ import '../../Onboarding/components/OnboardingInvite.js';
20
+ import '../../Onboarding/components/OnboardingSubmit.js';
21
+ import '../../types.js';
22
+ import '../../Onboarding/components/SaveDraftButton.js';
@@ -0,0 +1,2 @@
1
+ import{a}from"../../../chunk-XRU2O525.js";import"../../../chunk-W676SMID.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-SV2PWH6Y.js";import"../../../chunk-CFIJKJXD.js";import"../../../chunk-OUO2RTM4.js";import"../../../chunk-VHJFIDOX.js";import"../../../chunk-7XRPOR7L.js";import"../../../chunk-BCSSGG6E.js";import"../../../chunk-S2AQQVM7.js";import"../../../chunk-FCAGJMPU.js";import"../../../chunk-4NLAHGUV.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-XASIKHZL.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-PAZGF4C3.js";import"../../../chunk-HC56JKI2.js";import"../../../chunk-P37U34EQ.js";export{a as ContractDetailsStep};
2
+ //# sourceMappingURL=ContractDetailsStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}