@remoteoss/remote-flows 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/README.md +10 -9
  2. package/dist/CountryFieldDefault-DJ7VD267.js +2 -0
  3. package/dist/DatePickerFieldDefault-ZWLN5P55.js +2 -0
  4. package/dist/RadioGroupFieldDefault-7SVQ7ZQQ.js +2 -0
  5. package/dist/{chunk-IVY2QYWG.js → chunk-2J4XRENJ.js} +2 -2
  6. package/dist/{chunk-3KS3MSNS.js → chunk-2ZS5F6C7.js} +2 -2
  7. package/dist/{chunk-BUVW6LTT.js → chunk-37RBGAMM.js} +2 -2
  8. package/dist/{chunk-4DZWRQWY.js → chunk-3ACL4IFO.js} +2 -2
  9. package/dist/chunk-3FCX7SWN.js +2 -0
  10. package/dist/chunk-3FCX7SWN.js.map +1 -0
  11. package/dist/chunk-3XG2MGD3.js +2 -0
  12. package/dist/chunk-3XG2MGD3.js.map +1 -0
  13. package/dist/chunk-42R2H2DW.js +2 -0
  14. package/dist/{chunk-O3XMCNHE.js → chunk-47YUPC2L.js} +2 -2
  15. package/dist/{chunk-GOOMCQBE.js → chunk-4SGUDT5K.js} +2 -2
  16. package/dist/{chunk-FJMBBAVQ.js → chunk-5F7FMTGE.js} +2 -2
  17. package/dist/chunk-5KMUUL7U.js +1 -0
  18. package/dist/chunk-5KMUUL7U.js.map +1 -0
  19. package/dist/{chunk-RN6B2HER.js → chunk-5TBUDUEB.js} +2 -2
  20. package/dist/chunk-5WIBTOCI.js +2 -0
  21. package/dist/chunk-5WIBTOCI.js.map +1 -0
  22. package/dist/{chunk-EASVLA7B.js → chunk-6DRAZSGG.js} +2 -2
  23. package/dist/chunk-76ZDXC2T.js +2 -0
  24. package/dist/chunk-76ZDXC2T.js.map +1 -0
  25. package/dist/{chunk-UVAK3ZEO.js → chunk-7TOCURKO.js} +2 -2
  26. package/dist/{chunk-M4X3WYJY.js → chunk-A37NW25N.js} +2 -2
  27. package/dist/chunk-A3LRPGV3.js +2 -0
  28. package/dist/chunk-A3LRPGV3.js.map +1 -0
  29. package/dist/{chunk-GRHZMIP5.js → chunk-AB3RAEMM.js} +2 -2
  30. package/dist/{chunk-QIBRRCQX.js → chunk-AJ7L3ZO3.js} +2 -2
  31. package/dist/{chunk-IRVF252A.js → chunk-BC4UT7KC.js} +2 -2
  32. package/dist/chunk-BIDZO7XH.js +2 -0
  33. package/dist/chunk-BIDZO7XH.js.map +1 -0
  34. package/dist/{chunk-WROEWNZE.js → chunk-C36VO7DO.js} +2 -2
  35. package/dist/chunk-CQ2EF32E.js +2 -0
  36. package/dist/chunk-CQ2EF32E.js.map +1 -0
  37. package/dist/{chunk-XZLBYJZJ.js → chunk-D36BZQTP.js} +2 -2
  38. package/dist/{chunk-BBOEQU3O.js → chunk-D5YMIXK5.js} +2 -2
  39. package/dist/chunk-D6KO5LX6.js +2 -0
  40. package/dist/chunk-D6KO5LX6.js.map +1 -0
  41. package/dist/{chunk-66PXQJK6.js → chunk-DCB2H2SG.js} +2 -2
  42. package/dist/{chunk-BDNJNMR5.js → chunk-DI2QNZ2O.js} +2 -2
  43. package/dist/chunk-DI3XZUMY.js +2 -0
  44. package/dist/chunk-DI3XZUMY.js.map +1 -0
  45. package/dist/chunk-E6256SK7.js +2 -0
  46. package/dist/chunk-E6256SK7.js.map +1 -0
  47. package/dist/{chunk-GVK4VLLD.js → chunk-EPLPD54O.js} +2 -2
  48. package/dist/chunk-FKYEST54.js +2 -0
  49. package/dist/chunk-FKYEST54.js.map +1 -0
  50. package/dist/{chunk-NWWR6SBR.js → chunk-GLKITZNI.js} +2 -2
  51. package/dist/chunk-H463PCBN.js +2 -0
  52. package/dist/{chunk-5NZJD6CA.js.map → chunk-H463PCBN.js.map} +1 -1
  53. package/dist/{chunk-N2UBBJBK.js → chunk-HLAKUOQB.js} +2 -2
  54. package/dist/{chunk-ATPZXVQD.js → chunk-HN7ZP5AX.js} +2 -2
  55. package/dist/{chunk-APFUKV75.js → chunk-HU453KWI.js} +2 -2
  56. package/dist/{chunk-TRR7P5XQ.js → chunk-I2ED6EUG.js} +2 -2
  57. package/dist/{chunk-32EHLWZC.js → chunk-I7JUAYNN.js} +2 -2
  58. package/dist/{chunk-YRC6EEM3.js → chunk-IF42CZJH.js} +2 -2
  59. package/dist/{chunk-ZZJPAKGP.js → chunk-IHVEK72X.js} +2 -2
  60. package/dist/chunk-JITSAYF7.js +2 -0
  61. package/dist/chunk-JITSAYF7.js.map +1 -0
  62. package/dist/{chunk-L5VZ3XT7.js → chunk-JXXZH6KH.js} +2 -2
  63. package/dist/chunk-KJQN6GHW.js +6 -0
  64. package/dist/chunk-KJQN6GHW.js.map +1 -0
  65. package/dist/chunk-KUTIJABX.js +2 -0
  66. package/dist/chunk-KUTIJABX.js.map +1 -0
  67. package/dist/{chunk-MPYZD3SN.js → chunk-LDWPRPN4.js} +2 -2
  68. package/dist/chunk-LHEF2FN7.js +2 -0
  69. package/dist/chunk-LHEF2FN7.js.map +1 -0
  70. package/dist/{chunk-YAJCRUQL.js → chunk-M4BR3FKN.js} +2 -2
  71. package/dist/{chunk-H2PKQ3ML.js → chunk-MTOXXQYK.js} +2 -2
  72. package/dist/{chunk-PTNHB5BY.js → chunk-MUJT3F2Q.js} +2 -2
  73. package/dist/{chunk-Q7JVXGC6.js → chunk-NOY2YNXO.js} +2 -2
  74. package/dist/chunk-NZ64KNDV.js +2 -0
  75. package/dist/chunk-NZ64KNDV.js.map +1 -0
  76. package/dist/{chunk-AMWQ5P7T.js → chunk-PQP3KZ7P.js} +2 -2
  77. package/dist/{chunk-NHJT3DJU.js → chunk-PS5T7URZ.js} +2 -2
  78. package/dist/chunk-QORZCJSR.js +2 -0
  79. package/dist/chunk-QORZCJSR.js.map +1 -0
  80. package/dist/chunk-QPN6X6UA.js +2 -0
  81. package/dist/chunk-QPN6X6UA.js.map +1 -0
  82. package/dist/{chunk-Y7GCA66L.js → chunk-RFMIAO6J.js} +2 -2
  83. package/dist/chunk-RKS3FX3C.js +2 -0
  84. package/dist/chunk-RKS3FX3C.js.map +1 -0
  85. package/dist/{chunk-ILH332UR.js → chunk-RNXUKKPF.js} +2 -2
  86. package/dist/{chunk-2PUPF2EN.js → chunk-S63QGDMR.js} +2 -2
  87. package/dist/chunk-STEDOWHX.js +2 -0
  88. package/dist/chunk-STEDOWHX.js.map +1 -0
  89. package/dist/{chunk-WQYW6TGP.js → chunk-SZVBNL6O.js} +2 -2
  90. package/dist/chunk-TGLB5MA2.js +2 -0
  91. package/dist/{chunk-Y7QMIMYP.js.map → chunk-TGLB5MA2.js.map} +1 -1
  92. package/dist/chunk-TSPDJUGG.js +2 -0
  93. package/dist/chunk-TSPDJUGG.js.map +1 -0
  94. package/dist/chunk-TXSUZLOI.js +2 -0
  95. package/dist/chunk-TXSUZLOI.js.map +1 -0
  96. package/dist/chunk-VGIG5OUD.js +2 -0
  97. package/dist/chunk-VGIG5OUD.js.map +1 -0
  98. package/dist/chunk-VLKG3SNS.js +2 -0
  99. package/dist/chunk-VLKG3SNS.js.map +1 -0
  100. package/dist/{chunk-DBUX7M4A.js → chunk-VOUP5SMR.js} +2 -2
  101. package/dist/{chunk-7S2QQQDH.js → chunk-VSYION5R.js} +2 -2
  102. package/dist/{chunk-DT72SNYW.js → chunk-XLTZ7SN3.js} +2 -2
  103. package/dist/{chunk-AA3QOH66.js → chunk-XO5VURZY.js} +2 -2
  104. package/dist/chunk-Z4STVEJE.js +2 -0
  105. package/dist/chunk-Z4STVEJE.js.map +1 -0
  106. package/dist/default-components.d.ts +2 -2
  107. package/dist/default-components.js +1 -1
  108. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  109. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  110. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  111. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  112. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  113. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  114. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  115. package/dist/flows/ContractAmendment/hooks.js +1 -1
  116. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  117. package/dist/flows/ContractAmendment/index.js +1 -1
  118. package/dist/flows/ContractAmendment/types.d.ts +2 -2
  119. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  120. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +7 -5
  121. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  122. package/dist/flows/ContractorOnboarding/api.d.ts +213 -20
  123. package/dist/flows/ContractorOnboarding/api.js +1 -1
  124. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  125. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  126. package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.d.ts +29 -0
  127. package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.js +2 -0
  128. package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.js.map +1 -0
  129. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +7 -5
  130. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  131. package/dist/flows/ContractorOnboarding/components/ContractPreviewHeader.d.ts +2 -2
  132. package/dist/flows/ContractorOnboarding/components/ContractPreviewStatement.d.ts +2 -2
  133. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +7 -5
  134. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  135. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +7 -5
  136. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  137. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +7 -5
  138. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
  139. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  140. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  141. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +7 -5
  142. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  143. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  144. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  145. package/dist/flows/ContractorOnboarding/components/StatementOfWorkDisclaimer.js +1 -1
  146. package/dist/flows/ContractorOnboarding/constants.d.ts +4 -1
  147. package/dist/flows/ContractorOnboarding/constants.js +1 -1
  148. package/dist/flows/ContractorOnboarding/context.d.ts +12 -8
  149. package/dist/flows/ContractorOnboarding/hooks.d.ts +7 -5
  150. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  151. package/dist/flows/ContractorOnboarding/index.d.ts +7 -6
  152. package/dist/flows/ContractorOnboarding/index.js +1 -1
  153. package/dist/flows/ContractorOnboarding/jsfModify.d.ts +9 -6
  154. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  155. package/dist/flows/ContractorOnboarding/json-schemas/chooseAlternativePlanStep.d.ts +23 -0
  156. package/dist/flows/ContractorOnboarding/json-schemas/chooseAlternativePlanStep.js +2 -0
  157. package/dist/flows/ContractorOnboarding/json-schemas/chooseAlternativePlanStep.js.map +1 -0
  158. package/dist/flows/ContractorOnboarding/types.d.ts +7 -5
  159. package/dist/flows/ContractorOnboarding/utils.d.ts +19 -6
  160. package/dist/flows/ContractorOnboarding/utils.js +1 -1
  161. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  162. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  163. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  164. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  165. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -2
  166. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  167. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -2
  168. package/dist/flows/CostCalculator/api.d.ts +2 -2
  169. package/dist/flows/CostCalculator/api.js +1 -1
  170. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  171. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  172. package/dist/flows/CostCalculator/context.d.ts +3 -3
  173. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  174. package/dist/flows/CostCalculator/hooks.js +1 -1
  175. package/dist/flows/CostCalculator/index.d.ts +3 -3
  176. package/dist/flows/CostCalculator/index.js +1 -1
  177. package/dist/flows/CostCalculator/types.d.ts +2 -2
  178. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  179. package/dist/flows/CostCalculator/utils.js +1 -1
  180. package/dist/flows/CreateCompany/CreateCompany.d.ts +18 -0
  181. package/dist/flows/CreateCompany/CreateCompany.js +2 -0
  182. package/dist/flows/CreateCompany/CreateCompany.js.map +1 -0
  183. package/dist/flows/CreateCompany/api.d.ts +81 -0
  184. package/dist/flows/CreateCompany/api.js +2 -0
  185. package/dist/flows/CreateCompany/api.js.map +1 -0
  186. package/dist/flows/CreateCompany/components/AddressDetailsStep.d.ts +14 -0
  187. package/dist/flows/CreateCompany/components/AddressDetailsStep.js +2 -0
  188. package/dist/flows/CreateCompany/components/AddressDetailsStep.js.map +1 -0
  189. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.d.ts +14 -0
  190. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +2 -0
  191. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js.map +1 -0
  192. package/dist/flows/CreateCompany/components/CreateCompanyForm.d.ts +17 -0
  193. package/dist/flows/CreateCompany/components/CreateCompanyForm.js +2 -0
  194. package/dist/flows/CreateCompany/components/CreateCompanyForm.js.map +1 -0
  195. package/dist/flows/CreateCompany/components/CreateCompanySubmit.d.ts +6 -0
  196. package/dist/flows/CreateCompany/components/CreateCompanySubmit.js +2 -0
  197. package/dist/flows/CreateCompany/components/CreateCompanySubmit.js.map +1 -0
  198. package/dist/flows/CreateCompany/context.d.ts +82 -0
  199. package/dist/flows/CreateCompany/context.js +2 -0
  200. package/dist/flows/CreateCompany/context.js.map +1 -0
  201. package/dist/flows/CreateCompany/hooks.d.ts +14 -0
  202. package/dist/flows/CreateCompany/hooks.js +2 -0
  203. package/dist/flows/CreateCompany/hooks.js.map +1 -0
  204. package/dist/flows/CreateCompany/index.d.ts +15 -0
  205. package/dist/flows/CreateCompany/index.js +2 -0
  206. package/dist/flows/CreateCompany/index.js.map +1 -0
  207. package/dist/flows/CreateCompany/json-schemas/companyBasicInformationStep.d.ts +73 -0
  208. package/dist/flows/CreateCompany/json-schemas/companyBasicInformationStep.js +2 -0
  209. package/dist/flows/CreateCompany/json-schemas/companyBasicInformationStep.js.map +1 -0
  210. package/dist/flows/CreateCompany/types.d.ts +14 -0
  211. package/dist/flows/CreateCompany/types.js +1 -0
  212. package/dist/flows/CreateCompany/types.js.map +1 -0
  213. package/dist/flows/CreateCompany/utils.d.ts +8 -0
  214. package/dist/flows/CreateCompany/utils.js +2 -0
  215. package/dist/flows/CreateCompany/utils.js.map +1 -0
  216. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  217. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  218. package/dist/flows/Onboarding/api.d.ts +4 -4
  219. package/dist/flows/Onboarding/api.js +1 -1
  220. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  221. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  222. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  223. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  224. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  225. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  226. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  227. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  228. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  229. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  230. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  231. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  232. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  233. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  234. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  235. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  236. package/dist/flows/Onboarding/context.d.ts +4 -4
  237. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  238. package/dist/flows/Onboarding/hooks.js +1 -1
  239. package/dist/flows/Onboarding/index.d.ts +4 -4
  240. package/dist/flows/Onboarding/index.js +1 -1
  241. package/dist/flows/Onboarding/types.d.ts +4 -4
  242. package/dist/flows/Onboarding/utils.d.ts +4 -4
  243. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  244. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  245. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  246. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  247. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  248. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  249. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  250. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  251. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  252. package/dist/flows/Termination/TerminationFlow.js +1 -1
  253. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  254. package/dist/flows/Termination/TerminationForm.js +1 -1
  255. package/dist/flows/Termination/api.d.ts +5 -5
  256. package/dist/flows/Termination/api.js +1 -1
  257. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  258. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -6
  259. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -6
  260. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  261. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -6
  262. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  263. package/dist/flows/Termination/context.d.ts +4 -4
  264. package/dist/flows/Termination/hooks.d.ts +4 -4
  265. package/dist/flows/Termination/hooks.js +1 -1
  266. package/dist/flows/Termination/index.d.ts +6 -6
  267. package/dist/flows/Termination/index.js +1 -1
  268. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  269. package/dist/flows/Termination/json-schemas/schema.d.ts +4 -4
  270. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  271. package/dist/flows/Termination/types.d.ts +4 -4
  272. package/dist/flows/Termination/utils.d.ts +4 -4
  273. package/dist/flows/types.d.ts +2 -2
  274. package/dist/flows/useStepState.d.ts +1 -0
  275. package/dist/flows/useStepState.js +1 -1
  276. package/dist/index.css +1 -1
  277. package/dist/index.css.map +1 -1
  278. package/dist/index.d.ts +35 -13
  279. package/dist/index.js +2 -2
  280. package/dist/index.js.map +1 -1
  281. package/dist/internals.d.ts +3 -3
  282. package/dist/internals.js +1 -1
  283. package/dist/{mutations-DD5sJUOe.d.ts → mutations-B8OzuyhA.d.ts} +1 -1
  284. package/dist/{remoteFlows-XefHitC9.d.ts → remoteFlows-Bphgh2nl.d.ts} +13 -2
  285. package/dist/styles.css +1 -1
  286. package/dist/styles.css.map +1 -1
  287. package/dist/types-Bs66Ma28.d.ts +248 -0
  288. package/dist/{types-A0hYlRII.d.ts → types-Ck-iVGL_.d.ts} +2 -2
  289. package/dist/{types-CUjmrc0L.d.ts → types-Dcg5CIEH.d.ts} +3 -3
  290. package/dist/{types-PBjnmC_s.d.ts → types-Dr-apmY1.d.ts} +21 -8
  291. package/dist/{types-CVZaJm8w.d.ts → types-Jy-_3Y7m.d.ts} +1 -1
  292. package/dist/{types.gen-BGBO30Fw.d.ts → types.gen-Yvu8ksE5.d.ts} +254 -1
  293. package/dist/{utils-YCgjlF1V.d.ts → utils-C8T9BiQ3.d.ts} +1 -1
  294. package/package.json +1 -1
  295. package/dist/CountryFieldDefault-BBMP6LHE.js +0 -2
  296. package/dist/DatePickerFieldDefault-LBR6A7BF.js +0 -2
  297. package/dist/RadioGroupFieldDefault-5GHWP2P6.js +0 -2
  298. package/dist/chunk-3I3XSAYV.js +0 -2
  299. package/dist/chunk-3I3XSAYV.js.map +0 -1
  300. package/dist/chunk-4AM73KSF.js +0 -2
  301. package/dist/chunk-4AM73KSF.js.map +0 -1
  302. package/dist/chunk-5BRMLRS7.js +0 -2
  303. package/dist/chunk-5BRMLRS7.js.map +0 -1
  304. package/dist/chunk-5NZJD6CA.js +0 -2
  305. package/dist/chunk-6YEAHKT6.js +0 -2
  306. package/dist/chunk-6YEAHKT6.js.map +0 -1
  307. package/dist/chunk-BYX2YS2B.js +0 -6
  308. package/dist/chunk-BYX2YS2B.js.map +0 -1
  309. package/dist/chunk-EM5VOM56.js +0 -2
  310. package/dist/chunk-EM5VOM56.js.map +0 -1
  311. package/dist/chunk-FKLBLQIH.js +0 -2
  312. package/dist/chunk-FKLBLQIH.js.map +0 -1
  313. package/dist/chunk-O3G6HQ3B.js +0 -2
  314. package/dist/chunk-O3G6HQ3B.js.map +0 -1
  315. package/dist/chunk-SATHKK5B.js +0 -2
  316. package/dist/chunk-SATHKK5B.js.map +0 -1
  317. package/dist/chunk-UTNKUPL5.js +0 -2
  318. package/dist/chunk-UTNKUPL5.js.map +0 -1
  319. package/dist/chunk-XY2IEZHC.js +0 -2
  320. package/dist/chunk-XY2IEZHC.js.map +0 -1
  321. package/dist/chunk-Y7QMIMYP.js +0 -2
  322. package/dist/chunk-ZVUQDK2E.js +0 -2
  323. /package/dist/{CountryFieldDefault-BBMP6LHE.js.map → CountryFieldDefault-DJ7VD267.js.map} +0 -0
  324. /package/dist/{DatePickerFieldDefault-LBR6A7BF.js.map → DatePickerFieldDefault-ZWLN5P55.js.map} +0 -0
  325. /package/dist/{RadioGroupFieldDefault-5GHWP2P6.js.map → RadioGroupFieldDefault-7SVQ7ZQQ.js.map} +0 -0
  326. /package/dist/{chunk-IVY2QYWG.js.map → chunk-2J4XRENJ.js.map} +0 -0
  327. /package/dist/{chunk-3KS3MSNS.js.map → chunk-2ZS5F6C7.js.map} +0 -0
  328. /package/dist/{chunk-BUVW6LTT.js.map → chunk-37RBGAMM.js.map} +0 -0
  329. /package/dist/{chunk-4DZWRQWY.js.map → chunk-3ACL4IFO.js.map} +0 -0
  330. /package/dist/{chunk-ZVUQDK2E.js.map → chunk-42R2H2DW.js.map} +0 -0
  331. /package/dist/{chunk-O3XMCNHE.js.map → chunk-47YUPC2L.js.map} +0 -0
  332. /package/dist/{chunk-GOOMCQBE.js.map → chunk-4SGUDT5K.js.map} +0 -0
  333. /package/dist/{chunk-FJMBBAVQ.js.map → chunk-5F7FMTGE.js.map} +0 -0
  334. /package/dist/{chunk-RN6B2HER.js.map → chunk-5TBUDUEB.js.map} +0 -0
  335. /package/dist/{chunk-EASVLA7B.js.map → chunk-6DRAZSGG.js.map} +0 -0
  336. /package/dist/{chunk-UVAK3ZEO.js.map → chunk-7TOCURKO.js.map} +0 -0
  337. /package/dist/{chunk-M4X3WYJY.js.map → chunk-A37NW25N.js.map} +0 -0
  338. /package/dist/{chunk-GRHZMIP5.js.map → chunk-AB3RAEMM.js.map} +0 -0
  339. /package/dist/{chunk-QIBRRCQX.js.map → chunk-AJ7L3ZO3.js.map} +0 -0
  340. /package/dist/{chunk-IRVF252A.js.map → chunk-BC4UT7KC.js.map} +0 -0
  341. /package/dist/{chunk-WROEWNZE.js.map → chunk-C36VO7DO.js.map} +0 -0
  342. /package/dist/{chunk-XZLBYJZJ.js.map → chunk-D36BZQTP.js.map} +0 -0
  343. /package/dist/{chunk-BBOEQU3O.js.map → chunk-D5YMIXK5.js.map} +0 -0
  344. /package/dist/{chunk-66PXQJK6.js.map → chunk-DCB2H2SG.js.map} +0 -0
  345. /package/dist/{chunk-BDNJNMR5.js.map → chunk-DI2QNZ2O.js.map} +0 -0
  346. /package/dist/{chunk-GVK4VLLD.js.map → chunk-EPLPD54O.js.map} +0 -0
  347. /package/dist/{chunk-NWWR6SBR.js.map → chunk-GLKITZNI.js.map} +0 -0
  348. /package/dist/{chunk-N2UBBJBK.js.map → chunk-HLAKUOQB.js.map} +0 -0
  349. /package/dist/{chunk-ATPZXVQD.js.map → chunk-HN7ZP5AX.js.map} +0 -0
  350. /package/dist/{chunk-APFUKV75.js.map → chunk-HU453KWI.js.map} +0 -0
  351. /package/dist/{chunk-TRR7P5XQ.js.map → chunk-I2ED6EUG.js.map} +0 -0
  352. /package/dist/{chunk-32EHLWZC.js.map → chunk-I7JUAYNN.js.map} +0 -0
  353. /package/dist/{chunk-YRC6EEM3.js.map → chunk-IF42CZJH.js.map} +0 -0
  354. /package/dist/{chunk-ZZJPAKGP.js.map → chunk-IHVEK72X.js.map} +0 -0
  355. /package/dist/{chunk-L5VZ3XT7.js.map → chunk-JXXZH6KH.js.map} +0 -0
  356. /package/dist/{chunk-MPYZD3SN.js.map → chunk-LDWPRPN4.js.map} +0 -0
  357. /package/dist/{chunk-YAJCRUQL.js.map → chunk-M4BR3FKN.js.map} +0 -0
  358. /package/dist/{chunk-H2PKQ3ML.js.map → chunk-MTOXXQYK.js.map} +0 -0
  359. /package/dist/{chunk-PTNHB5BY.js.map → chunk-MUJT3F2Q.js.map} +0 -0
  360. /package/dist/{chunk-Q7JVXGC6.js.map → chunk-NOY2YNXO.js.map} +0 -0
  361. /package/dist/{chunk-AMWQ5P7T.js.map → chunk-PQP3KZ7P.js.map} +0 -0
  362. /package/dist/{chunk-NHJT3DJU.js.map → chunk-PS5T7URZ.js.map} +0 -0
  363. /package/dist/{chunk-Y7GCA66L.js.map → chunk-RFMIAO6J.js.map} +0 -0
  364. /package/dist/{chunk-ILH332UR.js.map → chunk-RNXUKKPF.js.map} +0 -0
  365. /package/dist/{chunk-2PUPF2EN.js.map → chunk-S63QGDMR.js.map} +0 -0
  366. /package/dist/{chunk-WQYW6TGP.js.map → chunk-SZVBNL6O.js.map} +0 -0
  367. /package/dist/{chunk-DBUX7M4A.js.map → chunk-VOUP5SMR.js.map} +0 -0
  368. /package/dist/{chunk-7S2QQQDH.js.map → chunk-VSYION5R.js.map} +0 -0
  369. /package/dist/{chunk-DT72SNYW.js.map → chunk-XLTZ7SN3.js.map} +0 -0
  370. /package/dist/{chunk-AA3QOH66.js.map → chunk-XO5VURZY.js.map} +0 -0
