@remoteoss/remote-flows 0.22.0 → 0.24.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 (315) hide show
  1. package/README.md +1 -1
  2. package/dist/{utils-CjDMg_Yr.d.ts → ZendeskTriggerButton-FSCvhzTG.d.ts} +10 -1
  3. package/dist/{chunk-2NGJN5IE.js → chunk-2M7EBC4K.js} +2 -2
  4. package/dist/chunk-2YTBWEC7.js +2 -0
  5. package/dist/chunk-2YTBWEC7.js.map +1 -0
  6. package/dist/chunk-347YWDTK.js +2 -0
  7. package/dist/chunk-347YWDTK.js.map +1 -0
  8. package/dist/chunk-3O3Q24JL.js +2 -0
  9. package/dist/chunk-3O3Q24JL.js.map +1 -0
  10. package/dist/{chunk-A6X6N2G7.js → chunk-4DCENNLW.js} +2 -2
  11. package/dist/{chunk-NHYBFEXA.js → chunk-4M4OJPUA.js} +2 -2
  12. package/dist/{chunk-QU3NSFU5.js → chunk-4SIGN3ZP.js} +2 -2
  13. package/dist/chunk-4T6PRR6R.js +2 -0
  14. package/dist/{chunk-DKA2EUPQ.js.map → chunk-4T6PRR6R.js.map} +1 -1
  15. package/dist/{chunk-JX3OQNNM.js → chunk-4URY37KB.js} +2 -2
  16. package/dist/{chunk-FVFXPT3Y.js → chunk-5XHKOMX5.js} +2 -2
  17. package/dist/{chunk-C4AVUIG2.js → chunk-5ZR7EFPY.js} +2 -2
  18. package/dist/chunk-6U2UCWVR.js +2 -0
  19. package/dist/chunk-6U2UCWVR.js.map +1 -0
  20. package/dist/{chunk-5N4L2G7Q.js → chunk-6VRUYYUV.js} +2 -2
  21. package/dist/{chunk-GLUERRJ2.js → chunk-A7HJICVX.js} +2 -2
  22. package/dist/{chunk-EIVHHLR5.js → chunk-A7T27JCJ.js} +2 -2
  23. package/dist/{chunk-C4SMHWP4.js → chunk-ANGJCT4I.js} +2 -2
  24. package/dist/{chunk-QP36XXCQ.js → chunk-BDPCUDJB.js} +2 -2
  25. package/dist/{chunk-22JS3T6G.js → chunk-BGU3LZ2S.js} +2 -2
  26. package/dist/chunk-BJOF6IEZ.js +2 -0
  27. package/dist/chunk-BJOF6IEZ.js.map +1 -0
  28. package/dist/{chunk-DHJZVBVD.js → chunk-BMDZJNJV.js} +2 -2
  29. package/dist/{chunk-WEYUB6DC.js → chunk-BVN2DKO5.js} +2 -2
  30. package/dist/{chunk-2VWU5VNU.js → chunk-C2BBQDCU.js} +2 -2
  31. package/dist/{chunk-D5KITGC6.js → chunk-D5RCRFJM.js} +2 -2
  32. package/dist/{chunk-QIAZQLSG.js → chunk-DPY77ASH.js} +2 -2
  33. package/dist/{chunk-XHOQSIXZ.js → chunk-DYWOG7Q2.js} +2 -2
  34. package/dist/{chunk-TGUF5Q7J.js → chunk-EFPZOIQ2.js} +2 -2
  35. package/dist/{chunk-BPJHPGTL.js → chunk-EKKRQI6B.js} +2 -2
  36. package/dist/{chunk-V2PJW577.js → chunk-EZV6DOVQ.js} +2 -2
  37. package/dist/chunk-EZWZMPD2.js +2 -0
  38. package/dist/chunk-EZWZMPD2.js.map +1 -0
  39. package/dist/{chunk-ULHGAKFT.js → chunk-GGXK727I.js} +2 -2
  40. package/dist/{chunk-OOUYQLIE.js → chunk-HFI2MD3H.js} +2 -2
  41. package/dist/{chunk-MRVBOQLW.js → chunk-HLPKGITX.js} +2 -2
  42. package/dist/{chunk-T6BYBXQA.js → chunk-ISZQNKMD.js} +2 -2
  43. package/dist/{chunk-J26AI33Z.js → chunk-IUJXAZHK.js} +2 -2
  44. package/dist/{chunk-VE36I6G6.js → chunk-IUZ7DEXC.js} +2 -2
  45. package/dist/{chunk-XTLLWD7O.js → chunk-KPTF6LPP.js} +2 -2
  46. package/dist/{chunk-GECFDGI7.js → chunk-KYSKA2UK.js} +2 -2
  47. package/dist/{chunk-5QP2BAUT.js → chunk-L2BJK3K5.js} +2 -2
  48. package/dist/chunk-LRGEEPGK.js +2 -0
  49. package/dist/{chunk-VXPJXQP3.js.map → chunk-LRGEEPGK.js.map} +1 -1
  50. package/dist/{chunk-XICA45G2.js → chunk-MP2T74PU.js} +2 -2
  51. package/dist/{chunk-GUHBW4V3.js → chunk-NVYMAOQ7.js} +2 -2
  52. package/dist/{chunk-V6I3EMYX.js → chunk-NYEZAOUI.js} +2 -2
  53. package/dist/{chunk-X5DMQNEM.js → chunk-NYM7QGN2.js} +2 -2
  54. package/dist/{chunk-2U4VW5TT.js → chunk-O5MKPE6I.js} +2 -2
  55. package/dist/{chunk-2GCMLKO2.js → chunk-O7REUCKR.js} +2 -2
  56. package/dist/{chunk-JG7FV7OZ.js → chunk-OEAHDUWE.js} +2 -2
  57. package/dist/{chunk-IUU4MOLL.js → chunk-OIN3HGOQ.js} +2 -2
  58. package/dist/{chunk-D52VU4UO.js → chunk-OW5QGJD4.js} +2 -2
  59. package/dist/{chunk-BVCBX72U.js → chunk-P5WUODPR.js} +2 -2
  60. package/dist/chunk-Q3A4A2HL.js +2 -0
  61. package/dist/{chunk-XKSAKI3P.js → chunk-Q4BKFSTW.js} +2 -2
  62. package/dist/{chunk-GOB6DUFS.js → chunk-QIQTM4HB.js} +1 -1
  63. package/dist/chunk-QIQTM4HB.js.map +1 -0
  64. package/dist/{chunk-MFKGLMRJ.js → chunk-QKLIYOMA.js} +2 -2
  65. package/dist/chunk-QKLIYOMA.js.map +1 -0
  66. package/dist/{chunk-5EP45OQV.js → chunk-RC3XP5WU.js} +2 -2
  67. package/dist/chunk-REDYWUCC.js +2 -0
  68. package/dist/chunk-REDYWUCC.js.map +1 -0
  69. package/dist/{chunk-2WDEVWIE.js → chunk-RINDVT6U.js} +2 -2
  70. package/dist/{chunk-3I6ONATN.js → chunk-RQXKQTRD.js} +2 -2
  71. package/dist/{chunk-IK6IRESD.js → chunk-SHF5L3PW.js} +2 -2
  72. package/dist/{chunk-6L7JELHX.js → chunk-UIO6B4GN.js} +2 -2
  73. package/dist/{chunk-RJGWAZBE.js → chunk-UPXJJBXZ.js} +2 -2
  74. package/dist/{chunk-K4NAASBM.js → chunk-UTBVLDKY.js} +2 -2
  75. package/dist/{chunk-PJUC5WAJ.js → chunk-VUP76ZMQ.js} +2 -2
  76. package/dist/{chunk-5SKMAYLG.js → chunk-VYDVPM5S.js} +2 -2
  77. package/dist/{chunk-KJSZIASL.js → chunk-WFMQ2IDE.js} +2 -2
  78. package/dist/{chunk-TWD2IDAS.js → chunk-WNXB2Y65.js} +2 -2
  79. package/dist/chunk-WVDTHFGS.js +2 -0
  80. package/dist/chunk-WVDTHFGS.js.map +1 -0
  81. package/dist/{chunk-CHQK23RH.js → chunk-YPHOFQ5O.js} +2 -2
  82. package/dist/{chunk-CHQK23RH.js.map → chunk-YPHOFQ5O.js.map} +1 -1
  83. package/dist/{chunk-7EDGHYMX.js → chunk-ZQ6MG635.js} +2 -2
  84. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  85. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  86. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  87. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  88. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  89. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  90. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  91. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  92. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  93. package/dist/flows/ContractAmendment/hooks.js +1 -1
  94. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  95. package/dist/flows/ContractAmendment/index.js +1 -1
  96. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  97. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  98. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  99. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  100. package/dist/flows/ContractorOnboarding/api.js +1 -1
  101. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  102. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  103. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  104. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  105. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  106. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  107. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  108. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  109. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  110. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  111. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  112. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  113. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  114. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  115. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  116. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  117. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  118. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  119. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  120. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  121. package/dist/flows/ContractorOnboarding/index.js +1 -1
  122. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  123. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  124. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  125. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  126. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  127. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  128. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  129. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  130. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  131. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  132. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  133. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  134. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  135. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  136. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  137. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  138. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  139. package/dist/flows/CostCalculator/api.d.ts +1 -1
  140. package/dist/flows/CostCalculator/api.js +1 -1
  141. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  142. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  143. package/dist/flows/CostCalculator/context.d.ts +3 -3
  144. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  145. package/dist/flows/CostCalculator/hooks.js +1 -1
  146. package/dist/flows/CostCalculator/index.d.ts +3 -3
  147. package/dist/flows/CostCalculator/index.js +1 -1
  148. package/dist/flows/CostCalculator/types.d.ts +1 -1
  149. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  150. package/dist/flows/CostCalculator/utils.js +1 -1
  151. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  152. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  153. package/dist/flows/Onboarding/api.d.ts +6 -6
  154. package/dist/flows/Onboarding/api.js +1 -1
  155. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  156. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  157. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  158. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  159. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  160. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  161. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  162. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  163. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  164. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  165. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  166. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  167. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  168. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  169. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  170. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  171. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  172. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  173. package/dist/flows/Onboarding/context.d.ts +4 -4
  174. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  175. package/dist/flows/Onboarding/hooks.js +1 -1
  176. package/dist/flows/Onboarding/index.d.ts +4 -4
  177. package/dist/flows/Onboarding/index.js +1 -1
  178. package/dist/flows/Onboarding/types.d.ts +4 -4
  179. package/dist/flows/Onboarding/utils.d.ts +4 -4
  180. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -5
  181. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  182. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -5
  183. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  184. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -5
  185. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  186. package/dist/flows/Termination/TerminationBack.js +1 -1
  187. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -5
  188. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  189. package/dist/flows/Termination/TerminationFlow.d.ts +4 -5
  190. package/dist/flows/Termination/TerminationFlow.js +1 -1
  191. package/dist/flows/Termination/TerminationForm.d.ts +4 -5
  192. package/dist/flows/Termination/TerminationForm.js +1 -1
  193. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  194. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +19 -0
  195. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +2 -0
  196. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +19 -0
  197. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +2 -0
  198. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -0
  199. package/dist/flows/Termination/components/PaidTimeOff/types.js +1 -0
  200. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +2 -0
  201. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js.map +1 -0
  202. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +2 -0
  203. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js.map +1 -0
  204. package/dist/flows/Termination/context.d.ts +4 -5
  205. package/dist/flows/Termination/hooks.d.ts +4 -5
  206. package/dist/flows/Termination/hooks.js +1 -1
  207. package/dist/flows/Termination/index.d.ts +10 -7
  208. package/dist/flows/Termination/index.js +1 -1
  209. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +10 -0
  210. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  211. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +10 -0
  212. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  213. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  214. package/dist/flows/Termination/types.d.ts +4 -5
  215. package/dist/flows/api.d.ts +4 -5
  216. package/dist/flows/api.js +1 -1
  217. package/dist/flows/types.d.ts +1 -1
  218. package/dist/index.css +1 -1
  219. package/dist/index.css.map +1 -1
  220. package/dist/index.d.ts +15 -38
  221. package/dist/index.js +1 -1
  222. package/dist/index.js.map +1 -1
  223. package/dist/internals.d.ts +45 -53
  224. package/dist/internals.js +1 -1
  225. package/dist/{mutations-BxS-iGnr.d.ts → mutations-CAhYrKGA.d.ts} +1 -1
  226. package/dist/{remoteFlows-DnbCoINb.d.ts → remoteFlows-HxRw2Djx.d.ts} +10 -2
  227. package/dist/types-1R2vg9SL.d.ts +179 -0
  228. package/dist/{types-BnLDzD9Z.d.ts → types-BsT_1de7.d.ts} +3 -3
  229. package/dist/{types-pEe84X2Z.d.ts → types-DU4HZ7C6.d.ts} +4 -4
  230. package/dist/{types-D31aAyFm.d.ts → types-r1cKZ-RE.d.ts} +2 -5
  231. package/dist/{types.gen-DOXoUj5J.d.ts → types.gen-oeDSqezz.d.ts} +104 -3
  232. package/package.json +1 -1
  233. package/dist/chunk-7XRPOR7L.js +0 -2
  234. package/dist/chunk-7XRPOR7L.js.map +0 -1
  235. package/dist/chunk-B25LAMRX.js +0 -2
  236. package/dist/chunk-B25LAMRX.js.map +0 -1
  237. package/dist/chunk-CELNQ7KS.js +0 -2
  238. package/dist/chunk-CELNQ7KS.js.map +0 -1
  239. package/dist/chunk-DKA2EUPQ.js +0 -2
  240. package/dist/chunk-E773NPNL.js +0 -2
  241. package/dist/chunk-E773NPNL.js.map +0 -1
  242. package/dist/chunk-GOB6DUFS.js.map +0 -1
  243. package/dist/chunk-HTCONTKZ.js +0 -2
  244. package/dist/chunk-HTCONTKZ.js.map +0 -1
  245. package/dist/chunk-MFKGLMRJ.js.map +0 -1
  246. package/dist/chunk-MISHDUB2.js +0 -2
  247. package/dist/chunk-MISHDUB2.js.map +0 -1
  248. package/dist/chunk-PSEOAELN.js +0 -2
  249. package/dist/chunk-PSEOAELN.js.map +0 -1
  250. package/dist/chunk-VXPJXQP3.js +0 -2
  251. package/dist/chunk-Z442TFR6.js +0 -2
  252. package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.js +0 -2
  253. package/dist/flows/Termination/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +0 -2
  254. package/dist/flows/Termination/TimeOff.d.ts +0 -11
  255. package/dist/flows/Termination/TimeOff.js +0 -2
  256. /package/dist/{chunk-2NGJN5IE.js.map → chunk-2M7EBC4K.js.map} +0 -0
  257. /package/dist/{chunk-A6X6N2G7.js.map → chunk-4DCENNLW.js.map} +0 -0
  258. /package/dist/{chunk-NHYBFEXA.js.map → chunk-4M4OJPUA.js.map} +0 -0
  259. /package/dist/{chunk-QU3NSFU5.js.map → chunk-4SIGN3ZP.js.map} +0 -0
  260. /package/dist/{chunk-JX3OQNNM.js.map → chunk-4URY37KB.js.map} +0 -0
  261. /package/dist/{chunk-FVFXPT3Y.js.map → chunk-5XHKOMX5.js.map} +0 -0
  262. /package/dist/{chunk-C4AVUIG2.js.map → chunk-5ZR7EFPY.js.map} +0 -0
  263. /package/dist/{chunk-5N4L2G7Q.js.map → chunk-6VRUYYUV.js.map} +0 -0
  264. /package/dist/{chunk-GLUERRJ2.js.map → chunk-A7HJICVX.js.map} +0 -0
  265. /package/dist/{chunk-EIVHHLR5.js.map → chunk-A7T27JCJ.js.map} +0 -0
  266. /package/dist/{chunk-C4SMHWP4.js.map → chunk-ANGJCT4I.js.map} +0 -0
  267. /package/dist/{chunk-QP36XXCQ.js.map → chunk-BDPCUDJB.js.map} +0 -0
  268. /package/dist/{chunk-22JS3T6G.js.map → chunk-BGU3LZ2S.js.map} +0 -0
  269. /package/dist/{chunk-DHJZVBVD.js.map → chunk-BMDZJNJV.js.map} +0 -0
  270. /package/dist/{chunk-WEYUB6DC.js.map → chunk-BVN2DKO5.js.map} +0 -0
  271. /package/dist/{chunk-2VWU5VNU.js.map → chunk-C2BBQDCU.js.map} +0 -0
  272. /package/dist/{chunk-D5KITGC6.js.map → chunk-D5RCRFJM.js.map} +0 -0
  273. /package/dist/{chunk-QIAZQLSG.js.map → chunk-DPY77ASH.js.map} +0 -0
  274. /package/dist/{chunk-XHOQSIXZ.js.map → chunk-DYWOG7Q2.js.map} +0 -0
  275. /package/dist/{chunk-TGUF5Q7J.js.map → chunk-EFPZOIQ2.js.map} +0 -0
  276. /package/dist/{chunk-BPJHPGTL.js.map → chunk-EKKRQI6B.js.map} +0 -0
  277. /package/dist/{chunk-V2PJW577.js.map → chunk-EZV6DOVQ.js.map} +0 -0
  278. /package/dist/{chunk-ULHGAKFT.js.map → chunk-GGXK727I.js.map} +0 -0
  279. /package/dist/{chunk-OOUYQLIE.js.map → chunk-HFI2MD3H.js.map} +0 -0
  280. /package/dist/{chunk-MRVBOQLW.js.map → chunk-HLPKGITX.js.map} +0 -0
  281. /package/dist/{chunk-T6BYBXQA.js.map → chunk-ISZQNKMD.js.map} +0 -0
  282. /package/dist/{chunk-J26AI33Z.js.map → chunk-IUJXAZHK.js.map} +0 -0
  283. /package/dist/{chunk-VE36I6G6.js.map → chunk-IUZ7DEXC.js.map} +0 -0
  284. /package/dist/{chunk-XTLLWD7O.js.map → chunk-KPTF6LPP.js.map} +0 -0
  285. /package/dist/{chunk-GECFDGI7.js.map → chunk-KYSKA2UK.js.map} +0 -0
  286. /package/dist/{chunk-5QP2BAUT.js.map → chunk-L2BJK3K5.js.map} +0 -0
  287. /package/dist/{chunk-XICA45G2.js.map → chunk-MP2T74PU.js.map} +0 -0
  288. /package/dist/{chunk-GUHBW4V3.js.map → chunk-NVYMAOQ7.js.map} +0 -0
  289. /package/dist/{chunk-V6I3EMYX.js.map → chunk-NYEZAOUI.js.map} +0 -0
  290. /package/dist/{chunk-X5DMQNEM.js.map → chunk-NYM7QGN2.js.map} +0 -0
  291. /package/dist/{chunk-2U4VW5TT.js.map → chunk-O5MKPE6I.js.map} +0 -0
  292. /package/dist/{chunk-2GCMLKO2.js.map → chunk-O7REUCKR.js.map} +0 -0
  293. /package/dist/{chunk-JG7FV7OZ.js.map → chunk-OEAHDUWE.js.map} +0 -0
  294. /package/dist/{chunk-IUU4MOLL.js.map → chunk-OIN3HGOQ.js.map} +0 -0
  295. /package/dist/{chunk-D52VU4UO.js.map → chunk-OW5QGJD4.js.map} +0 -0
  296. /package/dist/{chunk-BVCBX72U.js.map → chunk-P5WUODPR.js.map} +0 -0
  297. /package/dist/{chunk-Z442TFR6.js.map → chunk-Q3A4A2HL.js.map} +0 -0
  298. /package/dist/{chunk-XKSAKI3P.js.map → chunk-Q4BKFSTW.js.map} +0 -0
  299. /package/dist/{chunk-5EP45OQV.js.map → chunk-RC3XP5WU.js.map} +0 -0
  300. /package/dist/{chunk-2WDEVWIE.js.map → chunk-RINDVT6U.js.map} +0 -0
  301. /package/dist/{chunk-3I6ONATN.js.map → chunk-RQXKQTRD.js.map} +0 -0
  302. /package/dist/{chunk-IK6IRESD.js.map → chunk-SHF5L3PW.js.map} +0 -0
  303. /package/dist/{chunk-6L7JELHX.js.map → chunk-UIO6B4GN.js.map} +0 -0
  304. /package/dist/{chunk-RJGWAZBE.js.map → chunk-UPXJJBXZ.js.map} +0 -0
  305. /package/dist/{chunk-K4NAASBM.js.map → chunk-UTBVLDKY.js.map} +0 -0
  306. /package/dist/{chunk-PJUC5WAJ.js.map → chunk-VUP76ZMQ.js.map} +0 -0
  307. /package/dist/{chunk-5SKMAYLG.js.map → chunk-VYDVPM5S.js.map} +0 -0
  308. /package/dist/{chunk-KJSZIASL.js.map → chunk-WFMQ2IDE.js.map} +0 -0
  309. /package/dist/{chunk-TWD2IDAS.js.map → chunk-WNXB2Y65.js.map} +0 -0
  310. /package/dist/{chunk-7EDGHYMX.js.map → chunk-ZQ6MG635.js.map} +0 -0
  311. /package/dist/flows/Termination/{TerminationDialogInfoContent/TerminationDialogInfoContent.js.map → components/PaidTimeOff/PaidTimeOff.js.map} +0 -0
  312. /package/dist/flows/Termination/{TerminationReasonsDetailContent/TerminationReasonsDetailContent.js.map → components/PaidTimeOff/PaidTimeOffContainer.js.map} +0 -0
  313. /package/dist/flows/Termination/{TimeOff.js.map → components/PaidTimeOff/types.js.map} +0 -0
  314. /package/dist/flows/Termination/{TerminationDialogInfoContent → components/TerminationDialogInfoContent}/TerminationDialogInfoContent.d.ts +0 -0
  315. /package/dist/flows/Termination/{TerminationReasonsDetailContent → components/TerminationReasonsDetailContent}/TerminationReasonsDetailContent.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.tsx"],"sourcesContent":["import { cn } from '@/src/lib/utils';\n\nconst terminationReasonsList = [\n {\n label: 'Misconduct',\n description:\n 'The employee is being dismissed due to unacceptable or improper behavior.',\n },\n {\n label: 'Performance',\n description:\n 'When dismissing an employee for poor performance, employers are required by law to do so fairly. This means giving the employee reasonable opportunity to improve their performance prior to termination.',\n },\n {\n label: 'Workforce reduction',\n description:\n 'The employee’s position is being made redundant, and a layoff is underway.',\n },\n {\n label: 'Values',\n description: 'The employee is misaligned with the company’s values.',\n },\n {\n label: 'Compliance issue',\n description:\n 'Use this option if the employee violated key policies, processes or procedures. For example, they failed to comply with their employment agreement’s confidentiality clause.',\n },\n {\n label: 'Incapacity to perform inherent duties',\n description:\n 'Use this option if the employee is physically or mentally unable to fulfill the work requirements of their role.',\n },\n {\n label: 'Mutual agreement',\n description:\n 'Employee and employer made a mutual decision to end the relationship.',\n },\n {\n label: 'Decision to cancel hiring before the employee started',\n description:\n 'Use this option only if the employee has not started work yet.',\n },\n {\n label: 'Job abandonment',\n description:\n 'The employee has failed to appear for work; the Employer has been unsuccessful in establishing communications with the employee and does not know the employee’s whereabouts.',\n },\n {\n label: 'Dissatisfaction with EOR service',\n description: (\n <span>\n We’re sorry to see you go. If there is anything we can do to improve or\n if there is any remaining feedback you want to give us, please reach out\n to{' '}\n <a\n href='mailto:help@remote.com'\n target='_blank'\n rel='noopener noreferrer'\n >\n help@remote.com\n </a>\n .\n </span>\n ),\n },\n {\n label: 'End of fixed-term contract',\n description:\n 'Use this option when the employee fixed-term contract is coming to an end and will not be renewed or extended.',\n },\n];\nexport const TerminationReasonsDetailContent = () => {\n return (\n <>\n <h3 className={cn('RemoteFlows__TerminationReasonsDetailContent__Title')}>\n {' '}\n Why is this important?\n </h3>\n <p\n className={cn(\n 'RemoteFlows__TerminationReasonsDetailContent__Description',\n )}\n >\n We're here to help you follow all applicable labor laws when terminating\n an employee. Here are all the legal reasons for termination. Please read\n them to make sure you enter the correct reason in the platform.\n </p>\n\n <h4\n className={cn('RemoteFlows__TerminationReasonsDetailContent__Subtitle')}\n >\n Termination Reasons\n </h4>\n <ul\n className={cn(\n 'RemoteFlows__TerminationReasonsDetailContent__List list-disc list-inside',\n )}\n >\n {terminationReasonsList.map((reason) => (\n <li\n className={cn(\n 'RemoteFlows__TerminationReasonsDetailContent__ListItem',\n )}\n key={reason.label}\n >\n <span\n className={cn(\n 'RemoteFlows__TerminationReasonsDetailContent__ListItemLabel',\n )}\n >\n {reason.label}\n </span>\n <span\n className={cn(\n 'RemoteFlows__TerminationReasonsDetailContent__ListItemDescription',\n )}\n >\n {reason.description}\n </span>\n </li>\n ))}\n </ul>\n </>\n );\n};\n"],"mappings":"gFAkDM,OAuBF,YAAAA,EAnBI,OAAAC,EAJF,QAAAC,MAAA,oBAhDN,IAAMC,EAAyB,CAC7B,CACE,MAAO,aACP,YACE,2EACJ,EACA,CACE,MAAO,cACP,YACE,2MACJ,EACA,CACE,MAAO,sBACP,YACE,iFACJ,EACA,CACE,MAAO,SACP,YAAa,4DACf,EACA,CACE,MAAO,mBACP,YACE,mLACJ,EACA,CACE,MAAO,wCACP,YACE,kHACJ,EACA,CACE,MAAO,mBACP,YACE,uEACJ,EACA,CACE,MAAO,wDACP,YACE,gEACJ,EACA,CACE,MAAO,kBACP,YACE,oLACJ,EACA,CACE,MAAO,mCACP,YACED,EAAC,QAAK,qKAGD,IACHD,EAAC,KACC,KAAK,yBACL,OAAO,SACP,IAAI,sBACL,2BAED,EAAI,KAEN,CAEJ,EACA,CACE,MAAO,6BACP,YACE,gHACJ,CACF,EACaG,EAAkCC,EAAA,IAE3CH,EAAAF,EAAA,CACE,UAAAE,EAAC,MAAG,UAAWI,EAAG,qDAAqD,EACpE,cAAI,0BAEP,EACAL,EAAC,KACC,UAAWK,EACT,2DACF,EACD,6NAID,EAEAL,EAAC,MACC,UAAWK,EAAG,wDAAwD,EACvE,+BAED,EACAL,EAAC,MACC,UAAWK,EACT,0EACF,EAEC,SAAAH,EAAuB,IAAKI,GAC3BL,EAAC,MACC,UAAWI,EACT,wDACF,EAGA,UAAAL,EAAC,QACC,UAAWK,EACT,6DACF,EAEC,SAAAC,EAAO,MACV,EACAN,EAAC,QACC,UAAWK,EACT,mEACF,EAEC,SAAAC,EAAO,YACV,IAfKA,EAAO,KAgBd,CACD,EACH,GACF,EAnD2C","names":["Fragment","jsx","jsxs","terminationReasonsList","TerminationReasonsDetailContent","__name","cn","reason"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-32GSS4UM.js";import{a as n}from"./chunk-XICA45G2.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as m}from"react/jsx-runtime";var r=["You submit your termination request.","We review your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, we may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","We share termination documents with the employee.","The employee signs the termination documents if required.","We process the final salary and offboard the employee."],h=o(()=>m(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. We'll lead communication with them after you submit this form and we finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. We'll ask for the details regarding that communication and take it from there."}),t(n,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:i.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:r.map((a,l)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},l))})]}),"TerminationDialogInfoContent");export{h as a};
2
- //# sourceMappingURL=chunk-MFKGLMRJ.js.map
1
+ import{a as i}from"./chunk-32GSS4UM.js";import{a as n}from"./chunk-MP2T74PU.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as m}from"react/jsx-runtime";var r=["You submit your termination request.","We review your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, we may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","We share termination documents with the employee.","The employee signs the termination documents if required.","We process the final salary and offboard the employee."],h=o(()=>m(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. We'll lead communication with them after you submit this form and we finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. We'll ask for the details regarding that communication and take it from there."}),t(n,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:i.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:r.map((a,l)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},l))})]}),"TerminationDialogInfoContent");export{h as a};
2
+ //# sourceMappingURL=chunk-QKLIYOMA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.tsx"],"sourcesContent":["import { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\n\nconst terminationSteps = [\n 'You submit your termination request.',\n 'We review your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.',\n 'A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.',\n 'Depending on the country-specific laws and the terms of the employment agreement, we may need to seek additional legal advice. We’ll let you know if there are additional charges before proceeding.',\n 'Terms and conditions for the termination are finalized.',\n 'You verbally communicate the termination to the employee.',\n 'We share termination documents with the employee.',\n 'The employee signs the termination documents if required.',\n 'We process the final salary and offboard the employee.',\n];\n\nexport const TerminationDialogInfoContent = () => {\n return (\n <>\n <h3 className={cn('RemoteFlows__TerminationDialogInfoContent__Title')}>\n Please read carefully before you continue\n </h3>\n <p\n className={cn('RemoteFlows__TerminationDialogInfoContent__Description')}\n >\n Please do not inform the employee of the termination. We'll lead\n communication with them after you submit this form and we finalize the\n termination terms.\n </p>\n <p\n className={cn(\n 'RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription',\n )}\n >\n If you already informed them, that's okay. We'll ask for the details\n regarding that communication and take it from there.\n </p>\n\n <ZendeskTriggerButton\n className={cn(\n 'RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm',\n )}\n zendeskId={zendeskArticles.terminationEmployeeCommunication}\n >\n Learn more about employee communication\n </ZendeskTriggerButton>\n\n <h3\n className={cn(\n 'RemoteFlows__TerminationDialogInfoContent__ProcessTitle',\n )}\n >\n The termination process\n </h3>\n\n <ul\n className={cn(\n 'RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside',\n )}\n >\n {terminationSteps.map((step, index) => (\n <li\n key={index}\n className={cn(\n 'RemoteFlows__TerminationDialogInfoContent__ProcessListItem',\n )}\n >\n {step}\n </li>\n ))}\n </ul>\n </>\n );\n};\n"],"mappings":"gKAiBI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBAdJ,IAAMC,EAAmB,CACvB,uCACA,mIACA,2GACA,4MACA,0DACA,4DACA,oDACA,4DACA,wDACF,EAEaC,EAA+BC,EAAA,IAExCH,EAAAF,EAAA,CACE,UAAAC,EAAC,MAAG,UAAWK,EAAG,kDAAkD,EAAG,qDAEvE,EACAL,EAAC,KACC,UAAWK,EAAG,wDAAwD,EACvE,sKAID,EACAL,EAAC,KACC,UAAWK,EACT,uHACF,EACD,qIAGD,EAEAL,EAACM,EAAA,CACC,UAAWD,EACT,yEACF,EACA,UAAWE,EAAgB,iCAC5B,mDAED,EAEAP,EAAC,MACC,UAAWK,EACT,yDACF,EACD,mCAED,EAEAL,EAAC,MACC,UAAWK,EACT,8EACF,EAEC,SAAAH,EAAiB,IAAI,CAACM,EAAMC,IAC3BT,EAAC,MAEC,UAAWK,EACT,4DACF,EAEC,SAAAG,GALIC,CAMP,CACD,EACH,GACF,EAvDwC","names":["Fragment","jsx","jsxs","terminationSteps","TerminationDialogInfoContent","__name","cn","ZendeskTriggerButton","zendeskArticles","step","index"]}
@@ -1,2 +1,2 @@
1
- import{C as f,h as u,m as c,r as m,v as C,y as d}from"./chunk-MISHDUB2.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as r,useQuery as l}from"@tanstack/react-query";import{createHeadlessForm as g,modify as E}from"@remoteoss/json-schema-form";var x=t(({includePremiumBenefits:e})=>{let{client:i}=a();return l({queryKey:["cost-calculator-countries",e],queryFn:t(()=>m({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(o=>o.data?.data.filter(s=>s.availability==="active").map(s=>({value:s.region_slug,label:s.name,childRegions:s.child_regions,hasAdditionalFields:s.has_additional_fields,regionSlug:s.region_slug,currency:s.currency.code})),"select")})},"useCostCalculatorCountries"),P=t(()=>{let{client:e}=a();return l({queryKey:["company-currencies"],queryFn:t(()=>f({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(o=>({value:o.slug,label:o.code})),"select")})},"useCompanyCurrencies"),v=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),M=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>c({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),S=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>d({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),j=t((e,{includePremiumBenefits:i,options:o})=>{let{client:s}=a();return l({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>C({client:s,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:p})=>{let n=p?.data?.schema||{};if(o&&o.jsfModify){let{schema:y}=E(n,o.jsfModify);n=y}return g(n)},"select")})},"useRegionFields");export{x as a,P as b,v as c,M as d,S as e,j as f};
2
- //# sourceMappingURL=chunk-5EP45OQV.js.map
1
+ import{D as f,h as u,m as c,r as m,w as C,z as d}from"./chunk-3O3Q24JL.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as r,useQuery as l}from"@tanstack/react-query";import{createHeadlessForm as g,modify as E}from"@remoteoss/json-schema-form";var x=t(({includePremiumBenefits:e})=>{let{client:i}=a();return l({queryKey:["cost-calculator-countries",e],queryFn:t(()=>m({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(o=>o.data?.data.filter(s=>s.availability==="active").map(s=>({value:s.region_slug,label:s.name,childRegions:s.child_regions,hasAdditionalFields:s.has_additional_fields,regionSlug:s.region_slug,currency:s.currency.code})),"select")})},"useCostCalculatorCountries"),P=t(()=>{let{client:e}=a();return l({queryKey:["company-currencies"],queryFn:t(()=>f({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(o=>({value:o.slug,label:o.code})),"select")})},"useCompanyCurrencies"),v=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),M=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>c({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),S=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>d({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),j=t((e,{includePremiumBenefits:i,options:o})=>{let{client:s}=a();return l({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>C({client:s,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:p})=>{let n=p?.data?.schema||{};if(o&&o.jsfModify){let{schema:y}=E(n,o.jsfModify);n=y}return g(n)},"select")})},"useRegionFields");export{x as a,P as b,v as c,M as d,S as e,j as f};
2
+ //# sourceMappingURL=chunk-RC3XP5WU.js.map
@@ -0,0 +1,2 @@
1
+ import{G as p,s as u,u as y}from"./chunk-3O3Q24JL.js";import{d as i}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{useQuery as m}from"@tanstack/react-query";var x=a(({employmentId:n})=>{let{client:o}=i();return m({queryKey:["employment",n],retry:!1,queryFn:a(()=>y({client:o,headers:{Authorization:""},path:{employment_id:n}}),"queryFn"),select:a(({data:e})=>e,"select")})},"useEmploymentQuery"),l=a(({employmentId:n,status:o,timeoffType:e,options:t})=>{let{client:r}=i();return m({queryKey:["timeoff",n,o],retry:!1,queryFn:a(()=>p({client:r,headers:{Authorization:""},query:{employment_id:n,status:o,timeoff_type:e}}),"queryFn"),select:a(({data:s})=>t?.select?.(s)??s,"select"),enabled:t?.enabled})},"useTimeOffQuery"),T=a((n,o)=>{let e=new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),t=new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return`${e} \u2192 ${t}`},"formatDateRange"),w=a(({employmentId:n,options:o})=>l({employmentId:n,timeoffType:"paid_time_off",options:{enabled:o?.enabled,select:a(e=>({bookedDays:e?.data?.total_count||0,timeoffs:e?.data?.timeoffs?.map(t=>({status:t?.status,duration:t?.timeoff_days.length,startDate:t?.start_date,endDate:t?.end_date,formattedDate:T(t?.start_date,t?.end_date)}))||[]}),"select")}}),"usePaidTimeoffBreakdownQuery"),b=a(({employmentId:n,date:o,options:e})=>l({employmentId:n,timeoffType:"paid_time_off",status:"approved",options:{enabled:e?.enabled,select:a(t=>({bookedDaysBeforeTermination:t?.data?.timeoffs?.filter(r=>new Date(r?.start_date)<=new Date(o)).length||0,bookedDaysAfterTermination:t?.data?.timeoffs?.filter(r=>new Date(r?.start_date)>new Date(o)).length||0}),"select")}}),"useBookedTimeoffBeforeAndAfterTerminationQuery"),L=a(({employmentId:n,proposedTerminationDate:o})=>{let e=g({employmentId:n}),t=b({employmentId:n,date:o}),r=e.data?.data?.[0].annual_entitlement.type==="limited"&&e.data?.data?.[0].annual_entitlement.days||0,s=e.data?.data?.[0].booked?.days||0,d=e.data?.data?.[0].used.days||0,c=t.data?.bookedDaysBeforeTermination||0,D=t.data?.bookedDaysAfterTermination||0,f=r-s-d;return{data:{entitledDays:r,bookedDays:s,usedDays:d,approvedDaysBeforeTermination:c,approvedDaysAfterTermination:D,remainingDays:f<0?0:f},isLoading:e.isLoading||t.isLoading,isError:e.isError||t.isError,error:e.error||t.error}},"useSummaryTimeOffDataQuery"),g=a(({employmentId:n})=>{let{client:o}=i();return m({queryKey:["timeoff-balance",n],retry:!1,queryFn:a(()=>u({client:o,headers:{Authorization:""},path:{employment_id:n}}),"queryFn"),select:a(({data:e})=>e,"select")})},"useTimeOffLeavePoliciesSummaryQuery");export{x as a,l as b,w as c,b as d,L as e,g as f};
2
+ //# sourceMappingURL=chunk-REDYWUCC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/common/api.ts"],"sourcesContent":["import {\n getIndexLeavePoliciesSummary,\n getIndexTimeoff,\n getShowEmployment,\n ListTimeoffResponse,\n TimeoffStatus,\n TimeoffType,\n} from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { ContractAmendmentParams } from '@/src/flows/ContractAmendment/types';\nimport { Client } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\n\ntype UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;\n\n/**\n * Hook to retrieve employment details for a specific employment ID.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} params.employmentId - The ID of the employment to fetch details for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the employment details.\n */\nexport const useEmploymentQuery = ({ employmentId }: UseEmployment) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n queryFn: () => {\n return getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { employment_id: employmentId },\n });\n },\n select: ({ data }) => data,\n });\n};\n\n/**\n * Hook to retrieve time off data for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch time off data for.\n * @param {TimeoffStatus} [params.status] - The status of the time off requests to filter by (e.g., 'approved', 'pending').\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off data.\n *\n */\nexport const useTimeOffQuery = <TData = ListTimeoffResponse>({\n employmentId,\n status,\n timeoffType,\n options,\n}: {\n employmentId?: string;\n status?: TimeoffStatus;\n timeoffType?: TimeoffType;\n options?: {\n enabled?: boolean;\n select?: (data: ListTimeoffResponse | undefined) => TData;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['timeoff', employmentId, status],\n retry: false,\n queryFn: () => {\n return getIndexTimeoff({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n query: {\n employment_id: employmentId,\n status: status,\n timeoff_type: timeoffType,\n },\n });\n },\n select: ({ data }) => (options?.select?.(data) ?? data) as TData,\n enabled: options?.enabled,\n });\n};\n\nconst formatDateRange = (startDate: string, endDate: string) => {\n const start = new Date(startDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n const end = new Date(endDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n return `${start} → ${end}`;\n};\n\nexport type PaidTimeoffBreakdownResponse = {\n bookedDays: number;\n timeoffs: {\n status: string;\n duration: number;\n startDate: string;\n endDate: string;\n formattedDate: string;\n }[];\n};\n\n/**\n * Hook to retrieve paid time off breakdown for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch paid time off breakdown for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the paid time off breakdown.\n *\n */\nexport const usePaidTimeoffBreakdownQuery = ({\n employmentId,\n options,\n}: {\n employmentId?: string;\n options?: {\n enabled?: boolean;\n };\n}) => {\n return useTimeOffQuery<PaidTimeoffBreakdownResponse>({\n employmentId,\n timeoffType: 'paid_time_off',\n options: {\n enabled: options?.enabled,\n select: (data) => {\n return {\n bookedDays: data?.data?.total_count || 0,\n timeoffs:\n data?.data?.timeoffs?.map((timeoff) => {\n return {\n status: timeoff?.status,\n duration: timeoff?.timeoff_days.length,\n startDate: timeoff?.start_date,\n endDate: timeoff?.end_date,\n formattedDate: formatDateRange(\n timeoff?.start_date,\n timeoff?.end_date,\n ),\n };\n }) || [],\n };\n },\n },\n });\n};\n\nexport type BookedTimeoffBeforeDateResponse = {\n bookedDaysBeforeTermination: number;\n bookedDaysAfterTermination: number;\n};\n\n/**\n * Hook to retrieve booked time off data before and after a specific date for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch booked time off data for.\n * @param {string} [params.date] - The date to fetch booked time off data for.\n * @returns {BookedTimeoffBeforeDateResponse} - The booked time off data before and after the specific date.\n *\n * This hooks it's not taking into account unlimited time off or half days yet or even we you request several days in one request.\n */\nexport const useBookedTimeoffBeforeAndAfterTerminationQuery = ({\n employmentId,\n date,\n options,\n}: {\n employmentId: string;\n date: string;\n options?: { enabled: boolean };\n}) => {\n return useTimeOffQuery<BookedTimeoffBeforeDateResponse>({\n employmentId,\n timeoffType: 'paid_time_off',\n status: 'approved',\n options: {\n enabled: options?.enabled,\n select: (data) => {\n return {\n bookedDaysBeforeTermination:\n data?.data?.timeoffs?.filter((timeoff) => {\n return new Date(timeoff?.start_date) <= new Date(date);\n }).length || 0,\n bookedDaysAfterTermination:\n data?.data?.timeoffs?.filter((timeoff) => {\n return new Date(timeoff?.start_date) > new Date(date);\n }).length || 0,\n };\n },\n },\n });\n};\n\nexport type SummaryTimeOffDataResponse = {\n entitledDays: number;\n bookedDays: number;\n usedDays: number;\n approvedDaysBeforeTermination: number;\n approvedDaysAfterTermination: number;\n remainingDays: number;\n};\n\n/**\n * Hook to retrieve summary time off data for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch summary time off data for.\n * @param {string} [params.proposedTerminationDate] - The proposed termination date to fetch summary time off data for.\n * @returns {SummaryTimeOffDataResponse} - The summary time off data.\n *\n * This hook doesn't take into account unlimited time off or half days yet.\n *\n */\nexport const useSummaryTimeOffDataQuery = ({\n employmentId,\n proposedTerminationDate,\n}: {\n employmentId: string;\n proposedTerminationDate: string;\n}) => {\n const leavePoliciesSummaryQuery = useTimeOffLeavePoliciesSummaryQuery({\n employmentId,\n });\n const bookedTimeQuery = useBookedTimeoffBeforeAndAfterTerminationQuery({\n employmentId,\n date: proposedTerminationDate,\n });\n\n const entitledDays =\n (leavePoliciesSummaryQuery.data?.data?.[0].annual_entitlement.type ===\n 'limited' &&\n leavePoliciesSummaryQuery.data?.data?.[0].annual_entitlement.days) ||\n 0;\n const bookedDays =\n leavePoliciesSummaryQuery.data?.data?.[0].booked?.days || 0;\n const usedDays = leavePoliciesSummaryQuery.data?.data?.[0].used.days || 0;\n const approvedDaysBeforeTermination =\n bookedTimeQuery.data?.bookedDaysBeforeTermination || 0;\n const approvedDaysAfterTermination =\n bookedTimeQuery.data?.bookedDaysAfterTermination || 0;\n const remainingDays = entitledDays - bookedDays - usedDays;\n\n return {\n data: {\n entitledDays,\n bookedDays,\n usedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays: remainingDays < 0 ? 0 : remainingDays,\n },\n isLoading: leavePoliciesSummaryQuery.isLoading || bookedTimeQuery.isLoading,\n isError: leavePoliciesSummaryQuery.isError || bookedTimeQuery.isError,\n error: leavePoliciesSummaryQuery.error || bookedTimeQuery.error,\n };\n};\n\n/**\n * Hook to retrieve time off balance for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch time off balance for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off balance.\n *\n */\nexport const useTimeOffLeavePoliciesSummaryQuery = ({\n employmentId,\n}: {\n employmentId?: string;\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['timeoff-balance', employmentId],\n retry: false,\n queryFn: () => {\n return getIndexLeavePoliciesSummary({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { employment_id: employmentId as string },\n });\n },\n select: ({ data }) => data,\n });\n};\n"],"mappings":"iIAWA,OAAS,YAAAA,MAAgB,wBAWlB,IAAMC,EAAqBC,EAAA,CAAC,CAAE,aAAAC,CAAa,IAAqB,CACrE,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,aAAcH,CAA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AAgB,EAAI,EAAIA,CACzC,EACA,UAAWR,EAA0B,WAAaE,EAAgB,UAClE,QAASF,EAA0B,SAAWE,EAAgB,QAC9D,MAAOF,EAA0B,OAASE,EAAgB,KAC5D,CACF,EA1C0C,8BAoD7BD,EAAsCxB,EAAA,CAAC,CAClD,aAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,kBAAmBH,CAAY,EAC1C,MAAO,GACP,QAASD,EAAA,IACAgC,EAA6B,CAClC,OAAQ9B,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CAAE,cAAeD,CAAuB,CAChD,CAAC,EAPM,WAST,OAAQD,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAMA,EAAd,SACV,CAAC,CACH,EApBmD","names":["useQuery","useEmploymentQuery","__name","employmentId","client","useClient","useQuery","getShowEmployment","data","useTimeOffQuery","status","timeoffType","options","getIndexTimeoff","formatDateRange","startDate","endDate","start","end","usePaidTimeoffBreakdownQuery","timeoff","useBookedTimeoffBeforeAndAfterTerminationQuery","date","useSummaryTimeOffDataQuery","proposedTerminationDate","leavePoliciesSummaryQuery","useTimeOffLeavePoliciesSummaryQuery","bookedTimeQuery","entitledDays","bookedDays","usedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","remainingDays","getIndexLeavePoliciesSummary"]}
@@ -1,2 +1,2 @@
1
- import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-VXPJXQP3.js";import{a as m}from"./chunk-7XRPOR7L.js";import{b as E}from"./chunk-E773NPNL.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
2
- //# sourceMappingURL=chunk-2WDEVWIE.js.map
1
+ import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-LRGEEPGK.js";import{a as m}from"./chunk-2YTBWEC7.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
2
+ //# sourceMappingURL=chunk-RINDVT6U.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-5SKMAYLG.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function u({onSubmit:m}){let{terminationBag:i}=n();return a(r,{onSubmit:o(async t=>{await m?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
2
- //# sourceMappingURL=chunk-3I6ONATN.js.map
1
+ import{a as r}from"./chunk-VYDVPM5S.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function u({onSubmit:m}){let{terminationBag:i}=n();return a(r,{onSubmit:o(async t=>{await m?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
2
+ //# sourceMappingURL=chunk-RQXKQTRD.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as o}from"./chunk-XICA45G2.js";import{b as i}from"./chunk-E773NPNL.js";import{b as r}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{Info as p}from"lucide-react";import{Fragment as f,jsx as t,jsxs as e}from"react/jsx-runtime";function B({extraStatutoryPaymentsTotal:d,extraStatutoryPaymentsBreakdown:u,currency:s}){return e("div",{children:[e("div",{className:"flex justify-between items-center mb-2",children:[t("h3",{className:"font-medium text-primary-foreground-800",children:"Extra Statutory Payments"}),t("span",{className:"font-semibold text-lg",children:r(d,s)})]}),t(l,{className:"mb-3"}),t("div",{className:"space-y-3 pl-2",children:u.map((a,c)=>e("div",{className:"flex justify-between items-start text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{children:a.name}),a.description&&t(m,{content:e(f,{children:[t("span",{children:a.description})," ",a.zendesk_article_url&&t(o,{zendeskId:Number(a.zendesk_article_id),children:"Learn more"})]}),children:e(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[t(p,{className:"h-3 w-3 text-gray-400"}),t("span",{className:"sr-only",children:"Info"})]})})]}),t("span",{children:r(a.amount,s)})]},c))})]})}n(B,"CostCalculatorExtraStatutoryPaymentsBreakdown");export{B as a};
2
- //# sourceMappingURL=chunk-IK6IRESD.js.map
1
+ import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as l}from"./chunk-ZSCKSEAA.js";import{a as o}from"./chunk-MP2T74PU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as r}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{Info as p}from"lucide-react";import{Fragment as f,jsx as t,jsxs as e}from"react/jsx-runtime";function B({extraStatutoryPaymentsTotal:d,extraStatutoryPaymentsBreakdown:u,currency:s}){return e("div",{children:[e("div",{className:"flex justify-between items-center mb-2",children:[t("h3",{className:"font-medium text-primary-foreground-800",children:"Extra Statutory Payments"}),t("span",{className:"font-semibold text-lg",children:r(d,s)})]}),t(l,{className:"mb-3"}),t("div",{className:"space-y-3 pl-2",children:u.map((a,c)=>e("div",{className:"flex justify-between items-start text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{children:a.name}),a.description&&t(m,{content:e(f,{children:[t("span",{children:a.description})," ",a.zendesk_article_url&&t(o,{zendeskId:Number(a.zendesk_article_id),children:"Learn more"})]}),children:e(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[t(p,{className:"h-3 w-3 text-gray-400"}),t("span",{className:"sr-only",children:"Info"})]})})]}),t("span",{children:r(a.amount,s)})]},c))})]})}n(B,"CostCalculatorExtraStatutoryPaymentsBreakdown");export{B as a};
2
+ //# sourceMappingURL=chunk-SHF5L3PW.js.map
@@ -1,2 +1,2 @@
1
- import{c as d,d as S}from"./chunk-MRVBOQLW.js";import{a as u}from"./chunk-HN5HLFTB.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-CFIJKJXD.js";import{f as y}from"./chunk-CNDSIADP.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var i=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,s)=>!e&&!r?.management_fee&&n?i(u,n,s):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:s,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(g=>{m(g);let a=i(u,g,n.managementFees);a&&c.setValue("management.management_fee",a)},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:"",hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(l=>l.value===e.currencySlug)?.label;if(a){m(a);let l=i(u,a,n.managementFees);c.setValue("management.management_fee",l)}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:s(t)})},"CostCalculatorFlow");export{W as a};
2
- //# sourceMappingURL=chunk-6L7JELHX.js.map
1
+ import{a as f}from"./chunk-KSHK3ZPX.js";import{c as d,d as S}from"./chunk-HLPKGITX.js";import{a as u}from"./chunk-HN5HLFTB.js";import{b as C}from"./chunk-CFIJKJXD.js";import{f as y}from"./chunk-CNDSIADP.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var i=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,s)=>!e&&!r?.management_fee&&n?i(u,n,s):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:s,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(g=>{m(g);let a=i(u,g,n.managementFees);a&&c.setValue("management.management_fee",a)},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:"",hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(l=>l.value===e.currencySlug)?.label;if(a){m(a);let l=i(u,a,n.managementFees);c.setValue("management.management_fee",l)}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:s(t)})},"CostCalculatorFlow");export{W as a};
2
+ //# sourceMappingURL=chunk-UIO6B4GN.js.map
@@ -1,2 +1,2 @@
1
- import{b as m}from"./chunk-KSHK3ZPX.js";import{b as i}from"./chunk-E773NPNL.js";import{b as s}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as l}from"react/jsx-runtime";function b({children:o,...t}){let{formId:n}=m(),{components:C}=s(),r=C?.button;return r?l(r,{...t,form:n,children:o}):l(i,{...t,type:"submit",className:e("RemoteFlows__CostCalculatorForm__SubmitButton",t.className),form:n,children:o})}u(b,"CostCalculatorSubmitButton");export{b as a};
2
- //# sourceMappingURL=chunk-RJGWAZBE.js.map
1
+ import{b as m}from"./chunk-KSHK3ZPX.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as s}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as l}from"react/jsx-runtime";function b({children:o,...t}){let{formId:n}=m(),{components:C}=s(),r=C?.button;return r?l(r,{...t,form:n,children:o}):l(i,{...t,type:"submit",className:e("RemoteFlows__CostCalculatorForm__SubmitButton",t.className),form:n,children:o})}u(b,"CostCalculatorSubmitButton");export{b as a};
2
+ //# sourceMappingURL=chunk-UPXJJBXZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-OOUYQLIE.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
2
- //# sourceMappingURL=chunk-K4NAASBM.js.map
1
+ import{a as s}from"./chunk-HFI2MD3H.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
2
+ //# sourceMappingURL=chunk-UTBVLDKY.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-N6G4VZXF.js";import{a as r}from"./chunk-DKA2EUPQ.js";import{a as t}from"./chunk-GC23RRCI.js";import{a}from"./chunk-XSHHMBMT.js";var i={data:{version:7,schema:{additionalProperties:!1,allOf:[...e.data.schema.allOf,...t.data.schema.allOf,...r.data.schema.allOf,...a.data.schema.allOf],properties:{...e.data.schema.properties,...t.data.schema.properties,...r.data.schema.properties,...a.data.schema.properties},required:[...e.data.schema.required,...t.data.schema.required,...r.data.schema.required,...a.data.schema.required],type:"object","x-jsf-order":[...e.data.schema["x-jsf-order"],...t.data.schema["x-jsf-order"],...r.data.schema["x-jsf-order"],...a.data.schema["x-jsf-order"]]}}};export{i as a};
2
- //# sourceMappingURL=chunk-PJUC5WAJ.js.map
1
+ import{a as t}from"./chunk-GC23RRCI.js";import{a}from"./chunk-XSHHMBMT.js";import{a as e}from"./chunk-N6G4VZXF.js";import{a as r}from"./chunk-4T6PRR6R.js";var i={data:{version:7,schema:{additionalProperties:!1,allOf:[...e.data.schema.allOf,...t.data.schema.allOf,...r.data.schema.allOf,...a.data.schema.allOf],properties:{...e.data.schema.properties,...t.data.schema.properties,...r.data.schema.properties,...a.data.schema.properties},required:[...e.data.schema.required,...t.data.schema.required,...r.data.schema.required,...a.data.schema.required],type:"object","x-jsf-order":[...e.data.schema["x-jsf-order"],...t.data.schema["x-jsf-order"],...r.data.schema["x-jsf-order"],...a.data.schema["x-jsf-order"]]}}};export{i as a};
2
+ //# sourceMappingURL=chunk-VUP76ZMQ.js.map
@@ -1,2 +1,2 @@
1
- import{b as d}from"./chunk-MRYRNB7Y.js";import{b as a}from"./chunk-CFIJKJXD.js";import{a as f}from"./chunk-EIVHHLR5.js";import{f as s,g as l}from"./chunk-CNDSIADP.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as T}from"react";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:F}){let{formId:u,terminationBag:o}=d(),c=a(o.handleValidation),i=s({resolver:c,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});T(()=>{let y=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>y?.unsubscribe()},[]);let p=m||(o?.fields??[]);return e(l,{...i,children:e("form",{id:u,onSubmit:i.handleSubmit(F),className:"space-y-4 RemoteFlows__TerminationForm",children:e(f,{fields:p})})})}n(A,"TerminationForm");export{A as a};
2
- //# sourceMappingURL=chunk-5SKMAYLG.js.map
1
+ import{b as d}from"./chunk-MRYRNB7Y.js";import{a as f}from"./chunk-A7T27JCJ.js";import{b as a}from"./chunk-CFIJKJXD.js";import{f as s,g as l}from"./chunk-CNDSIADP.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as T}from"react";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:F}){let{formId:u,terminationBag:o}=d(),c=a(o.handleValidation),i=s({resolver:c,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});T(()=>{let y=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>y?.unsubscribe()},[]);let p=m||(o?.fields??[]);return e(l,{...i,children:e("form",{id:u,onSubmit:i.handleSubmit(F),className:"space-y-4 RemoteFlows__TerminationForm",children:e(f,{fields:p})})})}n(A,"TerminationForm");export{A as a};
2
+ //# sourceMappingURL=chunk-VYDVPM5S.js.map
@@ -1,2 +1,2 @@
1
- import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-EIVHHLR5.js";import{b as p}from"./chunk-7XRPOR7L.js";import{g as C}from"./chunk-CNDSIADP.js";import{g as E}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=f(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=p(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
2
- //# sourceMappingURL=chunk-KJSZIASL.js.map
1
+ import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-A7T27JCJ.js";import{b as p}from"./chunk-2YTBWEC7.js";import{g as C}from"./chunk-CNDSIADP.js";import{g as E}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=f(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=p(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
2
+ //# sourceMappingURL=chunk-WFMQ2IDE.js.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as e}from"./chunk-32GSS4UM.js";import{a}from"./chunk-XICA45G2.js";import{b as n}from"./chunk-E773NPNL.js";import{b as s}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as y,jsx as r,jsxs as t}from"react/jsx-runtime";function N({grossSalary:l,currency:p,hasExtraStatutoryPayment:c=!1}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[t("div",{className:"flex items-center gap-2",children:[r("h3",{className:"font-medium text-primary-foreground",children:"Gross Salary"}),c&&r(m,{content:t(y,{children:[r("span",{children:"This country respects extra payments on top of the gross salary."})," ",r(a,{zendeskId:e.extraPayments,children:"Learn more"})]}),children:t(n,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 mt-2",children:[r(f,{className:"h-3 w-3 text-gray-400"}),r("span",{className:"sr-only",children:"Info"})]})})]}),r("span",{className:"font-semibold text-lg",children:s(l,p)})]}),r(i,{})]})}o(N,"CostCalculatorGrossSalary");export{N as a};
2
- //# sourceMappingURL=chunk-TWD2IDAS.js.map
1
+ import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as i}from"./chunk-ZSCKSEAA.js";import{a as e}from"./chunk-32GSS4UM.js";import{a}from"./chunk-MP2T74PU.js";import{b as n}from"./chunk-WVDTHFGS.js";import{b as s}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as y,jsx as r,jsxs as t}from"react/jsx-runtime";function N({grossSalary:l,currency:p,hasExtraStatutoryPayment:c=!1}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[t("div",{className:"flex items-center gap-2",children:[r("h3",{className:"font-medium text-primary-foreground",children:"Gross Salary"}),c&&r(m,{content:t(y,{children:[r("span",{children:"This country respects extra payments on top of the gross salary."})," ",r(a,{zendeskId:e.extraPayments,children:"Learn more"})]}),children:t(n,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 mt-2",children:[r(f,{className:"h-3 w-3 text-gray-400"}),r("span",{className:"sr-only",children:"Info"})]})})]}),r("span",{className:"font-semibold text-lg",children:s(l,p)})]}),r(i,{})]})}o(N,"CostCalculatorGrossSalary");export{N as a};
2
+ //# sourceMappingURL=chunk-WNXB2Y65.js.map
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-43WMZDDH.js";import{a as t}from"./chunk-P37U34EQ.js";import{Slot as i}from"@radix-ui/react-slot";import{cva as u}from"class-variance-authority";import{jsx as l}from"react/jsx-runtime";var d=u("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:ring-destructive/20 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 RemoteFlows_ButtonDefault",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 RemoteFlows_ButtonDestructive",outline:"border border-input bg-background shadow-xs RemoteFlows_ButtonOutline",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80 RemoteFlows_ButtonSecondary",ghost:"hover:bg-accent hover:text-accent-foreground RemoteFlows_ButtonGhost",link:"text-link-button-primary underline-offset-4 hover:underline button-link RemoteFlows_ButtonLink"},size:{default:"h-9 px-4 py-7 has-[>svg]:px-3 RemoteFlows_ButtonDefault",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5 RemoteFlows_ButtonSm",lg:"h-10 rounded-md px-6 has-[>svg]:px-4 RemoteFlows_ButtonLg",icon:"size-9 RemoteFlows_ButtonIcon",link:"px-0 RemoteFlows_ButtonLink"}},defaultVariants:{variant:"default",size:"default"}});function g({className:e,variant:n,size:s,asChild:r=!1,...a}){return l(r?i:"button",{"data-slot":"button",className:o(d({variant:n,size:s,className:e}),"RemoteFlows__Button"),...a})}t(g,"Button");export{d as a,g as b};
2
+ //# sourceMappingURL=chunk-WVDTHFGS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/button.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:ring-destructive/20 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 RemoteFlows_ButtonDefault',\n destructive:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90 RemoteFlows_ButtonDestructive',\n outline:\n 'border border-input bg-background shadow-xs RemoteFlows_ButtonOutline',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80 RemoteFlows_ButtonSecondary',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground RemoteFlows_ButtonGhost',\n link: 'text-link-button-primary underline-offset-4 hover:underline button-link RemoteFlows_ButtonLink',\n },\n size: {\n default: 'h-9 px-4 py-7 has-[>svg]:px-3 RemoteFlows_ButtonDefault',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5 RemoteFlows_ButtonSm',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4 RemoteFlows_ButtonLg',\n icon: 'size-9 RemoteFlows_ButtonIcon',\n link: 'px-0 RemoteFlows_ButtonLink',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot='button'\n className={cn(\n buttonVariants({ variant, size, className }),\n 'RemoteFlows__Button',\n )}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":"gFAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BAkDnC,cAAAC,MAAA,oBA7CJ,IAAMC,EAAiBC,EACrB,yVACA,CACE,SAAU,CACR,QAAS,CACP,QACE,6FACF,YACE,4FACF,QACE,wEACF,UACE,qGACF,MACE,uEACF,KAAM,gGACR,EACA,KAAM,CACJ,QAAS,0DACT,GAAI,qEACJ,GAAI,4DACJ,KAAM,gCACN,KAAM,6BACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CAGH,OACER,EAHWO,EAAUE,EAAO,SAG3B,CACC,YAAU,SACV,UAAWC,EACTT,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EAC3C,qBACF,EACC,GAAGI,EACN,CAEJ,CAtBSG,EAAAR,EAAA","names":["Slot","cva","jsx","buttonVariants","cva","Button","className","variant","size","asChild","props","Slot","cn","__name"]}
@@ -1,2 +1,2 @@
1
- import{c as X,d as Z}from"./chunk-FB2QGVI2.js";import{a as $,f as K,h as Y,l as z}from"./chunk-VXPJXQP3.js";import{a as tt,b as et,c as nt,d as ot,e as rt}from"./chunk-QP36XXCQ.js";import{a as at,b as it}from"./chunk-U6RM2N4A.js";import{a as T}from"./chunk-7XRPOR7L.js";import{a as Q}from"./chunk-PJBAQZ6G.js";import{c as f,d as E}from"./chunk-PAQW5BFW.js";import{g as w}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Nt,useMemo as m,useRef as qt,useState as k}from"react";var At={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},xt={employment_basic_information:"basic_information"},te=p(({countryCode:st,externalId:ct,employmentId:y,skipSteps:lt,options:d,initialValues:i})=>{let[r,B]=k(st||null),[a,mt]=k(y),[M,dt]=k(void 0),v=qt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),ut=lt?.includes("select_country")?it:at,{fieldValues:b,stepState:e,setFieldValues:pt,previousStep:ft,nextStep:yt,goToStep:D,setStepValues:J}=Q(ut),{data:s,isLoading:I,refetch:_t}=$(a),{status:_}=s||{},j=_&&X.includes(_),St=_&&!Z.includes(_),gt=m(()=>_==="invited"?"invited":"not_invited",[_]),N=Y(d),q=ot(),A=et(),{mutateAsync:bt}=T(N),{mutateAsync:Ct}=T(q),{mutateAsync:ht}=T(A);y&&s?.country?.code&&!r&&B(s.country.code);let{selectCountryForm:P,isLoading:Ft}=z({jsfModify:d?.jsfModify?.select_country,jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="select_country"}}),Vt=At[e.currentStep.name]||"employment_basic_information",Et=xt[Vt],wt=s?.[Et]||{},vt=p(({form:t,options:o={},query:S={}})=>{let g=Object.keys(b).length>0?{...i,...e.values?.[e.currentStep.name],...b}:{...i,...wt};return K({countryCode:r,form:t,fieldValues:g,query:S,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),Pt=!!(r&&(e.currentStep.name==="basic_information"||y)),Ot=!!(r&&(e.currentStep.name==="contract_details"||y)),{data:c,isLoading:Tt}=vt({form:"employment_basic_information",options:{jsfModify:d?.jsfModify?.basic_information,queryOptions:{enabled:Pt},jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:l,isLoading:Mt}=rt({countryCode:r,fieldValues:b,options:{queryOptions:{enabled:Ot},jsfModify:d?.jsfModify?.contract_details,jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:u}=tt({fieldValues:b,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Dt,isLoading:It}=nt({employmentId:a,contractDocumentId:M,options:{queryOptions:{enabled:!!M}}}),n=m(()=>({select_country:P?.fields||[],basic_information:c?.fields||[],pricing_plan:[],contract_details:l?.fields||[],contract_preview:u?.fields||[],review:[]}),[P?.fields,c?.fields,l?.fields,u?.fields]),jt={select_country:null,basic_information:c?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:l?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Rt,basic_information:x={},contract_details:O={}}=s||{},U=Rt?.code,C=m(()=>E(n.select_country,{country:r||U||""}),[n.select_country,r,U]),h=m(()=>{let t={...i,...x};return E(n.basic_information,t)},[n.basic_information,x,i]),F=m(()=>{let t={...i,...O};return E(n.contract_details,t)},[n.contract_details,O,i]),H=m(()=>{let t={...i,...O};return E(n.contract_preview,t)},[n.contract_preview,O,i]),Lt=m(()=>({select_country:C,basic_information:h,contract_details:F,contract_preview:H,pricing_plan:{}}),[C,h,F,H]),G=m(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Nt(()=>{G&&(v.current={select_country:w(C,n.select_country),basic_information:w(h,n.basic_information),contract_details:w(F,n.contract_details),contract_preview:{},pricing_plan:{}},J({select_country:C,basic_information:h,contract_details:F,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[G,D,C,h,F,J,n.select_country,n.basic_information,n.contract_details]);let kt=p(t=>{D(t)},"goTo"),W=p(t=>P&&e.currentStep.name==="select_country"?t:c&&e.currentStep.name==="basic_information"?f(t,c?.fields,{isPartialValidation:!1}):l&&e.currentStep.name==="contract_details"?f(t,l?.fields,{isPartialValidation:!1}):u&&e.currentStep.name==="contract_preview"?f(t,u?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Bt(t){let o=e.currentStep.name;o in v.current&&(v.current[o]=w(t,n[o]));let S=W(t);switch(e.currentStep.name){case"select_country":return B(S.country),Promise.resolve({data:{countryCode:S.country}});case"basic_information":{let R=!a&&r,g=a&&r&&s?.country&&s?.country.code!==r;if(R||g){let L={basic_information:S,type:"contractor",country_code:r,external_id:ct};try{let V=await bt(L),Jt=V.data?.data?.employment?.id;return mt(Jt),V}catch(V){throw console.error("Error creating onboarding:",V),V}}else if(a)return Promise.resolve({data:{employmentId:a}});return}case"contract_details":{let g=await Ct({employmentId:a,payload:{contract_document:S}}),L=g.data?.data?.contract_document?.id;return dt(L),g}case"contract_preview":return ht({employmentId:a,contractDocumentId:M,payload:{signature:t.signature}});case"pricing_plan":return Promise.resolve({data:{pricingPlan:t}});default:throw new Error("Invalid step state")}}return p(Bt,"onSubmit"),{isLoading:Ft||Tt||I||Mt||It,fieldValues:b,stepState:e,checkFieldUpdates:pt,back:ft,next:yt,goTo:kt,onSubmit:Bt,fields:n[e.currentStep.name],meta:{fields:v.current,fieldsets:jt[e.currentStep.name]},parseFormValues:W,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return P.handleValidation(t);if(c&&e.currentStep.name==="basic_information"){let o=f(t,c?.fields,{isPartialValidation:!1});return c?.handleValidation(o)}if(l&&e.currentStep.name==="contract_details"){let o=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(u&&e.currentStep.name==="contract_preview"){let o=f(t,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Lt,employmentId:a,refetchEmployment:_t,isSubmitting:N.isPending||q.isPending||A.isPending,documentPreviewPdf:Dt,canInvite:St,isEmploymentReadOnly:j,invitedStatus:gt,employment:s}},"useContractorOnboarding");export{te as a};
2
- //# sourceMappingURL=chunk-CHQK23RH.js.map
1
+ import{a as tt,b as et,c as nt,d as ot,e as rt}from"./chunk-BDPCUDJB.js";import{a as at,b as it}from"./chunk-U6RM2N4A.js";import{c as X,d as Z}from"./chunk-FB2QGVI2.js";import{a as $,f as K,h as Y,l as z}from"./chunk-LRGEEPGK.js";import{a as T}from"./chunk-2YTBWEC7.js";import{a as Q}from"./chunk-PJBAQZ6G.js";import{c as f,d as E}from"./chunk-PAQW5BFW.js";import{g as w}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Nt,useMemo as m,useRef as qt,useState as k}from"react";var At={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},xt={employment_basic_information:"basic_information"},te=p(({countryCode:ct,externalId:st,employmentId:y,skipSteps:lt,options:d,initialValues:i})=>{let[r,B]=k(ct||null),[a,mt]=k(y),[M,dt]=k(void 0),v=qt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),ut=lt?.includes("select_country")?it:at,{fieldValues:b,stepState:e,setFieldValues:pt,previousStep:ft,nextStep:yt,goToStep:D,setStepValues:J}=Q(ut),{data:c,isLoading:I,refetch:_t}=$(a),{status:_}=c||{},j=_&&X.includes(_),St=_&&!Z.includes(_),gt=m(()=>_==="invited"?"invited":"not_invited",[_]),N=Y(d),q=ot(),A=et(),{mutateAsync:bt}=T(N),{mutateAsync:Ct}=T(q),{mutateAsync:ht}=T(A);y&&c?.country?.code&&!r&&B(c.country.code);let{selectCountryForm:P,isLoading:Ft}=z({jsfModify:d?.jsfModify?.select_country,jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="select_country"}}),Vt=At[e.currentStep.name]||"contractor_basic_information",Et=xt[Vt],wt=c?.[Et]||{},vt=p(({form:t,options:o={},query:S={}})=>{let g=Object.keys(b).length>0?{...i,...e.values?.[e.currentStep.name],...b}:{...i,...wt};return K({countryCode:r,form:t,fieldValues:g,query:S,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),Pt=!!(r&&(e.currentStep.name==="basic_information"||y)),Ot=!!(r&&(e.currentStep.name==="contract_details"||y)),{data:s,isLoading:Tt}=vt({form:"contractor_basic_information",options:{jsfModify:d?.jsfModify?.basic_information,queryOptions:{enabled:Pt},jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:l,isLoading:Mt}=rt({countryCode:r,fieldValues:b,options:{queryOptions:{enabled:Ot},jsfModify:d?.jsfModify?.contract_details,jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:u}=tt({fieldValues:b,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Dt,isLoading:It}=nt({employmentId:a,contractDocumentId:M,options:{queryOptions:{enabled:!!M}}}),n=m(()=>({select_country:P?.fields||[],basic_information:s?.fields||[],pricing_plan:[],contract_details:l?.fields||[],contract_preview:u?.fields||[],review:[]}),[P?.fields,s?.fields,l?.fields,u?.fields]),jt={select_country:null,basic_information:s?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:l?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Rt,basic_information:x={},contract_details:O={}}=c||{},U=Rt?.code,C=m(()=>E(n.select_country,{country:r||U||""}),[n.select_country,r,U]),h=m(()=>{let t={...i,...x};return E(n.basic_information,t)},[n.basic_information,x,i]),F=m(()=>{let t={...i,...O};return E(n.contract_details,t)},[n.contract_details,O,i]),H=m(()=>{let t={...i,...O};return E(n.contract_preview,t)},[n.contract_preview,O,i]),Lt=m(()=>({select_country:C,basic_information:h,contract_details:F,contract_preview:H,pricing_plan:{}}),[C,h,F,H]),G=m(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Nt(()=>{G&&(v.current={select_country:w(C,n.select_country),basic_information:w(h,n.basic_information),contract_details:w(F,n.contract_details),contract_preview:{},pricing_plan:{}},J({select_country:C,basic_information:h,contract_details:F,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[G,D,C,h,F,J,n.select_country,n.basic_information,n.contract_details]);let kt=p(t=>{D(t)},"goTo"),W=p(t=>P&&e.currentStep.name==="select_country"?t:s&&e.currentStep.name==="basic_information"?f(t,s?.fields,{isPartialValidation:!1}):l&&e.currentStep.name==="contract_details"?f(t,l?.fields,{isPartialValidation:!1}):u&&e.currentStep.name==="contract_preview"?f(t,u?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Bt(t){let o=e.currentStep.name;o in v.current&&(v.current[o]=w(t,n[o]));let S=W(t);switch(e.currentStep.name){case"select_country":return B(S.country),Promise.resolve({data:{countryCode:S.country}});case"basic_information":{let R=!a&&r,g=a&&r&&c?.country&&c?.country.code!==r;if(R||g){let L={basic_information:S,type:"contractor",country_code:r,external_id:st};try{let V=await bt(L),Jt=V.data?.data?.employment?.id;return mt(Jt),V}catch(V){throw console.error("Error creating onboarding:",V),V}}else if(a)return Promise.resolve({data:{employmentId:a}});return}case"contract_details":{let g=await Ct({employmentId:a,payload:{contract_document:S}}),L=g.data?.data?.contract_document?.id;return dt(L),g}case"contract_preview":return ht({employmentId:a,contractDocumentId:M,payload:{signature:t.signature}});case"pricing_plan":return Promise.resolve({data:{pricingPlan:t}});default:throw new Error("Invalid step state")}}return p(Bt,"onSubmit"),{isLoading:Ft||Tt||I||Mt||It,fieldValues:b,stepState:e,checkFieldUpdates:pt,back:ft,next:yt,goTo:kt,onSubmit:Bt,fields:n[e.currentStep.name],meta:{fields:v.current,fieldsets:jt[e.currentStep.name]},parseFormValues:W,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return P.handleValidation(t);if(s&&e.currentStep.name==="basic_information"){let o=f(t,s?.fields,{isPartialValidation:!1});return s?.handleValidation(o)}if(l&&e.currentStep.name==="contract_details"){let o=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(u&&e.currentStep.name==="contract_preview"){let o=f(t,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Lt,employmentId:a,refetchEmployment:_t,isSubmitting:N.isPending||q.isPending||A.isPending,documentPreviewPdf:Dt,canInvite:St,isEmploymentReadOnly:j,invitedStatus:gt,employment:c}},"useContractorOnboarding");export{te as a};
2
+ //# sourceMappingURL=chunk-YPHOFQ5O.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx"],"sourcesContent":["import {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n useGetShowContractDocument,\n useSignContractDocument,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCountriesSchemaField,\n useCreateEmployment,\n useEmployment,\n useJSONSchemaForm,\n} from '@/src/flows/Onboarding/api';\nimport {\n disabledInviteButtonEmploymentStatus,\n reviewStepAllowedEmploymentStatus,\n} from '@/src/flows/Onboarding/utils';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { Step, useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport { $TSFixMe, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n pricing_plan: null,\n contract_preview: null,\n review: null,\n};\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n};\n\nexport const useContractorOnboarding = ({\n countryCode,\n externalId,\n employmentId,\n skipSteps,\n options,\n initialValues: onboardingInitialValues,\n}: useContractorOnboardingProps) => {\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalContractDocumentId, setInternalContractDocumentId] = useState<\n string | undefined\n >(undefined);\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n contract_preview: Meta;\n pricing_plan: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n });\n\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n );\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmployment(internalEmploymentId);\n\n const { status: employmentStatus } = employment || {};\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const invitedStatus: 'invited' | 'not_invited' = useMemo(() => {\n const isInvited = employmentStatus === 'invited';\n\n return isInvited ? 'invited' : 'not_invited';\n }, [employmentStatus]);\n\n const createEmploymentMutation = useCreateEmployment(options);\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const signContractDocumentMutation = useSignContractDocument();\n\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n\n const { mutateAsync: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsync: signContractDocumentMutationAsync } = mutationToPromise(\n signContractDocumentMutation,\n );\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'employment_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n jsonSchemaVersion?: FlowOptions['jsonSchemaVersion'];\n };\n query?: Record<string, string>;\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractorOnboardingDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'employment_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: options?.jsfModify?.contract_details,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: stepState.currentStep.name === 'contract_preview',\n },\n },\n });\n const { data: documentPreviewPdf, isLoading: isLoadingDocumentPreviewForm } =\n useGetShowContractDocument({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n options: {\n queryOptions: {\n enabled: Boolean(internalContractDocumentId),\n },\n },\n });\n\n const stepFields: Record<keyof typeof STEPS, Fields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractorOnboardingDetailsForm?.fields,\n signatureSchemaForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n pricing_plan: null,\n contract_details: contractorOnboardingDetailsForm?.meta['x-jsf-fieldsets'],\n contract_preview: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const contractPreviewInitialValues = useMemo(() => {\n // TODO: TBD not sure if contract preview needs to be populated with anything\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: {},\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n ]);\n\n const isNavigatingToReview = useMemo(() => {\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !isLoadingEmployment &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0,\n );\n }, [\n employmentId,\n isEmploymentReadOnly,\n isLoadingEmployment,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepState.currentStep.name,\n ]);\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n // TODO: TBD\n contract_preview: {},\n // TODO: TBD\n pricing_plan: {},\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: {},\n pricing_plan: {},\n review: {},\n });\n goToStep('review');\n }\n }, [\n isNavigatingToReview,\n goToStep,\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n setStepValues,\n stepFields.select_country,\n stepFields.basic_information,\n stepFields.contract_details,\n ]);\n\n const goTo = (step: keyof typeof STEPS) => {\n goToStep(step);\n };\n\n const parseFormValues = (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n return parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return values;\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n const parsedValues = parseFormValues(values);\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n setInternalEmploymentId(employmentId);\n\n return response;\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n // TODO: Provisional it seems you cannot update a contractor employment\n return Promise.resolve({\n data: { employmentId: internalEmploymentId },\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response: $TSFixMe =\n await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n\n const contractDocumentId = response.data?.data?.contract_document?.id;\n setInternalContractDocumentId(contractDocumentId);\n return response;\n }\n\n case 'contract_preview': {\n return signContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n payload: {\n signature: values.signature,\n },\n });\n }\n\n case 'pricing_plan': {\n // TODO: TBD\n return Promise.resolve({ data: { pricingPlan: values } });\n }\n\n default: {\n throw new Error('Invalid step state');\n }\n }\n }\n\n const isLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingDocumentPreviewForm;\n\n return {\n /**\n * Loading state indicating if the flow is loading data\n */\n isLoading,\n\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back: previousStep,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next: nextStep,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo: goTo,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: FieldValues) => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractorOnboardingDetailsForm?.handleValidation(parsedValues);\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n signatureSchemaForm?.fields,\n { isPartialValidation: false },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return {\n formErrors: {},\n yupError: null,\n };\n }\n\n return null;\n },\n\n /**\n * Initial form values\n */\n initialValues,\n\n /**\n * Employment id\n */\n employmentId: internalEmploymentId,\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment: refetchEmployment,\n\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending,\n\n /**\n * Document preview PDF data\n */\n documentPreviewPdf,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n /**\n * let's the user know if the employment is invited or not\n * @returns {'invited' | 'not_invited'}\n */\n invitedStatus,\n\n /**\n * Employment data\n * @returns {Employment}\n */\n employment,\n };\n};\n"],"mappings":"qbAqCA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAQrD,IAAMC,GAGF,CACF,eAAgB,KAChB,kBAAmB,+BACnB,iBAAkB,KAClB,aAAc,KACd,iBAAkB,KAClB,OAAQ,IACV,EAEMC,GAEF,CACF,6BAA8B,mBAChC,EAEaC,GAA0BC,EAAA,CAAC,CACtC,YAAAC,GACA,WAAAC,GACA,aAAAC,EACA,UAAAC,GACA,QAAAC,EACA,cAAeC,CACjB,IAAoC,CAClC,GAAM,CAACC,EAAqBC,CAAsB,EAAIC,EACpDR,IAAe,IACjB,EACM,CAACS,EAAsBC,EAAuB,EAAIF,EAEtDN,C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E,EAMd,kBAAmBmB,GAKnB,aACES,EAAyB,WACzBE,EAAyC,WACzCE,EAA6B,UAK/B,mBAAA2B,GAMA,UAAAnC,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAT,CACF,CACF,EArrBuC","names":["useEffect","useMemo","useRef","useState","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","employment","isLoadingEmployment","refetchEmployment","useEmployment","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","useMemo","createEmploymentMutation","useCreateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","signContractDocumentMutation","useSignContractDocument","createEmploymentMutationAsync","mutationToPromise","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","selectCountryForm","isLoadingCountries","useCountriesSchemaField","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","basicInformationForm","isLoadingBasicInformationForm","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","signatureSchemaForm","useGetContractDocumentSignatureSchema","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","isNavigatingToReview","useEffect","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","contractDocumentId"]}
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx"],"sourcesContent":["import {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n useGetShowContractDocument,\n useSignContractDocument,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCountriesSchemaField,\n useCreateEmployment,\n useEmployment,\n useJSONSchemaForm,\n} from '@/src/flows/Onboarding/api';\nimport {\n disabledInviteButtonEmploymentStatus,\n reviewStepAllowedEmploymentStatus,\n} from '@/src/flows/Onboarding/utils';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { Step, useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport { $TSFixMe, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n pricing_plan: null,\n contract_preview: null,\n review: null,\n};\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n};\n\nexport const useContractorOnboarding = ({\n countryCode,\n externalId,\n employmentId,\n skipSteps,\n options,\n initialValues: onboardingInitialValues,\n}: useContractorOnboardingProps) => {\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalContractDocumentId, setInternalContractDocumentId] = useState<\n string | undefined\n >(undefined);\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n contract_preview: Meta;\n pricing_plan: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n });\n\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n );\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmployment(internalEmploymentId);\n\n const { status: employmentStatus } = employment || {};\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const invitedStatus: 'invited' | 'not_invited' = useMemo(() => {\n const isInvited = employmentStatus === 'invited';\n\n return isInvited ? 'invited' : 'not_invited';\n }, [employmentStatus]);\n\n const createEmploymentMutation = useCreateEmployment(options);\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const signContractDocumentMutation = useSignContractDocument();\n\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n\n const { mutateAsync: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsync: signContractDocumentMutationAsync } = mutationToPromise(\n signContractDocumentMutation,\n );\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'contractor_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n jsonSchemaVersion?: FlowOptions['jsonSchemaVersion'];\n };\n query?: Record<string, string>;\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractorOnboardingDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'contractor_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: options?.jsfModify?.contract_details,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: stepState.currentStep.name === 'contract_preview',\n },\n },\n });\n const { data: documentPreviewPdf, isLoading: isLoadingDocumentPreviewForm } =\n useGetShowContractDocument({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n options: {\n queryOptions: {\n enabled: Boolean(internalContractDocumentId),\n },\n },\n });\n\n const stepFields: Record<keyof typeof STEPS, Fields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractorOnboardingDetailsForm?.fields,\n signatureSchemaForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n pricing_plan: null,\n contract_details: contractorOnboardingDetailsForm?.meta['x-jsf-fieldsets'],\n contract_preview: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const contractPreviewInitialValues = useMemo(() => {\n // TODO: TBD not sure if contract preview needs to be populated with anything\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: {},\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n ]);\n\n const isNavigatingToReview = useMemo(() => {\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !isLoadingEmployment &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0,\n );\n }, [\n employmentId,\n isEmploymentReadOnly,\n isLoadingEmployment,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepState.currentStep.name,\n ]);\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n // TODO: TBD\n contract_preview: {},\n // TODO: TBD\n pricing_plan: {},\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: {},\n pricing_plan: {},\n review: {},\n });\n goToStep('review');\n }\n }, [\n isNavigatingToReview,\n goToStep,\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n setStepValues,\n stepFields.select_country,\n stepFields.basic_information,\n stepFields.contract_details,\n ]);\n\n const goTo = (step: keyof typeof STEPS) => {\n goToStep(step);\n };\n\n const parseFormValues = (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n return parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return values;\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n const parsedValues = parseFormValues(values);\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n setInternalEmploymentId(employmentId);\n\n return response;\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n // TODO: Provisional it seems you cannot update a contractor employment\n return Promise.resolve({\n data: { employmentId: internalEmploymentId },\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response: $TSFixMe =\n await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n\n const contractDocumentId = response.data?.data?.contract_document?.id;\n setInternalContractDocumentId(contractDocumentId);\n return response;\n }\n\n case 'contract_preview': {\n return signContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n payload: {\n signature: values.signature,\n },\n });\n }\n\n case 'pricing_plan': {\n // TODO: TBD\n return Promise.resolve({ data: { pricingPlan: values } });\n }\n\n default: {\n throw new Error('Invalid step state');\n }\n }\n }\n\n const isLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingDocumentPreviewForm;\n\n return {\n /**\n * Loading state indicating if the flow is loading data\n */\n isLoading,\n\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back: previousStep,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next: nextStep,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo: goTo,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: FieldValues) => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractorOnboardingDetailsForm?.handleValidation(parsedValues);\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n signatureSchemaForm?.fields,\n { isPartialValidation: false },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return {\n formErrors: {},\n yupError: null,\n };\n }\n\n return null;\n },\n\n /**\n * Initial form values\n */\n initialValues,\n\n /**\n * Employment id\n */\n employmentId: internalEmploymentId,\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment: refetchEmployment,\n\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending,\n\n /**\n * Document preview PDF data\n */\n documentPreviewPdf,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n /**\n * let's the user know if the employment is invited or not\n * @returns {'invited' | 'not_invited'}\n */\n invitedStatus,\n\n /**\n * Employment data\n * @returns {Employment}\n */\n employment,\n };\n};\n"],"mappings":"qbAqCA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAQrD,IAAMC,GAGF,CACF,eAAgB,KAChB,kBAAmB,+BACnB,iBAAkB,KAClB,aAAc,KACd,iBAAkB,KAClB,OAAQ,IACV,EAEMC,GAEF,CACF,6BAA8B,mBAChC,EAEaC,GAA0BC,EAAA,CAAC,CACtC,YAAAC,GACA,WAAAC,GACA,aAAAC,EACA,UAAAC,GACA,QAAAC,EACA,cAAeC,CACjB,IAAoC,CAClC,GAAM,CAACC,EAAqBC,CAAsB,EAAIC,EACpDR,IAAe,IACjB,EACM,CAACS,EAAsBC,EAAuB,EAAIF,EAEtDN,CAAY,EACR,CAACS,EAA4BC,EAA6B,EAAIJ,EAElE,MAAS,EACLK,EAAgBC,GAMnB,CACD,eAAgB,CAAC,EACjB,kBAAmB,CAAC,EACpB,iBAAkB,CAAC,EACnB,iBAAkB,CAAC,EACnB,aAAc,CAAC,CACjB,CAAC,EAEKC,GAAaZ,IAAW,SAAS,gBAAgB,EACnDa,GACAC,GAEE,CACJ,YAAAC,EACA,UAAAC,EACA,e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ACAK,GAWA,YAAAnD,EAKA,UAAAC,EAMA,kBAAmBC,GAMnB,KAAMC,GAMN,KAAMC,GAON,KAAMgE,GAON,SAAAK,GAKA,OAAQpB,EAAWpD,EAAU,YAAY,IAAI,EAK7C,KAAM,CACJ,OAAQN,EAAc,QACtB,UAAW2D,GAA4BrD,EAAU,YAAY,IAAI,CACnE,EAOA,gBAAAqE,EAOA,iBAAkBzF,EAAC0F,GAAwB,CACzC,GAAItE,EAAU,YAAY,OAAS,iBACjC,OAAO4B,EAAkB,iBAAiB0C,CAAM,EAGlD,GACE5B,GACA1C,EAAU,YAAY,OAAS,oBAC/B,CACA,IAAM0E,EAAeH,EACnBD,EACA5B,GAAsB,OACtB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAsB,iBAAiBgC,CAAY,CAC5D,CAEA,GACE9B,GACA5C,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAM0E,EAAeH,EACnBD,EACA1B,GAAiC,OACjC,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAiC,iBAAiB8B,CAAY,CACvE,CAEA,GACE3B,GACA/C,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAM0E,EAAeH,EACnBD,EACAvB,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAqB,iBAAiB2B,CAAY,CAC3D,CAEA,OAAI1E,EAAU,YAAY,OAAS,eAE1B,CACL,WAAY,CAAC,EACb,SAAU,IACZ,EAGK,IACT,EAlDkB,oBAuDlB,cAAA6D,GAKA,aAAcvE,EAMd,kBAAmBmB,GAKnB,aACES,EAAyB,WACzBE,EAAyC,WACzCE,EAA6B,UAK/B,mBAAA2B,GAMA,UAAAnC,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAT,CACF,CACF,EArrBuC","names":["useEffect","useMemo","useRef","useState","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","employment","isLoadingEmployment","refetchEmployment","useEmployment","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","useMemo","createEmploymentMutation","useCreateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","signContractDocumentMutation","useSignContractDocument","createEmploymentMutationAsync","mutationToPromise","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","selectCountryForm","isLoadingCountries","useCountriesSchemaField","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","basicInformationForm","isLoadingBasicInformationForm","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","signatureSchemaForm","useGetContractDocumentSignatureSchema","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","isNavigatingToReview","useEffect","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","contractDocumentId"]}
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-PGWKJ6FK.js";import{b as u}from"./chunk-E773NPNL.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as m}from"react/jsx-runtime";function f({children:o,onClick:a,...n}){let{onboardingBag:{back:c,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||c(),a?.(p)},"onBackHandler"),e=d?.button;return e?m(e,{...n,onClick:r,children:o}):m(u,{...n,onClick:r,children:o})}t(f,"OnboardingBack");export{f as a};
2
- //# sourceMappingURL=chunk-7EDGHYMX.js.map
1
+ import{b as s}from"./chunk-PGWKJ6FK.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as m}from"react/jsx-runtime";function f({children:o,onClick:a,...n}){let{onboardingBag:{back:c,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||c(),a?.(p)},"onBackHandler"),e=d?.button;return e?m(e,{...n,onClick:r,children:o}):m(u,{...n,onClick:r,children:o})}t(f,"OnboardingBack");export{f as a};
2
+ //# sourceMappingURL=chunk-ZQ6MG635.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-BPJHPGTL.js";import"../../chunk-E773NPNL.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
1
+ import{a}from"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
2
2
  //# sourceMappingURL=ContractAmendmentBack.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { d as PostCreateContractAmendmentError, c as ContractAmendmentResponse } from '../../types.gen-DOXoUj5J.js';
2
+ import { d as PostCreateContractAmendmentError, c as ContractAmendmentResponse } from '../../types.gen-oeDSqezz.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentConfirmationFormProps = {
@@ -5,11 +5,11 @@ import { ContractAmendmentForm } from './ContractAmendmentForm.js';
5
5
  import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
6
6
  import { useContractAmendment } from './hooks.js';
7
7
  import { ContractAmendmentParams } from './types.js';
8
- import '../../types.gen-DOXoUj5J.js';
8
+ import '../../types.gen-oeDSqezz.js';
9
9
  import 'react-hook-form';
10
10
  import 'react';
11
- import '../../mutations-BxS-iGnr.js';
12
- import '../../remoteFlows-DnbCoINb.js';
11
+ import '../../mutations-CAhYrKGA.js';
12
+ import '../../remoteFlows-HxRw2Djx.js';
13
13
  import 'yup';
14
14
  import '../../types-Zg1n_9wh.js';
15
15
  import '@remoteoss/json-schema-form';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-2VWU5VNU.js";import"../../chunk-V2PJW577.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-EIVHHLR5.js";import"../../chunk-QU3NSFU5.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-D52VU4UO.js";import"../../chunk-2GCMLKO2.js";import"../../chunk-HTCONTKZ.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-PD24XKD6.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-BPJHPGTL.js";import"../../chunk-E773NPNL.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-C2BBQDCU.js";import"../../chunk-EZV6DOVQ.js";import"../../chunk-A7T27JCJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-4SIGN3ZP.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-OW5QGJD4.js";import"../../chunk-O7REUCKR.js";import"../../chunk-REDYWUCC.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-PD24XKD6.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
2
2
  //# sourceMappingURL=ContractAmendmentFlow.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as PostAutomatableContractAmendmentError, a as ContractAmendmentAutomatableResponse } from '../../types.gen-DOXoUj5J.js';
2
+ import { b as PostAutomatableContractAmendmentError, a as ContractAmendmentAutomatableResponse } from '../../types.gen-oeDSqezz.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-V2PJW577.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-EIVHHLR5.js";import"../../chunk-QU3NSFU5.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-PD24XKD6.js";import"../../chunk-E773NPNL.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-EZV6DOVQ.js";import"../../chunk-A7T27JCJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-4SIGN3ZP.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-PD24XKD6.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-D52VU4UO.js";import"../../chunk-E773NPNL.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
1
+ import{a}from"../../chunk-OW5QGJD4.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
2
2
  //# sourceMappingURL=ContractAmendmentSubmit.js.map
@@ -1,8 +1,8 @@
1
- import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-DOXoUj5J.js';
1
+ import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-oeDSqezz.js';
2
2
  import * as React from 'react';
3
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-BxS-iGnr.js';
3
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-CAhYrKGA.js';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
- import '../../remoteFlows-DnbCoINb.js';
5
+ import '../../remoteFlows-HxRw2Djx.js';
6
6
  import * as react_hook_form from 'react-hook-form';
7
7
  import { useContractAmendment } from './hooks.js';
8
8
  import { Step } from '../useStepState.js';
@@ -1,11 +1,11 @@
1
- import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-DOXoUj5J.js';
2
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-BxS-iGnr.js';
1
+ import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-oeDSqezz.js';
2
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-CAhYrKGA.js';
3
3
  import * as React from 'react';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
5
  import { Step } from '../useStepState.js';
6
6
  import { ContractAmendmentParams } from './types.js';
7
7
  import { FieldValues } from 'react-hook-form';
8
- import '../../remoteFlows-DnbCoINb.js';
8
+ import '../../remoteFlows-HxRw2Djx.js';
9
9
  import 'yup';
10
10
  import '../../types-Zg1n_9wh.js';
11
11
  import '../types.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-2GCMLKO2.js";import"../../chunk-HTCONTKZ.js";import"../../chunk-7XRPOR7L.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-MISHDUB2.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
1
+ import{a}from"../../chunk-O7REUCKR.js";import"../../chunk-REDYWUCC.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-3AEKPMIN.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -4,15 +4,15 @@ export { ContractAmendmentForm } from './ContractAmendmentForm.js';
4
4
  export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
5
5
  export { useContractAmendment } from './hooks.js';
6
6
  import 'react/jsx-runtime';
7
- import '../../types.gen-DOXoUj5J.js';
7
+ import '../../types.gen-oeDSqezz.js';
8
8
  import 'react-hook-form';
9
9
  import './ContractAmendmentBack.js';
10
10
  import 'react';
11
11
  import './types.js';
12
12
  import '../types.js';
13
13
  import '@remoteoss/json-schema-form';
14
- import '../../mutations-BxS-iGnr.js';
15
- import '../../remoteFlows-DnbCoINb.js';
14
+ import '../../mutations-CAhYrKGA.js';
15
+ import '../../remoteFlows-HxRw2Djx.js';
16
16
  import 'yup';
17
17
  import '../../types-Zg1n_9wh.js';
18
18
  import '../useStepState.js';