@remoteoss/remote-flows 1.3.0 → 1.4.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 (371) hide show
  1. package/README.md +1 -0
  2. package/dist/{PdfPreview-6C3GGXIN.js → PdfPreview-2VXVDUFP.js} +2 -2
  3. package/dist/{chunk-EQOU2VPX.js → chunk-2FDEMDWJ.js} +2 -2
  4. package/dist/{chunk-6S6H4NAQ.js → chunk-3CRC4NDD.js} +2 -2
  5. package/dist/{chunk-AT7VHJMW.js → chunk-3DRSYLBM.js} +2 -2
  6. package/dist/{chunk-EYQ4PYUT.js → chunk-4FW2VTO4.js} +2 -2
  7. package/dist/chunk-4FW2VTO4.js.map +1 -0
  8. package/dist/{chunk-M2TLNSTK.js → chunk-4OVFMUUJ.js} +2 -2
  9. package/dist/{chunk-EC7QVRRX.js → chunk-4UAHJOHZ.js} +2 -2
  10. package/dist/chunk-5BRMLRS7.js +2 -0
  11. package/dist/chunk-5BRMLRS7.js.map +1 -0
  12. package/dist/{chunk-QUQLW5YW.js → chunk-5JQMTMHR.js} +2 -2
  13. package/dist/chunk-5WFWHEXV.js +2 -0
  14. package/dist/chunk-5WFWHEXV.js.map +1 -0
  15. package/dist/{chunk-MEZ7LYUK.js → chunk-6AQLDTMK.js} +2 -2
  16. package/dist/{chunk-OKM7DRCF.js → chunk-6CASSN2Z.js} +2 -2
  17. package/dist/chunk-6DHV4GT6.js +2 -0
  18. package/dist/{chunk-XRI6PRXK.js → chunk-6E5GX7W3.js} +2 -2
  19. package/dist/{chunk-T6HCUFYI.js → chunk-765OB2K5.js} +2 -2
  20. package/dist/{chunk-WCEHP5N7.js → chunk-7FMFSOJ3.js} +2 -2
  21. package/dist/{chunk-C4DLDK36.js → chunk-7JDWTTYE.js} +2 -2
  22. package/dist/{chunk-3Z6AFLXW.js → chunk-7XKEJ5Y6.js} +2 -2
  23. package/dist/{chunk-Z6TCBVRG.js → chunk-A5NDO6CQ.js} +2 -2
  24. package/dist/{chunk-7COHIUGW.js → chunk-AJ5SXKFO.js} +2 -2
  25. package/dist/chunk-AJ5SXKFO.js.map +1 -0
  26. package/dist/chunk-ARQ2PTEA.js +2 -0
  27. package/dist/chunk-ARQ2PTEA.js.map +1 -0
  28. package/dist/{chunk-UA6MNQLD.js → chunk-BNBEIHLD.js} +2 -2
  29. package/dist/{chunk-Y5P5IJRN.js → chunk-BPIGB72P.js} +2 -2
  30. package/dist/{chunk-66N57DKF.js → chunk-CR7AIZKA.js} +2 -2
  31. package/dist/chunk-CTAWDJ2D.js +2 -0
  32. package/dist/chunk-CTAWDJ2D.js.map +1 -0
  33. package/dist/{chunk-35RMJMSH.js → chunk-D6Y7GLBT.js} +2 -2
  34. package/dist/{chunk-LKMPZJIW.js → chunk-EGSUF7OD.js} +2 -2
  35. package/dist/chunk-FEIYAZ7Q.js +2 -0
  36. package/dist/chunk-FEIYAZ7Q.js.map +1 -0
  37. package/dist/chunk-FUBLGAPH.js +2 -0
  38. package/dist/chunk-FUBLGAPH.js.map +1 -0
  39. package/dist/{chunk-A3GZSC5Z.js → chunk-G2X5F5YR.js} +2 -2
  40. package/dist/{chunk-UOOUV52J.js → chunk-GGPEKIIH.js} +2 -2
  41. package/dist/{chunk-72OH7PSF.js → chunk-GPLI6GGL.js} +2 -2
  42. package/dist/chunk-GVSAZND2.js +2 -0
  43. package/dist/chunk-GVSAZND2.js.map +1 -0
  44. package/dist/{chunk-44IOQYR2.js → chunk-HLR4BEDV.js} +2 -2
  45. package/dist/{chunk-ARTSDUSS.js → chunk-HRG5MSVG.js} +2 -2
  46. package/dist/chunk-HRG5MSVG.js.map +1 -0
  47. package/dist/{chunk-BL7OYWNX.js → chunk-HUJ3AUIS.js} +2 -2
  48. package/dist/chunk-IJ6325YO.js +2 -0
  49. package/dist/chunk-IJ6325YO.js.map +1 -0
  50. package/dist/{chunk-PMTKQME6.js → chunk-ILOKQ6OH.js} +2 -2
  51. package/dist/{chunk-KKGRYDZA.js → chunk-K3XVYHGV.js} +2 -2
  52. package/dist/{chunk-5DKNCKV7.js → chunk-K62H3A5T.js} +2 -2
  53. package/dist/{chunk-LJVV6MMB.js → chunk-KRDAGWDH.js} +2 -2
  54. package/dist/{chunk-ZIN2OWTH.js → chunk-LAXQMTDQ.js} +2 -2
  55. package/dist/{chunk-N6BBMT7W.js → chunk-LGUGZN57.js} +2 -2
  56. package/dist/{chunk-MXLQEDRJ.js → chunk-LHNX27TY.js} +2 -2
  57. package/dist/{chunk-VXA6RPA5.js → chunk-LJ6FHPXW.js} +2 -2
  58. package/dist/{chunk-2Y3SXQ5B.js → chunk-LOHRUY4J.js} +1 -1
  59. package/dist/chunk-LOHRUY4J.js.map +1 -0
  60. package/dist/chunk-MD2QFLXC.js +2 -0
  61. package/dist/chunk-MD2QFLXC.js.map +1 -0
  62. package/dist/chunk-N3X274GT.js +2 -0
  63. package/dist/chunk-N3X274GT.js.map +1 -0
  64. package/dist/chunk-NFWNYW2E.js +2 -0
  65. package/dist/chunk-NFWNYW2E.js.map +1 -0
  66. package/dist/{chunk-EGRGQWIY.js → chunk-NHREKNSV.js} +2 -2
  67. package/dist/chunk-NPKIEWF4.js +2 -0
  68. package/dist/chunk-NPKIEWF4.js.map +1 -0
  69. package/dist/chunk-OFWEEY3Y.js +2 -0
  70. package/dist/chunk-OFWEEY3Y.js.map +1 -0
  71. package/dist/chunk-OKMERBJL.js +2 -0
  72. package/dist/chunk-OKMERBJL.js.map +1 -0
  73. package/dist/chunk-OXOK5PM3.js +2 -0
  74. package/dist/chunk-OXOK5PM3.js.map +1 -0
  75. package/dist/chunk-P5QKSFOE.js +2 -0
  76. package/dist/chunk-P5QKSFOE.js.map +1 -0
  77. package/dist/{chunk-F3KEIVSE.js → chunk-PC5JG4TT.js} +2 -2
  78. package/dist/{chunk-LJGCFFAT.js → chunk-PJN2YJO4.js} +2 -2
  79. package/dist/{chunk-A65WMO6K.js → chunk-PSHPB65F.js} +2 -2
  80. package/dist/{chunk-NDQ6UQFG.js → chunk-PU3WPIEK.js} +2 -2
  81. package/dist/{chunk-NABPCULM.js → chunk-QDSRG735.js} +2 -2
  82. package/dist/chunk-QKKAJK3A.js +2 -0
  83. package/dist/chunk-QKKAJK3A.js.map +1 -0
  84. package/dist/chunk-RTQ4GKPG.js +2 -0
  85. package/dist/chunk-RTQ4GKPG.js.map +1 -0
  86. package/dist/{chunk-3CFU6LKQ.js → chunk-SKQWZNKT.js} +2 -2
  87. package/dist/{chunk-HDNBZ6CB.js → chunk-T5OFLN36.js} +2 -2
  88. package/dist/{chunk-W3YE53JN.js → chunk-T6Q7IALZ.js} +2 -2
  89. package/dist/chunk-T6Q7IALZ.js.map +1 -0
  90. package/dist/chunk-TC7EQZJK.js +2 -0
  91. package/dist/chunk-TC7EQZJK.js.map +1 -0
  92. package/dist/chunk-TMBD35L4.js +2 -0
  93. package/dist/chunk-TMBD35L4.js.map +1 -0
  94. package/dist/{chunk-6P4DTWYK.js → chunk-U2HWB5HI.js} +2 -2
  95. package/dist/{chunk-GE5DH3UF.js → chunk-UD4GEI4B.js} +2 -2
  96. package/dist/{chunk-L3Z2G32A.js → chunk-UQCSN47K.js} +1 -1
  97. package/dist/chunk-UQCSN47K.js.map +1 -0
  98. package/dist/chunk-V334GIML.js +2 -0
  99. package/dist/chunk-V334GIML.js.map +1 -0
  100. package/dist/{chunk-Z2WV73EX.js → chunk-VCEQ5E2O.js} +2 -2
  101. package/dist/{chunk-PZNXAOZH.js → chunk-VYHITQHG.js} +2 -2
  102. package/dist/{chunk-VBO75DXV.js → chunk-W3OQNZW6.js} +2 -2
  103. package/dist/chunk-WINYXC33.js +2 -0
  104. package/dist/chunk-WINYXC33.js.map +1 -0
  105. package/dist/{chunk-LG2LVO4C.js → chunk-WLN6G3TE.js} +2 -2
  106. package/dist/{chunk-OP72BS23.js → chunk-WO33FKK4.js} +2 -2
  107. package/dist/{chunk-2FQ2KNP4.js → chunk-X6325UGJ.js} +2 -2
  108. package/dist/{chunk-QIVDIOJG.js → chunk-XGECMN4V.js} +2 -2
  109. package/dist/{chunk-BVDT43OO.js → chunk-XTXPKDZ7.js} +2 -2
  110. package/dist/{chunk-TVJYCR33.js → chunk-XXPJHT5A.js} +2 -2
  111. package/dist/{chunk-IBHNWMMB.js → chunk-YXVNCPUI.js} +2 -2
  112. package/dist/{chunk-4GDEWYZC.js → chunk-Z5A2M5EU.js} +2 -2
  113. package/dist/{chunk-OXL3QGHT.js → chunk-ZCXTTVGV.js} +2 -2
  114. package/dist/chunk-ZCXTTVGV.js.map +1 -0
  115. package/dist/{chunk-KGKDSOER.js → chunk-ZFKHCC4Z.js} +2 -2
  116. package/dist/{chunk-FZDQ7EEI.js → chunk-ZT72WOPZ.js} +2 -2
  117. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  118. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  119. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +4 -3
  120. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  121. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  122. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  123. package/dist/flows/ContractAmendment/context.d.ts +8 -7
  124. package/dist/flows/ContractAmendment/hooks.d.ts +9 -8
  125. package/dist/flows/ContractAmendment/hooks.js +1 -1
  126. package/dist/flows/ContractAmendment/index.d.ts +4 -3
  127. package/dist/flows/ContractAmendment/index.js +1 -1
  128. package/dist/flows/ContractAmendment/types.d.ts +1 -2
  129. package/dist/flows/ContractAmendment/utils.d.ts +4 -2
  130. package/dist/flows/ContractAmendment/utils.js +1 -1
  131. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +4 -5
  132. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  133. package/dist/flows/ContractorOnboarding/api.d.ts +14 -7
  134. package/dist/flows/ContractorOnboarding/api.js +1 -1
  135. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +3 -4
  136. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  137. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +4 -5
  138. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  139. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +4 -5
  140. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  141. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +9 -10
  142. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  143. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  144. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +2 -2
  145. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  146. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  147. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +4 -5
  148. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  149. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +3 -4
  150. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  151. package/dist/flows/ContractorOnboarding/context.d.ts +5 -6
  152. package/dist/flows/ContractorOnboarding/hooks.d.ts +6 -7
  153. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  154. package/dist/flows/ContractorOnboarding/index.d.ts +4 -5
  155. package/dist/flows/ContractorOnboarding/index.js +1 -1
  156. package/dist/flows/ContractorOnboarding/types.d.ts +4 -5
  157. package/dist/flows/ContractorOnboarding/utils.d.ts +3 -4
  158. package/dist/flows/ContractorOnboarding/utils.js +1 -1
  159. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +2 -3
  160. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  161. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +2 -3
  162. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  163. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  164. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  165. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -2
  166. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  167. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -2
  168. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.js +1 -1
  169. package/dist/flows/CostCalculator/api.d.ts +8 -5
  170. package/dist/flows/CostCalculator/api.js +1 -1
  171. package/dist/flows/CostCalculator/components/SalaryField.d.ts +1 -1
  172. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  173. package/dist/flows/CostCalculator/context.d.ts +2 -3
  174. package/dist/flows/CostCalculator/hooks.d.ts +2 -3
  175. package/dist/flows/CostCalculator/hooks.js +1 -1
  176. package/dist/flows/CostCalculator/index.d.ts +3 -4
  177. package/dist/flows/CostCalculator/index.js +1 -1
  178. package/dist/flows/CostCalculator/types.d.ts +1 -2
  179. package/dist/flows/CostCalculator/utils.d.ts +2 -3
  180. package/dist/flows/CostCalculator/utils.js +1 -1
  181. package/dist/flows/Onboarding/OnboardingFlow.d.ts +3 -4
  182. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  183. package/dist/flows/Onboarding/api.d.ts +19 -12
  184. package/dist/flows/Onboarding/api.js +1 -1
  185. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +1 -1
  186. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  187. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +3 -4
  188. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  189. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +3 -4
  190. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  191. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +3 -4
  192. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  193. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  194. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +8 -9
  195. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  196. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +2 -2
  197. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  198. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  199. package/dist/flows/Onboarding/components/ReviewStep.d.ts +3 -4
  200. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +2 -2
  201. package/dist/flows/Onboarding/components/SaveDraftButton.js +1 -1
  202. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +3 -4
  203. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  204. package/dist/flows/Onboarding/context.d.ts +6 -7
  205. package/dist/flows/Onboarding/hooks.d.ts +5 -6
  206. package/dist/flows/Onboarding/hooks.js +1 -1
  207. package/dist/flows/Onboarding/index.d.ts +3 -4
  208. package/dist/flows/Onboarding/index.js +1 -1
  209. package/dist/flows/Onboarding/types.d.ts +3 -4
  210. package/dist/flows/Onboarding/utils.d.ts +3 -4
  211. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +5 -4
  212. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  213. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +5 -4
  214. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  215. package/dist/flows/Termination/PaidTimeOffForm.d.ts +5 -4
  216. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  217. package/dist/flows/Termination/TerminationBack.js +1 -1
  218. package/dist/flows/Termination/TerminationDetailsForm.d.ts +5 -4
  219. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  220. package/dist/flows/Termination/TerminationFlow.d.ts +5 -4
  221. package/dist/flows/Termination/TerminationFlow.js +1 -1
  222. package/dist/flows/Termination/TerminationForm.d.ts +7 -6
  223. package/dist/flows/Termination/TerminationForm.js +1 -1
  224. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  225. package/dist/flows/Termination/api.d.ts +15 -10
  226. package/dist/flows/Termination/api.js +1 -1
  227. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js +1 -1
  228. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js +1 -1
  229. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  230. package/dist/flows/Termination/components/AcknowledgeInformation/constants.js +1 -1
  231. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -5
  232. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  233. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -5
  234. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  235. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -5
  236. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  237. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +1 -1
  238. package/dist/flows/Termination/context.d.ts +9 -8
  239. package/dist/flows/Termination/hooks.d.ts +5 -4
  240. package/dist/flows/Termination/hooks.js +1 -1
  241. package/dist/flows/Termination/index.d.ts +6 -5
  242. package/dist/flows/Termination/index.js +1 -1
  243. package/dist/flows/Termination/json-schemas/employeeComunication.js +1 -1
  244. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  245. package/dist/flows/Termination/json-schemas/schema.d.ts +5 -4
  246. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  247. package/dist/flows/Termination/types.d.ts +5 -4
  248. package/dist/flows/Termination/utils.d.ts +5 -4
  249. package/dist/flows/Termination/utils.js +1 -1
  250. package/dist/flows/types.d.ts +3 -20
  251. package/dist/flows/useStepState.d.ts +1 -1
  252. package/dist/flows/useStepState.js +1 -1
  253. package/dist/index.d.ts +10 -9
  254. package/dist/index.js +3 -1
  255. package/dist/index.js.map +1 -1
  256. package/dist/internals.d.ts +6 -2
  257. package/dist/internals.js +1 -1
  258. package/dist/{mutations-C051uRcC.d.ts → mutations-DodnkAWj.d.ts} +1 -1
  259. package/dist/{remoteFlows-B9Nl1qjN.d.ts → remoteFlows-xvD84Bor.d.ts} +9 -8
  260. package/dist/{types-Ci-EdBDb.d.ts → types-B5wlUr-S.d.ts} +8 -9
  261. package/dist/{types-Dx-2ocvG.d.ts → types-BukQasy8.d.ts} +8 -9
  262. package/dist/{types-DqaKYRUE.d.ts → types-Ct_LPoSR.d.ts} +8 -8
  263. package/dist/{utils-CjDMg_Yr.d.ts → utils-arqMz3zD.d.ts} +1 -0
  264. package/package.json +3 -4
  265. package/dist/chunk-2Y3SXQ5B.js.map +0 -1
  266. package/dist/chunk-3F77NXWU.js +0 -2
  267. package/dist/chunk-3F77NXWU.js.map +0 -1
  268. package/dist/chunk-5C3NU7R3.js +0 -2
  269. package/dist/chunk-5C3NU7R3.js.map +0 -1
  270. package/dist/chunk-5LSHRCAR.js +0 -2
  271. package/dist/chunk-5LSHRCAR.js.map +0 -1
  272. package/dist/chunk-6GTRAHWJ.js +0 -2
  273. package/dist/chunk-6GTRAHWJ.js.map +0 -1
  274. package/dist/chunk-7COHIUGW.js.map +0 -1
  275. package/dist/chunk-ARTSDUSS.js.map +0 -1
  276. package/dist/chunk-DV6PCBAX.js +0 -2
  277. package/dist/chunk-DV6PCBAX.js.map +0 -1
  278. package/dist/chunk-EDVJBPCB.js +0 -2
  279. package/dist/chunk-EDVJBPCB.js.map +0 -1
  280. package/dist/chunk-EHAZWZ3O.js +0 -2
  281. package/dist/chunk-EHAZWZ3O.js.map +0 -1
  282. package/dist/chunk-ERRQIROU.js +0 -2
  283. package/dist/chunk-ERRQIROU.js.map +0 -1
  284. package/dist/chunk-ETYRNQJJ.js +0 -2
  285. package/dist/chunk-ETYRNQJJ.js.map +0 -1
  286. package/dist/chunk-EYQ4PYUT.js.map +0 -1
  287. package/dist/chunk-GCTHZSIN.js +0 -2
  288. package/dist/chunk-GCTHZSIN.js.map +0 -1
  289. package/dist/chunk-GHJBEQIR.js +0 -2
  290. package/dist/chunk-GHJBEQIR.js.map +0 -1
  291. package/dist/chunk-GP6PRZVX.js +0 -2
  292. package/dist/chunk-GP6PRZVX.js.map +0 -1
  293. package/dist/chunk-HZVYZQ3Z.js +0 -2
  294. package/dist/chunk-HZVYZQ3Z.js.map +0 -1
  295. package/dist/chunk-IWA5B4U6.js +0 -2
  296. package/dist/chunk-L3Z2G32A.js.map +0 -1
  297. package/dist/chunk-LQBVRVXH.js +0 -2
  298. package/dist/chunk-LQBVRVXH.js.map +0 -1
  299. package/dist/chunk-OFI5KLQ4.js +0 -2
  300. package/dist/chunk-OFI5KLQ4.js.map +0 -1
  301. package/dist/chunk-OXL3QGHT.js.map +0 -1
  302. package/dist/chunk-PJBAQZ6G.js +0 -2
  303. package/dist/chunk-PJBAQZ6G.js.map +0 -1
  304. package/dist/chunk-RR55GUDT.js +0 -2
  305. package/dist/chunk-RR55GUDT.js.map +0 -1
  306. package/dist/chunk-SIYKTLFS.js +0 -2
  307. package/dist/chunk-SIYKTLFS.js.map +0 -1
  308. package/dist/chunk-SXR333SU.js +0 -2
  309. package/dist/chunk-SXR333SU.js.map +0 -1
  310. package/dist/chunk-W3YE53JN.js.map +0 -1
  311. package/dist/chunk-Y2NSR2N6.js +0 -2
  312. package/dist/chunk-Y2NSR2N6.js.map +0 -1
  313. package/dist/chunk-ZYRGEEPU.js +0 -2
  314. package/dist/chunk-ZYRGEEPU.js.map +0 -1
  315. /package/dist/{PdfPreview-6C3GGXIN.js.map → PdfPreview-2VXVDUFP.js.map} +0 -0
  316. /package/dist/{chunk-EQOU2VPX.js.map → chunk-2FDEMDWJ.js.map} +0 -0
  317. /package/dist/{chunk-6S6H4NAQ.js.map → chunk-3CRC4NDD.js.map} +0 -0
  318. /package/dist/{chunk-AT7VHJMW.js.map → chunk-3DRSYLBM.js.map} +0 -0
  319. /package/dist/{chunk-M2TLNSTK.js.map → chunk-4OVFMUUJ.js.map} +0 -0
  320. /package/dist/{chunk-EC7QVRRX.js.map → chunk-4UAHJOHZ.js.map} +0 -0
  321. /package/dist/{chunk-QUQLW5YW.js.map → chunk-5JQMTMHR.js.map} +0 -0
  322. /package/dist/{chunk-MEZ7LYUK.js.map → chunk-6AQLDTMK.js.map} +0 -0
  323. /package/dist/{chunk-OKM7DRCF.js.map → chunk-6CASSN2Z.js.map} +0 -0
  324. /package/dist/{chunk-IWA5B4U6.js.map → chunk-6DHV4GT6.js.map} +0 -0
  325. /package/dist/{chunk-XRI6PRXK.js.map → chunk-6E5GX7W3.js.map} +0 -0
  326. /package/dist/{chunk-T6HCUFYI.js.map → chunk-765OB2K5.js.map} +0 -0
  327. /package/dist/{chunk-WCEHP5N7.js.map → chunk-7FMFSOJ3.js.map} +0 -0
  328. /package/dist/{chunk-C4DLDK36.js.map → chunk-7JDWTTYE.js.map} +0 -0
  329. /package/dist/{chunk-3Z6AFLXW.js.map → chunk-7XKEJ5Y6.js.map} +0 -0
  330. /package/dist/{chunk-Z6TCBVRG.js.map → chunk-A5NDO6CQ.js.map} +0 -0
  331. /package/dist/{chunk-UA6MNQLD.js.map → chunk-BNBEIHLD.js.map} +0 -0
  332. /package/dist/{chunk-Y5P5IJRN.js.map → chunk-BPIGB72P.js.map} +0 -0
  333. /package/dist/{chunk-66N57DKF.js.map → chunk-CR7AIZKA.js.map} +0 -0
  334. /package/dist/{chunk-35RMJMSH.js.map → chunk-D6Y7GLBT.js.map} +0 -0
  335. /package/dist/{chunk-LKMPZJIW.js.map → chunk-EGSUF7OD.js.map} +0 -0
  336. /package/dist/{chunk-A3GZSC5Z.js.map → chunk-G2X5F5YR.js.map} +0 -0
  337. /package/dist/{chunk-UOOUV52J.js.map → chunk-GGPEKIIH.js.map} +0 -0
  338. /package/dist/{chunk-72OH7PSF.js.map → chunk-GPLI6GGL.js.map} +0 -0
  339. /package/dist/{chunk-44IOQYR2.js.map → chunk-HLR4BEDV.js.map} +0 -0
  340. /package/dist/{chunk-BL7OYWNX.js.map → chunk-HUJ3AUIS.js.map} +0 -0
  341. /package/dist/{chunk-PMTKQME6.js.map → chunk-ILOKQ6OH.js.map} +0 -0
  342. /package/dist/{chunk-KKGRYDZA.js.map → chunk-K3XVYHGV.js.map} +0 -0
  343. /package/dist/{chunk-5DKNCKV7.js.map → chunk-K62H3A5T.js.map} +0 -0
  344. /package/dist/{chunk-LJVV6MMB.js.map → chunk-KRDAGWDH.js.map} +0 -0
  345. /package/dist/{chunk-ZIN2OWTH.js.map → chunk-LAXQMTDQ.js.map} +0 -0
  346. /package/dist/{chunk-N6BBMT7W.js.map → chunk-LGUGZN57.js.map} +0 -0
  347. /package/dist/{chunk-MXLQEDRJ.js.map → chunk-LHNX27TY.js.map} +0 -0
  348. /package/dist/{chunk-VXA6RPA5.js.map → chunk-LJ6FHPXW.js.map} +0 -0
  349. /package/dist/{chunk-EGRGQWIY.js.map → chunk-NHREKNSV.js.map} +0 -0
  350. /package/dist/{chunk-F3KEIVSE.js.map → chunk-PC5JG4TT.js.map} +0 -0
  351. /package/dist/{chunk-LJGCFFAT.js.map → chunk-PJN2YJO4.js.map} +0 -0
  352. /package/dist/{chunk-A65WMO6K.js.map → chunk-PSHPB65F.js.map} +0 -0
  353. /package/dist/{chunk-NDQ6UQFG.js.map → chunk-PU3WPIEK.js.map} +0 -0
  354. /package/dist/{chunk-NABPCULM.js.map → chunk-QDSRG735.js.map} +0 -0
  355. /package/dist/{chunk-3CFU6LKQ.js.map → chunk-SKQWZNKT.js.map} +0 -0
  356. /package/dist/{chunk-HDNBZ6CB.js.map → chunk-T5OFLN36.js.map} +0 -0
  357. /package/dist/{chunk-6P4DTWYK.js.map → chunk-U2HWB5HI.js.map} +0 -0
  358. /package/dist/{chunk-GE5DH3UF.js.map → chunk-UD4GEI4B.js.map} +0 -0
  359. /package/dist/{chunk-Z2WV73EX.js.map → chunk-VCEQ5E2O.js.map} +0 -0
  360. /package/dist/{chunk-PZNXAOZH.js.map → chunk-VYHITQHG.js.map} +0 -0
  361. /package/dist/{chunk-VBO75DXV.js.map → chunk-W3OQNZW6.js.map} +0 -0
  362. /package/dist/{chunk-LG2LVO4C.js.map → chunk-WLN6G3TE.js.map} +0 -0
  363. /package/dist/{chunk-OP72BS23.js.map → chunk-WO33FKK4.js.map} +0 -0
  364. /package/dist/{chunk-2FQ2KNP4.js.map → chunk-X6325UGJ.js.map} +0 -0
  365. /package/dist/{chunk-QIVDIOJG.js.map → chunk-XGECMN4V.js.map} +0 -0
  366. /package/dist/{chunk-BVDT43OO.js.map → chunk-XTXPKDZ7.js.map} +0 -0
  367. /package/dist/{chunk-TVJYCR33.js.map → chunk-XXPJHT5A.js.map} +0 -0
  368. /package/dist/{chunk-IBHNWMMB.js.map → chunk-YXVNCPUI.js.map} +0 -0
  369. /package/dist/{chunk-4GDEWYZC.js.map → chunk-Z5A2M5EU.js.map} +0 -0
  370. /package/dist/{chunk-KGKDSOER.js.map → chunk-ZFKHCC4Z.js.map} +0 -0
  371. /package/dist/{chunk-FZDQ7EEI.js.map → chunk-ZT72WOPZ.js.map} +0 -0