@@ -348,6 +348,38 @@ type EmploymentBasicResponse = {
348
348
  * Optional UTC date time in YYYY-MM-DDTHH:mm:ss format
349
349
  */
350
350
  type NullableDateTime = string | null;
351
+ /**
352
+ * ClientCredentialsResponse
353
+ */
354
+ type ClientCredentialsResponse = BaseTokenResponse;
355
+ /**
356
+ * AuthorizationCodeResponse
357
+ */
358
+ type AuthorizationCodeResponse = BaseTokenResponse & {
359
+ /**
360
+ * The ID of the connected company.
361
+ */
362
+ company_id?: string;
363
+ /**
364
+ * The refresh token. This token must be stored and used for issuing new access tokens for managing the company's resources.
365
+ */
366
+ refresh_token?: string;
367
+ /**
368
+ * The ID of the user who connected the company.
369
+ */
370
+ user_id?: string;
371
+ };
372
+ /**
373
+ * CompanyAlreadyExistsErrorResponse
374
+ *
375
+ * Error returned when a company with matching criteria already exists
376
+ */
377
+ type CompanyAlreadyExistsErrorResponse = {
378
+ code?: string;
379
+ message?: string;
380
+ resource_id?: string;
381
+ resource_type?: string;
382
+ };
351
383
  /**
352
384
  * CostCalculatorEmploymentParam
353
385
  */
@@ -388,6 +420,10 @@ type LimitedDaysandHoursResponse = {
388
420
  type Country = {
389
421
  alpha_2_code: string;
390
422
  code: string;
423
+ /**
424
+ * Contractor product names available for this country
425
+ */
426
+ contractor_products_available?: Array<'standard' | 'plus' | 'cor'>;
391
427
  country_subdivisions?: Array<CountrySubdivision> | null;
392
428
  eor_onboarding?: boolean;
393
429
  locked_benefits?: string;
@@ -413,6 +449,12 @@ type CreateOffboardingParams = {
413
449
  * The status of the user
414
450
  */
415
451
  type UserStatus = 'active' | 'created' | 'initiated' | 'cancelled' | 'inactive' | 'deleted';
452
+ /**
453
+ * CompanyCreationResponse
454
+ */
455
+ type CompanyCreationResponse = {
456
+ data?: CompanyResponse | CompanyWithTokensResponse;
457
+ };
416
458
  /**
417
459
  * CostCalculatorEstimateParams
418
460
  */
@@ -660,6 +702,15 @@ type OffboardingFile = {
660
702
  */
661
703
  name: string;
662
704
  };
705
+ /**
706
+ * RefreshTokenResponse
707
+ */
708
+ type RefreshTokenResponse = BaseTokenResponse & {
709
+ /**
710
+ * The refresh token
711
+ */
712
+ refresh_token?: string;
713
+ };
663
714
  /**
664
715
  * UnprocessableEntityResponse
665
716
  */
@@ -720,6 +771,10 @@ type CostCalculatorCost = {
720
771
  zendesk_article_id: string | null;
721
772
  zendesk_article_url: string | null;
722
773
  };
774
+ /**
775
+ * OAuth2Tokens
776
+ */
777
+ type OAuth2Tokens = AuthorizationCodeResponse | ClientCredentialsResponse | RefreshTokenResponse;
723
778
  /**
724
779
  * CostCalculatorCosts
725
780
  */
@@ -817,6 +872,25 @@ type Product = {
817
872
  short_name?: string;
818
873
  tier: string;
819
874
  };
875
+ /**
876
+ * CompanyResponse
877
+ *
878
+ * Shows a company
879
+ */
880
+ type CompanyResponse = {
881
+ data: {
882
+ company?: Company;
883
+ };
884
+ };
885
+ /**
886
+ * CompanyWithTokensResponse
887
+ *
888
+ * Shows a company with its refresh and access tokens. Please contact Remote if you need the tokens when creating a company.
889
+ */
890
+ type CompanyWithTokensResponse = {
891
+ company?: Company;
892
+ tokens?: OAuth2Tokens;
893
+ };
820
894
  /**
821
895
  * ListLeavePoliciesSummaryResponse
822
896
  *
@@ -1001,6 +1075,10 @@ type CreateContractDocument = {
1001
1075
  contract_document: {
1002
1076
  [key: string]: unknown;
1003
1077
  };
1078
+ /**
1079
+ * When true, skips AI-based compliance checks (e.g. services and deliverables classification). Defaults to false.
1080
+ */
1081
+ skip_ai_checks?: boolean;
1004
1082
  };
1005
1083
  /**
1006
1084
  * ValidationError
@@ -1054,6 +1132,10 @@ type Signatory = {
1054
1132
  type NullableCountry = {
1055
1133
  alpha_2_code: string;
1056
1134
  code: string;
1135
+ /**
1136
+ * Contractor product names available for this country
1137
+ */
1138
+ contractor_products_available?: Array<'standard' | 'plus' | 'cor'>;
1057
1139
  country_subdivisions?: Array<CountrySubdivision> | null;
1058
1140
  eor_onboarding?: boolean;
1059
1141
  locked_benefits?: string;
@@ -1205,10 +1287,103 @@ type CostCalculatorEmployment = {
1205
1287
  region: MinimalRegion;
1206
1288
  regional_currency_costs: CostCalculatorCosts;
1207
1289
  };
1290
+ /**
1291
+ * CreateCompanyParams
1292
+ */
1293
+ type CreateCompanyParams = {
1294
+ /**
1295
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1296
+ * Use the desired country and `address_details` as the form name for the placeholders.
1297
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1298
+ *
1299
+ */
1300
+ address_details?: {
1301
+ [key: string]: unknown;
1302
+ };
1303
+ /**
1304
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1305
+ * Use the desired country and `bank_account_details` as the form name for the placeholders.
1306
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1307
+ *
1308
+ */
1309
+ bank_account_details?: {
1310
+ [key: string]: unknown;
1311
+ };
1312
+ /**
1313
+ * The company owner email.
1314
+ *
1315
+ * This value cannot be changed once set.
1316
+ *
1317
+ */
1318
+ company_owner_email: string;
1319
+ /**
1320
+ * The company owner name.
1321
+ *
1322
+ * This value cannot be changed from the Remote API once set.
1323
+ *
1324
+ */
1325
+ company_owner_name: string;
1326
+ /**
1327
+ * 3-letter country code of the country the company address is located in.
1328
+ *
1329
+ * For a list of countries supported through the Remote API, make a call to the [list countries endpoint](#tag/Countries/operation/get_supported_country). This endpoint will also include the 3-letter country codes you can use for this field.
1330
+ *
1331
+ */
1332
+ country_code: string;
1333
+ /**
1334
+ * Desired currency for invoicing and displaying converted salaries in Remote UI regardless of the employee's country.
1335
+ */
1336
+ desired_currency: 'AUD' | 'CAD' | 'CHF' | 'DKK' | 'EUR' | 'GBP' | 'JPY' | 'NOK' | 'NZD' | 'SEK' | 'SGD' | 'USD';
1337
+ /**
1338
+ * The domain of the company. Use this field to specify the company domain name when it's different from the domain in the company owner's email.
1339
+ */
1340
+ email_domain?: string;
1341
+ /**
1342
+ * Id of the company as represented in the external partner system.
1343
+ */
1344
+ external_id?: string;
1345
+ /**
1346
+ * The company name
1347
+ */
1348
+ name: string;
1349
+ /**
1350
+ * A phone number the company can be contacted with.
1351
+ */
1352
+ phone_number?: string;
1353
+ /**
1354
+ * The company registration number. This field or `tax_number` (but not both) should be submitted.
1355
+ */
1356
+ registration_number?: string;
1357
+ /**
1358
+ * The tax identifier of the company. This field or `registration_number` (but not both) should be submitted.
1359
+ */
1360
+ tax_number?: string;
1361
+ /**
1362
+ * Date and time the Terms of Service were accepted. To ensure users read the most recent version of Remote's Terms of Service, their action cannot have been done more than fifteen minutes ago. The UTC offset must be included in the ISO 8601 format: `YYYY-MM-DD HOURS:MINUTES:SECONDSZ`
1363
+ */
1364
+ terms_of_service_accepted_at: string;
1365
+ };
1208
1366
  /**
1209
1367
  * UuidSlug
1210
1368
  */
1211
1369
  type UuidSlug = string;
1370
+ /**
1371
+ * BaseTokenResponse
1372
+ */
1373
+ type BaseTokenResponse = {
1374
+ /**
1375
+ * A JWT token.
1376
+ */
1377
+ access_token?: string;
1378
+ /**
1379
+ * Number of seconds until token is expired.
1380
+ */
1381
+ expires_in?: number;
1382
+ /**
1383
+ * The type of the token. For now, always `Bearer`.
1384
+ */
1385
+ token_type?: string;
1386
+ };
1212
1387
  /**
1213
1388
  * SuccessResponse
1214
1389
  */
@@ -1427,6 +1602,10 @@ type ContractorSubscriptionsSummary = {
1427
1602
  is_termination_fees_enabled?: boolean;
1428
1603
  price: {
1429
1604
  amount?: number;
1605
+ /**
1606
+ * The price after applying the company discount, in cents
1607
+ */
1608
+ final_amount?: number;
1430
1609
  };
1431
1610
  product: Product;
1432
1611
  total_amount: number | null;
@@ -1524,6 +1703,63 @@ type UnauthorizedResponse = {
1524
1703
  type PricingPlanDetails = {
1525
1704
  frequency: 'annually' | 'monthly';
1526
1705
  };
1706
+ /**
1707
+ * UpdateCompanyParams
1708
+ */
1709
+ type UpdateCompanyParams = {
1710
+ /**
1711
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1712
+ * Use the desired country and `address_details` as the form name for the placeholders.
1713
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1714
+ *
1715
+ */
1716
+ address_details?: {
1717
+ [key: string]: unknown;
1718
+ };
1719
+ /**
1720
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1721
+ * Use the desired country and `bank_account_details` as the form name for the placeholders.
1722
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1723
+ *
1724
+ */
1725
+ bank_account_details?: {
1726
+ [key: string]: unknown;
1727
+ };
1728
+ /**
1729
+ * Country of company address
1730
+ */
1731
+ country_code?: string;
1732
+ /**
1733
+ * Desired currency for invoicing and displaying converted salaries in Remote UI regardless of the employee's country.
1734
+ *
1735
+ * This field is only accepted if company is in status `pending`. Please contact Remote if you wish to update it.
1736
+ *
1737
+ */
1738
+ desired_currency?: 'AUD' | 'CAD' | 'CHF' | 'DKK' | 'EUR' | 'GBP' | 'JPY' | 'NOK' | 'NZD' | 'SEK' | 'SGD' | 'USD';
1739
+ /**
1740
+ * This field is only accepted if company is in status `pending`. Please contact Remote if you wish to update it.
1741
+ *
1742
+ */
1743
+ name?: string;
1744
+ /**
1745
+ * A phone number the company can be contacted with.
1746
+ */
1747
+ phone_number?: string;
1748
+ /**
1749
+ * The company registration number. This field or tax_number (but not both) should be submitted.
1750
+ *
1751
+ * This field is only accepted if company is in status `pending`.
1752
+ *
1753
+ */
1754
+ registration_number?: string;
1755
+ /**
1756
+ * The tax identifier of the company. This field or registration_number (but not both) should be submitted.
1757
+ *
1758
+ * This field is only accepted if company is in status `pending`.
1759
+ *
1760
+ */
1761
+ tax_number?: string;
1762
+ };
1527
1763
  /**
1528
1764
  * SignContractDocument
1529
1765
  *
@@ -1702,6 +1938,17 @@ type Decimal = string;
1702
1938
  type MessageResponse = {
1703
1939
  message: string;
1704
1940
  };
1941
+ /**
1942
+ * CompanyNotEligibleForCreationErrorResponse
1943
+ *
1944
+ * Error returned when the company already have employees in countries supported by the integration.
1945
+ */
1946
+ type CompanyNotEligibleForCreationErrorResponse = {
1947
+ code?: string;
1948
+ message?: string;
1949
+ resource_id?: string;
1950
+ resource_type?: string;
1951
+ };
1705
1952
  /**
1706
1953
  * SalaryDecreaseDetails
1707
1954
  *
@@ -1825,6 +2072,12 @@ type HelpCenterArticle = {
1825
2072
  */
1826
2073
  zendesk_id: number;
1827
2074
  };
2075
+ /**
2076
+ * CompanyCreationConflictErrorResponse
2077
+ */
2078
+ type CompanyCreationConflictErrorResponse = {
2079
+ message?: CompanyAlreadyExistsErrorResponse | CompanyNotEligibleForCreationErrorResponse;
2080
+ };
1828
2081
  /**
1829
2082
  * EmploymentResponse
1830
2083
  *
@@ -1912,4 +2165,4 @@ type PostAutomatableContractAmendmentErrors = {
1912
2165
  };
1913
2166
  type PostAutomatableContractAmendmentError = PostAutomatableContractAmendmentErrors[keyof PostAutomatableContractAmendmentErrors];
1914
2167
 
1915
- export type { ListLeavePoliciesSummaryResponse as $, FileParams as A, BadRequestResponse as B, ContractAmendmentAutomatableResponse as C, SignContractDocument as D, Employment as E, ForbiddenResponse as F, ContractorSubscriptionsSummary as G, ManageContractorPlusSubscriptionOperationsParams as H, CreateContractDocument as I, File as J, DateTimeIso8601 as K, ContractDocumentItem as L, MinimalRegion as M, NotFoundResponse as N, OffboardingResponse as O, PostCreateContractAmendmentError as P, EligibilityQuestionnaireResponse as Q, RequestError as R, SuccessResponse as S, TooManyRequestsResponse as T, UnprocessableEntityResponse as U, ValidationError as V, ConflictErrorResponse as W, SubmitEligibilityQuestionnaireRequest as X, ListTimeoffResponse as Y, TimeoffStatus as Z, TimeoffType as _, UnauthorizedResponse as a, CreateOffboardingParams as a0, MagicLinkResponse as a1, MagicLinkParams as a2, GetShowEmploymentResponse as a3, Currency as a4, HelpCenterArticle as a5, PayrollCalendarEor as a6, ContractAmendmentResponse as b, PostAutomatableContractAmendmentError as c, EmploymentCreationResponse as d, EmploymentResponse as e, CreateContractDocumentResponse as f, Signatory as g, CompanyLegalEntity as h, CostCalculatorEstimateResponse as i, CostCalculatorEstimatePdfResponse as j, CostCalculatorEstimateParams as k, CostCalculatorEstimateCsvResponse as l, MinimalCountry as m, EmploymentTermType as n, CostCalculatorEmployment as o, PostCreateEstimationError as p, Company as q, ConflictResponse as r, EmploymentCreateParams as s, EmploymentFullParams as t, UnifiedEmploymentUpsertBenefitOffersRequest as u, ConvertCurrencyResponse as v, ConvertCurrencyParams as w, CreateContractEligibilityParams as x, TerminationDetailsParams as y, UploadFileResponse as z };
2168
+ export type { EligibilityQuestionnaireResponse as $, UnifiedEmploymentUpsertBenefitOffersRequest as A, BadRequestResponse as B, ContractAmendmentAutomatableResponse as C, ConvertCurrencyResponse as D, Employment as E, ForbiddenResponse as F, ConvertCurrencyParams as G, CreateContractEligibilityParams as H, TerminationDetailsParams as I, UploadFileResponse as J, FileParams as K, SignContractDocument as L, MinimalRegion as M, NotFoundResponse as N, OffboardingResponse as O, PostCreateContractAmendmentError as P, ContractorSubscriptionsSummary as Q, RequestError as R, SuccessResponse as S, TooManyRequestsResponse as T, UnprocessableEntityResponse as U, ValidationError as V, ManageContractorPlusSubscriptionOperationsParams as W, CreateContractDocument as X, File as Y, DateTimeIso8601 as Z, ContractDocumentItem as _, UnauthorizedResponse as a, ConflictErrorResponse as a0, SubmitEligibilityQuestionnaireRequest as a1, ListTimeoffResponse as a2, TimeoffStatus as a3, TimeoffType as a4, ListLeavePoliciesSummaryResponse as a5, CreateOffboardingParams as a6, MagicLinkResponse as a7, MagicLinkParams as a8, GetShowEmploymentResponse as a9, Currency as aa, HelpCenterArticle as ab, PayrollCalendarEor as ac, ContractAmendmentResponse as b, PostAutomatableContractAmendmentError as c, CostCalculatorEstimateResponse as d, CostCalculatorEstimatePdfResponse as e, CostCalculatorEstimateParams as f, CostCalculatorEstimateCsvResponse as g, MinimalCountry as h, EmploymentTermType as i, CostCalculatorEmployment as j, PostCreateEstimationError as k, EmploymentCreationResponse as l, EmploymentResponse as m, CreateContractDocumentResponse as n, EligibilityQuestionnaire as o, Signatory as p, CompanyLegalEntity as q, CompanyCreationResponse as r, CompanyCreationConflictErrorResponse as s, CreateCompanyParams as t, CompanyResponse as u, UpdateCompanyParams as v, Company as w, ConflictResponse as x, EmploymentCreateParams as y, EmploymentFullParams as z };
@@ -1,6 +1,6 @@
1
1
  import { ClassValue } from 'clsx';
2
2
  import { ValidationError } from 'yup';
3
- import './remoteFlows-XefHitC9.js';
3
+ import './remoteFlows-Bphgh2nl.js';
4
4
 
5
5
  declare function cn(...inputs: ClassValue[]): string;
6
6
  type YupError = Pick<ValidationError, 'type' | 'errors'> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/remote-flows",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/remoteoss/remote-flows.git"
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-NHJT3DJU.js";import"./chunk-UVAK3ZEO.js";import"./chunk-T7CGGZOK.js";import"./chunk-CU3WQ2KN.js";import"./chunk-AA3QOH66.js";import"./chunk-ZSJ6YADQ.js";import"./chunk-BYX2YS2B.js";import"./chunk-OK3CYSHV.js";import"./chunk-AS4ND5IO.js";import"./chunk-4YPJKEHT.js";import"./chunk-2DCJODMR.js";import"./chunk-3PIJOIYR.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as CountryFieldDefault};
2
- //# sourceMappingURL=CountryFieldDefault-BBMP6LHE.js.map
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-BDNJNMR5.js";import"./chunk-UVAK3ZEO.js";import"./chunk-CU3WQ2KN.js";import"./chunk-AA3QOH66.js";import"./chunk-ZSJ6YADQ.js";import"./chunk-BYX2YS2B.js";import"./chunk-4YPJKEHT.js";import"./chunk-2DCJODMR.js";import"./chunk-3PIJOIYR.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as DatePickerFieldDefault};
2
- //# sourceMappingURL=DatePickerFieldDefault-LBR6A7BF.js.map
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-NWWR6SBR.js";import"./chunk-UVAK3ZEO.js";import"./chunk-AA3QOH66.js";import"./chunk-ZSJ6YADQ.js";import"./chunk-BYX2YS2B.js";import"./chunk-JEULZR34.js";import"./chunk-2DCJODMR.js";import"./chunk-3PIJOIYR.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as RadioGroupFieldDefault};
2
- //# sourceMappingURL=RadioGroupFieldDefault-5GHWP2P6.js.map
@@ -1,2 +0,0 @@
1
- import{a as Xt,b as Yt,d as Zt,e as te}from"./chunk-SATHKK5B.js";import{f as qt,h as It,i as Dt,k as Lt}from"./chunk-4AM73KSF.js";import{a as Tt,b as Bt,c as jt,d as Jt,f as xt,g as Qt,h as kt,i as Kt,j as Nt,k as Ut,l as Gt,m as $t,n as zt,o as Ht,p as Wt}from"./chunk-EM5VOM56.js";import{a as ee,b as ne,c as ie}from"./chunk-6YEAHKT6.js";import{a as X,b as st,c as h}from"./chunk-O3G6HQ3B.js";import{a as Rt}from"./chunk-XY2IEZHC.js";import{a as Ot,e as p,f as O}from"./chunk-T7O3YYOG.js";import{G as vt,Q as Mt}from"./chunk-BYX2YS2B.js";import{h as w,i as Q}from"./chunk-3PIJOIYR.js";import{a as _}from"./chunk-X6ZAR7ZL.js";import{a as At}from"./chunk-5BRMLRS7.js";import{d as W}from"./chunk-KQPDXXG3.js";import{a as s}from"./chunk-P37U34EQ.js";import{useEffect as ct,useMemo as o,useRef as nn,useState as Y}from"react";import ae from"lodash.omit";import{useQuery as Ze}from"@tanstack/react-query";import{useQuery as Ye}from"@tanstack/react-query";var oe=s(()=>{let{client:y}=W();return Ye({queryKey:["identity"],queryFn:s(()=>Mt({client:y,headers:{Authorization:""}}),"queryFn"),select:s(g=>g.data?.data,"select")})},"useIdentity");function tn(y){return y!=null&&"company"in y}s(tn,"hasCompany");var en=s(()=>{let{client:y}=W(),{data:g}=oe(),r=tn(g)?g?.company?.id??"":"";return Ze({queryKey:["legal-entities",r],queryFn:s(()=>vt({client:y,path:{company_id:r}}),"queryFn"),select:s(k=>k.data?.data?.legal_entities,"select"),enabled:!!r})},"useLegalEntities"),re=s(()=>{let{data:y}=en();return y?.find(g=>g.is_default)},"useDefaultLegalEntity");var on={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},rn={employment_basic_information:"basic_information"},An=s(({countryCode:y,externalId:g,employmentId:r,skipSteps:k,options:b,initialValues:u})=>{let[d,lt]=Y(y||null),[a,se]=Y(r),[F,ut]=Y(void 0),K=nn({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[N,ce]=Y(void 0),{steps:le,stepsArray:ue}=o(()=>Xt({includeSelectCountry:!k?.includes("select_country"),includeEligibilityQuestionnaire:N===h}),[N,k]),{fieldValues:l,stepState:e,setFieldValues:de,previousStep:me,nextStep:pe,goToStep:Z,setStepValues:dt}=At(le),{data:c,isLoading:ye,refetch:fe}=Rt({employmentId:a,queryParams:{exclude_files:!0}}),_e=re(),{status:q}=c||{},P=q&&Zt.includes(q),ge=q&&!te.includes(q),be=o(()=>q==="invited"?"invited":"not_invited",[q]),mt=It(),pt=Dt(d,b),tt=Qt(),yt=Tt(),{mutateAsync:ft}=Nt(tt,yt,l),_t=zt(),gt=Ht(),{mutateAsyncOrThrow:Se}=_(pt),bt=jt(),St=xt(),Ct=Wt(),{mutateAsyncOrThrow:Ce}=_(mt),{mutateAsyncOrThrow:we}=_(tt),{mutateAsyncOrThrow:he}=_(bt),{mutateAsyncOrThrow:wt}=_(St),{mutateAsyncOrThrow:Fe}=_(_t),{mutateAsyncOrThrow:Pe}=_(gt),{mutateAsyncOrThrow:Ve}=_(Ct);r&&c?.country?.code&&!d&&lt(c.country.code);let{selectCountryForm:U,isLoading:Ee}=Lt({jsfModify:b?.jsfModify?.select_country,queryOptions:{enabled:e.currentStep.name==="select_country"}}),{form:V,isLoading:ve,contractorSubscriptions:I,refetch:et}=Kt(a,{jsonSchemaVersion:b?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="pricing_plan"||!!r&&P},jsfModify:b?.jsfModify?.pricing_plan}),G=o(()=>!!I?.find(t=>t.product.short_name==="COR")?.eligibility_questionnaire?.submitted_at,[I]),Me=o(()=>I?.find(i=>i.product.short_name==="COR")?.eligibility_questionnaire?.is_blocking,[I]),$=o(()=>I?.find(t=>t.product.short_name==="COR")?.eligibility_questionnaire?.responses,[I]),Oe=on[e.currentStep.name]||"contractor_basic_information",qe=rn[Oe],Ie=c?.[qe]||{},De=s(({form:t,options:i={},query:m={}})=>{let D=Object.keys(l).length>0?{...u,...e.values?.[e.currentStep.name],...l}:{...u,...Ie};return qt({countryCode:d,form:t,fieldValues:D,query:m,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}}})},"useJSONSchema"),Le=!!(d&&(e.currentStep.name==="basic_information"||r)),Re=!!(d&&(e.currentStep.name==="contract_details"||r)),Ae=!!(d==="GBR"&&r&&e.currentStep.name==="basic_information"),{data:L,isLoading:Te}=Ut(r,{enabled:Ae}),{data:z,isLoading:Be}=Gt(r,{enabled:!!r});ct(()=>{z&&z.length>0&&!F&&ut(z[0].id)},[z,F]);let{data:S,isLoading:je}=De({form:"contractor_basic_information",options:{jsfModify:ne(d,b),queryOptions:{enabled:Le}}}),Je=o(()=>Yt(c?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date),[c?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date]),f=o(()=>{let t={standard:X,plus:st,cor:h};if(l.subscription)return l.subscription;let i=e.values?.pricing_plan?.subscription;return i||(G?h:t[c?.contractor_type]||X)},[l,e.values,G,c?.contractor_type]);ct(()=>{f&&f!==N&&ce(f)},[f,N]);let xe=o(()=>({...$,...u,...e.values?.eligibility_questionnaire,...l}),[$,u,e.values?.eligibility_questionnaire,l]),Qe=o(()=>f===h&&e.currentStep.name==="eligibility_questionnaire"||!!r&&P&&f===h,[f,e.currentStep.name,r,P]),{data:E,isLoading:ke}=$t({options:{queryOptions:{enabled:Qe},jsfModify:b?.jsfModify?.eligibility_questionnaire},fieldValues:xe}),{data:C,isLoading:Ke}=kt({countryCode:d,fieldValues:l,employmentId:a,options:{queryOptions:{enabled:Re},jsfModify:ee(b?.jsfModify?.contract_details,Je,f,l)}}),Ne=o(()=>e.currentStep.name==="contract_preview"||!!r&&P,[e.currentStep.name,r,P]),{data:v}=Bt({fieldValues:l,options:{queryOptions:{enabled:Ne},jsfModify:ie(b,l)}}),{data:nt,isLoading:Ue}=Jt({employmentId:a,contractDocumentId:F,options:{queryOptions:{enabled:!!F}}}),n=o(()=>({select_country:U?.fields||[],basic_information:S?.fields||[],pricing_plan:V?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:C?.fields||[],contract_preview:v?.fields||[],review:[]}),[U?.fields,S?.fields,V?.fields,C?.fields,v?.fields,E?.fields]),Ge={select_country:null,basic_information:S?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:C?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},{country:$e,basic_information:H={},contract_details:ht={}}=c||{},Ft=$e?.code,R=o(()=>O(n.select_country,{country:d||Ft||""}),[n.select_country,d,Ft]),it=o(()=>L?.content?Ot(L.content,L.name):null,[L?.content,L?.name]),A=o(()=>{let t={...u,...H,ir35:c?.contract_details?.ir_35,saudi_nationality_status:c?.contract_details?.nationality,...it&&{ir35_sds_file:[it]}};return O(n.basic_information,t)},[u,H,c?.contract_details?.ir_35,c?.contract_details?.nationality,it,n.basic_information]),T=o(()=>{let i={...{service_duration:{provisional_start_date:H.provisional_start_date}},...u,...ht};return O(n.contract_details,i)},[n.contract_details,ht,u,H]),B=o(()=>{let t=nt?.contract_document?.signatories?.find(m=>m.type==="company"),i={...u,signature:t?.signature};return O(n.contract_preview,i)},[n.contract_preview,u,nt]),j=o(()=>{let i={...{subscription:f},...u};return O(n.pricing_plan,i)},[n.pricing_plan,u,f]),J=o(()=>{let t={...u,...$};return O(n.eligibility_questionnaire,t)},[n.eligibility_questionnaire,u,$]),ze=o(()=>({select_country:R,basic_information:A,contract_details:T,contract_preview:B,pricing_plan:j,eligibility_questionnaire:J}),[R,A,T,B,j,J]),ot=!!(r&&P&&e.currentStep.name!=="review"),rt=Ee||je||ye||Ke||ve||Ue||Te||Be||ke,Pt=o(()=>!!(ot&&!rt&&F&&n.basic_information.length>0&&n.contract_details.length>0&&n.contract_preview.length>0),[ot,rt,F,n.basic_information.length,n.contract_details.length,n.contract_preview.length]);ct(()=>{Pt&&(K.current={select_country:w(R,n.select_country),basic_information:w(A,n.basic_information),contract_details:w(T,n.contract_details),contract_preview:w(B,n.contract_preview),pricing_plan:w(j,n.pricing_plan),eligibility_questionnaire:w(J,n.eligibility_questionnaire)},dt({select_country:R,basic_information:A,contract_details:T,contract_preview:B,pricing_plan:j,eligibility_questionnaire:J,review:{}}),Z("review"))},[Pt,Z,R,A,T,dt,n.select_country,n.basic_information,n.contract_details,n.pricing_plan,j,n.contract_preview,B,n.eligibility_questionnaire,J]);let He=s(t=>{Z(t)},"goTo"),Vt=s(async t=>U&&e.currentStep.name==="select_country"?t:S&&e.currentStep.name==="basic_information"?await p(t,S?.fields,{isPartialValidation:!1}):C&&e.currentStep.name==="contract_details"?await p(t,C?.fields,{isPartialValidation:!1}):v&&e.currentStep.name==="contract_preview"?await p(t,v?.fields,{isPartialValidation:!1}):V&&e.currentStep.name==="pricing_plan"?await p(t,V?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await p(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function We(t){let i=e.currentStep.name;i in K.current&&(K.current[i]=w(t,n[i]));let m=await Vt(t);switch(e.currentStep.name){case"select_country":return lt(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let M=!a&&d,D=a&&d&&c?.country&&c?.country.code!==d;if(M||D){let Xe={basic_information:ae(m,"saudi_nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:d,external_id:g},Et=await Ce(Xe),at=Et?.data?.employment?.id;if(!at)throw Q("Employment ID not found");return se(at),await ft({employmentId:at}),Et}else if(a){let x=ae(m,"saudi_nationality_status","ir35","ir35_sds_file");return await ft({employmentId:a}),Se({employmentId:a,basic_information:x})}return}case"contract_details":{let D=await we({employmentId:a,payload:{contract_document:m}}),x=D?.data?.contract_document?.id;if(!x)throw Q("Contract document ID not found");return ut(x),D}case"contract_preview":return he({employmentId:a,contractDocumentId:F,payload:{signature:m.signature}});case"pricing_plan":{if(G&&t.subscription!==h)try{await Ve({employmentId:a}),await et()}catch(M){if(M?.response?.status!==404)throw M;await et()}if(t.subscription==X)return wt({employmentId:a,payload:{operation:"downgrade"}});if(t.subscription==st)return wt({employmentId:a,payload:{operation:"upgrade"}});if(t.subscription==h)return Promise.resolve({data:{subscription:t.subscription}});throw Q("invalid selection")}case"eligibility_questionnaire":{if(G||Me)return Promise.resolve({data:{eligibility_questionnaire:m}});try{return await Fe({employmentId:a,payload:m}),await Pe({employmentId:a})}finally{await et()}}default:throw Q("Invalid step state")}}return s(We,"onSubmit"),{isLoading:rt||ot,fieldValues:l,stepState:e,checkFieldUpdates:de,back:me,next:pe,goTo:He,onSubmit:We,fields:n[e.currentStep.name],meta:{fields:K.current,fieldsets:Ge[e.currentStep.name]},parseFormValues:Vt,handleValidation:s(async t=>{if(e.currentStep.name==="select_country")return U.handleValidation(t);if(S&&e.currentStep.name==="basic_information"){let i=await p(t,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}if(C&&e.currentStep.name==="contract_details"){let i=await p(t,C?.fields,{isPartialValidation:!1});return C?.handleValidation(i)}if(v&&e.currentStep.name==="contract_preview"){let i=await p(t,v?.fields,{isPartialValidation:!0});return v?.handleValidation(i)}if(V&&e.currentStep.name==="pricing_plan"){let i=await p(t,V?.fields,{isPartialValidation:!1});return V?.handleValidation(i)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let i=await p(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(i)}return null},"handleValidation"),initialValues:ze,employmentId:a,refetchEmployment:fe,isSubmitting:mt.isPending||pt.isPending||tt.isPending||bt.isPending||St.isPending||yt.isPending||_t.isPending||gt.isPending||Ct.isPending,documentPreviewPdf:nt,canInvite:ge,isEmploymentReadOnly:P,invitedStatus:be,employment:c,defaultLegalEntity:_e,steps:ue}},"useContractorOnboarding");export{An as a};
2
- //# sourceMappingURL=chunk-3I3XSAYV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx","../src/common/api/legal-entities.ts","../src/common/api/identity.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\nimport omit from 'lodash.omit';\nimport { $TSFixMe, 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 useUpdateUKandSaudiFields,\n useGetIR35File,\n useGetContractDocuments,\n useGetEligibilityQuestionnaire,\n usePostCreateEligibilityQuestionnaire,\n usePostManageContractorCorSubscription,\n useDeleteContractorCorSubscription,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n buildSteps,\n calculateProvisionalStartDateDescription,\n reviewStepAllowedEmploymentStatus,\n disabledInviteButtonEmploymentStatus,\n StepKeys,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCountriesSchemaField,\n useCreateEmployment,\n useJSONSchemaForm,\n useUpdateEmployment,\n} from '@/src/flows/Onboarding/api';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { createStructuredError, prettifyFormValues } from '@/src/lib/utils';\nimport { JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport {\n contractorStandardProductIdentifier,\n contractorPlusProductIdentifier,\n corProductIdentifier,\n} from '@/src/flows/ContractorOnboarding/constants';\nimport {\n buildBasicInformationJsfModify,\n buildContractDetailsJsfModify,\n buildContractPreviewJsfModify,\n} from '@/src/flows/ContractorOnboarding/jsfModify';\nimport { useUploadFile } from '@/src/common/api/files';\nimport { dataURLtoFile } from '@/src/lib/files';\nimport { useEmploymentQuery } from '@/src/common/api/employment';\nimport { useDefaultLegalEntity } from '@/src/common/api/legal-entities';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<StepKeys, JSONSchemaFormType | null> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n eligibility_questionnaire: null,\n pricing_plan: null,\n contract_preview: null,\n review: null,\n};\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n};\n\nexport const useContractorOnboarding = ({\n countryCode,\n externalId,\n employmentId,\n skipSteps,\n options,\n initialValues: onboardingInitialValues,\n}: useContractorOnboardingProps) => {\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalContractDocumentId, setInternalContractDocumentId] = useState<\n string | undefined\n >(undefined);\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n contract_preview: Meta;\n pricing_plan: Meta;\n eligibility_questionnaire: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n eligibility_questionnaire: {},\n });\n\n const [selectedProduct, setSelectedProduct] = useState<string | undefined>(\n undefined,\n );\n\n const { steps, stepsArray } = useMemo(\n () =>\n buildSteps({\n includeSelectCountry: !skipSteps?.includes('select_country'),\n includeEligibilityQuestionnaire:\n selectedProduct === corProductIdentifier,\n }),\n [selectedProduct, skipSteps],\n );\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(steps);\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmploymentQuery({\n employmentId: internalEmploymentId as string,\n queryParams: { exclude_files: true },\n });\n\n const defaultLegalEntity = useDefaultLegalEntity();\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 updateEmploymentMutation = useUpdateEmployment(\n internalCountryCode as string,\n options,\n );\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const uploadFileMutation = useUploadFile();\n const { mutateAsync: updateUKandSaudiFieldsMutation } =\n useUpdateUKandSaudiFields(\n createContractorContractDocumentMutation,\n uploadFileMutation,\n fieldValues,\n );\n const createEligibilityQuestionnaireMutation =\n usePostCreateEligibilityQuestionnaire();\n const manageContractorCorSubscriptionMutation =\n usePostManageContractorCorSubscription();\n\n const { mutateAsyncOrThrow: updateEmploymentMutationAsync } =\n mutationToPromise(updateEmploymentMutation);\n const signContractDocumentMutation = useSignContractDocument();\n const manageContractorSubscriptionMutation =\n usePostManageContractorSubscriptions();\n const deleteContractorCorSubscriptionMutation =\n useDeleteContractorCorSubscription();\n\n const { mutateAsyncOrThrow: createEmploymentMutationAsync } =\n mutationToPromise(createEmploymentMutation);\n\n const { mutateAsyncOrThrow: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsyncOrThrow: signContractDocumentMutationAsync } =\n mutationToPromise(signContractDocumentMutation);\n\n const { mutateAsyncOrThrow: manageContractorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorSubscriptionMutation);\n\n const { mutateAsyncOrThrow: createEligibilityQuestionnaireMutationAsync } =\n mutationToPromise(createEligibilityQuestionnaireMutation);\n\n const { mutateAsyncOrThrow: manageContractorCorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorCorSubscriptionMutation);\n\n const { mutateAsyncOrThrow: deleteContractorCorSubscriptionMutationAsync } =\n mutationToPromise(deleteContractorCorSubscriptionMutation);\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 contractorSubscriptions,\n refetch: refetchContractorSubscriptions,\n } = useContractorSubscriptionSchemaField(internalEmploymentId as string, {\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled:\n stepState.currentStep.name === 'pricing_plan' ||\n (Boolean(employmentId) && isEmploymentReadOnly),\n },\n jsfModify: options?.jsfModify?.pricing_plan,\n });\n\n const hasEligibilityQuestionnaireSubmitted = useMemo(() => {\n return Boolean(\n contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n )?.eligibility_questionnaire?.submitted_at,\n );\n }, [contractorSubscriptions]);\n\n const isEligibilityBlocked = useMemo(() => {\n const corSubscription = contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n );\n\n return corSubscription?.eligibility_questionnaire?.is_blocking;\n }, [contractorSubscriptions]);\n\n const eligibilityAnswers = useMemo(() => {\n return contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n )?.eligibility_questionnaire?.responses;\n }, [contractorSubscriptions]);\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 isIR35FileEnabled = Boolean(\n internalCountryCode === 'GBR' &&\n employmentId &&\n stepState.currentStep.name === 'basic_information',\n );\n\n const { data: ir35File, isLoading: isLoadingIR35File } = useGetIR35File(\n employmentId as string,\n {\n enabled: isIR35FileEnabled,\n },\n );\n\n const { data: contractDocuments, isLoading: isLoadingContractDocuments } =\n useGetContractDocuments(employmentId as string, {\n enabled: Boolean(employmentId),\n });\n\n useEffect(() => {\n if (\n contractDocuments &&\n contractDocuments.length > 0 &&\n !internalContractDocumentId\n ) {\n setInternalContractDocumentId(contractDocuments[0].id);\n }\n }, [contractDocuments, internalContractDocumentId]);\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'contractor_basic_information',\n options: {\n jsfModify: buildBasicInformationJsfModify(\n internalCountryCode as string,\n options,\n ),\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 /**\n * When the user selects COR, the data isn't saved yet in the BE\n * We need to use the internalState to know what has happened\n */\n const selectedPricingPlan = useMemo(() => {\n const subscriptions = {\n standard: contractorStandardProductIdentifier,\n plus: contractorPlusProductIdentifier,\n cor: corProductIdentifier,\n };\n\n // HIGHEST PRIORITY: Current form value (user is actively selecting)\n if (fieldValues.subscription) {\n return fieldValues.subscription;\n }\n\n // SECOND: Previously submitted value in this session\n const subscription = stepState.values?.pricing_plan?.subscription;\n if (subscription) {\n return subscription;\n }\n\n // THIRD: Backend state (eligibility submitted or employment contractor_type)\n if (hasEligibilityQuestionnaireSubmitted) {\n return corProductIdentifier;\n }\n\n // FALLBACK: Employment contractor_type or default\n return (\n subscriptions[\n employment?.contractor_type as keyof typeof subscriptions\n ] || contractorStandardProductIdentifier\n );\n }, [\n fieldValues,\n stepState.values,\n hasEligibilityQuestionnaireSubmitted,\n employment?.contractor_type,\n ]);\n\n useEffect(() => {\n if (selectedPricingPlan && selectedPricingPlan !== selectedProduct) {\n setSelectedProduct(selectedPricingPlan);\n }\n }, [selectedPricingPlan, selectedProduct]);\n\n const eligibilityFields = useMemo(() => {\n return {\n ...eligibilityAnswers,\n ...onboardingInitialValues,\n ...stepState.values?.eligibility_questionnaire,\n ...fieldValues,\n };\n }, [\n eligibilityAnswers,\n onboardingInitialValues,\n stepState.values?.eligibility_questionnaire,\n fieldValues,\n ]);\n\n const isEligibilityQuestionnaireEnabled = useMemo(() => {\n return (\n (selectedPricingPlan === corProductIdentifier &&\n stepState.currentStep.name === 'eligibility_questionnaire') ||\n (Boolean(employmentId) &&\n isEmploymentReadOnly &&\n selectedPricingPlan === corProductIdentifier)\n );\n }, [\n selectedPricingPlan,\n stepState.currentStep.name,\n employmentId,\n isEmploymentReadOnly,\n ]);\n\n const {\n data: eligibilityQuestionnaireForm,\n isLoading: isLoadingEligibilityQuestionnaire,\n } = useGetEligibilityQuestionnaire({\n options: {\n queryOptions: {\n enabled: isEligibilityQuestionnaireEnabled,\n },\n jsfModify: options?.jsfModify?.eligibility_questionnaire,\n },\n fieldValues: eligibilityFields,\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n employmentId: internalEmploymentId as string,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: buildContractDetailsJsfModify(\n options?.jsfModify?.contract_details,\n descriptionProvisionalStartDate,\n selectedPricingPlan,\n fieldValues,\n ),\n },\n });\n\n const isSignatureSchemaEnabled = useMemo(() => {\n return (\n stepState.currentStep.name === 'contract_preview' ||\n (Boolean(employmentId) && isEmploymentReadOnly)\n );\n }, [stepState.currentStep.name, employmentId, isEmploymentReadOnly]);\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isSignatureSchemaEnabled,\n },\n jsfModify: buildContractPreviewJsfModify(options, fieldValues),\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<StepKeys, JSFFields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: selectContractorSubscriptionForm?.fields || [],\n eligibility_questionnaire: eligibilityQuestionnaireForm?.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 eligibilityQuestionnaireForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n StepKeys,\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 eligibility_questionnaire: null,\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 // memoize file conversion to avoid re-converting the file on every render\n // noticed performance issues when not doing memoizing individually\n const convertedIr35File = useMemo(() => {\n if (!ir35File?.content) return null;\n return dataURLtoFile(ir35File.content as unknown as string, ir35File.name);\n }, [ir35File?.content, ir35File?.name]);\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n ir35: employment?.contract_details?.ir_35,\n saudi_nationality_status: employment?.contract_details?.nationality,\n ...(convertedIr35File && {\n ir35_sds_file: [convertedIr35File],\n }),\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n onboardingInitialValues,\n employmentBasicInformation,\n employment?.contract_details?.ir_35,\n employment?.contract_details?.nationality,\n convertedIr35File,\n stepFields.basic_information,\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 const signature = documentPreviewPdf?.contract_document?.signatories?.find(\n (signatory) => signatory.type === 'company',\n );\n const initialValues = {\n ...onboardingInitialValues,\n signature: signature?.signature,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n onboardingInitialValues,\n documentPreviewPdf,\n ]);\n\n const pricingPlanInitialValues = useMemo(() => {\n const preselectedPricingPlan = {\n subscription: selectedPricingPlan,\n };\n const initialValues = {\n ...preselectedPricingPlan,\n ...onboardingInitialValues,\n };\n\n return getInitialValues(stepFields.pricing_plan, initialValues);\n }, [stepFields.pricing_plan, onboardingInitialValues, selectedPricingPlan]);\n\n const eligibilityQuestionnaireInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...eligibilityAnswers,\n };\n return getInitialValues(\n stepFields.eligibility_questionnaire,\n initialValues,\n );\n }, [\n stepFields.eligibility_questionnaire,\n onboardingInitialValues,\n eligibilityAnswers,\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 eligibility_questionnaire: eligibilityQuestionnaireInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n pricingPlanInitialValues,\n eligibilityQuestionnaireInitialValues,\n ]);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n const initialLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingContractorSubscriptions ||\n isLoadingDocumentPreviewForm ||\n isLoadingIR35File ||\n isLoadingContractDocuments ||\n isLoadingEligibilityQuestionnaire;\n\n const isNavigatingToReview = useMemo(() => {\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n Boolean(internalContractDocumentId) &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0 &&\n stepFields.contract_preview.length > 0,\n );\n }, [\n shouldHandleReadOnlyEmployment,\n initialLoading,\n internalContractDocumentId,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepFields.contract_preview.length,\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 contract_preview: prettifyFormValues(\n contractPreviewInitialValues,\n stepFields.contract_preview,\n ),\n pricing_plan: prettifyFormValues(\n pricingPlanInitialValues,\n stepFields.pricing_plan,\n ),\n eligibility_questionnaire: prettifyFormValues(\n eligibilityQuestionnaireInitialValues,\n stepFields.eligibility_questionnaire,\n ),\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: pricingPlanInitialValues,\n eligibility_questionnaire: eligibilityQuestionnaireInitialValues,\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 stepFields.pricing_plan,\n pricingPlanInitialValues,\n stepFields.contract_preview,\n contractPreviewInitialValues,\n stepFields.eligibility_questionnaire,\n eligibilityQuestionnaireInitialValues,\n ]);\n\n const goTo = (step: StepKeys) => {\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 (\n selectContractorSubscriptionForm &&\n stepState.currentStep.name === 'pricing_plan'\n ) {\n return await parseJSFToValidate(\n values,\n selectContractorSubscriptionForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n eligibilityQuestionnaireForm &&\n stepState.currentStep.name === 'eligibility_questionnaire'\n ) {\n return await parseJSFToValidate(\n values,\n eligibilityQuestionnaireForm?.fields,\n {\n isPartialValidation: false,\n },\n );\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 basicInformationParsedValues = omit(\n parsedValues,\n 'saudi_nationality_status',\n 'ir35',\n 'ir35_sds_file',\n );\n const basicInformationPayload: EmploymentCreateParams = {\n basic_information: basicInformationParsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n const response = await createEmploymentMutationAsync(\n basicInformationPayload,\n );\n const employmentId = response?.data?.employment?.id;\n if (!employmentId) {\n throw createStructuredError('Employment ID not found');\n }\n\n setInternalEmploymentId(employmentId);\n await updateUKandSaudiFieldsMutation({\n employmentId: employmentId as string,\n });\n\n return response;\n } else if (internalEmploymentId) {\n const basicInformationParsedValues = omit(\n parsedValues,\n 'saudi_nationality_status',\n 'ir35',\n 'ir35_sds_file',\n );\n\n await updateUKandSaudiFieldsMutation({\n employmentId: internalEmploymentId,\n });\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: basicInformationParsedValues,\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response = await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n const contractDocumentId = response?.data?.contract_document?.id;\n if (!contractDocumentId) {\n throw createStructuredError('Contract document ID not found');\n }\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: parsedValues.signature,\n },\n });\n }\n case 'pricing_plan': {\n if (\n hasEligibilityQuestionnaireSubmitted &&\n values.subscription !== corProductIdentifier\n ) {\n try {\n await deleteContractorCorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n });\n await refetchContractorSubscriptions();\n } catch (error) {\n if ((error as $TSFixMe)?.response?.status !== 404) {\n throw error;\n }\n // Still refetch to update the UI state\n await refetchContractorSubscriptions();\n }\n }\n\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 } else if (values.subscription == corProductIdentifier) {\n return Promise.resolve({\n data: { subscription: values.subscription },\n });\n }\n\n throw createStructuredError('invalid selection');\n }\n\n case 'eligibility_questionnaire': {\n // TODO: for now skip sending the questionnaire if it has been submitted or is blockedº\n if (hasEligibilityQuestionnaireSubmitted || isEligibilityBlocked) {\n return Promise.resolve({\n data: { eligibility_questionnaire: parsedValues },\n });\n }\n\n try {\n await createEligibilityQuestionnaireMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: parsedValues,\n });\n\n const response = await manageContractorCorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n });\n\n return response;\n } finally {\n // Always refetch to keep state in sync, even on error\n await refetchContractorSubscriptions();\n }\n }\n\n default: {\n throw createStructuredError('Invalid step state');\n }\n }\n }\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\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: true },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (\n selectContractorSubscriptionForm &&\n stepState.currentStep.name === 'pricing_plan'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n selectContractorSubscriptionForm?.fields,\n { isPartialValidation: false },\n );\n return selectContractorSubscriptionForm?.handleValidation(parsedValues);\n }\n\n if (\n eligibilityQuestionnaireForm &&\n stepState.currentStep.name === 'eligibility_questionnaire'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n eligibilityQuestionnaireForm?.fields,\n { isPartialValidation: false },\n );\n return eligibilityQuestionnaireForm?.handleValidation(parsedValues);\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 updateEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending ||\n manageContractorSubscriptionMutation.isPending ||\n uploadFileMutation.isPending ||\n createEligibilityQuestionnaireMutation.isPending ||\n manageContractorCorSubscriptionMutation.isPending ||\n deleteContractorCorSubscriptionMutation.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 * Default legal entity\n * @returns {CompanyLegalEntity}\n */\n defaultLegalEntity,\n /**\n * Steps array\n * @returns {Array<{name: string, index: number, label: string}>}\n */\n steps: stepsArray,\n };\n};\n","import { useQuery } from '@tanstack/react-query';\nimport {\n getIndexCompanyLegalEntities,\n IdentityCurrentResponse,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { useClient } from '@/src/context';\nimport { useIdentity } from '@/src/common/api/identity';\n\nfunction hasCompany(\n identity: IdentityCurrentResponse['data'] | undefined,\n): identity is Extract<\n IdentityCurrentResponse['data'],\n { company: { id: string } }\n> {\n return identity != null && 'company' in identity;\n}\n\n/**\n * Hook to get the legal entities for a company\n * @param companyId - The company ID\n * @returns The legal entities\n */\nexport const useLegalEntities = () => {\n const { client } = useClient();\n const { data: identity } = useIdentity();\n const companyId = hasCompany(identity) ? (identity?.company?.id ?? '') : '';\n\n return useQuery({\n queryKey: ['legal-entities', companyId],\n queryFn: () =>\n getIndexCompanyLegalEntities({\n client: client as Client,\n path: {\n company_id: companyId,\n },\n }),\n select: (data) => data.data?.data?.legal_entities,\n enabled: !!companyId,\n });\n};\n\nexport const useDefaultLegalEntity = () => {\n const { data: legalEntities } = useLegalEntities();\n return legalEntities?.find((legalEntity) => legalEntity.is_default);\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { getCurrentIdentity } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@/src/client/client';\n\nexport const useIdentity = () => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['identity'],\n queryFn: () =>\n getCurrentIdentity({\n client: client as Client,\n headers: { Authorization: `` },\n }),\n select: (data) => data.data?.data,\n });\n};\n"],"mappings":"4uBAAA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAErD,OAAOC,OAAU,cCFjB,OAAS,YAAAC,OAAgB,wBCAzB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,GAAcC,EAAA,IAAM,CAC/B,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,GAAS,CACd,SAAU,CAAC,UAAU,EACrB,QAASH,EAAA,IACPI,GAAmB,CACjB,OAAQH,EACR,QAAS,CAAE,cAAe,EAAG,CAC/B,CAAC,EAJM,WAKT,OAAQD,EAACK,GAASA,EAAK,MAAM,KAArB,SACV,CAAC,CACH,EAX2B,eDI3B,SAASC,GACPC,EAIA,CACA,OAAOA,GAAY,MAAQ,YAAaA,CAC1C,CAPSC,EAAAF,GAAA,cAcF,IAAMG,GAAmBD,EAAA,IAAM,CACpC,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EACvB,CAAE,KAAMJ,CAAS,EAAIK,GAAY,EACjCC,EAAYP,GAAWC,CAAQ,EAAKA,GAAU,SAAS,IAAM,GAAM,GAEzE,OAAOO,GAAS,CACd,SAAU,CAAC,iBAAkBD,CAAS,EACtC,QAASL,EAAA,IACPO,GAA6B,CAC3B,OAAQL,EACR,KAAM,CACJ,WAAYG,CACd,CACF,CAAC,EANM,WAOT,OAAQL,EAACQ,GAASA,EAAK,MAAM,MAAM,eAA3B,UACR,QAAS,CAAC,CAACH,CACb,CAAC,CACH,EAjBgC,oBAmBnBI,GAAwBT,EAAA,IAAM,CACzC,GAAM,CAAE,KAAMU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BI,GAAuC,WACvCE,GAAwC,WACxCQ,GAAwC,UAK1C,mBAAA8D,GAMA,UAAArF,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAX,EAMA,mBAAAI,GAKA,MAAOhB,EACT,CACF,EAjnCuC","names":["useEffect","useMemo","useRef","useState","omit","useQuery","useQuery","useIdentity","__name","client","useClient","useQuery","getCurrentIdentity","data","hasCompany","identity","__name","useLegalEntities","client","useClient","useIdentity","companyId","useQuery","getIndexCompanyLegalEntities","data","useDefaultLegalEntity","legalEntities","legalEntity","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","selectedProduct","setSelectedProduct","steps","stepsArray","useMemo","buildSteps","corProductIdentifier","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","employment","isLoadingEmployment","refetchEmployment","useEmploymentQuery","defaultLegalEntity","useDefaultLegalEntity","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","uploadFileMutation","useUploadFile","updateUKandSaudiFieldsMutation","useUpdateUKandSaudiFields","createEligibilityQuestionnaireMutation","usePostCreateEligibilityQuestionnaire","manageContractorCorSubscriptionMutation","usePostManageContractorCorSubscription","updateEmploymentMutationAsync","mutationToPromise","signContractDocumentMutation","useSignContractDocument","manageContractorSubscriptionMutation","usePostManageContractorSubscriptions","deleteContractorCorSubscriptionMutation","useDeleteContractorCorSubscription","createEmploymentMutationAsync","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","manageContractorSubscriptionMutationAsync","createEligibilityQuestionnaireMutationAsync","manageContractorCorSubscriptionMutationAsync","deleteContractorCorSubscriptionMutationAsync","selectCountryForm","isLoadingCountries","useCountriesSchemaField","selectContractorSubscriptionForm","isLoadingContractorSubscriptions","contractorSubscriptions","refetchContractorSubscriptions","useContractorSubscriptionSchemaField","hasEligibilityQuestionnaireSubmitted","subscription","isEligibilityBlocked","eligibilityAnswers","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","isIR35FileEnabled","ir35File","isLoadingIR35File","useGetIR35File","contractDocuments","isLoadingContractDocuments","useGetContractDocuments","useEffect","basicInformationForm","isLoadingBasicInformationForm","buildBasicInformationJsfModify","descriptionProvisionalStartDate","calculateProvisionalStartDateDescription","selectedPricingPlan","subscriptions","contractorStandardProductIdentifier","contractorPlusProductIdentifier","eligibilityFields","isEligibilityQuestionnaireEnabled","eligibilityQuestionnaireForm","isLoadingEligibilityQuestionnaire","useGetEligibilityQuestionnaire","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","buildContractDetailsJsfModify","isSignatureSchemaEnabled","signatureSchemaForm","useGetContractDocumentSignatureSchema","buildContractPreviewJsfModify","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","convertedIr35File","dataURLtoFile","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","signature","signatory","pricingPlanInitialValues","eligibilityQuestionnaireInitialValues","shouldHandleReadOnlyEmployment","initialLoading","isNavigatingToReview","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","basicInformationPayload","omit","response","createStructuredError","basicInformationParsedValues","contractDocumentId","error"]}
@@ -1,2 +0,0 @@
1
- import{a as O}from"./chunk-WVJDCDGZ.js";import{f as j}from"./chunk-STF3NTPS.js";import{a as u}from"./chunk-EUSCQL4H.js";import{B as g,C as S,E as w,F as v,J as E,O as q,e as f,g as y,k as d,l as h,s as C,t as b,v as _,z as F}from"./chunk-BYX2YS2B.js";import{d as a}from"./chunk-KQPDXXG3.js";import{a as r}from"./chunk-P37U34EQ.js";import{useMutation as c,useQuery as l}from"@tanstack/react-query";var W=r(t=>{let{client:n}=a();return l({queryKey:["employment",t],retry:!1,enabled:!!t,select:r(({data:e})=>e?.data.employment,"select"),queryFn:r(async()=>{let e=await g({client:n,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn")})},"useEmployment"),T=r(t=>{let{client:n}=a();return l({queryKey:["company",t],retry:!1,enabled:!!t,queryFn:r(async()=>{let e=await b({client:n,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn"),select:r(({data:e})=>e.data.company,"select")})},"useCompany"),H=r(t=>{let{client:n}=a();return l({queryKey:["benefit-offers",t],retry:!1,enabled:!!t,queryFn:r(async()=>d({client:n,path:{employment_id:t}}).then(e=>{if(e.error||!e.data)throw new Error("Failed to fetch benefit offers data");return e}),"queryFn"),select:r(({data:e})=>e?.data?.reduce((o,s)=>({...o,[s.benefit_group.slug]:{value:s.benefit_tier?.slug??"no",...s.benefit_group?.filter?.slug?{filter:s.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),L=r(()=>{let{client:t}=a();return c({mutationFn:r(n=>q({client:t,headers:{Authorization:""},path:n}),"mutationFn")})},"useEmploymentInvite"),G=r(()=>{let{client:t}=a();return c({mutationFn:r(n=>C({client:t,body:n}),"mutationFn")})},"useCreateReserveInvoice"),X=r(({countryCode:t,form:n,fieldValues:e,options:o,query:s={},jsonSchemaVersion:i})=>{let{client:p}=a(),P=i?{json_schema_version:i}:{};return l({queryKey:["onboarding-json-schema-form",t,n],retry:!1,queryFn:r(async()=>{let m=await _({client:p,headers:{Authorization:""},path:{country_code:t,form:n},query:{skip_benefits:!0,...s,...P}});if(m.error||!m.data)throw new Error("Failed to fetch onboarding schema");return m},"queryFn"),enabled:o?.queryOptions?.enabled,select:r(({data:m})=>{let x=m?.data||{};return u(x,e,o)},"select")})},"useJSONSchemaForm"),Y=r((t,n,e)=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:s}=a();return l({queryKey:["benefit-offers-schema",t],retry:!1,enabled:!!t,queryFn:r(async()=>{let i=await F({client:s,path:{employment_id:t},query:o});if(i.error||!i.data)throw new Error("Failed to fetch benefit offers schema");return i},"queryFn"),select:r(({data:i})=>{let p=i?.data?.schema||{};return u(p,n,{jsfModify:e?.jsfModify?.benefits})},"select")})},"useBenefitOffersSchema"),Z=r(()=>{let{client:t}=a(),n={json_schema_version:1};return c({mutationFn:r(e=>y({client:t,headers:{Authorization:""},body:e,query:{...n}}),"mutationFn")})},"useCreateEmployment"),$=r((t,n)=>{let{client:e}=a(),o={employment_basic_information_json_schema_version:1,contract_details_json_schema_version:j(n,t)||1};return c({mutationFn:r(({employmentId:s,...i})=>S({client:e,headers:{Authorization:""},body:i,path:{employment_id:s},query:{skip_benefits:!0,...o}}),"mutationFn")})},"useUpdateEmployment"),ee=r(t=>{let{client:n}=a();return c({mutationFn:r(({employmentId:e,...o})=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{};return h({client:n,body:o,path:{employment_id:e},query:{...s}})},"mutationFn")})},"useUpdateBenefitsOffers"),R=r(t=>{let{client:n}=a();return l({...t,queryKey:["countries"],retry:!1,queryFn:r(async()=>{let e=await v({client:n,headers:{Authorization:""}});if(e.error||!e.data)throw new Error("Failed to fetch supported countries");return e},"queryFn"),select:r(({data:e})=>e?.data?.filter(o=>o.eor_onboarding).map(o=>({label:o.name,value:o.code}))||[],"select")})},"useCountries"),te=r(t=>{let{data:n,isLoading:e}=R(t?.queryOptions),o=u(O.data.schema,{},t);if(n){let s=o.fields.find(i=>i.name==="country");s&&(s.options=n)}return{isLoading:e,selectCountryForm:o}},"useCountriesSchemaField"),re=r(({type:t="spread"})=>{let{client:n}=a();return c({mutationFn:r(e=>(t==="no_spread"?f:E)({client:n,body:e}),"mutationFn")})},"useConvertCurrency"),ne=r(()=>{let{client:t}=a();return c({mutationFn:r(({employmentId:n,...e})=>w({client:t,path:{employment_id:n},body:e}),"mutationFn")})},"useUpsertContractEligibility");export{W as a,T as b,H as c,L as d,G as e,X as f,Y as g,Z as h,$ as i,ee as j,te as k,re as l,ne as m};
2
- //# sourceMappingURL=chunk-4AM73KSF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/api.ts"],"sourcesContent":["import { useMutation, useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { FieldValues } from 'react-hook-form';\nimport { Client } from '@/src/client/client';\nimport {\n ConvertCurrencyParams,\n CreateContractEligibilityParams,\n EmploymentCreateParams,\n EmploymentFullParams,\n getIndexBenefitOffer,\n getShowCompany,\n getShowEmployment,\n getShowFormCountry,\n getShowSchema,\n getSupportedCountry,\n patchUpdateEmployment2,\n postConvertRawCurrencyConverter,\n postConvertWithSpreadCurrencyConverter,\n postCreateContractEligibility,\n postCreateEmployment2,\n postCreateRiskReserve,\n postInviteEmploymentInvitation,\n PostInviteEmploymentInvitationData,\n putUpdateBenefitOffer,\n UnifiedEmploymentUpsertBenefitOffersRequest,\n} from '@/src/client';\n\nimport { useClient } from '@/src/context';\nimport { selectCountryStepSchema } from '@/src/flows/Onboarding/json-schemas/selectCountryStep';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport {\n JSONSchemaFormResultWithFieldsets,\n JSONSchemaFormType,\n FlowOptions,\n} from '@/src/flows/types';\nimport { getContractDetailsSchemaVersion } from '@/src/flows/Onboarding/utils';\nimport { createHeadlessForm } from '@/src/common/createHeadlessForm';\n\nexport const useEmployment = (employmentId: string | undefined) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n enabled: !!employmentId,\n select: ({ data }) => {\n return data?.data.employment;\n },\n queryFn: async () => {\n const response = await getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n employment_id: employmentId as string,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n });\n};\n\nexport const useCompany = (companyId: string) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['company', companyId],\n retry: false,\n enabled: !!companyId,\n queryFn: async () => {\n const response = await getShowCompany({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n select: ({ data }) => {\n return data.data.company;\n },\n });\n};\n\nexport const useBenefitOffers = (employmentId: string | undefined) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n return getIndexBenefitOffer({\n client: client as Client,\n path: {\n employment_id: employmentId as string,\n },\n }).then((response) => {\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers data');\n }\n\n return response;\n });\n },\n select: ({ data }) =>\n data?.data?.reduce(\n (acc, item) => {\n return {\n ...acc,\n [item.benefit_group.slug]: {\n value: item.benefit_tier?.slug ?? 'no',\n ...(item.benefit_group?.filter?.slug\n ? { filter: item.benefit_group?.filter?.slug }\n : {}),\n },\n };\n },\n {} as Record<string, { value: string }>,\n ),\n });\n};\n/**\n * Use this hook to invite an employee to the onboarding flow\n * @returns\n */\nexport const useEmploymentInvite = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: PostInviteEmploymentInvitationData['path']) => {\n return postInviteEmploymentInvitation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: payload,\n });\n },\n });\n};\n\nexport const useCreateReserveInvoice = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: { employment_slug: string }) => {\n return postCreateRiskReserve({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Use this hook to get the JSON schema form for the onboarding flow\n * @param param0\n * @returns\n */\nexport const useJSONSchemaForm = ({\n countryCode,\n form,\n fieldValues,\n options,\n query = {},\n jsonSchemaVersion,\n}: {\n countryCode: string;\n form: JSONSchemaFormType;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n jsonSchemaVersion?: number | 'latest';\n}): UseQueryResult<JSONSchemaFormResultWithFieldsets> => {\n const { client } = useClient();\n const jsonSchemaQueryParam = jsonSchemaVersion\n ? {\n json_schema_version: jsonSchemaVersion,\n }\n : {};\n return useQuery({\n queryKey: ['onboarding-json-schema-form', countryCode, form],\n retry: false,\n queryFn: async () => {\n const response = await getShowFormCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n country_code: countryCode,\n form: form,\n },\n query: {\n skip_benefits: true,\n ...query,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch onboarding schema');\n }\n\n return response;\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n const jsfSchema = data?.data || {};\n return createHeadlessForm(jsfSchema, fieldValues, options);\n },\n });\n};\n\nexport const useBenefitOffersSchema = (\n employmentId: string,\n fieldValues: FieldValues,\n options: OnboardingFlowProps['options'],\n) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers-schema', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n const response = await getShowSchema({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n query: jsonSchemaQueryParam,\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers schema');\n }\n\n return response;\n },\n select: ({ data }) => {\n const jsfSchema = data?.data?.schema || {};\n\n return createHeadlessForm(jsfSchema, fieldValues, {\n jsfModify: options?.jsfModify?.benefits,\n });\n },\n });\n};\n\n/**\n * Use this hook to create an employment\n * @returns\n */\nexport const useCreateEmployment = () => {\n const { client } = useClient();\n // TODO: setting 1 as basic_information only supports v1 for now in the API\n const jsonSchemaQueryParam = {\n json_schema_version: 1,\n };\n return useMutation({\n mutationFn: (payload: EmploymentCreateParams) => {\n return postCreateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useUpdateEmployment = (\n countryCode: string,\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParams = {\n // TODO: setting 1 as basic_information only supports v1 for now in the API\n employment_basic_information_json_schema_version: 1,\n contract_details_json_schema_version:\n getContractDetailsSchemaVersion(options, countryCode) || 1,\n };\n\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: EmploymentFullParams & { employmentId: string }) => {\n return patchUpdateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n skip_benefits: true,\n ...jsonSchemaQueryParams,\n },\n });\n },\n });\n};\n\nexport const useUpdateBenefitsOffers = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: UnifiedEmploymentUpsertBenefitOffersRequest & {\n employmentId: string;\n }) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n return putUpdateBenefitOffer({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nconst useCountries = (queryOptions?: { enabled?: boolean }) => {\n const { client } = useClient();\n return useQuery({\n ...queryOptions,\n queryKey: ['countries'],\n retry: false,\n queryFn: async () => {\n const response = await getSupportedCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch supported countries');\n }\n\n return response;\n },\n select: ({ data }) => {\n return (\n data?.data\n ?.filter((country) => country.eor_onboarding)\n .map((country) => {\n return {\n label: country.name,\n value: country.code,\n };\n }) || []\n );\n },\n });\n};\n\nexport const useCountriesSchemaField = (\n options?: Omit<FlowOptions, 'jsonSchemaVersion'> & {\n queryOptions?: { enabled?: boolean };\n },\n) => {\n const { data: countries, isLoading } = useCountries(options?.queryOptions);\n\n const selectCountryForm = createHeadlessForm(\n selectCountryStepSchema.data.schema,\n {},\n options,\n );\n\n if (countries) {\n const countryField = selectCountryForm.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n }\n }\n\n return {\n isLoading,\n selectCountryForm,\n };\n};\n\nexport const useConvertCurrency = ({\n type = 'spread',\n}: {\n type?: 'spread' | 'no_spread';\n}) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: ConvertCurrencyParams) => {\n const apiFn =\n type === 'no_spread'\n ? postConvertRawCurrencyConverter\n : postConvertWithSpreadCurrencyConverter;\n return apiFn({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useUpsertContractEligibility = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: { employmentId: string } & CreateContractEligibilityParams) => {\n return postCreateContractEligibility({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n body: payload,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cAAeD,CACjB,EACA,KAAMgB,CACR,CAAC,EAVS,aAYd,CAAC,CACH,EAhB4C","names":["useMutation","useQuery","useEmployment","__name","employmentId","client","useClient","useQuery","data","response","getShowEmployment","useCompany","companyId","getShowCompany","useBenefitOffers","getIndexBenefitOffer","acc","item","useEmploymentInvite","useMutation","payload","postInviteEmploymentInvitation","useCreateReserveInvoice","postCreateRiskReserve","useJSONSchemaForm","countryCode","form","fieldValues","options","query","jsonSchemaVersion","jsonSchemaQueryParam","getShowFormCountry","jsfSchema","createHeadlessForm","useBenefitOffersSchema","getShowSchema","useCreateEmployment","postCreateEmployment2","useUpdateEmployment","jsonSchemaQueryParams","getContractDetailsSchemaVersion","patchUpdateEmployment2","useUpdateBenefitsOffers","putUpdateBenefitOffer","useCountries","queryOptions","getSupportedCountry","country","useCountriesSchemaField","countries","isLoading","selectCountryForm","selectCountryStepSchema","countryField","field","useConvertCurrency","type","postConvertRawCurrencyConverter","postConvertWithSpreadCurrencyConverter","useUpsertContractEligibility","postCreateContractEligibility"]}
@@ -1,2 +0,0 @@
1
- import{a as l}from"./chunk-P37U34EQ.js";import{useState as S,useEffect as x}from"react";var y=l((s,r)=>{let i=Object.keys(s);if(i.length===0)throw new Error("No steps provided to useStepState");let[d,p]=S({}),[a,c]=S({currentStep:s[i[0]],totalSteps:i.length,values:null});x(()=>{r?.(s[i[0]])},[]);function o(){let{index:t}=a.currentStep,n=Object.values(s).find(e=>e.index===t+1);n&&(c(e=>({...e,currentStep:n,values:{...e.values,[e.currentStep.name]:{...e.values?.[e.currentStep.name],...d}}})),r?.(n),p({}))}l(o,"nextStep");function T(){let{index:t}=a.currentStep,n=Object.values(s).find(e=>e.index===t-1);n&&(c(e=>({...e,currentStep:n,values:{...e.values,[e.currentStep.name]:{...e.values?.[e.currentStep.name],...d}}})),r?.(n),p({}))}l(T,"previousStep");function f(t){a.values?.[t]&&(c(u=>({...u,currentStep:s[t]})),r?.(s[t]))}l(f,"goToStep");function F(t){c(u=>({...u,values:t}))}return l(F,"setStepValues"),{nextStep:o,previousStep:T,stepState:a,goToStep:f,fieldValues:d,setFieldValues:p,setStepValues:F}},"useStepState");export{y as a};
2
- //# sourceMappingURL=chunk-5BRMLRS7.js.map