@remoteoss/remote-flows 1.3.0 → 1.3.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 (365) hide show
  1. package/dist/{PdfPreview-6C3GGXIN.js → PdfPreview-2VXVDUFP.js} +2 -2
  2. package/dist/{chunk-N6BBMT7W.js → chunk-26Y25KF6.js} +2 -2
  3. package/dist/{chunk-IBHNWMMB.js → chunk-2MX3WPCK.js} +2 -2
  4. package/dist/{chunk-UA6MNQLD.js → chunk-3BOFG6MK.js} +2 -2
  5. package/dist/{chunk-AT7VHJMW.js → chunk-3DRSYLBM.js} +2 -2
  6. package/dist/{chunk-C4DLDK36.js → chunk-3NMCXHSQ.js} +2 -2
  7. package/dist/{chunk-OP72BS23.js → chunk-447M3MFN.js} +2 -2
  8. package/dist/{chunk-VBO75DXV.js → chunk-4G2UMXRE.js} +2 -2
  9. package/dist/{chunk-GE5DH3UF.js → chunk-4GXONSSK.js} +2 -2
  10. package/dist/{chunk-M2TLNSTK.js → chunk-4OVFMUUJ.js} +2 -2
  11. package/dist/{chunk-EC7QVRRX.js → chunk-4UAHJOHZ.js} +2 -2
  12. package/dist/{chunk-QUQLW5YW.js → chunk-5JQMTMHR.js} +2 -2
  13. package/dist/{chunk-NDQ6UQFG.js → chunk-5S54GMUJ.js} +2 -2
  14. package/dist/chunk-5WFWHEXV.js +2 -0
  15. package/dist/chunk-5WFWHEXV.js.map +1 -0
  16. package/dist/{chunk-OKM7DRCF.js → chunk-6CASSN2Z.js} +2 -2
  17. package/dist/chunk-6DHV4GT6.js +2 -0
  18. package/dist/{chunk-LG2LVO4C.js → chunk-6E467YF3.js} +2 -2
  19. package/dist/{chunk-XRI6PRXK.js → chunk-6E5GX7W3.js} +2 -2
  20. package/dist/{chunk-T6HCUFYI.js → chunk-765OB2K5.js} +2 -2
  21. package/dist/chunk-AD53V4MM.js +2 -0
  22. package/dist/chunk-AD53V4MM.js.map +1 -0
  23. package/dist/{chunk-2FQ2KNP4.js → chunk-ADOJOLLL.js} +2 -2
  24. package/dist/{chunk-35RMJMSH.js → chunk-AF3YOXUE.js} +2 -2
  25. package/dist/{chunk-44IOQYR2.js → chunk-AFGXZINW.js} +2 -2
  26. package/dist/{chunk-6S6H4NAQ.js → chunk-AL2HSQPC.js} +2 -2
  27. package/dist/{chunk-Z6TCBVRG.js → chunk-B2OOX56F.js} +2 -2
  28. package/dist/{chunk-EYQ4PYUT.js → chunk-BB2GHYJY.js} +2 -2
  29. package/dist/chunk-BB2GHYJY.js.map +1 -0
  30. package/dist/{chunk-Y5P5IJRN.js → chunk-BPIGB72P.js} +2 -2
  31. package/dist/chunk-CATDB2YM.js +2 -0
  32. package/dist/chunk-CATDB2YM.js.map +1 -0
  33. package/dist/{chunk-EGRGQWIY.js → chunk-CM2YPABC.js} +2 -2
  34. package/dist/{chunk-66N57DKF.js → chunk-CR7AIZKA.js} +2 -2
  35. package/dist/{chunk-WCEHP5N7.js → chunk-CWAUKF77.js} +2 -2
  36. package/dist/{chunk-A3GZSC5Z.js → chunk-CX735AP4.js} +2 -2
  37. package/dist/{chunk-3CFU6LKQ.js → chunk-ER7DFMME.js} +2 -2
  38. package/dist/chunk-FOPSJRQG.js +2 -0
  39. package/dist/chunk-FOPSJRQG.js.map +1 -0
  40. package/dist/{chunk-NABPCULM.js → chunk-FQQKCROC.js} +2 -2
  41. package/dist/chunk-FUBLGAPH.js +2 -0
  42. package/dist/chunk-FUBLGAPH.js.map +1 -0
  43. package/dist/{chunk-5DKNCKV7.js → chunk-GAF5TFZJ.js} +2 -2
  44. package/dist/chunk-GFVGV76O.js +2 -0
  45. package/dist/chunk-GFVGV76O.js.map +1 -0
  46. package/dist/{chunk-UOOUV52J.js → chunk-GGPEKIIH.js} +2 -2
  47. package/dist/{chunk-72OH7PSF.js → chunk-GPLI6GGL.js} +2 -2
  48. package/dist/chunk-GVSAZND2.js +2 -0
  49. package/dist/chunk-GVSAZND2.js.map +1 -0
  50. package/dist/chunk-HIQNB5UN.js +2 -0
  51. package/dist/chunk-HIQNB5UN.js.map +1 -0
  52. package/dist/{chunk-ARTSDUSS.js → chunk-HRG5MSVG.js} +2 -2
  53. package/dist/chunk-HRG5MSVG.js.map +1 -0
  54. package/dist/chunk-IJ6325YO.js +2 -0
  55. package/dist/chunk-IJ6325YO.js.map +1 -0
  56. package/dist/{chunk-PMTKQME6.js → chunk-ILOKQ6OH.js} +2 -2
  57. package/dist/{chunk-PZNXAOZH.js → chunk-JS3H25UQ.js} +2 -2
  58. package/dist/{chunk-KKGRYDZA.js → chunk-K3XVYHGV.js} +2 -2
  59. package/dist/chunk-KDI2AVBF.js +2 -0
  60. package/dist/chunk-KDI2AVBF.js.map +1 -0
  61. package/dist/{chunk-ZIN2OWTH.js → chunk-LAXQMTDQ.js} +2 -2
  62. package/dist/{chunk-MEZ7LYUK.js → chunk-LFQDVSKU.js} +2 -2
  63. package/dist/{chunk-MXLQEDRJ.js → chunk-LHNX27TY.js} +2 -2
  64. package/dist/{chunk-2Y3SXQ5B.js → chunk-LOHRUY4J.js} +1 -1
  65. package/dist/chunk-LOHRUY4J.js.map +1 -0
  66. package/dist/{chunk-3Z6AFLXW.js → chunk-LSNMODBH.js} +2 -2
  67. package/dist/chunk-NFWNYW2E.js +2 -0
  68. package/dist/chunk-NFWNYW2E.js.map +1 -0
  69. package/dist/{chunk-A65WMO6K.js → chunk-NP3HE6QX.js} +2 -2
  70. package/dist/{chunk-LKMPZJIW.js → chunk-NY7LII5R.js} +2 -2
  71. package/dist/chunk-OKMERBJL.js +2 -0
  72. package/dist/chunk-OKMERBJL.js.map +1 -0
  73. package/dist/chunk-P5PRB2JC.js +2 -0
  74. package/dist/chunk-P5PRB2JC.js.map +1 -0
  75. package/dist/chunk-P5QKSFOE.js +2 -0
  76. package/dist/chunk-P5QKSFOE.js.map +1 -0
  77. package/dist/{chunk-F3KEIVSE.js → chunk-PC5JG4TT.js} +2 -2
  78. package/dist/{chunk-LJGCFFAT.js → chunk-PJN2YJO4.js} +2 -2
  79. package/dist/chunk-PNRHCOPF.js +2 -0
  80. package/dist/chunk-PNRHCOPF.js.map +1 -0
  81. package/dist/{chunk-VXA6RPA5.js → chunk-PS6EXVKH.js} +2 -2
  82. package/dist/{chunk-EQOU2VPX.js → chunk-Q2JVGEYM.js} +2 -2
  83. package/dist/{chunk-LJVV6MMB.js → chunk-SQVJRTTA.js} +2 -2
  84. package/dist/chunk-SRR73QPD.js +2 -0
  85. package/dist/chunk-SRR73QPD.js.map +1 -0
  86. package/dist/{chunk-Z2WV73EX.js → chunk-T6KVMOX7.js} +2 -2
  87. package/dist/chunk-TC7EQZJK.js +2 -0
  88. package/dist/chunk-TC7EQZJK.js.map +1 -0
  89. package/dist/{chunk-6P4DTWYK.js → chunk-U2HWB5HI.js} +2 -2
  90. package/dist/{chunk-L3Z2G32A.js → chunk-UQCSN47K.js} +1 -1
  91. package/dist/chunk-UQCSN47K.js.map +1 -0
  92. package/dist/chunk-W4KHMUDZ.js +2 -0
  93. package/dist/chunk-W4KHMUDZ.js.map +1 -0
  94. package/dist/chunk-WINYXC33.js +2 -0
  95. package/dist/chunk-WINYXC33.js.map +1 -0
  96. package/dist/{chunk-7COHIUGW.js → chunk-XCA33UL6.js} +2 -2
  97. package/dist/chunk-XCA33UL6.js.map +1 -0
  98. package/dist/{chunk-QIVDIOJG.js → chunk-XGECMN4V.js} +2 -2
  99. package/dist/{chunk-BVDT43OO.js → chunk-XTXPKDZ7.js} +2 -2
  100. package/dist/{chunk-TVJYCR33.js → chunk-XXPJHT5A.js} +2 -2
  101. package/dist/{chunk-BL7OYWNX.js → chunk-XXXQA4SY.js} +2 -2
  102. package/dist/{chunk-HDNBZ6CB.js → chunk-Z3AKMQ4S.js} +2 -2
  103. package/dist/{chunk-4GDEWYZC.js → chunk-Z5A2M5EU.js} +2 -2
  104. package/dist/{chunk-OXL3QGHT.js → chunk-ZCXTTVGV.js} +2 -2
  105. package/dist/chunk-ZCXTTVGV.js.map +1 -0
  106. package/dist/{chunk-KGKDSOER.js → chunk-ZFKHCC4Z.js} +2 -2
  107. package/dist/{chunk-FZDQ7EEI.js → chunk-ZT72WOPZ.js} +2 -2
  108. package/dist/chunk-ZUNMNGRC.js +2 -0
  109. package/dist/chunk-ZUNMNGRC.js.map +1 -0
  110. package/dist/chunk-ZZPYYZNT.js +2 -0
  111. package/dist/chunk-ZZPYYZNT.js.map +1 -0
  112. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  113. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  114. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  115. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +5 -4
  116. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  117. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  118. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  119. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  120. package/dist/flows/ContractAmendment/context.d.ts +9 -8
  121. package/dist/flows/ContractAmendment/hooks.d.ts +10 -9
  122. package/dist/flows/ContractAmendment/hooks.js +1 -1
  123. package/dist/flows/ContractAmendment/index.d.ts +5 -4
  124. package/dist/flows/ContractAmendment/index.js +1 -1
  125. package/dist/flows/ContractAmendment/types.d.ts +2 -3
  126. package/dist/flows/ContractAmendment/utils.d.ts +5 -3
  127. package/dist/flows/ContractAmendment/utils.js +1 -1
  128. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -6
  129. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  130. package/dist/flows/ContractorOnboarding/api.d.ts +15 -8
  131. package/dist/flows/ContractorOnboarding/api.js +1 -1
  132. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -5
  133. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  134. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -6
  135. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  136. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -6
  137. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  138. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +9 -10
  139. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  140. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  141. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  142. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  143. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  144. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -6
  145. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  146. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -5
  147. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  148. package/dist/flows/ContractorOnboarding/context.d.ts +6 -7
  149. package/dist/flows/ContractorOnboarding/hooks.d.ts +7 -8
  150. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  151. package/dist/flows/ContractorOnboarding/index.d.ts +5 -6
  152. package/dist/flows/ContractorOnboarding/index.js +1 -1
  153. package/dist/flows/ContractorOnboarding/types.d.ts +5 -6
  154. package/dist/flows/ContractorOnboarding/utils.d.ts +4 -5
  155. package/dist/flows/ContractorOnboarding/utils.js +1 -1
  156. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -4
  157. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  158. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -4
  159. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  160. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  161. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  162. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -3
  163. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  164. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -3
  165. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.js +1 -1
  166. package/dist/flows/CostCalculator/api.d.ts +9 -6
  167. package/dist/flows/CostCalculator/api.js +1 -1
  168. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  169. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  170. package/dist/flows/CostCalculator/context.d.ts +3 -4
  171. package/dist/flows/CostCalculator/hooks.d.ts +3 -4
  172. package/dist/flows/CostCalculator/hooks.js +1 -1
  173. package/dist/flows/CostCalculator/index.d.ts +4 -5
  174. package/dist/flows/CostCalculator/index.js +1 -1
  175. package/dist/flows/CostCalculator/types.d.ts +2 -3
  176. package/dist/flows/CostCalculator/utils.d.ts +3 -4
  177. package/dist/flows/CostCalculator/utils.js +1 -1
  178. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -5
  179. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  180. package/dist/flows/Onboarding/api.d.ts +20 -13
  181. package/dist/flows/Onboarding/api.js +1 -1
  182. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  183. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  184. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -5
  185. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  186. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -5
  187. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  188. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -5
  189. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  190. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  191. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +8 -9
  192. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  193. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  194. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  195. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  196. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -5
  197. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  198. package/dist/flows/Onboarding/components/SaveDraftButton.js +1 -1
  199. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -5
  200. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  201. package/dist/flows/Onboarding/context.d.ts +7 -8
  202. package/dist/flows/Onboarding/hooks.d.ts +6 -7
  203. package/dist/flows/Onboarding/hooks.js +1 -1
  204. package/dist/flows/Onboarding/index.d.ts +4 -5
  205. package/dist/flows/Onboarding/index.js +1 -1
  206. package/dist/flows/Onboarding/types.d.ts +4 -5
  207. package/dist/flows/Onboarding/utils.d.ts +4 -5
  208. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +6 -5
  209. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  210. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +6 -5
  211. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  212. package/dist/flows/Termination/PaidTimeOffForm.d.ts +6 -5
  213. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  214. package/dist/flows/Termination/TerminationBack.js +1 -1
  215. package/dist/flows/Termination/TerminationDetailsForm.d.ts +6 -5
  216. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  217. package/dist/flows/Termination/TerminationFlow.d.ts +6 -5
  218. package/dist/flows/Termination/TerminationFlow.js +1 -1
  219. package/dist/flows/Termination/TerminationForm.d.ts +7 -6
  220. package/dist/flows/Termination/TerminationForm.js +1 -1
  221. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  222. package/dist/flows/Termination/api.d.ts +16 -11
  223. package/dist/flows/Termination/api.js +1 -1
  224. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js +1 -1
  225. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js +1 -1
  226. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  227. package/dist/flows/Termination/components/AcknowledgeInformation/constants.js +1 -1
  228. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +8 -7
  229. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  230. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +8 -7
  231. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  232. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +8 -7
  233. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  234. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +1 -1
  235. package/dist/flows/Termination/context.d.ts +10 -9
  236. package/dist/flows/Termination/hooks.d.ts +6 -5
  237. package/dist/flows/Termination/hooks.js +1 -1
  238. package/dist/flows/Termination/index.d.ts +8 -7
  239. package/dist/flows/Termination/index.js +1 -1
  240. package/dist/flows/Termination/json-schemas/employeeComunication.js +1 -1
  241. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  242. package/dist/flows/Termination/json-schemas/schema.d.ts +6 -5
  243. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  244. package/dist/flows/Termination/types.d.ts +6 -5
  245. package/dist/flows/Termination/utils.d.ts +6 -5
  246. package/dist/flows/Termination/utils.js +1 -1
  247. package/dist/flows/types.d.ts +4 -21
  248. package/dist/index.d.ts +11 -10
  249. package/dist/index.js +1 -1
  250. package/dist/index.js.map +1 -1
  251. package/dist/internals.d.ts +5 -1
  252. package/dist/internals.js +1 -1
  253. package/dist/{mutations-C051uRcC.d.ts → mutations-Dhsqyt9R.d.ts} +1 -1
  254. package/dist/{remoteFlows-B9Nl1qjN.d.ts → remoteFlows-8lgzhRZb.d.ts} +3 -2
  255. package/dist/{types-DqaKYRUE.d.ts → types-7X9Do4Qx.d.ts} +8 -8
  256. package/dist/{types-Ckh2r3F3.d.ts → types-BH1usu8z.d.ts} +1 -1
  257. package/dist/{types-Ci-EdBDb.d.ts → types-CR6ZHxiM.d.ts} +10 -11
  258. package/dist/{types-Dx-2ocvG.d.ts → types-CgFQV0b1.d.ts} +9 -10
  259. package/dist/{types.gen-D2nbxMA0.d.ts → types.gen-q3-YX6jr.d.ts} +1 -1
  260. package/dist/{utils-CjDMg_Yr.d.ts → utils-CGX-jPIw.d.ts} +1 -0
  261. package/package.json +1 -2
  262. package/dist/chunk-2Y3SXQ5B.js.map +0 -1
  263. package/dist/chunk-3F77NXWU.js +0 -2
  264. package/dist/chunk-3F77NXWU.js.map +0 -1
  265. package/dist/chunk-5C3NU7R3.js +0 -2
  266. package/dist/chunk-5C3NU7R3.js.map +0 -1
  267. package/dist/chunk-5LSHRCAR.js +0 -2
  268. package/dist/chunk-5LSHRCAR.js.map +0 -1
  269. package/dist/chunk-6GTRAHWJ.js +0 -2
  270. package/dist/chunk-6GTRAHWJ.js.map +0 -1
  271. package/dist/chunk-7COHIUGW.js.map +0 -1
  272. package/dist/chunk-ARTSDUSS.js.map +0 -1
  273. package/dist/chunk-DV6PCBAX.js +0 -2
  274. package/dist/chunk-DV6PCBAX.js.map +0 -1
  275. package/dist/chunk-EDVJBPCB.js +0 -2
  276. package/dist/chunk-EDVJBPCB.js.map +0 -1
  277. package/dist/chunk-EHAZWZ3O.js +0 -2
  278. package/dist/chunk-EHAZWZ3O.js.map +0 -1
  279. package/dist/chunk-ERRQIROU.js +0 -2
  280. package/dist/chunk-ERRQIROU.js.map +0 -1
  281. package/dist/chunk-ETYRNQJJ.js +0 -2
  282. package/dist/chunk-ETYRNQJJ.js.map +0 -1
  283. package/dist/chunk-EYQ4PYUT.js.map +0 -1
  284. package/dist/chunk-GCTHZSIN.js +0 -2
  285. package/dist/chunk-GCTHZSIN.js.map +0 -1
  286. package/dist/chunk-GHJBEQIR.js +0 -2
  287. package/dist/chunk-GHJBEQIR.js.map +0 -1
  288. package/dist/chunk-GP6PRZVX.js +0 -2
  289. package/dist/chunk-GP6PRZVX.js.map +0 -1
  290. package/dist/chunk-HZVYZQ3Z.js +0 -2
  291. package/dist/chunk-HZVYZQ3Z.js.map +0 -1
  292. package/dist/chunk-IWA5B4U6.js +0 -2
  293. package/dist/chunk-L3Z2G32A.js.map +0 -1
  294. package/dist/chunk-LQBVRVXH.js +0 -2
  295. package/dist/chunk-LQBVRVXH.js.map +0 -1
  296. package/dist/chunk-OFI5KLQ4.js +0 -2
  297. package/dist/chunk-OFI5KLQ4.js.map +0 -1
  298. package/dist/chunk-OXL3QGHT.js.map +0 -1
  299. package/dist/chunk-RR55GUDT.js +0 -2
  300. package/dist/chunk-RR55GUDT.js.map +0 -1
  301. package/dist/chunk-SIYKTLFS.js +0 -2
  302. package/dist/chunk-SIYKTLFS.js.map +0 -1
  303. package/dist/chunk-SXR333SU.js +0 -2
  304. package/dist/chunk-SXR333SU.js.map +0 -1
  305. package/dist/chunk-Y2NSR2N6.js +0 -2
  306. package/dist/chunk-Y2NSR2N6.js.map +0 -1
  307. package/dist/chunk-ZYRGEEPU.js +0 -2
  308. package/dist/chunk-ZYRGEEPU.js.map +0 -1
  309. /package/dist/{PdfPreview-6C3GGXIN.js.map → PdfPreview-2VXVDUFP.js.map} +0 -0
  310. /package/dist/{chunk-N6BBMT7W.js.map → chunk-26Y25KF6.js.map} +0 -0
  311. /package/dist/{chunk-IBHNWMMB.js.map → chunk-2MX3WPCK.js.map} +0 -0
  312. /package/dist/{chunk-UA6MNQLD.js.map → chunk-3BOFG6MK.js.map} +0 -0
  313. /package/dist/{chunk-AT7VHJMW.js.map → chunk-3DRSYLBM.js.map} +0 -0
  314. /package/dist/{chunk-C4DLDK36.js.map → chunk-3NMCXHSQ.js.map} +0 -0
  315. /package/dist/{chunk-OP72BS23.js.map → chunk-447M3MFN.js.map} +0 -0
  316. /package/dist/{chunk-VBO75DXV.js.map → chunk-4G2UMXRE.js.map} +0 -0
  317. /package/dist/{chunk-GE5DH3UF.js.map → chunk-4GXONSSK.js.map} +0 -0
  318. /package/dist/{chunk-M2TLNSTK.js.map → chunk-4OVFMUUJ.js.map} +0 -0
  319. /package/dist/{chunk-EC7QVRRX.js.map → chunk-4UAHJOHZ.js.map} +0 -0
  320. /package/dist/{chunk-QUQLW5YW.js.map → chunk-5JQMTMHR.js.map} +0 -0
  321. /package/dist/{chunk-NDQ6UQFG.js.map → chunk-5S54GMUJ.js.map} +0 -0
  322. /package/dist/{chunk-OKM7DRCF.js.map → chunk-6CASSN2Z.js.map} +0 -0
  323. /package/dist/{chunk-IWA5B4U6.js.map → chunk-6DHV4GT6.js.map} +0 -0
  324. /package/dist/{chunk-LG2LVO4C.js.map → chunk-6E467YF3.js.map} +0 -0
  325. /package/dist/{chunk-XRI6PRXK.js.map → chunk-6E5GX7W3.js.map} +0 -0
  326. /package/dist/{chunk-T6HCUFYI.js.map → chunk-765OB2K5.js.map} +0 -0
  327. /package/dist/{chunk-2FQ2KNP4.js.map → chunk-ADOJOLLL.js.map} +0 -0
  328. /package/dist/{chunk-35RMJMSH.js.map → chunk-AF3YOXUE.js.map} +0 -0
  329. /package/dist/{chunk-44IOQYR2.js.map → chunk-AFGXZINW.js.map} +0 -0
  330. /package/dist/{chunk-6S6H4NAQ.js.map → chunk-AL2HSQPC.js.map} +0 -0
  331. /package/dist/{chunk-Z6TCBVRG.js.map → chunk-B2OOX56F.js.map} +0 -0
  332. /package/dist/{chunk-Y5P5IJRN.js.map → chunk-BPIGB72P.js.map} +0 -0
  333. /package/dist/{chunk-EGRGQWIY.js.map → chunk-CM2YPABC.js.map} +0 -0
  334. /package/dist/{chunk-66N57DKF.js.map → chunk-CR7AIZKA.js.map} +0 -0
  335. /package/dist/{chunk-WCEHP5N7.js.map → chunk-CWAUKF77.js.map} +0 -0
  336. /package/dist/{chunk-A3GZSC5Z.js.map → chunk-CX735AP4.js.map} +0 -0
  337. /package/dist/{chunk-3CFU6LKQ.js.map → chunk-ER7DFMME.js.map} +0 -0
  338. /package/dist/{chunk-NABPCULM.js.map → chunk-FQQKCROC.js.map} +0 -0
  339. /package/dist/{chunk-5DKNCKV7.js.map → chunk-GAF5TFZJ.js.map} +0 -0
  340. /package/dist/{chunk-UOOUV52J.js.map → chunk-GGPEKIIH.js.map} +0 -0
  341. /package/dist/{chunk-72OH7PSF.js.map → chunk-GPLI6GGL.js.map} +0 -0
  342. /package/dist/{chunk-PMTKQME6.js.map → chunk-ILOKQ6OH.js.map} +0 -0
  343. /package/dist/{chunk-PZNXAOZH.js.map → chunk-JS3H25UQ.js.map} +0 -0
  344. /package/dist/{chunk-KKGRYDZA.js.map → chunk-K3XVYHGV.js.map} +0 -0
  345. /package/dist/{chunk-ZIN2OWTH.js.map → chunk-LAXQMTDQ.js.map} +0 -0
  346. /package/dist/{chunk-MEZ7LYUK.js.map → chunk-LFQDVSKU.js.map} +0 -0
  347. /package/dist/{chunk-MXLQEDRJ.js.map → chunk-LHNX27TY.js.map} +0 -0
  348. /package/dist/{chunk-3Z6AFLXW.js.map → chunk-LSNMODBH.js.map} +0 -0
  349. /package/dist/{chunk-A65WMO6K.js.map → chunk-NP3HE6QX.js.map} +0 -0
  350. /package/dist/{chunk-LKMPZJIW.js.map → chunk-NY7LII5R.js.map} +0 -0
  351. /package/dist/{chunk-F3KEIVSE.js.map → chunk-PC5JG4TT.js.map} +0 -0
  352. /package/dist/{chunk-LJGCFFAT.js.map → chunk-PJN2YJO4.js.map} +0 -0
  353. /package/dist/{chunk-VXA6RPA5.js.map → chunk-PS6EXVKH.js.map} +0 -0
  354. /package/dist/{chunk-EQOU2VPX.js.map → chunk-Q2JVGEYM.js.map} +0 -0
  355. /package/dist/{chunk-LJVV6MMB.js.map → chunk-SQVJRTTA.js.map} +0 -0
  356. /package/dist/{chunk-Z2WV73EX.js.map → chunk-T6KVMOX7.js.map} +0 -0
  357. /package/dist/{chunk-6P4DTWYK.js.map → chunk-U2HWB5HI.js.map} +0 -0
  358. /package/dist/{chunk-QIVDIOJG.js.map → chunk-XGECMN4V.js.map} +0 -0
  359. /package/dist/{chunk-BVDT43OO.js.map → chunk-XTXPKDZ7.js.map} +0 -0
  360. /package/dist/{chunk-TVJYCR33.js.map → chunk-XXPJHT5A.js.map} +0 -0
  361. /package/dist/{chunk-BL7OYWNX.js.map → chunk-XXXQA4SY.js.map} +0 -0
  362. /package/dist/{chunk-HDNBZ6CB.js.map → chunk-Z3AKMQ4S.js.map} +0 -0
  363. /package/dist/{chunk-4GDEWYZC.js.map → chunk-Z5A2M5EU.js.map} +0 -0
  364. /package/dist/{chunk-KGKDSOER.js.map → chunk-ZFKHCC4Z.js.map} +0 -0
  365. /package/dist/{chunk-FZDQ7EEI.js.map → chunk-ZT72WOPZ.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{a as Q}from"./chunk-6DHV4GT6.js";import{a as J}from"./chunk-3DRSYLBM.js";import{a as U}from"./chunk-B2OOX56F.js";import{a as Z}from"./chunk-6E5GX7W3.js";import{a as K}from"./chunk-26Y25KF6.js";import{a as R}from"./chunk-XGECMN4V.js";import{a as g,b as N,c as B,d as q,e as A}from"./chunk-5JQMTMHR.js";import{c as H,d as L}from"./chunk-GFVGV76O.js";import{a as z}from"./chunk-ZXGAFQXW.js";import{a as _,b as O}from"./chunk-NY7LII5R.js";import{a as I}from"./chunk-KDI2AVBF.js";import{a as v}from"./chunk-2YTBWEC7.js";import{a as w}from"./chunk-P5QKSFOE.js";import{m as h}from"./chunk-W3YE53JN.js";import{a as E}from"./chunk-PJBAQZ6G.js";import{a as b}from"./chunk-Z5WMKCRJ.js";import{d as D}from"./chunk-KQPDXXG3.js";import{d as p}from"./chunk-HRG5MSVG.js";import{a as $}from"./chunk-UQCSN47K.js";import{a as o}from"./chunk-P37U34EQ.js";import Te from"lodash.omitby";import Fe from"lodash.isnull";import{format as S,isFuture as Me,parseISO as x,subDays as ge}from"date-fns";import{useMemo as j}from"react";import Se from"lodash.omit";import{useQuery as pe}from"@tanstack/react-query";var W=o(({query:t,options:e})=>{let{client:u}=D();return pe({queryKey:["payroll-calendars"],queryFn:o(()=>h({client:u,query:{year:t?.year,country_code:t?.countryCode}}),"queryFn"),enabled:e?.enabled,select:o(c=>c.data?.data?.payroll_calendars?.[0],"select")})},"usePayrollCalendars");import{isFuture as _e,isToday as ue,parseISO as ye}from"date-fns";var Y=o(t=>{if(!t)return!1;let e=ye(t);return _e(e)||ue(e)},"isInProbationPeriod");import{Fragment as xe,jsx as m,jsxs as je}from"react/jsx-runtime";var ro=o(({employmentId:t,options:e,initialValues:u})=>{let{fieldValues:c,setFieldValues:G,stepState:l,previousStep:X,nextStep:ee}=E(N),{data:n}=I({employmentId:t}),{data:oe}=W({query:{year:new Date().getFullYear().toString(),countryCode:n?.country?.code},options:{enabled:!!n?.country?.code}}),y=Y(n?.probation_period_end_date),T=B(oe),V=j(()=>y?S(new Date,"yyyy-MM-dd"):S(T,"yyyy-MM-dd"),[y,T]),F=!!(n?.provisional_start_date&&Me(x(n.provisional_start_date))),M=A({...u,...l.values?.employee_communication,...l.values?.termination_details,...l.values?.paid_time_off,...l.values?.additional_information},F),d=j(()=>({...M,...c}),[c,M]),P=q({minTerminationDate:T,isEmployeeInProbationPeriod:y,selectedDate:x(d.proposed_termination_date)}),ie=j(()=>{let s=z.data.schema.properties.termination_reason.oneOf,a=F?s.filter(i=>i.const==="cancellation_before_start_date"):s.filter(i=>i.const!=="cancellation_before_start_date");return{fields:{risk_assesment_info:g("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),termination_reason:{...e?.jsfModify?.fields?.termination_reason,oneOf:a},proposed_termination_date_info:g("Proposed termination date",je(xe,{children:["In most cases, Remote must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",m(O,{external:!0,zendeskId:_.terminationNoticePeriods,className:$("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:V,...d.termination_reason==="cancellation_before_start_date"&&n?.provisional_start_date?{maxDate:S(ge(x(n.provisional_start_date),1),"yyyy-MM-dd")}:{},...P},...d.termination_reason==="cancellation_before_start_date"?{"x-jsf-errorMessage":{maximum:"The proposed termination date must be before the employee's start date."}}:{}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return m(K,{employeeName:n?.basic_information?.name,proposedTerminationDate:d.proposed_termination_date,employmentId:t,employment:n,render:r=>i?m(i,{...r}):m(Z,{...r})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return m(Q,{render:r=>i?m(i,{...r}):m(J,{...r})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:o(()=>{let i={involuntaryOffboardingServiceChargeZendeskId:_.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:_.reconciliationInvoice},r=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return r?m(r,{...i}):m(U,{...i})},"Component")}}}}},[n,t,d.proposed_termination_date,d.termination_reason,F,V,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.termination_reason,P]),{data:f,isLoading:te}=L({formValues:d,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...ie?.fields}},step:l.currentStep.name}),ne=w(R.data.schema),k=H(),{mutateAsync:ae}=v(k);async function re(s){if(!t)throw new Error("Employment id is missing");if(f){let a=await C(s,!0),{customer_informed_employee:i}=a,r=i==="yes"?{employee_awareness:{date:a.customer_informed_employee_date,note:a.customer_informed_employee_description}}:void 0,fe=await b(a,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),le=Se(fe,"customer_informed_employee_date","customer_informed_employee_description"),ce=Te({...le,...r},Fe);return ae({employment_id:t,termination_details:ce,type:"termination"})}}o(re,"onSubmit");function se(){X()}o(se,"back");function me(){ee()}o(me,"next");let de=Object.keys(c).length>0,C=o(async(s,a=!1)=>a?await p(s,ne.fields,{isPartialValidation:!0}):f?await p(s,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");return{employmentId:t,employment:n,fieldValues:d,isDirty:de,stepState:l,fields:f?.fields||[],isLoading:te,isSubmitting:k.isPending,initialValues:M,handleValidation:o(async s=>{if(f){let a=await p(s,f?.fields);return f?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:G,parseFormValues:C,onSubmit:re,back:se,next:me}},"useTermination");export{ro as a};
2
+ //# sourceMappingURL=chunk-ZUNMNGRC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/common/api/payroll-calendars.ts","../src/common/employment.ts"],"sourcesContent":["import { $TSFixMe } from '@/src/types/remoteFlows';\nimport { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format, isFuture, parseISO, subDays } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n EmployeeCommunicationFormValues,\n PaidTimeOffFormValues,\n TerminationDetailsFormValues,\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport {\n buildInitialValues,\n calculateMinTerminationDate,\n calculateProposedTerminationDateStatement,\n STEPS,\n} from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { terminationDetailsSchema } from '@/src/flows/Termination/json-schemas/terminationDetails';\nimport {\n useCreateTermination,\n useTerminationSchema,\n} from '@/src/flows/Termination/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api';\nimport { AcknowledgeInformationContainer } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer';\nimport { AcknowledgeInformation } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation';\nimport { AcknowledgeInformationFees } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees';\nimport { usePayrollCalendars } from '@/src/common/api/payroll-calendars';\nimport { isInProbationPeriod } from '@/src/common/employment';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmploymentQuery({ employmentId });\n\n const { data: payrollCalendars } = usePayrollCalendars({\n query: {\n year: new Date().getFullYear().toString(),\n countryCode: employment?.country?.code,\n },\n options: {\n enabled: Boolean(employment?.country?.code),\n },\n });\n\n const isEmployeeInProbationPeriod = isInProbationPeriod(\n employment?.probation_period_end_date,\n );\n\n const minTerminationDate = calculateMinTerminationDate(payrollCalendars);\n const minDate = useMemo(\n () =>\n isEmployeeInProbationPeriod\n ? format(new Date(), 'yyyy-MM-dd')\n : format(minTerminationDate, 'yyyy-MM-dd'),\n [isEmployeeInProbationPeriod, minTerminationDate],\n );\n\n const hasFutureStartDate = Boolean(\n employment?.provisional_start_date &&\n isFuture(parseISO(employment.provisional_start_date)),\n );\n\n const initialValues = buildInitialValues(\n {\n ...terminationInitialValues,\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n },\n hasFutureStartDate,\n );\n\n const formValues = useMemo(\n () => ({\n ...initialValues,\n ...fieldValues,\n }),\n [fieldValues, initialValues],\n );\n\n const proposedTerminationDateStatement =\n calculateProposedTerminationDateStatement({\n minTerminationDate,\n isEmployeeInProbationPeriod,\n selectedDate: parseISO(formValues.proposed_termination_date),\n });\n\n const customFields = useMemo(() => {\n const originalTerminationReasonOptions =\n terminationDetailsSchema.data.schema.properties.termination_reason.oneOf;\n\n const terminationReasonOptions = hasFutureStartDate\n ? originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const === 'cancellation_before_start_date',\n )\n : originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const !== 'cancellation_before_start_date',\n );\n\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n termination_reason: {\n ...(options?.jsfModify?.fields?.termination_reason as $TSFixMe),\n oneOf: terminationReasonOptions,\n },\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, Remote must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n external\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: minDate,\n ...(formValues.termination_reason ===\n 'cancellation_before_start_date' &&\n employment?.provisional_start_date\n ? {\n maxDate: format(\n subDays(parseISO(employment.provisional_start_date), 1),\n 'yyyy-MM-dd',\n ),\n }\n : {}),\n ...proposedTerminationDateStatement,\n },\n ...(formValues.termination_reason === 'cancellation_before_start_date'\n ? {\n 'x-jsf-errorMessage': {\n maximum:\n \"The proposed termination date must be before the employee's start date.\",\n },\n }\n : {}),\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <AcknowledgeInformationContainer\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <AcknowledgeInformation {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_fees_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const zendeskIds = {\n involuntaryOffboardingServiceChargeZendeskId:\n zendeskArticles.involuntaryOffboardingServiceCharge,\n reconciliationInvoiceZendeskId:\n zendeskArticles.reconciliationInvoice,\n };\n\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n if (CustomComponent) {\n return <CustomComponent {...zendeskIds} />;\n }\n\n return <AcknowledgeInformationFees {...zendeskIds} />;\n },\n },\n },\n },\n };\n }, [\n employment,\n employmentId,\n formValues.proposed_termination_date,\n formValues.termination_reason,\n hasFutureStartDate,\n minDate,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_info,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.termination_reason,\n proposedTerminationDateStatement,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n const parsedValues = (await parseFormValues(\n values,\n true,\n )) as TerminationFormValues;\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = await parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n const isDirty = Boolean(Object.keys(fieldValues).length > 0);\n\n const parseFormValues = async (\n values: TerminationFormValues,\n includeAllFields: boolean = false,\n ): Promise<\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues\n | TerminationFormValues\n > => {\n if (includeAllFields) {\n return (await parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n })) as TerminationFormValues;\n }\n\n if (terminationHeadlessForm) {\n return (await parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n {\n isPartialValidation: true,\n },\n )) as\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues;\n }\n return {} as $TSFixMe;\n };\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Employment data\n */\n employment,\n\n /**\n * Current form field values, we use formValues to let the user know about all the current form values\n */\n fieldValues: formValues,\n\n /**\n * Indicates if the form is dirty\n */\n isDirty,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: async (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = await parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\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 * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\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 * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { getIndexEorPayrollCalendar } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@/src/client/client';\n\nexport const usePayrollCalendars = ({\n query,\n options,\n}: {\n query?: {\n year?: string;\n countryCode?: string;\n };\n options?: {\n enabled?: boolean;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['payroll-calendars'],\n queryFn: () =>\n getIndexEorPayrollCalendar({\n client: client as Client,\n query: {\n year: query?.year,\n country_code: query?.countryCode,\n },\n }),\n enabled: options?.enabled,\n select: (data) => data.data?.data?.payroll_calendars?.[0],\n });\n};\n","import { isFuture, isToday, parseISO } from 'date-fns';\n\nexport const isInProbationPeriod = (probationEndDate: string | undefined) => {\n if (!probationEndDate) return false;\n\n const parsedProbationEndDate = parseISO(probationEndDate);\n\n return isFuture(parsedProbationEndDate) || isToday(parsedProbationEndDate);\n};\n"],"mappings":"00BAEA,OAAOA,OAAY,gBACnB,OAAOC,OAAY,gBACnB,OAAS,UAAAC,EAAQ,YAAAC,GAAU,YAAAC,EAAU,WAAAC,OAAe,WACpD,OAAS,WAAAC,MAAe,QAcxB,OAAOC,OAAU,cCnBjB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,EAAsBC,EAAA,CAAC,CAClC,MAAAC,EACA,QAAAC,CACF,IAQM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,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CA5DepE,EAAA0D,GAAA,YA8Df,SAASa,IAAO,CACdhE,EAAa,CACf,CAFSP,EAAAuE,GAAA,QAIT,SAASC,IAAO,CACdhE,GAAS,CACX,CAFSR,EAAAwE,GAAA,QAIT,IAAMC,GAAkB,OAAO,KAAKrE,CAAW,EAAE,OAAS,EAEpDyD,EAAkB7D,EAAA,MACtB2D,EACAe,EAA4B,KAOxBA,EACM,MAAMC,EAAmBhB,EAAQR,GAAwB,OAAQ,CACvE,oBAAqB,EACvB,CAAC,EAGCH,EACM,MAAM2B,EACZhB,EACAX,GAAyB,OACzB,CACE,oBAAqB,EACvB,CACF,EAKK,CAAC,EA3Bc,mBA8BxB,MAAO,CAIL,aAAA/C,EAIA,WAAAU,EAKA,YAAagB,EAKb,QAAA8C,GAIA,UAAAnE,EAIA,OAAQ0C,GAAyB,QAAU,CAAC,EAI5C,UAAWC,GAIX,aAAcK,EAAkB,UAIhC,cAAe7B,EAMf,iBAAkBzB,EAAA,MAAO2D,GAAkC,CACzD,GAAIX,EAAyB,CAC3B,IAAMY,EAAe,MAAMe,EACzBhB,EACAX,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBY,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAclB,kBAAmBvD,EAMnB,gBAAAwD,EAMA,SAAAH,GAMA,KAAAa,GAMA,KAAAC,EACF,CACF,EAzc8B","names":["omitBy","isNull","format","isFuture","parseISO","subDays","useMemo","omit","useQuery","usePayrollCalendars","__name","query","options","client","useClient","useQuery","getIndexEorPayrollCalendar","data","isFuture","isToday","parseISO","isInProbationPeriod","__name","probationEndDate","parsedProbationEndDate","parseISO","isFuture","isToday","Fragment","jsx","jsxs","useTermination","__name","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmploymentQuery","payrollCalendars","usePayrollCalendars","isEmployeeInProbationPeriod","isInProbationPeriod","minTerminationDate","calculateMinTerminationDate","minDate","useMemo","format","hasFutureStartDate","isFuture","parseISO","initialValues","buildInitialValues","formValues","proposedTerminationDateStatement","calculateProposedTerminationDateStatement","customFields","originalTerminationReasonOptions","terminationDetailsSchema","terminationReasonOptions","option","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","subDays","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","AcknowledgeInformationContainer","AcknowledgeInformation","zendeskIds","AcknowledgeInformationFees","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseFormValues","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next","isDirty","includeAllFields","parseJSFToValidate"]}
@@ -0,0 +1,2 @@
1
+ import{a as ut,b as pt,c as ft,d as yt}from"./chunk-LOHRUY4J.js";import{a as at,b as it,c as st,e as ct,f as lt,g as dt,h as mt}from"./chunk-CATDB2YM.js";import{a as ot,b as rt}from"./chunk-3UDG4IJO.js";import{a as X,f as Z,h as tt,k as et}from"./chunk-W4KHMUDZ.js";import{c as z,d as Q}from"./chunk-H6YNMT4M.js";import{a as E}from"./chunk-2YTBWEC7.js";import{a as nt}from"./chunk-PJBAQZ6G.js";import{d as f,e as C}from"./chunk-HRG5MSVG.js";import{g as V}from"./chunk-UQCSN47K.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Qt,useMemo as c,useRef as Xt,useState as J}from"react";var Zt={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},te={employment_basic_information:"basic_information"},ee=new Date().toISOString().split("T")[0],fe=p(({countryCode:_t,externalId:St,employmentId:y,skipSteps:gt,options:P,initialValues:i})=>{let[a,A]=J(_t||null),[r,bt]=J(y),[T,Ct]=J(void 0),O=Xt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),wt=gt?.includes("select_country")?pt:ut,{fieldValues:m,stepState:e,setFieldValues:Ft,previousStep:vt,nextStep:ht,goToStep:I,setStepValues:B}=nt(wt),{data:s,isLoading:R,refetch:Vt}=X(r),{status:_}=s||{},L=_&&z.includes(_),Et=_&&!Q.includes(_),Pt=c(()=>_==="invited"?"invited":"not_invited",[_]),q=tt(),N=lt(),x=it(),Ot=ct(),{mutateAsync:Mt}=E(q),{mutateAsync:Dt}=E(N),{mutateAsync:Tt}=E(x),{mutateAsync:U}=E(Ot);y&&s?.country?.code&&!a&&A(s.country.code);let{selectCountryForm:M,isLoading:It}=et({jsfModify:P?.jsfModify?.select_country,queryOptions:{enabled:e.currentStep.name==="select_country"}}),{form:H,isLoading:Rt}=mt(r,{jsonSchemaVersion:P?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="pricing_plan"}}),Lt=Zt[e.currentStep.name]||"contractor_basic_information",jt=te[Lt],kt=s?.[jt]||{},Jt=p(({form:t,options:o={},query:g={}})=>{let b=Object.keys(m).length>0?{...i,...e.values?.[e.currentStep.name],...m}:{...i,...kt};return Z({countryCode:a,form:t,fieldValues:b,query:g,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),At=!!(a&&(e.currentStep.name==="basic_information"||y)),Bt=!!(a&&(e.currentStep.name==="contract_details"||y)),{data:l,isLoading:qt}=Jt({form:"contractor_basic_information",options:{jsfModify:P?.jsfModify?.basic_information,queryOptions:{enabled:At}}}),Nt=c(()=>ft(s?.basic_information?.provisional_start_date,m?.service_duration?.provisional_start_date),[s?.basic_information?.provisional_start_date,m?.service_duration?.provisional_start_date]),{data:d,isLoading:xt}=dt({countryCode:a,fieldValues:m,options:{queryOptions:{enabled:Bt},jsfModify:yt(P?.jsfModify?.contract_details,Nt)}}),{data:u}=at({fieldValues:m,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Ut,isLoading:Ht}=st({employmentId:r,contractDocumentId:T,options:{queryOptions:{enabled:!!T}}}),n=c(()=>({select_country:M?.fields||[],basic_information:l?.fields||[],pricing_plan:H?.fields||[],contract_details:d?.fields||[],contract_preview:u?.fields||[],review:[]}),[M?.fields,l?.fields,H?.fields,d?.fields,u?.fields]),Gt={select_country:null,basic_information:l?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:d?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Wt,basic_information:D={},contract_details:S={}}=s||{},G=Wt?.code,w=c(()=>C(n.select_country,{country:a||G||""}),[n.select_country,a,G]),F=c(()=>{let t={provisional_start_date:ee,...i,...D};return C(n.basic_information,t)},[n.basic_information,D,i]),v=c(()=>{let o={...{service_duration:{provisional_start_date:D.provisional_start_date}},...i,...S};return C(n.contract_details,o)},[n.contract_details,S,i,D]),W=c(()=>{let t={...i,...S};return C(n.contract_preview,t)},[n.contract_preview,S,i]),$=c(()=>{let t={...i,...S};return C(n.pricing_plan,t?.pricing_plan??{})},[n.pricing_plan,S,i]),$t=c(()=>({select_country:w,basic_information:F,contract_details:v,contract_preview:W,pricing_plan:$}),[w,F,v,W,$]),K=c(()=>!!(!!(y&&L&&e.currentStep.name!=="review")&&!R&&n.basic_information.length>0&&n.contract_details.length>0),[y,L,R,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Qt(()=>{K&&(O.current={select_country:V(w,n.select_country),basic_information:V(F,n.basic_information),contract_details:V(v,n.contract_details),contract_preview:{},pricing_plan:{}},B({select_country:w,basic_information:F,contract_details:v,contract_preview:{},pricing_plan:{},review:{}}),I("review"))},[K,I,w,F,v,B,n.select_country,n.basic_information,n.contract_details]);let Kt=p(t=>{I(t)},"goTo"),Y=p(async t=>M&&e.currentStep.name==="select_country"?t:l&&e.currentStep.name==="basic_information"?await f(t,l?.fields,{isPartialValidation:!1}):d&&e.currentStep.name==="contract_details"?await f(t,d?.fields,{isPartialValidation:!1}):u&&e.currentStep.name==="contract_preview"?await f(t,u?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Yt(t){let o=e.currentStep.name;o in O.current&&(O.current[o]=V(t,n[o]));let g=await Y(t);switch(e.currentStep.name){case"select_country":return A(g.country),Promise.resolve({data:{countryCode:g.country}});case"basic_information":{let j=!r&&a,b=r&&a&&s?.country&&s?.country.code!==a;if(j||b){let k={basic_information:g,type:"contractor",country_code:a,external_id:St};try{let h=await Mt(k),zt=h.data?.data?.employment?.id;return bt(zt),h}catch(h){throw console.error("Error creating onboarding:",h),h}}else if(r)return Promise.resolve({data:{employmentId:r}});return}case"contract_details":{let b=await Dt({employmentId:r,payload:{contract_document:g}}),k=b.data?.data?.contract_document?.id;return Ct(k),b}case"contract_preview":return Tt({employmentId:r,contractDocumentId:T,payload:{signature:t.signature}});case"pricing_plan":return t.subscription==ot?U({employmentId:r,payload:{operation:"downgrade"}}):t.subscription==rt?U({employmentId:r,payload:{operation:"upgrade"}}):Promise.reject({error:"invalid selection"});default:throw new Error("Invalid step state")}}return p(Yt,"onSubmit"),{isLoading:It||qt||R||xt||Rt||Ht,fieldValues:m,stepState:e,checkFieldUpdates:Ft,back:vt,next:ht,goTo:Kt,onSubmit:Yt,fields:n[e.currentStep.name],meta:{fields:O.current,fieldsets:Gt[e.currentStep.name]},parseFormValues:Y,handleValidation:p(async t=>{if(e.currentStep.name==="select_country")return M.handleValidation(t);if(l&&e.currentStep.name==="basic_information"){let o=await f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(d&&e.currentStep.name==="contract_details"){let o=await f(t,d?.fields,{isPartialValidation:!1});return d?.handleValidation(o)}if(u&&e.currentStep.name==="contract_preview"){let o=await f(t,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{}}:null},"handleValidation"),initialValues:$t,employmentId:r,refetchEmployment:Vt,isSubmitting:q.isPending||N.isPending||x.isPending,documentPreviewPdf:Ut,canInvite:Et,isEmploymentReadOnly:L,invitedStatus:Pt,employment:s}},"useContractorOnboarding");export{fe as a};
2
+ //# sourceMappingURL=chunk-ZZPYYZNT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\nimport { JSFFields } from '@/src/types/remoteFlows';\nimport {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n usePostManageContractorSubscriptions,\n useContractorSubscriptionSchemaField,\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 calculateProvisionalStartDateDescription,\n buildContractDetailsJsfModify,\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 {\n contractorStandardProductIdentifier,\n contractorPlusProductIdentifier,\n} from '@/src/flows/ContractorOnboarding/constants';\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\nconst provisionalStartDate = new Date().toISOString().split('T')[0];\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();\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const signContractDocumentMutation = useSignContractDocument();\n const manageContractorSubscriptionMutation =\n usePostManageContractorSubscriptions();\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 const { mutateAsync: manageContractorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorSubscriptionMutation);\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 queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const {\n form: selectContractorSubscriptionForm,\n isLoading: isLoadingContractorSubscriptions,\n } = useContractorSubscriptionSchemaField(internalEmploymentId as string, {\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: stepState.currentStep.name === 'pricing_plan',\n },\n });\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'contractor_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: 'contractor_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n });\n\n const descriptionProvisionalStartDate = useMemo(() => {\n return calculateProvisionalStartDateDescription(\n employment?.basic_information?.provisional_start_date as string,\n fieldValues?.service_duration?.provisional_start_date as string,\n );\n }, [\n employment?.basic_information?.provisional_start_date,\n fieldValues?.service_duration?.provisional_start_date,\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: buildContractDetailsJsfModify(\n options?.jsfModify?.contract_details,\n descriptionProvisionalStartDate,\n ),\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, JSFFields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: selectContractorSubscriptionForm?.fields || [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n selectContractorSubscriptionForm?.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 provisional_start_date: provisionalStartDate,\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 hardcodedValues = {\n service_duration: {\n provisional_start_date:\n employmentBasicInformation.provisional_start_date,\n },\n };\n const initialValues = {\n ...hardcodedValues,\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n employmentBasicInformation,\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 pricingPlanInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(\n stepFields.pricing_plan,\n (initialValues?.pricing_plan ?? {}) as Record<string, unknown>,\n );\n }, [\n stepFields.pricing_plan,\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: pricingPlanInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n pricingPlanInitialValues,\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 = async (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 await parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return await 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 await parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\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 = await 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 // TODO: we'll need to check later if the provisional start date gets updated for the statement of work\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 case 'pricing_plan': {\n if (values.subscription == contractorStandardProductIdentifier) {\n return manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'downgrade',\n },\n });\n } else if (values.subscription == contractorPlusProductIdentifier) {\n return manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'upgrade',\n },\n });\n }\n return Promise.reject({ error: 'invalid selection' });\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 isLoadingContractorSubscriptions ||\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: async (\n values: FieldValues,\n ): Promise<ValidationResult | null> => {\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 = await 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 = await 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 = await 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 };\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":"ygBAAA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAsDrD,IAAMC,GAGF,CACF,eAAgB,KAChB,kBAAmB,+BACnB,iBAAkB,KAClB,aAAc,KACd,iBAAkB,KAClB,OAAQ,IACV,EAEMC,GAEF,CACF,6BAA8B,mBAChC,EAEMC,GAAuB,IAAI,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC,EAErDC,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,EAA6B,EAAIJ,EAElE,MAAS,EACLK,EAAgBC,GAMnB,CACD,eAAgB,CAAC,EACjB,kBAAmB,CAAC,EACpB,iBAAkB,CAAC,EACnB,iBAA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,EAAU,YAAY,OAAS,iBACjC,OAAO+B,EAAkB,iBAAiBiD,CAAM,EAGlD,GACEhC,GACAhD,EAAU,YAAY,OAAS,oBAC/B,CACA,IAAMoF,EAAe,MAAMH,EACzBD,EACAhC,GAAsB,OACtB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAsB,iBAAiBoC,CAAY,CAC5D,CAEA,GACEhC,GACApD,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAMoF,EAAe,MAAMH,EACzBD,EACA5B,GAAiC,OACjC,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAiC,iBAAiBgC,CAAY,CACvE,CAEA,GACE5B,GACAxD,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAMoF,EAAe,MAAMH,EACzBD,EACAxB,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAqB,iBAAiB4B,CAAY,CAC3D,CAEA,OAAIpF,EAAU,YAAY,OAAS,eAE1B,CACL,WAAY,CAAC,CACf,EAGK,IACT,EAnDkB,oBAwDlB,cAAAsE,GAKA,aAAchF,EAMd,kBAAmBmB,GAKnB,aACES,EAAyB,WACzBE,EAAyC,WACzCE,EAA6B,UAK/B,mBAAAoC,GAMA,UAAA5C,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAT,CACF,CACF,EAxvBuC","names":["useEffect","useMemo","useRef","useState","stepToFormSchemaMap","jsonSchemaToEmployment","provisionalStartDate","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","manageContractorSubscriptionMutation","usePostManageContractorSubscriptions","createEmploymentMutationAsync","mutationToPromise","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","manageContractorSubscriptionMutationAsync","selectCountryForm","isLoadingCountries","useCountriesSchemaField","selectContractorSubscriptionForm","isLoadingContractorSubscriptions","useContractorSubscriptionSchemaField","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","basicInformationForm","isLoadingBasicInformationForm","descriptionProvisionalStartDate","calculateProvisionalStartDateDescription","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","buildContractDetailsJsfModify","signatureSchemaForm","useGetContractDocumentSignatureSchema","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","pricingPlanInitialValues","isNavigatingToReview","useEffect","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","contractDocumentId","contractorStandardProductIdentifier","contractorPlusProductIdentifier"]}
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-F3KEIVSE.js";import"../../chunk-6GTRAHWJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-LJGCFFAT.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
1
+ import{a}from"../../chunk-PC5JG4TT.js";import"../../chunk-NFWNYW2E.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-PJN2YJO4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-UQCSN47K.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 { P as PostCreateContractAmendmentError, b as ContractAmendmentResponse } from '../../types.gen-D2nbxMA0.js';
2
+ import { P as PostCreateContractAmendmentError, b as ContractAmendmentResponse } from '../../types.gen-q3-YX6jr.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentConfirmationFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-KKGRYDZA.js";import"../../chunk-66N57DKF.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-PMTKQME6.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
1
+ import{a}from"../../chunk-K3XVYHGV.js";import"../../chunk-CR7AIZKA.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-ILOKQ6OH.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-UQCSN47K.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
2
2
  //# sourceMappingURL=ContractAmendmentConfirmationForm.js.map
@@ -5,14 +5,15 @@ 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-D2nbxMA0.js';
8
+ import '../../types.gen-q3-YX6jr.js';
9
9
  import 'react-hook-form';
10
10
  import 'react';
11
- import '../../mutations-C051uRcC.js';
12
- import '../../remoteFlows-B9Nl1qjN.js';
11
+ import '../../mutations-Dhsqyt9R.js';
12
+ import '../../remoteFlows-8lgzhRZb.js';
13
13
  import 'yup';
14
14
  import '../../types-ZWIpiFgj.js';
15
- import '@remoteoss/json-schema-form-old';
15
+ import '@remoteoss/json-schema-form';
16
+ import '@remoteoss/json-schema-form-v0-deprecated';
16
17
  import '../useStepState.js';
17
18
  import '../types.js';
18
19
  import '@remoteoss/remote-json-schema-form-kit';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-3Z6AFLXW.js";import"../../chunk-LG2LVO4C.js";import"../../chunk-EYQ4PYUT.js";import"../../chunk-LNV36S6D.js";import"../../chunk-EGRGQWIY.js";import"../../chunk-LKMPZJIW.js";import"../../chunk-KGKDSOER.js";import"../../chunk-Y2NSR2N6.js";import"../../chunk-DV6PCBAX.js";import"../../chunk-SXR333SU.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-W3YE53JN.js";import"../../chunk-OXL3QGHT.js";import"../../chunk-ZIN2OWTH.js";import"../../chunk-UOOUV52J.js";import"../../chunk-72OH7PSF.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-F3KEIVSE.js";import"../../chunk-6GTRAHWJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-LJGCFFAT.js";import"../../chunk-KKGRYDZA.js";import"../../chunk-66N57DKF.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-PMTKQME6.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-LSNMODBH.js";import"../../chunk-6E467YF3.js";import"../../chunk-BB2GHYJY.js";import"../../chunk-LNV36S6D.js";import"../../chunk-CM2YPABC.js";import"../../chunk-NY7LII5R.js";import"../../chunk-ZFKHCC4Z.js";import"../../chunk-OKMERBJL.js";import"../../chunk-PNRHCOPF.js";import"../../chunk-KDI2AVBF.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-P5QKSFOE.js";import"../../chunk-W3YE53JN.js";import"../../chunk-ZCXTTVGV.js";import"../../chunk-LAXQMTDQ.js";import"../../chunk-GGPEKIIH.js";import"../../chunk-GPLI6GGL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-PC5JG4TT.js";import"../../chunk-NFWNYW2E.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-PJN2YJO4.js";import"../../chunk-K3XVYHGV.js";import"../../chunk-CR7AIZKA.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-ILOKQ6OH.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-UQCSN47K.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 { c as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-D2nbxMA0.js';
2
+ import { c as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-q3-YX6jr.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-LG2LVO4C.js";import"../../chunk-EYQ4PYUT.js";import"../../chunk-LNV36S6D.js";import"../../chunk-EGRGQWIY.js";import"../../chunk-LKMPZJIW.js";import"../../chunk-KGKDSOER.js";import"../../chunk-W3YE53JN.js";import"../../chunk-ZIN2OWTH.js";import"../../chunk-UOOUV52J.js";import"../../chunk-72OH7PSF.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-LJGCFFAT.js";import"../../chunk-66N57DKF.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-PMTKQME6.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-6E467YF3.js";import"../../chunk-BB2GHYJY.js";import"../../chunk-LNV36S6D.js";import"../../chunk-CM2YPABC.js";import"../../chunk-NY7LII5R.js";import"../../chunk-ZFKHCC4Z.js";import"../../chunk-W3YE53JN.js";import"../../chunk-LAXQMTDQ.js";import"../../chunk-GGPEKIIH.js";import"../../chunk-GPLI6GGL.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-PJN2YJO4.js";import"../../chunk-CR7AIZKA.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-ILOKQ6OH.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-UQCSN47K.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-Y2NSR2N6.js";import"../../chunk-6GTRAHWJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-LJGCFFAT.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
1
+ import{a}from"../../chunk-OKMERBJL.js";import"../../chunk-NFWNYW2E.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-PJN2YJO4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-UQCSN47K.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
2
2
  //# sourceMappingURL=ContractAmendmentSubmit.js.map
@@ -1,10 +1,11 @@
1
- import { C as ContractAmendmentAutomatableResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, a as UnauthorizedResponse, b as ContractAmendmentResponse } from '../../types.gen-D2nbxMA0.js';
1
+ import { C as ContractAmendmentAutomatableResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, a as UnauthorizedResponse, b as ContractAmendmentResponse } from '../../types.gen-q3-YX6jr.js';
2
2
  import * as React from 'react';
3
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-C051uRcC.js';
4
- import '../../remoteFlows-B9Nl1qjN.js';
5
- import * as _remoteoss_json_schema_form_old from '@remoteoss/json-schema-form-old';
3
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-Dhsqyt9R.js';
4
+ import '../../remoteFlows-8lgzhRZb.js';
6
5
  import * as react_hook_form from 'react-hook-form';
7
6
  import { useContractAmendment } from './hooks.js';
7
+ import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
8
+ import * as _remoteoss_json_schema_form_v0_deprecated from '@remoteoss/json-schema-form-v0-deprecated';
8
9
  import { Step } from '../useStepState.js';
9
10
  import 'yup';
10
11
  import '../../types-ZWIpiFgj.js';
@@ -27,16 +28,16 @@ declare const useContractAmendmentContext: () => {
27
28
  confirmation_form: react_hook_form.FieldValues;
28
29
  } | null;
29
30
  };
30
- fields: _remoteoss_json_schema_form_old.Fields;
31
+ fields: _remoteoss_json_schema_form_v0_deprecated.Fields;
31
32
  isLoading: boolean;
32
33
  isError: boolean;
33
34
  error: Error | null;
34
35
  isSubmitting: boolean;
35
36
  initialValues: {};
36
37
  values: react_hook_form.FieldValues;
37
- handleValidation: (values: react_hook_form.FieldValues) => Promise<{
38
- yupError: _remoteoss_json_schema_form_old.$TSFixMe;
39
- formErrors: _remoteoss_json_schema_form_old.$TSFixMe;
38
+ handleValidation: (values: react_hook_form.FieldValues) => Promise<_remoteoss_json_schema_form.ValidationResult | {
39
+ yupError: _remoteoss_json_schema_form_v0_deprecated.$TSFixMe;
40
+ formErrors: _remoteoss_json_schema_form_v0_deprecated.$TSFixMe;
40
41
  } | null>;
41
42
  checkFieldUpdates: React.Dispatch<React.SetStateAction<react_hook_form.FieldValues>>;
42
43
  onSubmit: (values: react_hook_form.FieldValues) => Promise<ErrorResponse<Error> | SuccessResponse<({
@@ -1,11 +1,12 @@
1
- import { C as ContractAmendmentAutomatableResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, a as UnauthorizedResponse, b as ContractAmendmentResponse } from '../../types.gen-D2nbxMA0.js';
2
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-C051uRcC.js';
1
+ import { C as ContractAmendmentAutomatableResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, a as UnauthorizedResponse, b as ContractAmendmentResponse } from '../../types.gen-q3-YX6jr.js';
2
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-Dhsqyt9R.js';
3
3
  import * as React from 'react';
4
- import * as _remoteoss_json_schema_form_old from '@remoteoss/json-schema-form-old';
4
+ import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
+ import * as _remoteoss_json_schema_form_v0_deprecated from '@remoteoss/json-schema-form-v0-deprecated';
5
6
  import { Step } from '../useStepState.js';
6
- import { ContractAmendmentParams } from './types.js';
7
7
  import { FieldValues } from 'react-hook-form';
8
- import '../../remoteFlows-B9Nl1qjN.js';
8
+ import { ContractAmendmentParams } from './types.js';
9
+ import '../../remoteFlows-8lgzhRZb.js';
9
10
  import 'yup';
10
11
  import '../../types-ZWIpiFgj.js';
11
12
  import '../types.js';
@@ -26,7 +27,7 @@ declare const useContractAmendment: ({ employmentId, countryCode, options, }: Co
26
27
  /**
27
28
  * Array of form fields from the contract amendment schema
28
29
  */
29
- fields: _remoteoss_json_schema_form_old.Fields;
30
+ fields: _remoteoss_json_schema_form_v0_deprecated.Fields;
30
31
  /**
31
32
  * Loading state indicating if either employment or contract amendment data is being fetched
32
33
  */
@@ -56,9 +57,9 @@ declare const useContractAmendment: ({ employmentId, countryCode, options, }: Co
56
57
  * @param values - Form values to validate
57
58
  * @returns Validation result or null if no schema is available
58
59
  */
59
- handleValidation: (values: FieldValues) => Promise<{
60
- yupError: _remoteoss_json_schema_form_old.$TSFixMe;
61
- formErrors: _remoteoss_json_schema_form_old.$TSFixMe;
60
+ handleValidation: (values: FieldValues) => Promise<_remoteoss_json_schema_form.ValidationResult | {
61
+ yupError: _remoteoss_json_schema_form_v0_deprecated.$TSFixMe;
62
+ formErrors: _remoteoss_json_schema_form_v0_deprecated.$TSFixMe;
62
63
  } | null>;
63
64
  /**
64
65
  * Function to update the current form field values
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-DV6PCBAX.js";import"../../chunk-SXR333SU.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-W3YE53JN.js";import"../../chunk-OXL3QGHT.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
1
+ import{a}from"../../chunk-PNRHCOPF.js";import"../../chunk-KDI2AVBF.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-P5QKSFOE.js";import"../../chunk-W3YE53JN.js";import"../../chunk-ZCXTTVGV.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -4,16 +4,17 @@ 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-D2nbxMA0.js';
7
+ import '../../types.gen-q3-YX6jr.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
- import '../../remoteFlows-B9Nl1qjN.js';
13
+ import '../../remoteFlows-8lgzhRZb.js';
14
14
  import 'yup';
15
15
  import '../../types-ZWIpiFgj.js';
16
- import '@remoteoss/json-schema-form-old';
17
16
  import '@remoteoss/remote-json-schema-form-kit';
18
- import '../../mutations-C051uRcC.js';
17
+ import '../../mutations-Dhsqyt9R.js';
18
+ import '@remoteoss/json-schema-form';
19
+ import '@remoteoss/json-schema-form-v0-deprecated';
19
20
  import '../useStepState.js';
@@ -1,2 +1,2 @@
1
- import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-3Z6AFLXW.js";import{a as b}from"../../chunk-LG2LVO4C.js";import"../../chunk-EYQ4PYUT.js";import"../../chunk-LNV36S6D.js";import"../../chunk-EGRGQWIY.js";import"../../chunk-LKMPZJIW.js";import"../../chunk-KGKDSOER.js";import{a as c}from"../../chunk-Y2NSR2N6.js";import{a as d}from"../../chunk-DV6PCBAX.js";import"../../chunk-SXR333SU.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-W3YE53JN.js";import"../../chunk-OXL3QGHT.js";import"../../chunk-ZIN2OWTH.js";import"../../chunk-UOOUV52J.js";import"../../chunk-72OH7PSF.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-F3KEIVSE.js";import"../../chunk-6GTRAHWJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-LJGCFFAT.js";import{a}from"../../chunk-KKGRYDZA.js";import"../../chunk-66N57DKF.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-PMTKQME6.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-L3Z2G32A.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-LSNMODBH.js";import{a as b}from"../../chunk-6E467YF3.js";import"../../chunk-BB2GHYJY.js";import"../../chunk-LNV36S6D.js";import"../../chunk-CM2YPABC.js";import"../../chunk-NY7LII5R.js";import"../../chunk-ZFKHCC4Z.js";import{a as c}from"../../chunk-OKMERBJL.js";import{a as d}from"../../chunk-PNRHCOPF.js";import"../../chunk-KDI2AVBF.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-P5QKSFOE.js";import"../../chunk-W3YE53JN.js";import"../../chunk-ZCXTTVGV.js";import"../../chunk-LAXQMTDQ.js";import"../../chunk-GGPEKIIH.js";import"../../chunk-GPLI6GGL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-PC5JG4TT.js";import"../../chunk-NFWNYW2E.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-PJN2YJO4.js";import{a}from"../../chunk-K3XVYHGV.js";import"../../chunk-CR7AIZKA.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-ILOKQ6OH.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-UQCSN47K.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,11 +1,10 @@
1
1
  import { FlowOptions } from '../types.js';
2
- import '../../remoteFlows-B9Nl1qjN.js';
2
+ import '../../remoteFlows-8lgzhRZb.js';
3
3
  import 'react';
4
4
  import 'yup';
5
- import '../../types.gen-D2nbxMA0.js';
5
+ import '../../types.gen-q3-YX6jr.js';
6
6
  import '../../types-ZWIpiFgj.js';
7
7
  import 'react-hook-form';
8
- import '@remoteoss/json-schema-form-old';
9
8
  import '@remoteoss/remote-json-schema-form-kit';
10
9
 
11
10
  type ContractAmendmentParams = {
@@ -1,11 +1,13 @@
1
- import { E as Employment } from '../../types.gen-D2nbxMA0.js';
2
- import { Fields } from '@remoteoss/json-schema-form-old';
1
+ import { E as Employment } from '../../types.gen-q3-YX6jr.js';
2
+ import { J as JSFFields } from '../../remoteFlows-8lgzhRZb.js';
3
3
  import { Step } from '../useStepState.js';
4
4
  import 'react';
5
+ import 'yup';
6
+ import '../../types-ZWIpiFgj.js';
5
7
  import 'react-hook-form';
6
8
 
7
9
  type StepKeys = 'form' | 'confirmation_form';
8
10
  declare const STEPS: Record<StepKeys, Step<StepKeys>>;
9
- declare function buildInitialValues(employment: Employment | undefined, fields?: Fields | undefined): {};
11
+ declare function buildInitialValues(employment: Employment | undefined, fields?: JSFFields | undefined): {};
10
12
 
11
13
  export { STEPS, buildInitialValues };
@@ -1,2 +1,2 @@
1
- import{a,b}from"../../chunk-OXL3QGHT.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-P37U34EQ.js";export{a as STEPS,b as buildInitialValues};
1
+ import{a,b}from"../../chunk-ZCXTTVGV.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-P37U34EQ.js";export{a as STEPS,b as buildInitialValues};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1,22 +1,21 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as ContractorOnboardingFlowProps } from '../../types-Dx-2ocvG.js';
3
- import '../../types.gen-D2nbxMA0.js';
2
+ import { a as ContractorOnboardingFlowProps } from '../../types-CgFQV0b1.js';
3
+ import '../../types.gen-q3-YX6jr.js';
4
4
  import './components/OnboardingBack.js';
5
5
  import 'react';
6
6
  import './components/OnboardingSubmit.js';
7
- import '../../mutations-C051uRcC.js';
8
- import '../../remoteFlows-B9Nl1qjN.js';
7
+ import '../../mutations-Dhsqyt9R.js';
8
+ import '../../remoteFlows-8lgzhRZb.js';
9
9
  import 'yup';
10
10
  import '../../types-ZWIpiFgj.js';
11
11
  import 'react-hook-form';
12
12
  import '@tanstack/query-core';
13
- import '@remoteoss/json-schema-form-old';
14
13
  import '@remoteoss/remote-json-schema-form-kit';
15
14
  import './utils.js';
16
15
  import '../types.js';
17
16
  import '../useStepState.js';
18
17
  import './components/BasicInformationStep.js';
19
- import '../../types-Ci-EdBDb.js';
18
+ import '../../types-CR6ZHxiM.js';
20
19
  import '../Onboarding/components/OnboardingBack.js';
21
20
  import '../Onboarding/components/OnboardingInvite.js';
22
21
  import '../Onboarding/components/OnboardingSubmit.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-5DKNCKV7.js";import"../../chunk-6P4DTWYK.js";import"../../chunk-2FQ2KNP4.js";import"../../chunk-ERRQIROU.js";import"../../chunk-VBO75DXV.js";import"../../chunk-BL7OYWNX.js";import"../../chunk-NABPCULM.js";import"../../chunk-HDNBZ6CB.js";import"../../chunk-PZNXAOZH.js";import"../../chunk-7COHIUGW.js";import"../../chunk-5C3NU7R3.js";import"../../chunk-2Y3SXQ5B.js";import"../../chunk-GCTHZSIN.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-TOA3JILU.js";import"../../chunk-5LSHRCAR.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-H6YNMT4M.js";import"../../chunk-EYQ4PYUT.js";import"../../chunk-LNV36S6D.js";import"../../chunk-EGRGQWIY.js";import"../../chunk-LKMPZJIW.js";import"../../chunk-KGKDSOER.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-W3YE53JN.js";import"../../chunk-ZIN2OWTH.js";import"../../chunk-UOOUV52J.js";import"../../chunk-72OH7PSF.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-6GTRAHWJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-LJGCFFAT.js";import"../../chunk-66N57DKF.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-PMTKQME6.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
1
+ import{a}from"../../chunk-GAF5TFZJ.js";import"../../chunk-4G2UMXRE.js";import"../../chunk-XXXQA4SY.js";import"../../chunk-FQQKCROC.js";import"../../chunk-Z3AKMQ4S.js";import"../../chunk-JS3H25UQ.js";import"../../chunk-XCA33UL6.js";import"../../chunk-U2HWB5HI.js";import"../../chunk-ADOJOLLL.js";import"../../chunk-IJ6325YO.js";import"../../chunk-TOA3JILU.js";import"../../chunk-ZZPYYZNT.js";import"../../chunk-LOHRUY4J.js";import"../../chunk-CATDB2YM.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-W4KHMUDZ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-H6YNMT4M.js";import"../../chunk-BB2GHYJY.js";import"../../chunk-LNV36S6D.js";import"../../chunk-CM2YPABC.js";import"../../chunk-NY7LII5R.js";import"../../chunk-ZFKHCC4Z.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-P5QKSFOE.js";import"../../chunk-W3YE53JN.js";import"../../chunk-LAXQMTDQ.js";import"../../chunk-GGPEKIIH.js";import"../../chunk-GPLI6GGL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-NFWNYW2E.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-PJN2YJO4.js";import"../../chunk-CR7AIZKA.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-ILOKQ6OH.js";import"../../chunk-UQCSN47K.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
2
2
  //# sourceMappingURL=ContractorOnboarding.js.map
@@ -1,14 +1,13 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseQueryResult } from '@tanstack/react-query';
3
- import { S as SuccessResponse, B as BadRequestResponse, F as ForbiddenResponse, h as SignContractDocument, i as File, j as ContractorSubscriptionsSummary, k as ManageContractorPlusSubscriptionOperationsParams, l as CreateContractDocumentResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, a as UnauthorizedResponse, m as CreateContractDocument } from '../../types.gen-D2nbxMA0.js';
3
+ import { S as SuccessResponse, B as BadRequestResponse, F as ForbiddenResponse, v as SignContractDocument, w as File, x as ContractorSubscriptionsSummary, y as ManageContractorPlusSubscriptionOperationsParams, z as CreateContractDocumentResponse, N as NotFoundResponse, U as UnprocessableEntityResponse, a as UnauthorizedResponse, A as CreateContractDocument } from '../../types.gen-q3-YX6jr.js';
4
+ import { a as JSFFieldset } from '../../remoteFlows-8lgzhRZb.js';
4
5
  import * as _remoteoss_remote_json_schema_form_kit from '@remoteoss/remote-json-schema-form-kit';
5
- import { NextFlowOptions, JSONSchemaFormResultWithFieldsets } from '../types.js';
6
+ import { FlowOptions, JSONSchemaFormResultWithFieldsets } from '../types.js';
6
7
  import { FieldValues } from 'react-hook-form';
7
- import '../../remoteFlows-B9Nl1qjN.js';
8
8
  import 'react';
9
9
  import 'yup';
10
10
  import '../../types-ZWIpiFgj.js';
11
- import '@remoteoss/json-schema-form-old';
12
11
 
13
12
  /**
14
13
  * Get the contract document signature schema
@@ -23,7 +22,11 @@ declare const useGetContractDocumentSignatureSchema: ({ fieldValues, options, }:
23
22
  enabled?: boolean;
24
23
  };
25
24
  };
26
- }) => UseQueryResult<_remoteoss_remote_json_schema_form_kit.FormResult, Error>;
25
+ }) => UseQueryResult<_remoteoss_remote_json_schema_form_kit.FormResult & {
26
+ meta: {
27
+ "x-jsf-fieldsets": JSFFieldset;
28
+ };
29
+ }, Error>;
27
30
  /**
28
31
  * Signs the contract document
29
32
  * @param employmentId - The employment ID
@@ -123,20 +126,24 @@ declare const useCreateContractorContractDocument: () => _tanstack_react_query.U
123
126
  declare const useContractorOnboardingDetailsSchema: ({ countryCode, fieldValues, options, }: {
124
127
  countryCode: string;
125
128
  fieldValues: FieldValues;
126
- options?: NextFlowOptions & {
129
+ options?: FlowOptions & {
127
130
  queryOptions?: {
128
131
  enabled?: boolean;
129
132
  };
130
133
  };
131
134
  query?: Record<string, unknown>;
132
135
  }) => UseQueryResult<JSONSchemaFormResultWithFieldsets>;
133
- declare const useContractorSubscriptionSchemaField: (employmentId: string, options?: NextFlowOptions & {
136
+ declare const useContractorSubscriptionSchemaField: (employmentId: string, options?: FlowOptions & {
134
137
  queryOptions?: {
135
138
  enabled?: boolean;
136
139
  };
137
140
  }) => {
138
141
  isLoading: boolean;
139
- form: _remoteoss_remote_json_schema_form_kit.FormResult;
142
+ form: _remoteoss_remote_json_schema_form_kit.FormResult & {
143
+ meta: {
144
+ "x-jsf-fieldsets": JSFFieldset;
145
+ };
146
+ };
140
147
  };
141
148
 
142
149
  export { useContractorOnboardingDetailsSchema, useContractorSubscriptionSchemaField, useCreateContractorContractDocument, useGetContractDocumentSignatureSchema, useGetContractorSubscriptions, useGetShowContractDocument, usePostManageContractorSubscriptions, useSignContractDocument };
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h}from"../../chunk-GCTHZSIN.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-W3YE53JN.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-ARTSDUSS.js";import"../../chunk-L3Z2G32A.js";import"../../chunk-P37U34EQ.js";export{g as useContractorOnboardingDetailsSchema,h as useContractorSubscriptionSchemaField,f as useCreateContractorContractDocument,a as useGetContractDocumentSignatureSchema,d as useGetContractorSubscriptions,c as useGetShowContractDocument,e as usePostManageContractorSubscriptions,b as useSignContractDocument};
1
+ import{a,b,c,d,e,f,g,h}from"../../chunk-CATDB2YM.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-P5QKSFOE.js";import"../../chunk-W3YE53JN.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-HRG5MSVG.js";import"../../chunk-UQCSN47K.js";import"../../chunk-P37U34EQ.js";export{g as useContractorOnboardingDetailsSchema,h as useContractorSubscriptionSchemaField,f as useCreateContractorContractDocument,a as useGetContractDocumentSignatureSchema,d as useGetContractorSubscriptions,c as useGetShowContractDocument,e as usePostManageContractorSubscriptions,b as useSignContractDocument};
2
2
  //# sourceMappingURL=api.js.map
@@ -1,18 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { B as BasicInformationFormPayload } from '../../../types-Ci-EdBDb.js';
3
- import { r as EmploymentCreationResponse } from '../../../types.gen-D2nbxMA0.js';
4
- import { N as NormalizedFieldError } from '../../../mutations-C051uRcC.js';
2
+ import { B as BasicInformationFormPayload } from '../../../types-CR6ZHxiM.js';
3
+ import { j as EmploymentCreationResponse } from '../../../types.gen-q3-YX6jr.js';
4
+ import { N as NormalizedFieldError } from '../../../mutations-Dhsqyt9R.js';
5
5
  import '../../Onboarding/components/OnboardingBack.js';
6
6
  import 'react';
7
7
  import '../../Onboarding/components/OnboardingInvite.js';
8
- import '../../../remoteFlows-B9Nl1qjN.js';
8
+ import '../../../remoteFlows-8lgzhRZb.js';
9
9
  import 'yup';
10
10
  import '../../../types-ZWIpiFgj.js';
11
11
  import 'react-hook-form';
12
12
  import '../../Onboarding/components/OnboardingSubmit.js';
13
13
  import '@tanstack/query-core';
14
14
  import '@remoteoss/remote-json-schema-form-kit';
15
- import '@remoteoss/json-schema-form-old';
16
15
  import '../../useStepState.js';
17
16
  import '../../types.js';
18
17
  import '../../Onboarding/components/SaveDraftButton.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-NABPCULM.js";import"../../../chunk-7COHIUGW.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-EYQ4PYUT.js";import"../../../chunk-LNV36S6D.js";import"../../../chunk-EGRGQWIY.js";import"../../../chunk-LKMPZJIW.js";import"../../../chunk-KGKDSOER.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-W3YE53JN.js";import"../../../chunk-ZIN2OWTH.js";import"../../../chunk-UOOUV52J.js";import"../../../chunk-72OH7PSF.js";import"../../../chunk-KQPDXXG3.js";import"../../../chunk-LJGCFFAT.js";import"../../../chunk-66N57DKF.js";import"../../../chunk-ARTSDUSS.js";import"../../../chunk-PMTKQME6.js";import"../../../chunk-L3Z2G32A.js";import"../../../chunk-P37U34EQ.js";export{a as BasicInformationStep};
1
+ import{a}from"../../../chunk-FQQKCROC.js";import"../../../chunk-XCA33UL6.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-BB2GHYJY.js";import"../../../chunk-LNV36S6D.js";import"../../../chunk-CM2YPABC.js";import"../../../chunk-NY7LII5R.js";import"../../../chunk-ZFKHCC4Z.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-W3YE53JN.js";import"../../../chunk-LAXQMTDQ.js";import"../../../chunk-GGPEKIIH.js";import"../../../chunk-GPLI6GGL.js";import"../../../chunk-KQPDXXG3.js";import"../../../chunk-PJN2YJO4.js";import"../../../chunk-CR7AIZKA.js";import"../../../chunk-HRG5MSVG.js";import"../../../chunk-ILOKQ6OH.js";import"../../../chunk-UQCSN47K.js";import"../../../chunk-P37U34EQ.js";export{a as BasicInformationStep};
2
2
  //# sourceMappingURL=BasicInformationStep.js.map