package/README.md CHANGED
@@ -64,6 +64,7 @@ The `RemoteFlows` component serves as a provider for authentication and theming.
64
64
  | `components` | `Components` | No | - | Custom field components for form rendering |
65
65
  | `proxy` | `{ url: string, headers?: Record<string, string> }` | No | - | Configuration for API request proxy with optional headers |
66
66
  | `errorBoundary` | `{ useParentErrorBoundary?: boolean, fallback?: ReactNode \| ((error: Error) => ReactNode) }` | No |  - | Error boundary configuration to prevent crashes and show custom fallback UI |
67
+ | `debug` | boolean | No | - | useful to see telemetry debugging in console |
67
68
 
68
69
  #### Error Boundary
69
70
 
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-LJGCFFAT.js";import"./chunk-L3Z2G32A.js";import{a as r}from"./chunk-P37U34EQ.js";import{useState as l,useMemo as h}from"react";import{Document as y,Page as D,pdfjs as g}from"react-pdf";import{jsx as e,jsxs as a}from"react/jsx-runtime";g.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${g.version}/build/pdf.worker.min.mjs`;function j({base64Data:m,fileName:c="document.pdf"}){let[s,f]=l(0),[n,u]=l(1),[x,p]=l(!0),[i,v]=l(""),d=h(()=>{if(!m)return"";let t=m.trim();return t.startsWith("data:application/pdf;base64,")||t.startsWith("data:")?t:`data:application/pdf;base64,${t}`},[m]),b=r(({numPages:t})=>{f(t),p(!1),v("")},"onDocumentLoadSuccess"),N=r(t=>{console.error("Error loading PDF:",t),v("Failed to load PDF document"),p(!1)},"onDocumentLoadError"),P=r(()=>{u(t=>Math.max(1,t-1))},"goToPrevPage"),w=r(()=>{u(t=>Math.min(s,t+1))},"goToNextPage");return d?a("div",{className:"w-full space-y-4",children:[a("div",{children:[a("div",{className:"flex justify-center items-center min-h-[600px] p-4 bg-gray-50",children:[x&&a("div",{className:"text-center",children:[e("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"}),e("p",{className:"text-gray-600",children:"Loading PDF..."})]}),i&&a("div",{className:"text-center space-y-4",children:[e("p",{className:"text-red-600",children:i}),e(o,{asChild:!0,children:e("a",{href:d,download:c,children:"Download PDF Instead"})})]}),!i&&e(y,{file:d,onLoadSuccess:b,onLoadError:N,loading:"",className:"flex flex-col items-center",children:e(D,{pageNumber:n,renderTextLayer:!0,renderAnnotationLayer:!0,className:"shadow-lg",width:Math.min(window.innerWidth-100,800)})})]}),s>0&&!i&&e("div",{className:"border-t bg-white px-4 py-3",children:a("div",{className:"flex items-center justify-between",children:[e(o,{onClick:P,disabled:n<=1,variant:"outline",size:"sm",children:"\u2190 Previous"}),a("div",{className:"text-sm text-gray-600",children:["Page ",n," of ",s]}),e(o,{onClick:w,disabled:n>=s,variant:"outline",size:"sm",children:"Next \u2192"})]})})]}),a("div",{className:"flex justify-between items-center text-sm",children:[e("p",{className:"text-gray-600",children:c}),e(o,{variant:"link",size:"link",asChild:!0,children:a("a",{href:d,download:c,className:"flex items-center gap-1",children:[e("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download PDF"]})})]})]}):e("div",{className:"w-full border rounded p-8 text-center bg-gray-50",children:e("p",{className:"text-gray-500",children:"No PDF data available"})})}r(j,"PDFPreview");export{j as PDFPreview};
2
- //# sourceMappingURL=PdfPreview-6C3GGXIN.js.map
1
+ import{b as o}from"./chunk-PJN2YJO4.js";import"./chunk-UQCSN47K.js";import{a as r}from"./chunk-P37U34EQ.js";import{useState as l,useMemo as h}from"react";import{Document as y,Page as D,pdfjs as g}from"react-pdf";import{jsx as e,jsxs as a}from"react/jsx-runtime";g.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${g.version}/build/pdf.worker.min.mjs`;function j({base64Data:m,fileName:c="document.pdf"}){let[s,f]=l(0),[n,u]=l(1),[x,p]=l(!0),[i,v]=l(""),d=h(()=>{if(!m)return"";let t=m.trim();return t.startsWith("data:application/pdf;base64,")||t.startsWith("data:")?t:`data:application/pdf;base64,${t}`},[m]),b=r(({numPages:t})=>{f(t),p(!1),v("")},"onDocumentLoadSuccess"),N=r(t=>{console.error("Error loading PDF:",t),v("Failed to load PDF document"),p(!1)},"onDocumentLoadError"),P=r(()=>{u(t=>Math.max(1,t-1))},"goToPrevPage"),w=r(()=>{u(t=>Math.min(s,t+1))},"goToNextPage");return d?a("div",{className:"w-full space-y-4",children:[a("div",{children:[a("div",{className:"flex justify-center items-center min-h-[600px] p-4 bg-gray-50",children:[x&&a("div",{className:"text-center",children:[e("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"}),e("p",{className:"text-gray-600",children:"Loading PDF..."})]}),i&&a("div",{className:"text-center space-y-4",children:[e("p",{className:"text-red-600",children:i}),e(o,{asChild:!0,children:e("a",{href:d,download:c,children:"Download PDF Instead"})})]}),!i&&e(y,{file:d,onLoadSuccess:b,onLoadError:N,loading:"",className:"flex flex-col items-center",children:e(D,{pageNumber:n,renderTextLayer:!0,renderAnnotationLayer:!0,className:"shadow-lg",width:Math.min(window.innerWidth-100,800)})})]}),s>0&&!i&&e("div",{className:"border-t bg-white px-4 py-3",children:a("div",{className:"flex items-center justify-between",children:[e(o,{onClick:P,disabled:n<=1,variant:"outline",size:"sm",children:"\u2190 Previous"}),a("div",{className:"text-sm text-gray-600",children:["Page ",n," of ",s]}),e(o,{onClick:w,disabled:n>=s,variant:"outline",size:"sm",children:"Next \u2192"})]})})]}),a("div",{className:"flex justify-between items-center text-sm",children:[e("p",{className:"text-gray-600",children:c}),e(o,{variant:"link",size:"link",asChild:!0,children:a("a",{href:d,download:c,className:"flex items-center gap-1",children:[e("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download PDF"]})})]})]}):e("div",{className:"w-full border rounded p-8 text-center bg-gray-50",children:e("p",{className:"text-gray-500",children:"No PDF data available"})})}r(j,"PDFPreview");export{j as PDFPreview};
2
+ //# sourceMappingURL=PdfPreview-2VXVDUFP.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-ETYRNQJJ.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function d({onSubmit:m}){let{terminationBag:o}=a(),r=i(async t=>{let n=await o?.parseFormValues(t);await m?.(n),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:r})}i(d,"PaidTimeOffForm");export{d as a};
2
- //# sourceMappingURL=chunk-EQOU2VPX.js.map
1
+ import{a as e}from"./chunk-OXOK5PM3.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function d({onSubmit:m}){let{terminationBag:o}=a(),r=i(async t=>{let n=await o?.parseFormValues(t);await m?.(n),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:r})}i(d,"PaidTimeOffForm");export{d as a};
2
+ //# sourceMappingURL=chunk-2FDEMDWJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-ETYRNQJJ.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function p({onSubmit:n}){let{terminationBag:o}=e(),a=m(async t=>{let r=await o?.parseFormValues(t);await n?.(r),o?.next()},"handleSubmit");return u(i,{defaultValues:o.fieldValues,onSubmit:a})}m(p,"EmployeeCommunicationForm");export{p as a};
2
- //# sourceMappingURL=chunk-6S6H4NAQ.js.map
1
+ import{a as i}from"./chunk-OXOK5PM3.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function p({onSubmit:n}){let{terminationBag:o}=e(),a=m(async t=>{let r=await o?.parseFormValues(t);await n?.(r),o?.next()},"handleSubmit");return u(i,{defaultValues:o.fieldValues,onSubmit:a})}m(p,"EmployeeCommunicationForm");export{p as a};
2
+ //# sourceMappingURL=chunk-3CRC4NDD.js.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-MXLQEDRJ.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as n}from"react/jsx-runtime";var i=m(({cards:e})=>n("div",{className:"RemoteFlows__AcknowledgeInformation",children:[n(t,{className:"mb-6",children:[o("h2",{className:"RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium",children:e.remoteDoesNext.title}),o("p",{className:"RemoteFlows__AcknowledgeInformation__Description color-[#71717A] text-xs",children:e.remoteDoesNext.description})]}),n(t,{className:"mb-6",children:[o("h2",{className:"RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium",children:e.whatYouNeedToDo.title}),o("ul",{className:"RemoteFlows__AcknowledgeInformation__List list-disc pl-5 text-xs text-[#71717A]",children:e.whatYouNeedToDo.list.map(l=>o("li",{className:"RemoteFlows__AcknowledgeInformation__ListItem mb-2",children:l},l))})]})]}),"AcknowledgeInformation");export{i as a};
2
- //# sourceMappingURL=chunk-AT7VHJMW.js.map
1
+ import{a as t}from"./chunk-LHNX27TY.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as n}from"react/jsx-runtime";var i=m(({cards:e})=>n("div",{className:"RemoteFlows__AcknowledgeInformation",children:[n(t,{className:"mb-6",children:[o("h2",{className:"RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium",children:e.remoteDoesNext.title}),o("p",{className:"RemoteFlows__AcknowledgeInformation__Description color-[#71717A] text-xs",children:e.remoteDoesNext.description})]}),n(t,{className:"mb-6",children:[o("h2",{className:"RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium",children:e.whatYouNeedToDo.title}),o("ul",{className:"RemoteFlows__AcknowledgeInformation__List list-disc pl-5 text-xs text-[#71717A]",children:e.whatYouNeedToDo.list.map(l=>o("li",{className:"RemoteFlows__AcknowledgeInformation__ListItem mb-2",children:l},l))})]})]}),"AcknowledgeInformation");export{i as a};
2
+ //# sourceMappingURL=chunk-3DRSYLBM.js.map
@@ -1,2 +1,2 @@
1
- import{a as T,b as _,c as F}from"./chunk-EGRGQWIY.js";import{b as y}from"./chunk-LKMPZJIW.js";import{c}from"./chunk-66N57DKF.js";import{f as g}from"./chunk-ARTSDUSS.js";import{e as m}from"./chunk-L3Z2G32A.js";import{a}from"./chunk-P37U34EQ.js";import{Fragment as R}from"react";var d={...T,fieldset:F,"fieldset-flat":F};import{useEffect as V}from"react";import{Fragment as P,jsx as p,jsxs as k}from"react/jsx-runtime";var S=a(({name:t,description:i,helpCenter:n})=>k("span",{children:[p("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(i)}}),n?.callToAction&&n?.id&&p(y,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function C({name:t,value:i,description:n,statement:r,label:u,helpCenter:l}){let{setValue:e}=c(),o=m(r?.description||n);return V(()=>{e(t,i)},[]),p("div",{children:r?k(P,{children:[p("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:m(r?.title||u)}}),p(S,{name:t,description:m(r?.description||n),helpCenter:l})]}):p(S,{name:t,description:o,helpCenter:l})})}a(C,"ForcedValueField");import{Fragment as N,jsx as s,jsxs as h}from"react/jsx-runtime";function M(t){return t.const!==void 0&&t.const===t.default&&t.inputType!=="checkbox"&&t.inputType!=="hidden"}a(M,"checkFieldHasForcedValue");var G=a(({fields:t,fieldsets:i,fieldValues:n,components:r})=>{let{setValue:u}=c();if(!t||t.length===0)return null;let l=i&&n?g({fields:t,fieldsets:i,values:n}):t;return s(N,{children:l.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(n,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(M(e))return s(C,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label,helpCenter:e.meta?.helpCenter},e.name);if(e.Component){let{Component:x}=e;return s(x,{setValue:b=>u(e.name,b),...e},e.name)}let o=d[e.inputType];return o?e.inputType==="fieldset"?s(o,{...e,components:r},e.name):e.inputType==="fieldset-flat"?s(o,{...e,components:r,isFlatFieldset:!0},e.name):(e.inputType==="select"&&e.multiple&&(o=d["multi-select"]),h(R,{children:[s(o,{...e,component:r&&r[e.inputType]}),e.statement?s(_,{...e.statement}):null,e.extra?e.extra:null]},e.name)):h("p",{className:"error",children:["Field type ",e.inputType," not supported"]})})})},"JSONSchemaFormFields");export{G as a};
2
- //# sourceMappingURL=chunk-EYQ4PYUT.js.map
1
+ import{a as T,b as S,c as F}from"./chunk-NHREKNSV.js";import{b as y}from"./chunk-EGSUF7OD.js";import{c}from"./chunk-CR7AIZKA.js";import{f as g}from"./chunk-HRG5MSVG.js";import{e as m}from"./chunk-UQCSN47K.js";import{a}from"./chunk-P37U34EQ.js";import{Fragment as R}from"react";var d={...T,fieldset:F,"fieldset-flat":F};import{useEffect as V}from"react";import{Fragment as P,jsx as p,jsxs as k}from"react/jsx-runtime";var _=a(({name:t,description:i,helpCenter:n})=>k("span",{children:[p("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(i)}}),n?.callToAction&&n?.id&&p(y,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function C({name:t,value:i,description:n,statement:r,label:u,helpCenter:l}){let{setValue:e}=c(),o=m(r?.description||n);return V(()=>{e(t,i)},[]),p("div",{children:r?k(P,{children:[p("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:m(r?.title||u)}}),p(_,{name:t,description:m(r?.description||n),helpCenter:l})]}):p(_,{name:t,description:o,helpCenter:l})})}a(C,"ForcedValueField");import{Fragment as M,jsx as s,jsxs as h}from"react/jsx-runtime";function J(t){return t.const!==void 0&&t.const===t.default&&t.inputType!=="checkbox"&&t.inputType!=="hidden"}a(J,"checkFieldHasForcedValue");var G=a(({fields:t,fieldsets:i,fieldValues:n,components:r})=>{let{setValue:u}=c();if(!t||t.length===0)return null;let l=i&&n?g({fields:t,fieldsets:i,values:n}):t;return s(M,{children:l.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(n,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(J(e))return s(C,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label,helpCenter:e.meta?.helpCenter},e.name);if(e.Component){let{Component:x}=e;return s(x,{setValue:b=>u(e.name,b),...e},e.name)}let o=d[e.inputType];return o?e.inputType==="fieldset"?s(o,{...e,components:r},e.name):e.inputType==="fieldset-flat"?s(o,{...e,components:r,isFlatFieldset:!0},e.name):(e.inputType==="select"&&e.multiple&&(o=d["multi-select"]),h(R,{children:[s(o,{...e,component:r&&r[e.inputType]}),e.statement?s(S,{...e.statement}):null,e.extra?e.extra:null]},e.name)):h("p",{className:"error",children:["Field type ",e.inputType," not supported"]})})})},"JSONSchemaFormFields");export{G as a};
2
+ //# sourceMappingURL=chunk-4FW2VTO4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/form/JSONSchemaForm.tsx","../src/components/form/fields/fieldsMapping.tsx","../src/components/form/fields/ForcedValueField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { JSFFields } from '@/src/types/remoteFlows';\nimport React, { Fragment } from 'react';\n\nimport { fieldsMap } from '@/src/components/form/fields/fieldsMapping';\nimport { Statement } from '@/src/components/form/Statement';\nimport { ForcedValueField } from '@/src/components/form/fields/ForcedValueField';\nimport { Components, JSFFieldset } from '@/src/types/remoteFlows';\nimport { getFieldsWithFlatFieldsets } from './utils';\nimport { StatementComponentProps } from '@/src/types/fields';\nimport { useFormContext } from 'react-hook-form';\n\ntype JSONSchemaFormFieldsProps = {\n fields: JSFFields;\n components?: Components;\n fieldsets?: JSFFieldset | null | undefined;\n fieldValues?: Record<string, unknown>;\n};\n\nfunction checkFieldHasForcedValue(field: any) {\n // A field to be considered \"forced value\" must:\n return (\n field.const !== undefined && // Only accepts a specific value\n field.const === field.default && // It can be prefilled, meaning it's not critical\n field.inputType !== 'checkbox' && // Because checkbox must always be visible\n field.inputType !== 'hidden' // Because hidden inputs shouldn't be visible\n );\n}\n\nexport const JSONSchemaFormFields = ({\n fields,\n fieldsets,\n fieldValues,\n components,\n}: JSONSchemaFormFieldsProps) => {\n const { setValue } = useFormContext();\n\n if (!fields || fields.length === 0) return null;\n\n const maybeFieldWithFlatFieldsets =\n fieldsets && fieldValues\n ? getFieldsWithFlatFieldsets({\n fields: fields,\n fieldsets: fieldsets,\n values: fieldValues,\n })\n : fields;\n\n return (\n <>\n {maybeFieldWithFlatFieldsets.map((field) => {\n if (field.calculateDynamicProperties) {\n field = {\n ...field,\n ...(field.calculateDynamicProperties(fieldValues, field) || {}),\n };\n }\n\n if (field.isVisible === false || field.deprecated || field.hidden) {\n return null; // Skip hidden or deprecated fields\n }\n\n if (checkFieldHasForcedValue(field)) {\n return (\n <ForcedValueField\n key={field.name as string}\n name={field.name as string}\n description={field.description as string}\n value={field.const as string}\n statement={field.statement as any}\n label={field.label as string}\n helpCenter={field.meta?.helpCenter}\n />\n );\n }\n\n if (field.Component) {\n const { Component } = field as {\n Component: React.ComponentType<any>;\n };\n return (\n <Component\n key={field.name as string}\n setValue={(value: unknown) => setValue(field.name, value)}\n {...field}\n />\n );\n }\n\n let FieldComponent =\n fieldsMap[field.inputType as keyof typeof fieldsMap];\n\n if (!FieldComponent) {\n return (\n <p className='error'>\n Field type {field.inputType as string} not supported\n </p>\n );\n }\n\n if (field.inputType === 'fieldset') {\n return (\n <FieldComponent\n key={field.name}\n {...field}\n components={components}\n />\n );\n }\n\n if (field.inputType === 'fieldset-flat') {\n return (\n <FieldComponent\n key={field.name}\n {...field}\n components={components}\n isFlatFieldset\n />\n );\n }\n\n // TODO: Have doubts about this, it seems we only support checkbox for multiple select\n if (field.inputType === 'select' && field.multiple) {\n FieldComponent = fieldsMap['multi-select'];\n }\n\n return (\n <Fragment key={field.name as string}>\n <FieldComponent\n {...field}\n component={\n components && components[field.inputType as keyof Components]\n }\n />\n {field.statement ? (\n <Statement\n {...(field.statement as StatementComponentProps['data'])}\n />\n ) : null}\n {field.extra ? field.extra : null}\n </Fragment>\n );\n })}\n </>\n );\n};\n","import { $TSFixMe } from '@/src/types/remoteFlows';\nimport { baseFields } from './baseFields';\nimport { FieldSetField } from './FieldSetField';\nimport { SupportedTypes } from './types';\n\nexport const fieldsMap: Record<\n SupportedTypes,\n React.ComponentType<$TSFixMe>\n> = {\n ...baseFields,\n fieldset: FieldSetField,\n 'fieldset-flat': FieldSetField,\n};\n","import { useFormContext } from 'react-hook-form';\nimport { sanitizeHtml } from '@/src/lib/utils';\nimport { useEffect } from 'react';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\nconst Description = ({\n name,\n description,\n helpCenter,\n}: {\n name: string;\n description: string;\n helpCenter?: {\n callToAction: string;\n id: number;\n url: string;\n label: string;\n };\n}) => {\n return (\n <span>\n <span\n className={`text-xs RemoteFlows__ForcedValue__Description__${name}`}\n dangerouslySetInnerHTML={{ __html: sanitizeHtml(description) }}\n />\n {helpCenter?.callToAction && helpCenter?.id && (\n <ZendeskTriggerButton\n className='RemoteFlows__ForcedValue__HelpCenterLink'\n zendeskId={helpCenter.id}\n >\n {helpCenter.callToAction}\n </ZendeskTriggerButton>\n )}\n </span>\n );\n};\n\nexport type ForcedValueFieldProps = {\n name: string;\n value: string;\n description: string;\n statement?: {\n title?: string;\n description?: string;\n };\n label: string;\n helpCenter?: {\n callToAction: string;\n id: number;\n url: string;\n label: string;\n };\n};\n\nexport function ForcedValueField({\n name,\n value,\n description,\n statement,\n label,\n helpCenter,\n}: ForcedValueFieldProps) {\n const { setValue } = useFormContext();\n const descriptionSanitized = sanitizeHtml(\n statement?.description || description,\n );\n useEffect(() => {\n setValue(name, value);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div>\n {statement ? (\n <>\n {/* if statement?.title is undefined which could be for example belgium contract details form, we need to use the label attribute */}\n <p\n className={`text-sm RemoteFlows__ForcedValue__Title__${name}`}\n dangerouslySetInnerHTML={{\n __html: sanitizeHtml(statement?.title || label),\n }}\n />\n <Description\n name={name}\n description={sanitizeHtml(statement?.description || description)}\n helpCenter={helpCenter}\n />\n </>\n ) : (\n <Description\n name={name}\n description={descriptionSanitized}\n helpCenter={helpCenter}\n />\n )}\n </div>\n );\n}\n"],"mappings":"oPAEA,OAAgB,YAAAA,MAAgB,QCGzB,IAAMC,EAGT,CACF,GAAGC,EACH,SAAUC,EACV,gBAAiBA,CACnB,ECVA,OAAS,aAAAC,MAAiB,QAkBtB,OAsDI,YAAAC,EArDF,OAAAC,EADF,QAAAC,MAAA,oBAfJ,IAAMC,EAAcC,EAAA,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,WAAAC,CACF,IAWIL,EAAC,QACC,UAAAD,EAAC,QACC,UAAW,kDAAkDI,CAAI,GACjE,wBAAyB,CAAE,OAAQG,EAAaF,CAAW,CAAE,EAC/D,EACCC,GAAY,cAAgBA,GAAY,IACvCN,EAACQ,EAAA,CACC,UAAU,2CACV,UAAWF,EAAW,GAErB,SAAAA,EAAW,aACd,GAEJ,EA5BgB,eAiDb,SAASG,EAAiB,CAC/B,KAAAL,EACA,MAAAM,EACA,YAAAL,EACA,UAAAM,EACA,MAAAC,EACA,WAAAN,CACF,EAA0B,CACxB,GAAM,CAAE,SAAAO,CAAS,EAAIC,EAAe,EAC9BC,EAAuBR,EAC3BI,GAAW,aAAeN,CAC5B,EACA,OAAAW,EAAU,IAAM,CACdH,EAAST,EAAMM,CAAK,CAEtB,EAAG,CAAC,CAAC,EAGHV,EAAC,OACE,SAAAW,EACCV,EAAAF,EAAA,CAEE,UAAAC,EAAC,KACC,UAAW,4CAA4CI,CAAI,GAC3D,wBAAyB,CACvB,OAAQG,EAAaI,GAAW,OAASC,CAAK,CAChD,EACF,EACAZ,EAACE,EAAA,CACC,KAAME,EACN,YAAaG,EAAaI,GAAW,aAAeN,CAAW,EAC/D,WAAYC,EACd,GACF,EAEAN,EAACE,EAAA,CACC,KAAME,EACN,YAAaW,EACb,WAAYT,EACd,EAEJ,CAEJ,CA3CgBH,EAAAM,EAAA,oBFLZ,mBAAAQ,EAeQ,OAAAC,EA8BA,QAAAC,MA7CR,oBA9BJ,SAASC,EAAyBC,EAAY,CAE5C,OACEA,EAAM,QAAU,QAChBA,EAAM,QAAUA,EAAM,SACtBA,EAAM,YAAc,YACpBA,EAAM,YAAc,QAExB,CARSC,EAAAF,EAAA,4BAUF,IAAMG,EAAuBD,EAAA,CAAC,CACnC,OAAAE,EACA,UAAAC,EACA,YAAAC,EACA,WAAAC,CACF,IAAiC,CAC/B,GAAM,CAAE,SAAAC,CAAS,EAAIC,EAAe,EAEpC,GAAI,CAACL,GAAUA,EAAO,SAAW,EAAG,OAAO,KAE3C,IAAMM,EACJL,GAAaC,EACTK,EAA2B,CACzB,OAAQP,EACR,UAAWC,EACX,OAAQC,CACV,CAAC,EACDF,EAEN,OACEN,EAAAD,EAAA,CACG,SAAAa,EAA4B,IAAKT,GAAU,CAQ1C,GAPIA,EAAM,6BACRA,EAAQ,CACN,GAAGA,EACH,GAAIA,EAAM,2BAA2BK,EAAaL,CAAK,GAAK,CAAC,CAC/D,GAGEA,EAAM,YAAc,IAASA,EAAM,YAAcA,EAAM,OACzD,OAAO,KAGT,GAAID,EAAyBC,CAAK,EAChC,OACEH,EAACc,EAAA,CAEC,KAAMX,EAAM,KACZ,YAAaA,EAAM,YACnB,MAAOA,EAAM,MACb,UAAWA,EAAM,UACjB,MAAOA,EAAM,MACb,WAAYA,EAAM,MAAM,YANnBA,EAAM,IAOb,EAIJ,GAAIA,EAAM,UAAW,CACnB,GAAM,CAAE,UAAAY,CAAU,EAAIZ,EAGtB,OACEH,EAACe,EAAA,CAEC,SAAWC,GAAmBN,EAASP,EAAM,KAAMa,CAAK,EACvD,GAAGb,GAFCA,EAAM,IAGb,CAEJ,CAEA,IAAIc,EACFC,EAAUf,EAAM,SAAmC,EAErD,OAAKc,EAQDd,EAAM,YAAc,WAEpBH,EAACiB,EAAA,CAEE,GAAGd,EACJ,WAAYM,GAFPN,EAAM,IAGb,EAIAA,EAAM,YAAc,gBAEpBH,EAACiB,EAAA,CAEE,GAAGd,EACJ,WAAYM,EACZ,eAAc,IAHTN,EAAM,IAIb,GAKAA,EAAM,YAAc,UAAYA,EAAM,WACxCc,EAAiBC,EAAU,cAAc,GAIzCjB,EAACF,EAAA,CACC,UAAAC,EAACiB,EAAA,CACE,GAAGd,EACJ,UACEM,GAAcA,EAAWN,EAAM,SAA6B,EAEhE,EACCA,EAAM,UACLH,EAACmB,EAAA,CACE,GAAIhB,EAAM,UACb,EACE,KACHA,EAAM,MAAQA,EAAM,MAAQ,OAZhBA,EAAM,IAarB,GA9CEF,EAAC,KAAE,UAAU,QAAQ,wBACPE,EAAM,UAAoB,kBACxC,CA8CN,CAAC,EACH,CAEJ,EApHoC","names":["Fragment","fieldsMap","baseFields","FieldSetField","useEffect","Fragment","jsx","jsxs","Description","__name","name","description","helpCenter","sanitizeHtml","ZendeskTriggerButton","ForcedValueField","value","statement","label","setValue","useFormContext","descriptionSanitized","useEffect","Fragment","jsx","jsxs","checkFieldHasForcedValue","field","__name","JSONSchemaFormFields","fields","fieldsets","fieldValues","components","setValue","useFormContext","maybeFieldWithFlatFieldsets","getFieldsWithFlatFieldsets","ForcedValueField","Component","value","FieldComponent","fieldsMap","Statement"]}
@@ -1,2 +1,2 @@
1
- import{b as r}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-6GTRAHWJ.js";import{b as n}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";function f({children:e,...t}){let{terminationBag:{back:u}}=r(),{components:m}=n(),s=m?.button||i;return B(s,{...t,onClick:c=>{u(),t.onClick?.(c)},children:e})}o(f,"TerminationBack");export{f as a};
2
- //# sourceMappingURL=chunk-M2TLNSTK.js.map
1
+ import{b as r}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-NFWNYW2E.js";import{b as n}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";function f({children:e,...t}){let{terminationBag:{back:u}}=r(),{components:m}=n(),s=m?.button||i;return B(s,{...t,onClick:c=>{u(),t.onClick?.(c)},children:e})}o(f,"TerminationBack");export{f as a};
2
+ //# sourceMappingURL=chunk-4OVFMUUJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-L3Z2G32A.js";import{a as r}from"./chunk-P37U34EQ.js";import*as o from"@radix-ui/react-accordion";import{ChevronDownIcon as d}from"lucide-react";import{jsx as t,jsxs as s}from"react/jsx-runtime";function l({...i}){return t(o.Root,{"data-slot":"accordion",...i})}r(l,"Accordion");function f({className:i,...e}){return t(o.Item,{"data-slot":"accordion-item",className:n("border-b last:border-b-0",i),...e})}r(f,"AccordionItem");function v({className:i,iconClassName:e,children:c,...a}){return t(o.Header,{className:"flex items-center",children:s(o.Trigger,{"data-slot":"accordion-trigger",className:n("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",i),...a,children:[c,t(d,{className:n("text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 mt-1",e)})]})})}r(v,"AccordionTrigger");function g({className:i,children:e,...c}){return t(o.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...c,children:t("div",{className:n("pt-0 pb-4",i),children:e})})}r(g,"AccordionContent");export{l as a,f as b,v as c,g as d};
2
- //# sourceMappingURL=chunk-EC7QVRRX.js.map
1
+ import{a as n}from"./chunk-UQCSN47K.js";import{a as r}from"./chunk-P37U34EQ.js";import*as o from"@radix-ui/react-accordion";import{ChevronDownIcon as d}from"lucide-react";import{jsx as t,jsxs as s}from"react/jsx-runtime";function l({...i}){return t(o.Root,{"data-slot":"accordion",...i})}r(l,"Accordion");function f({className:i,...e}){return t(o.Item,{"data-slot":"accordion-item",className:n("border-b last:border-b-0",i),...e})}r(f,"AccordionItem");function v({className:i,iconClassName:e,children:c,...a}){return t(o.Header,{className:"flex items-center",children:s(o.Trigger,{"data-slot":"accordion-trigger",className:n("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",i),...a,children:[c,t(d,{className:n("text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 mt-1",e)})]})})}r(v,"AccordionTrigger");function g({className:i,children:e,...c}){return t(o.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...c,children:t("div",{className:n("pt-0 pb-4",i),children:e})})}r(g,"AccordionContent");export{l as a,f as b,v as c,g as d};
2
+ //# sourceMappingURL=chunk-4UAHJOHZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as l}from"./chunk-P37U34EQ.js";import{useState as S,useEffect as x}from"react";var y=l((s,r)=>{let i=Object.keys(s);if(i.length===0)throw new Error("No steps provided to useStepState");let[d,p]=S({}),[a,c]=S({currentStep:s[i[0]],totalSteps:i.length,values:null});x(()=>{r?.(s[i[0]])},[]);function o(){let{index:t}=a.currentStep,n=Object.values(s).find(e=>e.index===t+1);n&&(c(e=>({...e,currentStep:n,values:{...e.values,[e.currentStep.name]:{...e.values?.[e.currentStep.name],...d}}})),r?.(n),p({}))}l(o,"nextStep");function T(){let{index:t}=a.currentStep,n=Object.values(s).find(e=>e.index===t-1);n&&(c(e=>({...e,currentStep:n,values:{...e.values,[e.currentStep.name]:{...e.values?.[e.currentStep.name],...d}}})),r?.(n),p({}))}l(T,"previousStep");function f(t){a.values?.[t]&&(c(u=>({...u,currentStep:s[t]})),r?.(s[t]))}l(f,"goToStep");function F(t){c(u=>({...u,values:t}))}return l(F,"setStepValues"),{nextStep:o,previousStep:T,stepState:a,goToStep:f,fieldValues:d,setFieldValues:p,setStepValues:F}},"useStepState");export{y as a};
2
+ //# sourceMappingURL=chunk-5BRMLRS7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/useStepState.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { FieldValues } from 'react-hook-form';\n\nexport type Step<T extends string> = {\n index: number;\n name: T;\n};\n\ntype StepState<T extends string, Fields = FieldValues> = {\n currentStep: Step<T>;\n totalSteps: number;\n values:\n | {\n [key in T]: Fields;\n }\n | null;\n};\n\nexport const useStepState = <T extends string, Fields = FieldValues>(\n steps: Record<T, Step<T>>,\n onStepChange?: (step: Step<T>) => void,\n) => {\n const stepKeys = Object.keys(steps) as Array<keyof typeof steps>;\n\n if (stepKeys.length === 0) {\n throw new Error('No steps provided to useStepState');\n }\n\n const [fieldValues, setFieldValues] = useState<Fields>({} as Fields);\n const [stepState, setStepState] = useState<StepState<T, Fields>>({\n currentStep: steps[stepKeys[0]],\n totalSteps: stepKeys.length,\n values: null,\n });\n\n // Call onStepChange once when the hook initializes\n // Note: intentionally no deps to only run on mount and avoid re-renders\n // when onStepChange/steps references change\n useEffect(() => {\n onStepChange?.(steps[stepKeys[0]]);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n function nextStep() {\n const { index } = stepState.currentStep;\n const stepValues = Object.values<Step<T>>(steps);\n const nextStep = stepValues.find((step) => step.index === index + 1);\n\n if (nextStep) {\n setStepState((previousState) => ({\n ...previousState,\n currentStep: nextStep,\n values: {\n ...previousState.values,\n [previousState.currentStep.name]: {\n ...previousState.values?.[previousState.currentStep.name as T],\n ...fieldValues,\n },\n } as { [key in T]: Fields },\n }));\n onStepChange?.(nextStep);\n setFieldValues({} as Fields);\n }\n }\n\n function previousStep() {\n const { index } = stepState.currentStep;\n const stepValues = Object.values<Step<T>>(steps);\n const previousStep = stepValues.find((step) => step.index === index - 1);\n\n if (previousStep) {\n setStepState((previousState) => ({\n ...previousState,\n currentStep: previousStep,\n values: {\n ...previousState.values,\n [previousState.currentStep.name]: {\n ...previousState.values?.[previousState.currentStep.name as T],\n ...fieldValues,\n },\n } as { [key in T]: Fields },\n }));\n onStepChange?.(previousStep);\n setFieldValues({} as Fields);\n }\n }\n\n function goToStep(step: T) {\n if (stepState.values?.[step]) {\n setStepState((previousState) => ({\n ...previousState,\n currentStep: steps[step],\n }));\n onStepChange?.(steps[step]);\n }\n }\n\n function setStepValues(values: Record<T, Fields>) {\n setStepState((previousState) => ({\n ...previousState,\n values: values,\n }));\n }\n\n return {\n /**\n * Moves to the next step in the step state.\n * It updates the current step and resets the field values for the next step.\n * The field values for the current step are stored in the step state.\n * @returns {void}\n */\n nextStep,\n /**\n * Moves to the previous step in the step state.\n * It updates the current step and resets the field values for the previous step.\n * The field values for the current step are stored in the step state.\n * @returns {void}\n */\n previousStep,\n /**\n * The current step state containing the current step, total number of steps and\n * the form values for each step.\n * @returns {StepState<T>} The current step state.\n */\n stepState,\n /**\n * Goes to a specific step in the step state.\n * @param step The step to go to.\n * @returns {void}\n */\n goToStep,\n /**\n * The field values for the current step.\n * @returns {FieldValues} The field values for the current step.\n */\n fieldValues,\n /**\n * Sets the field values for the current step.\n * @param values The field values to set.\n * @returns {void}\n */\n setFieldValues,\n /**\n * Sets the step values for the step state.\n * This is used to update all values in the step state.\n * @param values The values to set for the all steps.\n * @returns {void}\n */\n setStepValues,\n };\n};\n"],"mappings":"wCAAA,OAAS,YAAAA,EAAU,aAAAC,MAAiB,QAkB7B,IAAMC,EAAeC,EAAA,CAC1BC,EACAC,IACG,CACH,IAAMC,EAAW,OAAO,KAAKF,CAAK,EAElC,GAAIE,EAAS,SAAW,EACtB,MAAM,IAAI,MAAM,mCAAmC,EAGrD,GAAM,CAACC,EAAaC,CAAc,EAAIC,EAAiB,CAAC,CAAW,EAC7D,CAACC,EAAWC,CAAY,EAAIF,EAA+B,CAC/D,YAAaL,EAAME,EAAS,CAAC,CAAC,EAC9B,WAAYA,EAAS,OACrB,OAAQ,IACV,CAAC,EAKDM,EAAU,IAAM,CACdP,IAAeD,EAAME,EAAS,CAAC,CAAC,CAAC,CAEnC,EAAG,CAAC,CAAC,EAEL,SAASO,GAAW,CAClB,GAAM,CAAE,MAAAC,CAAM,EAAIJ,EAAU,YAEtBG,EADa,OAAO,OAAgBT,CAAK,EACnB,KAAMW,GAASA,EAAK,QAAUD,EAAQ,CAAC,EAE/DD,IACFF,EAAcK,IAAmB,CAC/B,GAAGA,EACH,YAAaH,EACb,OAAQ,CACN,GAAGG,EAAc,OACjB,CAACA,EAAc,YAAY,IAAI,EAAG,CAChC,GAAGA,EAAc,SAASA,EAAc,YAAY,IAAS,EAC7D,GAAGT,CACL,CACF,CACF,EAAE,EACFF,IAAeQ,CAAQ,EACvBL,EAAe,CAAC,CAAW,EAE/B,CApBSL,EAAAU,EAAA,YAsBT,SAASI,GAAe,CACtB,GAAM,CAAE,MAAAH,CAAM,EAAIJ,EAAU,YAEtBO,EADa,OAAO,OAAgBb,CAAK,EACf,KAAMW,GAASA,EAAK,QAAUD,EAAQ,CAAC,EAEnEG,IACFN,EAAcK,IAAmB,CAC/B,GAAGA,EACH,YAAaC,EACb,OAAQ,CACN,GAAGD,EAAc,OACjB,CAACA,EAAc,YAAY,IAAI,EAAG,CAChC,GAAGA,EAAc,SAASA,EAAc,YAAY,IAAS,EAC7D,GAAGT,CACL,CACF,CACF,EAAE,EACFF,IAAeY,CAAY,EAC3BT,EAAe,CAAC,CAAW,EAE/B,CApBSL,EAAAc,EAAA,gBAsBT,SAASC,EAASH,EAAS,CACrBL,EAAU,SAASK,CAAI,IACzBJ,EAAcK,IAAmB,CAC/B,GAAGA,EACH,YAAaZ,EAAMW,CAAI,CACzB,EAAE,EACFV,IAAeD,EAAMW,CAAI,CAAC,EAE9B,CARSZ,EAAAe,EAAA,YAUT,SAASC,EAAcC,EAA2B,CAChDT,EAAcK,IAAmB,CAC/B,GAAGA,EACH,OAAQI,CACV,EAAE,CACJ,CALS,OAAAjB,EAAAgB,EAAA,iBAOF,CAOL,SAAAN,EAOA,aAAAI,EAMA,UAAAP,EAMA,SAAAQ,EAKA,YAAAX,EAMA,eAAAC,EAOA,cAAAW,CACF,CACF,EApI4B","names":["useState","useEffect","useStepState","__name","steps","onStepChange","stepKeys","fieldValues","setFieldValues","useState","stepState","setStepState","useEffect","nextStep","index","step","previousState","previousStep","goToStep","setStepValues","values"]}
@@ -1,2 +1,2 @@
1
- import{e as p}from"./chunk-DFJNVGK4.js";import{a as m}from"./chunk-L3Z2G32A.js";import{a as i}from"./chunk-P37U34EQ.js";import{endOfMonth as _,isAfter as d,isBefore as g,parseISO as y,startOfDay as h,setDate as S,isFuture as w,differenceInHours as M,endOfDay as F,differenceInDays as x}from"date-fns";var c={MONTHLY:"monthly",SEMI_MONTHLY:"bi_monthly",BI_WEEKLY:"bi_weekly"};import{jsx as u,jsxs as T}from"react/jsx-runtime";function b(n,e,t){return{"x-jsf-presentation":{inputType:"hidden",Component:i(()=>T("div",{className:m("RemoteFlows__InformationStatement",t?.className),children:[u("h3",{className:m("RemoteFlows__InformationStatement__Title"),children:n}),u("p",{className:m("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(b,"createInformationField");function a({title:n,description:e,severity:t}){return{statement:{title:n,description:e,severity:t}}}i(a,"createStatementProperty");var E={employee_communication:{index:0,name:"employee_communication"},termination_details:{index:1,name:"termination_details"},paid_time_off:{index:2,name:"paid_time_off"},additional_information:{index:3,name:"additional_information"}},Y=i(n=>{let e=new Date,t=S(e,15),o=h(e),l=h(t),f=n?.cycle_frequency,r=n?.cycles?.filter(s=>s.input_cutoff_date&&y(s.input_cutoff_date).getMonth()===e.getMonth())?.map(s=>y(s.input_cutoff_date));if(!r?.length)return e;switch(f){case c.MONTHLY:return d(o,r[0])?_(e):e;case c.SEMI_MONTHLY:return d(o,r[1])?_(e):d(o,r[0])&&g(o,l)?t:e;default:return e}},"calculateMinTerminationDate"),k=i(({minTerminationDate:n,isEmployeeInProbationPeriod:e,selectedDate:t})=>{let o=w(n),l=t&&M(F(t),new Date)<48;return t&&x(t,new Date)>=30||!t&&!o?null:o&&!e?a({description:`The next available termination dates are ${p(n)} and later. We've already processed the employee's payments until then.`,severity:"info"}):o&&e?a({description:"This payroll period's cut-off has passed. While you can offboard the employee after the cut-off, their payment may have already processed. If that's the case, we'll try to recover the payment. But if that isn't possible, we'll send you an invoice for the amount.",severity:"info"}):l?a({description:"Requests made with less than 48 hours' notice are subject to changes due to the country-specific offboarding laws and case details. If changes are needed, your specialist will guide you accordingly.",severity:"info"}):a({description:"Termination dates depend on payroll cutoffs, local laws, and case details. We'll aim for your proposed date but it's possible it will need to change. After you submit your request, a specialist will reach out and guide you through the process.",severity:"info"})},"calculateProposedTerminationDateStatement");function V(n,e){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...n,...e?{termination_reason:"cancellation_before_start_date"}:{}}}i(V,"buildInitialValues");export{b as a,E as b,Y as c,k as d,V as e};
2
- //# sourceMappingURL=chunk-QUQLW5YW.js.map
1
+ import{e as p}from"./chunk-DFJNVGK4.js";import{a as m}from"./chunk-UQCSN47K.js";import{a as i}from"./chunk-P37U34EQ.js";import{endOfMonth as _,isAfter as d,isBefore as g,parseISO as y,startOfDay as h,setDate as S,isFuture as w,differenceInHours as M,endOfDay as F,differenceInDays as x}from"date-fns";var c={MONTHLY:"monthly",SEMI_MONTHLY:"bi_monthly",BI_WEEKLY:"bi_weekly"};import{jsx as u,jsxs as T}from"react/jsx-runtime";function b(n,e,t){return{"x-jsf-presentation":{inputType:"hidden",Component:i(()=>T("div",{className:m("RemoteFlows__InformationStatement",t?.className),children:[u("h3",{className:m("RemoteFlows__InformationStatement__Title"),children:n}),u("p",{className:m("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(b,"createInformationField");function a({title:n,description:e,severity:t}){return{statement:{title:n,description:e,severity:t}}}i(a,"createStatementProperty");var E={employee_communication:{index:0,name:"employee_communication"},termination_details:{index:1,name:"termination_details"},paid_time_off:{index:2,name:"paid_time_off"},additional_information:{index:3,name:"additional_information"}},Y=i(n=>{let e=new Date,t=S(e,15),o=h(e),l=h(t),f=n?.cycle_frequency,r=n?.cycles?.filter(s=>s.input_cutoff_date&&y(s.input_cutoff_date).getMonth()===e.getMonth())?.map(s=>y(s.input_cutoff_date));if(!r?.length)return e;switch(f){case c.MONTHLY:return d(o,r[0])?_(e):e;case c.SEMI_MONTHLY:return d(o,r[1])?_(e):d(o,r[0])&&g(o,l)?t:e;default:return e}},"calculateMinTerminationDate"),k=i(({minTerminationDate:n,isEmployeeInProbationPeriod:e,selectedDate:t})=>{let o=w(n),l=t&&M(F(t),new Date)<48;return t&&x(t,new Date)>=30||!t&&!o?null:o&&!e?a({description:`The next available termination dates are ${p(n)} and later. We've already processed the employee's payments until then.`,severity:"info"}):o&&e?a({description:"This payroll period's cut-off has passed. While you can offboard the employee after the cut-off, their payment may have already processed. If that's the case, we'll try to recover the payment. But if that isn't possible, we'll send you an invoice for the amount.",severity:"info"}):l?a({description:"Requests made with less than 48 hours' notice are subject to changes due to the country-specific offboarding laws and case details. If changes are needed, your specialist will guide you accordingly.",severity:"info"}):a({description:"Termination dates depend on payroll cutoffs, local laws, and case details. We'll aim for your proposed date but it's possible it will need to change. After you submit your request, a specialist will reach out and guide you through the process.",severity:"info"})},"calculateProposedTerminationDateStatement");function V(n,e){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...n,...e?{termination_reason:"cancellation_before_start_date"}:{}}}i(V,"buildInitialValues");export{b as a,E as b,Y as c,k as d,V as e};
2
+ //# sourceMappingURL=chunk-5JQMTMHR.js.map
@@ -0,0 +1,2 @@
1
+ var e={remoteDoesNext:{title:"What Remote does next:",description:"They'll review the termination request and respond within the next 5 days with any subsequent actions or advice."},whatYouNeedToDo:{title:"What you need to do next:",list:["Make sure any expenses for this employee are approved on Remote.","Make sure any additional payments, such as commission, bonuses, or other allowances are added to Remote before\xA0the 11th, 11:59PM UTC of the last month of employment.","Coordinate the return of the employee\u2019s work equipment."]}};export{e as a};
2
+ //# sourceMappingURL=chunk-5WFWHEXV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/components/AcknowledgeInformation/constants.ts"],"sourcesContent":["export const cards = {\n remoteDoesNext: {\n title: 'What Remote does next:',\n description:\n \"They'll review the termination request and respond within the next 5 days with any subsequent actions or advice.\",\n },\n whatYouNeedToDo: {\n title: 'What you need to do next:',\n list: [\n 'Make sure any expenses for this employee are approved on Remote.',\n 'Make sure any additional payments, such as commission, bonuses, or other allowances are added to Remote before the 11th, 11:59PM UTC of the last month of employment.',\n 'Coordinate the return of the employee’s work equipment.',\n ],\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAQ,CACnB,eAAgB,CACd,MAAO,yBACP,YACE,kHACJ,EACA,gBAAiB,CACf,MAAO,4BACP,KAAM,CACJ,mEACA,2KACA,8DACF,CACF,CACF","names":["cards"]}
@@ -1,2 +1,2 @@
1
- import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-EYQ4PYUT.js";import{b as p}from"./chunk-2YTBWEC7.js";import{g as C}from"./chunk-66N57DKF.js";import{g as E}from"./chunk-L3Z2G32A.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=await 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-MEZ7LYUK.js.map
1
+ import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-4FW2VTO4.js";import{b as p}from"./chunk-2YTBWEC7.js";import{g as C}from"./chunk-CR7AIZKA.js";import{g as E}from"./chunk-UQCSN47K.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=await 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-6AQLDTMK.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-RR55GUDT.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
- //# sourceMappingURL=chunk-OKM7DRCF.js.map
1
+ import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-TC7EQZJK.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
+ //# sourceMappingURL=chunk-6CASSN2Z.js.map
@@ -0,0 +1,2 @@
1
+ import{a as n}from"./chunk-5WFWHEXV.js";import{a as o}from"./chunk-P37U34EQ.js";var t=o(({render:r})=>r({cards:n}),"AcknowledgeInformationContainer");export{t as a};
2
+ //# sourceMappingURL=chunk-6DHV4GT6.js.map
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-SGE4DLC3.js";import{a as E,b as F,c as L,d as _,e as k}from"./chunk-UOOUV52J.js";import{b as w}from"./chunk-KQPDXXG3.js";import{b as S}from"./chunk-LJGCFFAT.js";import{a as n}from"./chunk-L3Z2G32A.js";import{a as d}from"./chunk-P37U34EQ.js";import{jsx as y,jsxs as B}from"react/jsx-runtime";function O({open:e,onOpenChange:a,direction:t,className:i,title:s,trigger:m,children:l}){return B(E,{open:e,onOpenChange:a,direction:t,children:[y(F,{asChild:!0,children:m}),y(L,{className:n(i,"RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4"),children:B("div",{className:"h-full flex flex-col",children:[y(_,{children:y(k,{children:s})}),y("div",{className:"flex-1 overflow-y-auto",children:l})]})})]})}d(O,"DrawerDefault");import{jsx as q}from"react/jsx-runtime";var A=d(({open:e,onOpenChange:a,title:t,trigger:i,children:s,className:m="",direction:l="right"})=>{let{components:T}=w(),p=T?.drawer||O;return q(p,{open:e,onOpenChange:a,title:t,trigger:i,direction:l,className:m,children:s})},"Drawer");import{forwardRef as W}from"react";import*as b from"react";import{jsx as f}from"react/jsx-runtime";var g=b.forwardRef(({className:e,...a},t)=>f("div",{className:"relative w-full overflow-auto",children:f("table",{ref:t,className:n("w-full caption-bottom text-sm",e),...a})}));g.displayName="Table";var x=b.forwardRef(({className:e,...a},t)=>f("thead",{ref:t,className:n("[&_tr]:border-b",e),...a}));x.displayName="TableHeader";var C=b.forwardRef(({className:e,...a},t)=>f("tbody",{ref:t,className:n("[&_tr:last-child]:border-0",e),...a}));C.displayName="TableBody";var z=b.forwardRef(({className:e,...a},t)=>f("tfoot",{ref:t,className:n("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));z.displayName="TableFooter";var D=b.forwardRef(({className:e,...a},t)=>f("tr",{ref:t,className:n("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));D.displayName="TableRow";var h=b.forwardRef(({className:e,...a},t)=>f("th",{ref:t,className:n("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));h.displayName="TableHead";var v=b.forwardRef(({className:e,...a},t)=>f("td",{ref:t,className:n("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));v.displayName="TableCell";var I=b.forwardRef(({className:e,...a},t)=>f("caption",{ref:t,className:n("mt-4 text-sm text-muted-foreground",e),...a}));I.displayName="TableCaption";import{jsx as u,jsxs as V}from"react/jsx-runtime";var U=d(({data:e,columns:a,className:t,ref:i})=>V(g,{ref:i,className:n("RemoteFlows__Table",t),children:[u(x,{children:u(D,{children:a.map(s=>u(h,{className:n("RemoteFlows__TableHead",s.className),children:s.label},String(s.id)))})}),u(C,{children:e?.map((s,m)=>u(D,{children:a.map(l=>u(v,{className:n("RemoteFlows__TableCell",l.className,l.cellClassName),children:l.render?l.render(s[l.id],s,m):s[l.id]},String(l.id)))},J(s,m)))})]}),"TableFieldDefault");function J(e,a){return String(e.id??a)}d(J,"getRowKey");import{jsx as X}from"react/jsx-runtime";var P=W(({data:e=[],columns:a,className:t=""},i)=>{let{components:s}=w(),m=s?.table||U;return X(m,{ref:i,data:e,columns:a,className:t})});P.displayName="Table";import{Fragment as H,jsx as o,jsxs as r}from"react/jsx-runtime";var Z="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",j="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",c=d(({children:e,withBorder:a=!1,className:t=""})=>o("div",{className:n(Z,a&&j,t),children:e}),"SummaryRow"),ee=d(({usedDays:e,bookedDays:a,approvedDaysBeforeTermination:t,approvedDaysAfterTermination:i,remainingDays:s,proposedTerminationDate:m,isUnlimitedPto:l,currentEntitlementDays:T})=>{let p=new Date(m).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return r("div",{children:[r(c,{withBorder:!0,children:[o("label",{children:"Number of days entitled to per year"}),o("p",{"data-testid":"entitled-days",className:"font-bold",children:l?"Unlimited":T})]}),r(c,{children:[o("label",{children:"Total days booked"}),o("p",{"data-testid":"booked-days",className:"font-bold",children:a})]}),r(c,{children:[o("label",{children:"Number of days already used"}),o("p",{"data-testid":"used-days",className:"font-bold",children:e})]}),r(c,{children:[r("label",{children:["Approved for use before ",p]}),o("p",{"data-testid":"approved-days-before-termination",className:"font-bold",children:t})]}),r(c,{withBorder:!0,children:[r("label",{children:["Approved for use after ",p]}),o("p",{"data-testid":"approved-days-after-termination",className:"font-bold",children:i})]}),r(c,{children:[o("label",{children:"Total days remaining unused"}),o("p",{"data-testid":"remaining-days",className:"font-bold",children:s})]}),o(c,{className:"mb-2 py-0",children:r("p",{className:"text-xs text-[#222E39]",children:["Unused days expire on ",p]})})]})},"SummaryTimeOff"),ae=[{id:"formattedDate",label:"Dates",className:"w-[250px]",cellClassName:"font-medium"},{id:"duration",label:"Duration",render:d(e=>R({number:e,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0}),"render")},{id:"status",label:"Status"}],te=d(({employeeName:e,timeoffQuery:a,entitledDays:t,countryName:i,currentEntitlementDays:s,formattedProposedTerminationDate:m,onOpenChange:l,open:T})=>{let{data:p,isLoading:N}=a;return o(A,{open:T,onOpenChange:l,title:`${e} paid time off breakdown`,trigger:o(S,{variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"}),className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:!N&&o(H,{children:Array.isArray(p?.timeoffs)&&p?.timeoffs?.length>0?r(H,{children:[o("p",{className:"text-[#09090B] font-medium mb-4",children:"This list is for your information only."}),r("p",{className:"text-xs text-[#09090B] mb-1 flex items-center justify-between gap-2",children:[r("span",{children:["Annual entitlement for ",i]}),o("span",{className:"font-bold",children:t})]}),r("p",{className:"text-xs text-[#09090B] mb-6 flex items-center justify-between gap-2",children:[r("span",{children:["Entitlement up to ",m]}),o("span",{className:"font-bold",children:s})]}),o("div",{className:"mb-2",children:o(P,{data:p?.timeoffs,columns:ae})}),r("p",{className:"text-xs",children:["Total of"," ",R({number:p?.bookedDays,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0})," ","booked"]})]}):r(H,{children:[o("p",{className:"font-medium mb-1 text-[#09090B]",children:"No recorded time off"}),r("p",{className:"text-sm text-[#09090B]",children:["According to our records, ",e," has not taken any time off this year."]})]})})})},"DrawerTimeOff"),Ee=d(({employeeName:e,proposedTerminationDate:a,summaryData:t,formattedProposedTerminationDate:i,timeoffQuery:s,employment:m,onOpenChange:l,open:T})=>{let{entitledDays:p,bookedDays:N,usedDays:$,approvedDaysBeforeTermination:Q,approvedDaysAfterTermination:G,remainingDays:K,currentEntitlementDays:M,isUnlimitedPto:Y}=t.data;return r("div",{className:"RemoteFlows__PaidTimeOff__Container py-3",children:[o("h3",{className:"RemoteFlows__PaidTimeOff__Title mb-2",children:"Paid time off"}),r("p",{className:"RemoteFlows__PaidTimeOff__Description text-sm mb-2",children:["The proposed termination date for ",e," is"," ",i,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),r("div",{className:"mb-2",children:[!t?.isLoading&&!t?.isError&&t?.data&&o(ee,{usedDays:$,bookedDays:N,currentEntitlementDays:M,approvedDaysBeforeTermination:Q,approvedDaysAfterTermination:G,remainingDays:K,proposedTerminationDate:a,isUnlimitedPto:Y}),o(te,{employeeName:e,timeoffQuery:s,entitledDays:p,currentEntitlementDays:M,countryName:m?.country?.name??"Unknown",onOpenChange:l,formattedProposedTerminationDate:i,open:T})]})]})},"PaidTimeOff");export{Ee as a};
2
- //# sourceMappingURL=chunk-XRI6PRXK.js.map
1
+ import{a as R}from"./chunk-SGE4DLC3.js";import{a as E,b as F,c as L,d as _,e as k}from"./chunk-GGPEKIIH.js";import{b as w}from"./chunk-KQPDXXG3.js";import{b as S}from"./chunk-PJN2YJO4.js";import{a as n}from"./chunk-UQCSN47K.js";import{a as d}from"./chunk-P37U34EQ.js";import{jsx as y,jsxs as B}from"react/jsx-runtime";function O({open:e,onOpenChange:a,direction:t,className:i,title:s,trigger:m,children:l}){return B(E,{open:e,onOpenChange:a,direction:t,children:[y(F,{asChild:!0,children:m}),y(L,{className:n(i,"RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4"),children:B("div",{className:"h-full flex flex-col",children:[y(_,{children:y(k,{children:s})}),y("div",{className:"flex-1 overflow-y-auto",children:l})]})})]})}d(O,"DrawerDefault");import{jsx as q}from"react/jsx-runtime";var A=d(({open:e,onOpenChange:a,title:t,trigger:i,children:s,className:m="",direction:l="right"})=>{let{components:T}=w(),p=T?.drawer||O;return q(p,{open:e,onOpenChange:a,title:t,trigger:i,direction:l,className:m,children:s})},"Drawer");import{forwardRef as W}from"react";import*as b from"react";import{jsx as f}from"react/jsx-runtime";var g=b.forwardRef(({className:e,...a},t)=>f("div",{className:"relative w-full overflow-auto",children:f("table",{ref:t,className:n("w-full caption-bottom text-sm",e),...a})}));g.displayName="Table";var x=b.forwardRef(({className:e,...a},t)=>f("thead",{ref:t,className:n("[&_tr]:border-b",e),...a}));x.displayName="TableHeader";var C=b.forwardRef(({className:e,...a},t)=>f("tbody",{ref:t,className:n("[&_tr:last-child]:border-0",e),...a}));C.displayName="TableBody";var z=b.forwardRef(({className:e,...a},t)=>f("tfoot",{ref:t,className:n("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));z.displayName="TableFooter";var D=b.forwardRef(({className:e,...a},t)=>f("tr",{ref:t,className:n("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));D.displayName="TableRow";var h=b.forwardRef(({className:e,...a},t)=>f("th",{ref:t,className:n("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));h.displayName="TableHead";var v=b.forwardRef(({className:e,...a},t)=>f("td",{ref:t,className:n("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));v.displayName="TableCell";var I=b.forwardRef(({className:e,...a},t)=>f("caption",{ref:t,className:n("mt-4 text-sm text-muted-foreground",e),...a}));I.displayName="TableCaption";import{jsx as u,jsxs as V}from"react/jsx-runtime";var U=d(({data:e,columns:a,className:t,ref:i})=>V(g,{ref:i,className:n("RemoteFlows__Table",t),children:[u(x,{children:u(D,{children:a.map(s=>u(h,{className:n("RemoteFlows__TableHead",s.className),children:s.label},String(s.id)))})}),u(C,{children:e?.map((s,m)=>u(D,{children:a.map(l=>u(v,{className:n("RemoteFlows__TableCell",l.className,l.cellClassName),children:l.render?l.render(s[l.id],s,m):s[l.id]},String(l.id)))},J(s,m)))})]}),"TableFieldDefault");function J(e,a){return String(e.id??a)}d(J,"getRowKey");import{jsx as X}from"react/jsx-runtime";var P=W(({data:e=[],columns:a,className:t=""},i)=>{let{components:s}=w(),m=s?.table||U;return X(m,{ref:i,data:e,columns:a,className:t})});P.displayName="Table";import{Fragment as H,jsx as o,jsxs as r}from"react/jsx-runtime";var Z="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",j="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",c=d(({children:e,withBorder:a=!1,className:t=""})=>o("div",{className:n(Z,a&&j,t),children:e}),"SummaryRow"),ee=d(({usedDays:e,bookedDays:a,approvedDaysBeforeTermination:t,approvedDaysAfterTermination:i,remainingDays:s,proposedTerminationDate:m,isUnlimitedPto:l,currentEntitlementDays:T})=>{let p=new Date(m).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return r("div",{children:[r(c,{withBorder:!0,children:[o("label",{children:"Number of days entitled to per year"}),o("p",{"data-testid":"entitled-days",className:"font-bold",children:l?"Unlimited":T})]}),r(c,{children:[o("label",{children:"Total days booked"}),o("p",{"data-testid":"booked-days",className:"font-bold",children:a})]}),r(c,{children:[o("label",{children:"Number of days already used"}),o("p",{"data-testid":"used-days",className:"font-bold",children:e})]}),r(c,{children:[r("label",{children:["Approved for use before ",p]}),o("p",{"data-testid":"approved-days-before-termination",className:"font-bold",children:t})]}),r(c,{withBorder:!0,children:[r("label",{children:["Approved for use after ",p]}),o("p",{"data-testid":"approved-days-after-termination",className:"font-bold",children:i})]}),r(c,{children:[o("label",{children:"Total days remaining unused"}),o("p",{"data-testid":"remaining-days",className:"font-bold",children:s})]}),o(c,{className:"mb-2 py-0",children:r("p",{className:"text-xs text-[#222E39]",children:["Unused days expire on ",p]})})]})},"SummaryTimeOff"),ae=[{id:"formattedDate",label:"Dates",className:"w-[250px]",cellClassName:"font-medium"},{id:"duration",label:"Duration",render:d(e=>R({number:e,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0}),"render")},{id:"status",label:"Status"}],te=d(({employeeName:e,timeoffQuery:a,entitledDays:t,countryName:i,currentEntitlementDays:s,formattedProposedTerminationDate:m,onOpenChange:l,open:T})=>{let{data:p,isLoading:N}=a;return o(A,{open:T,onOpenChange:l,title:`${e} paid time off breakdown`,trigger:o(S,{variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"}),className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:!N&&o(H,{children:Array.isArray(p?.timeoffs)&&p?.timeoffs?.length>0?r(H,{children:[o("p",{className:"text-[#09090B] font-medium mb-4",children:"This list is for your information only."}),r("p",{className:"text-xs text-[#09090B] mb-1 flex items-center justify-between gap-2",children:[r("span",{children:["Annual entitlement for ",i]}),o("span",{className:"font-bold",children:t})]}),r("p",{className:"text-xs text-[#09090B] mb-6 flex items-center justify-between gap-2",children:[r("span",{children:["Entitlement up to ",m]}),o("span",{className:"font-bold",children:s})]}),o("div",{className:"mb-2",children:o(P,{data:p?.timeoffs,columns:ae})}),r("p",{className:"text-xs",children:["Total of"," ",R({number:p?.bookedDays,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0})," ","booked"]})]}):r(H,{children:[o("p",{className:"font-medium mb-1 text-[#09090B]",children:"No recorded time off"}),r("p",{className:"text-sm text-[#09090B]",children:["According to our records, ",e," has not taken any time off this year."]})]})})})},"DrawerTimeOff"),Ee=d(({employeeName:e,proposedTerminationDate:a,summaryData:t,formattedProposedTerminationDate:i,timeoffQuery:s,employment:m,onOpenChange:l,open:T})=>{let{entitledDays:p,bookedDays:N,usedDays:$,approvedDaysBeforeTermination:Q,approvedDaysAfterTermination:G,remainingDays:K,currentEntitlementDays:M,isUnlimitedPto:Y}=t.data;return r("div",{className:"RemoteFlows__PaidTimeOff__Container py-3",children:[o("h3",{className:"RemoteFlows__PaidTimeOff__Title mb-2",children:"Paid time off"}),r("p",{className:"RemoteFlows__PaidTimeOff__Description text-sm mb-2",children:["The proposed termination date for ",e," is"," ",i,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),r("div",{className:"mb-2",children:[!t?.isLoading&&!t?.isError&&t?.data&&o(ee,{usedDays:$,bookedDays:N,currentEntitlementDays:M,approvedDaysBeforeTermination:Q,approvedDaysAfterTermination:G,remainingDays:K,proposedTerminationDate:a,isUnlimitedPto:Y}),o(te,{employeeName:e,timeoffQuery:s,entitledDays:p,currentEntitlementDays:M,countryName:m?.country?.name??"Unknown",onOpenChange:l,formattedProposedTerminationDate:i,open:T})]})]})},"PaidTimeOff");export{Ee as a};
2
+ //# sourceMappingURL=chunk-6E5GX7W3.js.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-6GTRAHWJ.js";import{b as e}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";var g=t(({onSuccess:i,onError:a,className:m,children:u,disabled:d=!1,...l})=>{let{onboardingBag:f,formId:c}=s(),{components:b}=e(),E=t(async()=>{let o=document.getElementById(c);if(o){let r=new Event("submit",{bubbles:!0,cancelable:!0});r.isDraftSubmission=!0,r.draftCallbacks={onSuccess:i,onError:a},o.dispatchEvent(r)}},"handleSaveDraft"),p=b?.button||n;return B(p,{...l,onClick:E,disabled:d||f.isSubmitting,className:m,children:u})},"SaveDraftButton");export{g as a};
2
- //# sourceMappingURL=chunk-T6HCUFYI.js.map
1
+ import{b as s}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-NFWNYW2E.js";import{b as e}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";var g=t(({onSuccess:i,onError:a,className:m,children:u,disabled:d=!1,...l})=>{let{onboardingBag:f,formId:c}=s(),{components:b}=e(),E=t(async()=>{let o=document.getElementById(c);if(o){let r=new Event("submit",{bubbles:!0,cancelable:!0});r.isDraftSubmission=!0,r.draftCallbacks={onSuccess:i,onError:a},o.dispatchEvent(r)}},"handleSaveDraft"),p=b?.button||n;return B(p,{...l,onClick:E,disabled:d||f.isSubmitting,className:m,children:u})},"SaveDraftButton");export{g as a};
2
+ //# sourceMappingURL=chunk-765OB2K5.js.map
@@ -1,2 +1,2 @@
1
- import{l as J}from"./chunk-5LSHRCAR.js";import{a as L}from"./chunk-KGKDSOER.js";import{a as U}from"./chunk-6GTRAHWJ.js";import{b as H}from"./chunk-KQPDXXG3.js";import{c as B,l as G}from"./chunk-66N57DKF.js";import{a as A,b as w,c as M}from"./chunk-ARTSDUSS.js";import{a as n,b as l,c as Fe}from"./chunk-P37U34EQ.js";var D=l((Rn,V)=>{"use strict";function Pe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(Pe,"isObject");V.exports=Pe});var z=l((qn,X)=>{"use strict";var ke=typeof global=="object"&&global&&global.Object===Object&&global;X.exports=ke});var _=l((Fn,K)=>{"use strict";var we=z(),Me=typeof self=="object"&&self&&self.Object===Object&&self,Le=we||Me||Function("return this")();K.exports=Le});var Y=l((Pn,Q)=>{"use strict";var De=_(),_e=n(function(){return De.Date.now()},"now");Q.exports=_e});var ee=l((wn,Z)=>{"use strict";var $e=/\s/;function Ne(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}n(Ne,"trimmedEndIndex");Z.exports=Ne});var te=l((Ln,ne)=>{"use strict";var We=ee(),Be=/^\s+/;function Ae(e){return e&&e.slice(0,We(e)+1).replace(Be,"")}n(Ae,"baseTrim");ne.exports=Ae});var $=l((_n,re)=>{"use strict";var He=_(),Ge=He.Symbol;re.exports=Ge});var ae=l(($n,se)=>{"use strict";var oe=$(),ie=Object.prototype,Je=ie.hasOwnProperty,Ue=ie.toString,O=oe?oe.toStringTag:void 0;function Ve(e){var t=Je.call(e,O),r=e[O];try{e[O]=void 0;var i=!0}catch{}var c=Ue.call(e);return i&&(t?e[O]=r:delete e[O]),c}n(Ve,"getRawTag");se.exports=Ve});var ue=l((Wn,ce)=>{"use strict";var Xe=Object.prototype,ze=Xe.toString;function Ke(e){return ze.call(e)}n(Ke,"objectToString");ce.exports=Ke});var me=l((An,de)=>{"use strict";var fe=$(),Qe=ae(),Ye=ue(),Ze="[object Null]",en="[object Undefined]",le=fe?fe.toStringTag:void 0;function nn(e){return e==null?e===void 0?en:Ze:le&&le in Object(e)?Qe(e):Ye(e)}n(nn,"baseGetTag");de.exports=nn});var ge=l((Gn,pe)=>{"use strict";function tn(e){return e!=null&&typeof e=="object"}n(tn,"isObjectLike");pe.exports=tn});var ve=l((Un,be)=>{"use strict";var rn=me(),on=ge(),sn="[object Symbol]";function an(e){return typeof e=="symbol"||on(e)&&rn(e)==sn}n(an,"isSymbol");be.exports=an});var Te=l((Xn,Ce)=>{"use strict";var cn=te(),ye=D(),un=ve(),xe=NaN,fn=/^[-+]0x[0-9a-f]+$/i,ln=/^0b[01]+$/i,dn=/^0o[0-7]+$/i,mn=parseInt;function pn(e){if(typeof e=="number")return e;if(un(e))return xe;if(ye(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ye(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cn(e);var r=ln.test(e);return r||dn.test(e)?mn(e.slice(2),r?2:8):fn.test(e)?xe:+e}n(pn,"toNumber");Ce.exports=pn});var je=l((Kn,Se)=>{"use strict";var gn=D(),N=Y(),he=Te(),bn="Expected a function",vn=Math.max,yn=Math.min;function xn(e,t,r){var i,c,b,d,u,s,p=0,E=!1,f=!1,x=!0;if(typeof e!="function")throw new TypeError(bn);t=he(t)||0,gn(r)&&(E=!!r.leading,f="maxWait"in r,b=f?vn(he(r.maxWait)||0,t):b,x="trailing"in r?!!r.trailing:x);function C(o){var g=i,y=c;return i=c=void 0,p=o,d=e.apply(y,g),d}n(C,"invokeFunc");function R(o){return p=o,u=setTimeout(m,t),E?C(o):d}n(R,"leadingEdge");function q(o){var g=o-s,y=o-p,a=t-g;return f?yn(a,b-y):a}n(q,"remainingWait");function h(o){var g=o-s,y=o-p;return s===void 0||g>=t||g<0||f&&y>=b}n(h,"shouldInvoke");function m(){var o=N();if(h(o))return S(o);u=setTimeout(m,q(o))}n(m,"timerExpired");function S(o){return u=void 0,x&&i?C(o):(i=c=void 0,d)}n(S,"trailingEdge");function I(){u!==void 0&&clearTimeout(u),p=0,i=s=c=u=void 0}n(I,"cancel");function F(){return u===void 0?d:S(N())}n(F,"flush");function j(){var o=N(),g=h(o);if(i=arguments,c=this,s=o,g){if(u===void 0)return R(s);if(f)return clearTimeout(u),u=setTimeout(m,t),C(s)}return u===void 0&&(u=setTimeout(m,t)),d}return n(j,"debounced"),j.cancel=I,j.flush=F,j}n(xn,"debounce");Se.exports=xn});import{useState as hn,useCallback as Sn,useEffect as Re,useRef as jn}from"react";var Ee=Fe(je(),1);import{useCallback as Cn,useEffect as Tn,useRef as Oe}from"react";function W(e,t){let r=Oe(e);Tn(()=>{r.current=e},[e]);let i=Oe((0,Ee.default)(c=>{r.current(c)},t)).current;return Cn(c=>{i(c)},[i])}n(W,"useDebounce");import{Fragment as En,jsx as T,jsxs as Ie}from"react/jsx-runtime";var On=n(({description:e,showConversion:t,targetCurrency:r,className:i,onClick:c})=>{let{components:b}=H(),d=t?`Hide ${r} conversion`:`Show ${r} conversion`,u=b?.button||U;return Ie("span",{className:i,children:[T(G,{as:"span",children:e})," ",T(u,{className:`${i.replace("-description","-button")}`,"data-type":"inline",onClick:c,children:d})]})},"DescriptionWithConversion"),lt=n(({sourceCurrency:e,targetCurrency:t,mainFieldName:r,conversionFieldName:i,conversionProperties:c,classNamePrefix:b,description:d,conversionType:u="spread",...s})=>{let[p,E]=hn(!1),{setValue:f,watch:x}=B(),C=x(r||s.name),R=jn(!0),q=e&&t&&e!==t,{mutateAsync:h}=J({type:u}),m=`${s.name}_converted`;Re(()=>{f(m,r||s.name)},[f,r,s.name,m]),Re(()=>{if(R.current){R.current=!1;return}f(i,"")},[e,i,f]);let S=Sn(async(a,v,P)=>{if(!(!a||isNaN(a)||a<=0))return h({source_currency:v,target_currency:P,amount:a})},[h]),I=W(async a=>{let v=w(a),k=1/((await S(v,t,e))?.data?.data.conversion_data?.exchange_rate??1),qe=A(Number(v)*k);f(i,M(qe))},500),F=W(async a=>{let v=w(a),k=(await S(v,t,e))?.data?.data.conversion_data.target_amount;f(r||s.name,M(k))},500),j=n(a=>{f(m,r||s.name),p&&I(a.target.value)},"handleMainFieldChange"),o=n(a=>{f(m,i),F(a.target.value)},"handleConversionFieldChange"),g=n(a=>{a.preventDefault(),E(v=>!v),!p&&C&&I(C)},"toggleConversion"),y=q?T(On,{targetCurrency:t,description:d,showConversion:p,className:`${b}-description`,onClick:g}):d;return Ie(En,{children:[T(L,{...s,name:r||s.name,additionalProps:{currency:e},description:y,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:j}),p&&T(L,{additionalProps:{currency:t},name:i,label:c?.label||"Conversion",description:c?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:o}),T("input",{type:"hidden",name:m,value:x(m)||r||s.name})]})},"CurrencyConversionField");export{lt as a};
2
- //# sourceMappingURL=chunk-WCEHP5N7.js.map
1
+ import{l as J}from"./chunk-N3X274GT.js";import{a as L}from"./chunk-ZFKHCC4Z.js";import{a as U}from"./chunk-NFWNYW2E.js";import{b as H}from"./chunk-KQPDXXG3.js";import{c as B,l as G}from"./chunk-CR7AIZKA.js";import{a as A,b as w,c as M}from"./chunk-HRG5MSVG.js";import{a as n,b as l,c as Fe}from"./chunk-P37U34EQ.js";var D=l((Rn,V)=>{"use strict";function Pe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(Pe,"isObject");V.exports=Pe});var z=l((qn,X)=>{"use strict";var ke=typeof global=="object"&&global&&global.Object===Object&&global;X.exports=ke});var _=l((Fn,K)=>{"use strict";var we=z(),Me=typeof self=="object"&&self&&self.Object===Object&&self,Le=we||Me||Function("return this")();K.exports=Le});var Y=l((Pn,Q)=>{"use strict";var De=_(),_e=n(function(){return De.Date.now()},"now");Q.exports=_e});var ee=l((wn,Z)=>{"use strict";var $e=/\s/;function Ne(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}n(Ne,"trimmedEndIndex");Z.exports=Ne});var te=l((Ln,ne)=>{"use strict";var We=ee(),Be=/^\s+/;function Ae(e){return e&&e.slice(0,We(e)+1).replace(Be,"")}n(Ae,"baseTrim");ne.exports=Ae});var $=l((_n,re)=>{"use strict";var He=_(),Ge=He.Symbol;re.exports=Ge});var ae=l(($n,se)=>{"use strict";var oe=$(),ie=Object.prototype,Je=ie.hasOwnProperty,Ue=ie.toString,O=oe?oe.toStringTag:void 0;function Ve(e){var t=Je.call(e,O),r=e[O];try{e[O]=void 0;var i=!0}catch{}var c=Ue.call(e);return i&&(t?e[O]=r:delete e[O]),c}n(Ve,"getRawTag");se.exports=Ve});var ue=l((Wn,ce)=>{"use strict";var Xe=Object.prototype,ze=Xe.toString;function Ke(e){return ze.call(e)}n(Ke,"objectToString");ce.exports=Ke});var me=l((An,de)=>{"use strict";var fe=$(),Qe=ae(),Ye=ue(),Ze="[object Null]",en="[object Undefined]",le=fe?fe.toStringTag:void 0;function nn(e){return e==null?e===void 0?en:Ze:le&&le in Object(e)?Qe(e):Ye(e)}n(nn,"baseGetTag");de.exports=nn});var ge=l((Gn,pe)=>{"use strict";function tn(e){return e!=null&&typeof e=="object"}n(tn,"isObjectLike");pe.exports=tn});var ve=l((Un,be)=>{"use strict";var rn=me(),on=ge(),sn="[object Symbol]";function an(e){return typeof e=="symbol"||on(e)&&rn(e)==sn}n(an,"isSymbol");be.exports=an});var Te=l((Xn,Ce)=>{"use strict";var cn=te(),ye=D(),un=ve(),xe=NaN,fn=/^[-+]0x[0-9a-f]+$/i,ln=/^0b[01]+$/i,dn=/^0o[0-7]+$/i,mn=parseInt;function pn(e){if(typeof e=="number")return e;if(un(e))return xe;if(ye(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ye(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cn(e);var r=ln.test(e);return r||dn.test(e)?mn(e.slice(2),r?2:8):fn.test(e)?xe:+e}n(pn,"toNumber");Ce.exports=pn});var je=l((Kn,Se)=>{"use strict";var gn=D(),N=Y(),he=Te(),bn="Expected a function",vn=Math.max,yn=Math.min;function xn(e,t,r){var i,c,b,d,u,s,p=0,E=!1,f=!1,x=!0;if(typeof e!="function")throw new TypeError(bn);t=he(t)||0,gn(r)&&(E=!!r.leading,f="maxWait"in r,b=f?vn(he(r.maxWait)||0,t):b,x="trailing"in r?!!r.trailing:x);function C(o){var g=i,y=c;return i=c=void 0,p=o,d=e.apply(y,g),d}n(C,"invokeFunc");function R(o){return p=o,u=setTimeout(m,t),E?C(o):d}n(R,"leadingEdge");function q(o){var g=o-s,y=o-p,a=t-g;return f?yn(a,b-y):a}n(q,"remainingWait");function h(o){var g=o-s,y=o-p;return s===void 0||g>=t||g<0||f&&y>=b}n(h,"shouldInvoke");function m(){var o=N();if(h(o))return S(o);u=setTimeout(m,q(o))}n(m,"timerExpired");function S(o){return u=void 0,x&&i?C(o):(i=c=void 0,d)}n(S,"trailingEdge");function I(){u!==void 0&&clearTimeout(u),p=0,i=s=c=u=void 0}n(I,"cancel");function F(){return u===void 0?d:S(N())}n(F,"flush");function j(){var o=N(),g=h(o);if(i=arguments,c=this,s=o,g){if(u===void 0)return R(s);if(f)return clearTimeout(u),u=setTimeout(m,t),C(s)}return u===void 0&&(u=setTimeout(m,t)),d}return n(j,"debounced"),j.cancel=I,j.flush=F,j}n(xn,"debounce");Se.exports=xn});import{useState as hn,useCallback as Sn,useEffect as Re,useRef as jn}from"react";var Ee=Fe(je(),1);import{useCallback as Cn,useEffect as Tn,useRef as Oe}from"react";function W(e,t){let r=Oe(e);Tn(()=>{r.current=e},[e]);let i=Oe((0,Ee.default)(c=>{r.current(c)},t)).current;return Cn(c=>{i(c)},[i])}n(W,"useDebounce");import{Fragment as En,jsx as T,jsxs as Ie}from"react/jsx-runtime";var On=n(({description:e,showConversion:t,targetCurrency:r,className:i,onClick:c})=>{let{components:b}=H(),d=t?`Hide ${r} conversion`:`Show ${r} conversion`,u=b?.button||U;return Ie("span",{className:i,children:[T(G,{as:"span",children:e})," ",T(u,{className:`${i.replace("-description","-button")}`,"data-type":"inline",onClick:c,children:d})]})},"DescriptionWithConversion"),lt=n(({sourceCurrency:e,targetCurrency:t,mainFieldName:r,conversionFieldName:i,conversionProperties:c,classNamePrefix:b,description:d,conversionType:u="spread",...s})=>{let[p,E]=hn(!1),{setValue:f,watch:x}=B(),C=x(r||s.name),R=jn(!0),q=e&&t&&e!==t,{mutateAsync:h}=J({type:u}),m=`${s.name}_converted`;Re(()=>{f(m,r||s.name)},[f,r,s.name,m]),Re(()=>{if(R.current){R.current=!1;return}f(i,"")},[e,i,f]);let S=Sn(async(a,v,P)=>{if(!(!a||isNaN(a)||a<=0))return h({source_currency:v,target_currency:P,amount:a})},[h]),I=W(async a=>{let v=w(a),k=1/((await S(v,t,e))?.data?.data.conversion_data?.exchange_rate??1),qe=A(Number(v)*k);f(i,M(qe))},500),F=W(async a=>{let v=w(a),k=(await S(v,t,e))?.data?.data.conversion_data.target_amount;f(r||s.name,M(k))},500),j=n(a=>{f(m,r||s.name),p&&I(a.target.value)},"handleMainFieldChange"),o=n(a=>{f(m,i),F(a.target.value)},"handleConversionFieldChange"),g=n(a=>{a.preventDefault(),E(v=>!v),!p&&C&&I(C)},"toggleConversion"),y=q?T(On,{targetCurrency:t,description:d,showConversion:p,className:`${b}-description`,onClick:g}):d;return Ie(En,{children:[T(L,{...s,name:r||s.name,additionalProps:{currency:e},description:y,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:j}),p&&T(L,{additionalProps:{currency:t},name:i,label:c?.label||"Conversion",description:c?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:o}),T("input",{type:"hidden",name:m,value:x(m)||r||s.name})]})},"CurrencyConversionField");export{lt as a};
2
+ //# sourceMappingURL=chunk-7FMFSOJ3.js.map
@@ -1,2 +1,2 @@
1
- import{b as v}from"./chunk-PGWKJ6FK.js";import{d as l,e as p}from"./chunk-5LSHRCAR.js";import{a as s}from"./chunk-2YTBWEC7.js";import{a as y}from"./chunk-6GTRAHWJ.js";import{b as c}from"./chunk-KQPDXXG3.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as _}from"react/jsx-runtime";function A({onSubmit:f,onSuccess:a,onError:t,render:w,...o}){let{components:E}=c(),{onboardingBag:r,setCreditScore:m}=v(),d=l(),u=p(),{mutateAsync:R}=s(d),{mutateAsync:g}=s(u),S=i(async()=>{try{if(await f?.(),r.creditRiskStatus==="deposit_required"&&r.employmentId&&r.employment?.status&&!r.isEmploymentReadOnly){let e=await g({employment_slug:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),m?.(n=>({...n,showReserveInvoice:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(r.employmentId){let e=await R({employment_id:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"invited"}),m?.(n=>({...n,showInviteSuccessful:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){t?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),I=r.creditRiskStatus==="deposit_required"&&r.employment?.status&&!r.isEmploymentReadOnly,b=E?.button||y;return _(b,{...o,disabled:d.isPending||u.isPending||o.disabled,onClick:e=>{S(),o.onClick?.(e)},children:w({employmentStatus:I?"created_awaiting_reserve":"invited"})})}i(A,"OnboardingInvite");export{A as a};
2
- //# sourceMappingURL=chunk-C4DLDK36.js.map
1
+ import{b as v}from"./chunk-PGWKJ6FK.js";import{d as l,e as p}from"./chunk-N3X274GT.js";import{a as s}from"./chunk-2YTBWEC7.js";import{a as y}from"./chunk-NFWNYW2E.js";import{b as c}from"./chunk-KQPDXXG3.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as _}from"react/jsx-runtime";function A({onSubmit:f,onSuccess:a,onError:t,render:w,...o}){let{components:E}=c(),{onboardingBag:r,setCreditScore:m}=v(),d=l(),u=p(),{mutateAsync:R}=s(d),{mutateAsync:g}=s(u),S=i(async()=>{try{if(await f?.(),r.creditRiskStatus==="deposit_required"&&r.employmentId&&r.employment?.status&&!r.isEmploymentReadOnly){let e=await g({employment_slug:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),m?.(n=>({...n,showReserveInvoice:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(r.employmentId){let e=await R({employment_id:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"invited"}),m?.(n=>({...n,showInviteSuccessful:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){t?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),I=r.creditRiskStatus==="deposit_required"&&r.employment?.status&&!r.isEmploymentReadOnly,b=E?.button||y;return _(b,{...o,disabled:d.isPending||u.isPending||o.disabled,onClick:e=>{S(),o.onClick?.(e)},children:w({employmentStatus:I?"created_awaiting_reserve":"invited"})})}i(A,"OnboardingInvite");export{A as a};
2
+ //# sourceMappingURL=chunk-7JDWTTYE.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-LG2LVO4C.js";import{a}from"./chunk-Y2NSR2N6.js";import{a as c}from"./chunk-DV6PCBAX.js";import{a as e}from"./chunk-F3KEIVSE.js";import{a as m}from"./chunk-KKGRYDZA.js";import{a as o}from"./chunk-TVZAFTPT.js";import{a as n}from"./chunk-P37U34EQ.js";import{useId as f}from"react";import{jsx as s}from"react/jsx-runtime";function k({employmentId:d,countryCode:C,options:p,render:A}){let t=c({employmentId:d,countryCode:C,options:p}),i=f();return s(o.Provider,{value:{formId:i,contractAmendmentBag:t},children:A({contractAmendmentBag:t,components:{Form:r,SubmitButton:a,ConfirmationForm:m,BackButton:e}})})}n(k,"ContractAmendmentFlow");export{k as a};
2
- //# sourceMappingURL=chunk-3Z6AFLXW.js.map
1
+ import{a as r}from"./chunk-WLN6G3TE.js";import{a}from"./chunk-OKMERBJL.js";import{a as c}from"./chunk-QKKAJK3A.js";import{a as e}from"./chunk-PC5JG4TT.js";import{a as m}from"./chunk-K3XVYHGV.js";import{a as o}from"./chunk-TVZAFTPT.js";import{a as n}from"./chunk-P37U34EQ.js";import{useId as f}from"react";import{jsx as s}from"react/jsx-runtime";function k({employmentId:d,countryCode:C,options:p,render:A}){let t=c({employmentId:d,countryCode:C,options:p}),i=f();return s(o.Provider,{value:{formId:i,contractAmendmentBag:t},children:A({contractAmendmentBag:t,components:{Form:r,SubmitButton:a,ConfirmationForm:m,BackButton:e}})})}n(k,"ContractAmendmentFlow");export{k as a};
2
+ //# sourceMappingURL=chunk-7XKEJ5Y6.js.map
@@ -1,2 +1,2 @@
1
- import{b as e}from"./chunk-LKMPZJIW.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as t}from"react/jsx-runtime";var a=n(({involuntaryOffboardingServiceChargeZendeskId:r,reconciliationInvoiceZendeskId:i})=>t("p",{className:"RemoteFlows__AcknowledgeInformationFees text-xs text-[#71717A]",children:["You'll receive an"," ",o(e,{zendeskId:r,className:"align-baseline",children:"involuntary offboarding service charge \u2197"})," ","on your"," ",o(e,{zendeskId:i,children:"reconciliation invoice \u2197"})]}),"AcknowledgeInformationFees");export{a};
2
- //# sourceMappingURL=chunk-Z6TCBVRG.js.map
1
+ import{b as e}from"./chunk-EGSUF7OD.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as t}from"react/jsx-runtime";var a=n(({involuntaryOffboardingServiceChargeZendeskId:r,reconciliationInvoiceZendeskId:i})=>t("p",{className:"RemoteFlows__AcknowledgeInformationFees text-xs text-[#71717A]",children:["You'll receive an"," ",o(e,{zendeskId:r,className:"align-baseline",children:"involuntary offboarding service charge \u2197"})," ","on your"," ",o(e,{zendeskId:i,children:"reconciliation invoice \u2197"})]}),"AcknowledgeInformationFees");export{a};
2
+ //# sourceMappingURL=chunk-A5NDO6CQ.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-TOA3JILU.js";import{a as l}from"./chunk-EYQ4PYUT.js";import{b as s}from"./chunk-LNV36S6D.js";import{f as m,g as d}from"./chunk-66N57DKF.js";import{a as e}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as p}from"react/jsx-runtime";import{createElement as P}from"react";function B({defaultValues:i,onSubmit:F,components:u}){let{formId:y,contractorOnboardingBag:o}=c(),b=s(o.handleValidation),r=m({resolver:b,defaultValues:i,shouldUnregister:!1,mode:"onBlur"});f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),f(()=>{let n=r?.watch(t=>{Object.keys(t).some(a=>t[a]!==i[a])&&o?.checkFieldUpdates(t)});return()=>n?.unsubscribe()},[]);let g=e(async n=>{F(n)},"handleSubmit");return P(d,{...r,key:`form-${o.stepState.currentStep.name}`},p("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:p(l,{components:u,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}e(B,"ContractorOnboardingForm");export{B as a};
2
- //# sourceMappingURL=chunk-7COHIUGW.js.map
1
+ import{b as c}from"./chunk-TOA3JILU.js";import{a as l}from"./chunk-4FW2VTO4.js";import{b as s}from"./chunk-LNV36S6D.js";import{f as m,g as d}from"./chunk-CR7AIZKA.js";import{a as e}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as p}from"react/jsx-runtime";import{createElement as P}from"react";function B({defaultValues:i,onSubmit:F,components:u}){let{formId:y,contractorOnboardingBag:o}=c(),b=s(o.handleValidation),r=m({resolver:b,defaultValues:i,shouldUnregister:!1,mode:"onBlur"});f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),f(()=>{let n=r?.watch(t=>{Object.keys(t).some(a=>t[a]!==i[a])&&o?.checkFieldUpdates(t)});return()=>n?.unsubscribe()},[]);let g=e(async n=>{await F(n)},"handleSubmit");return P(d,{...r,key:`form-${o.stepState.currentStep.name}`},p("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:p(l,{components:u,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}e(B,"ContractorOnboardingForm");export{B as a};
2
+ //# sourceMappingURL=chunk-AJ5SXKFO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/components/ContractorOnboardingForm.tsx"],"sourcesContent":["import { JSFFields } from '@/src/types/remoteFlows';\nimport { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/validationResolver';\nimport { BasicInformationFormPayload } from '@/src/flows/Onboarding/types';\nimport { Components } from '@/src/types/remoteFlows';\nimport { useContractorOnboardingContext } from '@/src/flows/ContractorOnboarding/context';\nimport { useEffect } from 'react';\nimport { PricingPlanFormPayload } from '@/src/flows/ContractorOnboarding/types';\nimport { ContractorOnboardingContractDetailsFormPayload } from '@/src/flows/ContractorOnboarding/types';\n\ntype ContractorOnboardingFormProps = {\n onSubmit: (\n payload:\n | BasicInformationFormPayload\n | PricingPlanFormPayload\n | ContractorOnboardingContractDetailsFormPayload,\n ) => Promise<void>;\n components?: Components;\n fields?: JSFFields;\n defaultValues: Record<string, unknown>;\n};\n\nexport function ContractorOnboardingForm({\n defaultValues,\n onSubmit,\n components,\n}: ContractorOnboardingFormProps) {\n const { formId, contractorOnboardingBag } = useContractorOnboardingContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n contractorOnboardingBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n // When the employmentId is set,\n // we need to run the checkFieldUpdates to update fieldValues in useStepState\n if (contractorOnboardingBag.employmentId) {\n contractorOnboardingBag?.checkFieldUpdates(form.getValues());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof unknown] !== defaultValues[key as keyof unknown],\n );\n if (isAnyFieldDirty) {\n contractorOnboardingBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (values: Record<string, unknown>) => {\n await onSubmit(values);\n };\n\n return (\n <Form\n {...form}\n key={`form-${contractorOnboardingBag.stepState.currentStep.name}`}\n >\n <form\n id={formId}\n onSubmit={form.handleSubmit(handleSubmit)}\n className='space-y-4 RemoteFlows__OnboardingForm'\n >\n <JSONSchemaFormFields\n components={components}\n fields={contractorOnboardingBag.fields}\n fieldsets={contractorOnboardingBag.meta.fieldsets}\n fieldValues={contractorOnboardingBag.fieldValues}\n />\n </form>\n </Form>\n );\n}\n"],"mappings":"+MAQA,OAAS,aAAAA,MAAiB,QAuElB,cAAAC,MAAA,oBATJ,wBAAAC,MAAA,QA9CG,SAASC,EAAyB,CACvC,cAAAC,EACA,SAAAC,EACA,WAAAC,CACF,EAAkC,CAChC,GAAM,CAAE,OAAAC,EAAQ,wBAAAC,CAAwB,EAAIC,EAA+B,EAErEC,EAAWC,EACfH,EAAwB,gBAC1B,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAAN,EACA,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDU,EAAU,IAAM,CAGVN,EAAwB,cAC1BA,GAAyB,kBAAkBI,EAAK,UAAU,CAAC,CAG/D,EAAG,CAAC,CAAC,EAELE,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAoB,IAAMb,EAAca,CAAoB,CACvE,GAEET,GAAyB,kBAAkBQ,CAAM,CAErD,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAeC,EAAA,MAAOH,GAAoC,CAC9D,MAAMX,EAASW,CAAM,CACvB,EAFqB,gBAIrB,OACEd,EAACkB,EAAA,CACE,GAAGR,EACJ,IAAK,QAAQJ,EAAwB,UAAU,YAAY,IAAI,IAE/DP,EAAC,QACC,GAAIM,EACJ,SAAUK,EAAK,aAAaM,CAAY,EACxC,UAAU,wCAEV,SAAAjB,EAACoB,EAAA,CACC,WAAYf,EACZ,OAAQE,EAAwB,OAChC,UAAWA,EAAwB,KAAK,UACxC,YAAaA,EAAwB,YACvC,EACF,CACF,CAEJ,CAhEgBW,EAAAhB,EAAA","names":["useEffect","jsx","createElement","ContractorOnboardingForm","defaultValues","onSubmit","components","formId","contractorOnboardingBag","useContractorOnboardingContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","handleSubmit","__name","Form","JSONSchemaFormFields"]}
@@ -0,0 +1,2 @@
1
+ import{a as l}from"./chunk-P5QKSFOE.js";import{A as C,D as d,H as p,j as u,q as c,v as m}from"./chunk-T6Q7IALZ.js";import{d as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as a,useQuery as r}from"@tanstack/react-query";var h=t(({includePremiumBenefits:e})=>{let{client:i}=o();return r({queryKey:["cost-calculator-countries",e],queryFn:t(()=>m({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(s=>s.data?.data.filter(n=>n.availability==="active").map(n=>({value:n.region_slug,label:n.name,childRegions:n.child_regions,hasAdditionalFields:n.has_additional_fields,regionSlug:n.region_slug,currency:n.currency.code})),"select")})},"useCostCalculatorCountries"),q=t(()=>{let{client:e}=o();return r({queryKey:["company-currencies"],queryFn:t(()=>p({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(s=>({value:s.slug,label:s.code})),"select")})},"useCompanyCurrencies"),x=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),P=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>c({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),v=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>d({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),S=t((e,{includePremiumBenefits:i,options:s})=>{let{client:n}=o();return r({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>C({client:n,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:f})=>{let y=f?.data?.schema||{};return l(y,void 0,s)},"select")})},"useRegionFields");export{h as a,q as b,x as c,P as d,v as e,S as f};
2
+ //# sourceMappingURL=chunk-ARQ2PTEA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/api.ts"],"sourcesContent":["import { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport {\n CostCalculatorEstimateParams,\n getIndexCompanyCurrency,\n getIndexCountry,\n getShowRegionField,\n postCreateEstimation,\n postCreateEstimationCsv,\n postCreateEstimationPdf,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { useClient } from '@/src/context';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { CostCalculatorEstimationOptions } from '@/src/flows/CostCalculator/types';\nimport { JSFModify } from '@/src/flows/types';\n\n/**\n * Hook to fetch the countries for the cost calculator.\n * @returns\n */\nexport const useCostCalculatorCountries = ({\n includePremiumBenefits,\n}: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['cost-calculator-countries', includePremiumBenefits],\n queryFn: () => {\n return getIndexCountry({\n client: client as Client,\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n select: (data) =>\n data.data?.data\n .filter((country) => country.availability === 'active')\n .map((country) => ({\n value: country.region_slug,\n label: country.name,\n childRegions: country.child_regions,\n hasAdditionalFields: country.has_additional_fields,\n regionSlug: country.region_slug,\n currency: country.currency.code,\n })),\n });\n};\n\n/**\n * Hook to fetch the company currencies.\n * @returns\n */\nexport const useCompanyCurrencies = () => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['company-currencies'],\n queryFn: () => {\n return getIndexCompanyCurrency({\n client: client as Client,\n });\n },\n select: (data) =>\n data.data?.data?.company_currencies.map((currency) => ({\n value: currency.slug,\n label: currency.code,\n })),\n });\n};\n\n/**\n * Hook to create an estimation.\n * @returns\n */\nexport const useCostCalculatorEstimation = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimation({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a PDF estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationPdf = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationPdf({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a CSV estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationCsv = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationCsv({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Hook to fetch the region fields.\n * @param region\n * @returns\n */\nexport const useRegionFields = (\n region: string | undefined,\n {\n includePremiumBenefits,\n options,\n }: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n options?: {\n jsfModify?: JSFModify;\n };\n },\n) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['cost-calculator-region-fields', region, includePremiumBenefits],\n queryFn: () => {\n return getShowRegionField({\n client: client as Client,\n path: { slug: region as string },\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n enabled: !!region,\n select: ({ data }) => {\n const jsfSchema = data?.data?.schema || {};\n return createHeadlessForm(jsfSchema, undefined, options);\n },\n });\n};\n"],"mappings":"mMAYA,OAAS,eAAAA,EAAa,YAAAC,MAAgB,wBAQ/B,IAAMC,EAA6BC,EAAA,CAAC,CACzC,uBAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,4BAA6BH,CAAsB,EAC9D,QAASD,EAAA,IACAK,EAAgB,CACrB,OAAQH,EACR,MAAO,CACL,yBAA0BD,CAC5B,CACF,CAAC,EANM,WAQT,OAAQD,EAACM,GACPA,EAAK,MAAM,KACR,OAAQC,GAAYA,EAAQ,eAAiB,QAAQ,EACrD,IAAKA,IAAa,CACjB,MAAOA,EAAQ,YACf,MAAOA,EAAQ,KACf,aAAcA,EAAQ,cACtB,oBAAqBA,EAAQ,sBAC7B,WAAYA,EAAQ,YACpB,SAAUA,EAAQ,SAAS,IAC7B,EAAE,EAVE,SAWV,CAAC,CACH,EA5B0C,8BAkC7BC,EAAuBR,EAAA,IAAM,CACxC,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,oBAAoB,EAC/B,QAASJ,EAAA,IACAS,EAAwB,CAC7B,OAAQP,CACV,CAAC,EAHM,WAKT,OAAQF,EAACM,GACPA,EAAK,MAAM,MAAM,mBAAmB,IAAKI,IAAc,CACrD,MAAOA,EAAS,KAChB,MAAOA,EAAS,IAClB,EAAE,EAJI,SAKV,CAAC,CACH,EAhBoC,wBAsBvBC,EAA8BX,EAAA,IAAM,CAC/C,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJC,EAAqB,CAC1B,OAAQZ,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAX2C,+BAkB9BE,EAAiCf,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJG,EAAwB,CAC7B,OAAQd,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAX8C,kCAkBjCI,EAAiCjB,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAC7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJK,EAAwB,CAC7B,OAAQhB,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAV8C,kCAiBjCM,EAAkBnB,EAAA,CAC7BoB,EACA,CACE,uBAAAnB,EACA,QAAAoB,CACF,IAMG,CACH,GAAM,CAAE,OAAAnB,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,gCAAiCgB,EAAQnB,CAAsB,EAC1E,QAASD,EAAA,IACAsB,EAAmB,CACxB,OAAQpB,EACR,KAAM,CAAE,KAAMkB,CAAiB,EAC/B,MAAO,CACL,yBAA0BnB,CAC5B,CACF,CAAC,EAPM,WAST,QAAS,CAAC,CAACmB,EACX,OAAQpB,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAM,CACpB,IAAMiB,EAAYjB,GAAM,MAAM,QAAU,CAAC,EACzC,OAAOkB,EAAmBD,EAAW,OAAWF,CAAO,CACzD,EAHQ,SAIV,CAAC,CACH,EA/B+B","names":["useMutation","useQuery","useCostCalculatorCountries","__name","includePremiumBenefits","client","useClient","useQuery","getIndexCountry","data","country","useCompanyCurrencies","getIndexCompanyCurrency","currency","useCostCalculatorEstimation","useMutation","payload","postCreateEstimation","useCostCalculatorEstimationPdf","postCreateEstimationPdf","useCostCalculatorEstimationCsv","postCreateEstimationCsv","useRegionFields","region","options","getShowRegionField","jsfSchema","createHeadlessForm"]}
@@ -1,2 +1,2 @@
1
- import{a as n,b as i}from"./chunk-LKMPZJIW.js";import{a as e}from"./chunk-L3Z2G32A.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as m,jsx as t,jsxs as s}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(()=>s(m,{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(i,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:n.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-UA6MNQLD.js.map
1
+ import{a as n,b as i}from"./chunk-EGSUF7OD.js";import{a as e}from"./chunk-UQCSN47K.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as m,jsx as t,jsxs as s}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(()=>s(m,{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(i,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:n.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-BNBEIHLD.js.map
@@ -1,2 +1,2 @@
1
- import{b as r}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-6GTRAHWJ.js";import{b as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function g({children:e,onClick:i,...s}){let{onboardingBag:{back:u,isEmploymentReadOnly:m}}=r(),{components:a}=o(),c=t(B=>{m||u(),i?.(B)},"onBackHandler"),p=a?.button||n;return d(p,{...s,onClick:c,children:e})}t(g,"OnboardingBack");export{g as a};
2
- //# sourceMappingURL=chunk-Y5P5IJRN.js.map
1
+ import{b as r}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-NFWNYW2E.js";import{b as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function g({children:e,onClick:i,...s}){let{onboardingBag:{back:u,isEmploymentReadOnly:m}}=r(),{components:a}=o(),c=t(B=>{m||u(),i?.(B)},"onBackHandler"),p=a?.button||n;return d(p,{...s,onClick:c,children:e})}t(g,"OnboardingBack");export{g as a};
2
+ //# sourceMappingURL=chunk-BPIGB72P.js.map