@remoteoss/remote-flows 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/README.md +1 -1
  2. package/dist/{utils-CjDMg_Yr.d.ts → ZendeskTriggerButton-FSCvhzTG.d.ts} +10 -1
  3. package/dist/{chunk-2NGJN5IE.js → chunk-2M7EBC4K.js} +2 -2
  4. package/dist/chunk-2YTBWEC7.js +2 -0
  5. package/dist/chunk-2YTBWEC7.js.map +1 -0
  6. package/dist/chunk-347YWDTK.js +2 -0
  7. package/dist/chunk-347YWDTK.js.map +1 -0
  8. package/dist/chunk-3O3Q24JL.js +2 -0
  9. package/dist/chunk-3O3Q24JL.js.map +1 -0
  10. package/dist/{chunk-A6X6N2G7.js → chunk-4DCENNLW.js} +2 -2
  11. package/dist/{chunk-NHYBFEXA.js → chunk-4M4OJPUA.js} +2 -2
  12. package/dist/{chunk-QU3NSFU5.js → chunk-4SIGN3ZP.js} +2 -2
  13. package/dist/chunk-4T6PRR6R.js +2 -0
  14. package/dist/{chunk-DKA2EUPQ.js.map → chunk-4T6PRR6R.js.map} +1 -1
  15. package/dist/{chunk-JX3OQNNM.js → chunk-4URY37KB.js} +2 -2
  16. package/dist/{chunk-FVFXPT3Y.js → chunk-5XHKOMX5.js} +2 -2
  17. package/dist/{chunk-C4AVUIG2.js → chunk-5ZR7EFPY.js} +2 -2
  18. package/dist/chunk-6U2UCWVR.js +2 -0
  19. package/dist/chunk-6U2UCWVR.js.map +1 -0
  20. package/dist/{chunk-5N4L2G7Q.js → chunk-6VRUYYUV.js} +2 -2
  21. package/dist/{chunk-GLUERRJ2.js → chunk-A7HJICVX.js} +2 -2
  22. package/dist/{chunk-EIVHHLR5.js → chunk-A7T27JCJ.js} +2 -2
  23. package/dist/{chunk-C4SMHWP4.js → chunk-ANGJCT4I.js} +2 -2
  24. package/dist/{chunk-QP36XXCQ.js → chunk-BDPCUDJB.js} +2 -2
  25. package/dist/{chunk-22JS3T6G.js → chunk-BGU3LZ2S.js} +2 -2
  26. package/dist/chunk-BJOF6IEZ.js +2 -0
  27. package/dist/chunk-BJOF6IEZ.js.map +1 -0
  28. package/dist/{chunk-DHJZVBVD.js → chunk-BMDZJNJV.js} +2 -2
  29. package/dist/{chunk-WEYUB6DC.js → chunk-BVN2DKO5.js} +2 -2
  30. package/dist/{chunk-2VWU5VNU.js → chunk-C2BBQDCU.js} +2 -2
  31. package/dist/{chunk-D5KITGC6.js → chunk-D5RCRFJM.js} +2 -2
  32. package/dist/{chunk-QIAZQLSG.js → chunk-DPY77ASH.js} +2 -2
  33. package/dist/{chunk-XHOQSIXZ.js → chunk-DYWOG7Q2.js} +2 -2
  34. package/dist/{chunk-TGUF5Q7J.js → chunk-EFPZOIQ2.js} +2 -2
  35. package/dist/{chunk-BPJHPGTL.js → chunk-EKKRQI6B.js} +2 -2
  36. package/dist/{chunk-V2PJW577.js → chunk-EZV6DOVQ.js} +2 -2
  37. package/dist/chunk-EZWZMPD2.js +2 -0
  38. package/dist/chunk-EZWZMPD2.js.map +1 -0
  39. package/dist/{chunk-ULHGAKFT.js → chunk-GGXK727I.js} +2 -2
  40. package/dist/{chunk-OOUYQLIE.js → chunk-HFI2MD3H.js} +2 -2
  41. package/dist/{chunk-MRVBOQLW.js → chunk-HLPKGITX.js} +2 -2
  42. package/dist/{chunk-T6BYBXQA.js → chunk-ISZQNKMD.js} +2 -2
  43. package/dist/{chunk-J26AI33Z.js → chunk-IUJXAZHK.js} +2 -2
  44. package/dist/{chunk-VE36I6G6.js → chunk-IUZ7DEXC.js} +2 -2
  45. package/dist/{chunk-XTLLWD7O.js → chunk-KPTF6LPP.js} +2 -2
  46. package/dist/{chunk-GECFDGI7.js → chunk-KYSKA2UK.js} +2 -2
  47. package/dist/{chunk-5QP2BAUT.js → chunk-L2BJK3K5.js} +2 -2
  48. package/dist/chunk-LRGEEPGK.js +2 -0
  49. package/dist/{chunk-VXPJXQP3.js.map → chunk-LRGEEPGK.js.map} +1 -1
  50. package/dist/{chunk-XICA45G2.js → chunk-MP2T74PU.js} +2 -2
  51. package/dist/{chunk-GUHBW4V3.js → chunk-NVYMAOQ7.js} +2 -2
  52. package/dist/{chunk-V6I3EMYX.js → chunk-NYEZAOUI.js} +2 -2
  53. package/dist/{chunk-X5DMQNEM.js → chunk-NYM7QGN2.js} +2 -2
  54. package/dist/{chunk-2U4VW5TT.js → chunk-O5MKPE6I.js} +2 -2
  55. package/dist/{chunk-2GCMLKO2.js → chunk-O7REUCKR.js} +2 -2
  56. package/dist/{chunk-JG7FV7OZ.js → chunk-OEAHDUWE.js} +2 -2
  57. package/dist/{chunk-IUU4MOLL.js → chunk-OIN3HGOQ.js} +2 -2
  58. package/dist/{chunk-D52VU4UO.js → chunk-OW5QGJD4.js} +2 -2
  59. package/dist/{chunk-BVCBX72U.js → chunk-P5WUODPR.js} +2 -2
  60. package/dist/chunk-Q3A4A2HL.js +2 -0
  61. package/dist/{chunk-XKSAKI3P.js → chunk-Q4BKFSTW.js} +2 -2
  62. package/dist/{chunk-GOB6DUFS.js → chunk-QIQTM4HB.js} +1 -1
  63. package/dist/chunk-QIQTM4HB.js.map +1 -0
  64. package/dist/{chunk-MFKGLMRJ.js → chunk-QKLIYOMA.js} +2 -2
  65. package/dist/chunk-QKLIYOMA.js.map +1 -0
  66. package/dist/{chunk-5EP45OQV.js → chunk-RC3XP5WU.js} +2 -2
  67. package/dist/chunk-REDYWUCC.js +2 -0
  68. package/dist/chunk-REDYWUCC.js.map +1 -0
  69. package/dist/{chunk-2WDEVWIE.js → chunk-RINDVT6U.js} +2 -2
  70. package/dist/{chunk-3I6ONATN.js → chunk-RQXKQTRD.js} +2 -2
  71. package/dist/{chunk-IK6IRESD.js → chunk-SHF5L3PW.js} +2 -2
  72. package/dist/{chunk-6L7JELHX.js → chunk-UIO6B4GN.js} +2 -2
  73. package/dist/{chunk-RJGWAZBE.js → chunk-UPXJJBXZ.js} +2 -2
  74. package/dist/{chunk-K4NAASBM.js → chunk-UTBVLDKY.js} +2 -2
  75. package/dist/{chunk-PJUC5WAJ.js → chunk-VUP76ZMQ.js} +2 -2
  76. package/dist/{chunk-5SKMAYLG.js → chunk-VYDVPM5S.js} +2 -2
  77. package/dist/{chunk-KJSZIASL.js → chunk-WFMQ2IDE.js} +2 -2
  78. package/dist/{chunk-TWD2IDAS.js → chunk-WNXB2Y65.js} +2 -2
  79. package/dist/chunk-WVDTHFGS.js +2 -0
  80. package/dist/chunk-WVDTHFGS.js.map +1 -0
  81. package/dist/{chunk-CHQK23RH.js → chunk-YPHOFQ5O.js} +2 -2
  82. package/dist/{chunk-CHQK23RH.js.map → chunk-YPHOFQ5O.js.map} +1 -1
  83. package/dist/{chunk-7EDGHYMX.js → chunk-ZQ6MG635.js} +2 -2
  84. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  85. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  86. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  87. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  88. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  89. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  90. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  91. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  92. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  93. package/dist/flows/ContractAmendment/hooks.js +1 -1
  94. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  95. package/dist/flows/ContractAmendment/index.js +1 -1
  96. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  97. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  98. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  99. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  100. package/dist/flows/ContractorOnboarding/api.js +1 -1
  101. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  102. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  103. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  104. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  105. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  106. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  107. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  108. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  109. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  110. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  111. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  112. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  113. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  114. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  115. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  116. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  117. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  118. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  119. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  120. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  121. package/dist/flows/ContractorOnboarding/index.js +1 -1
  122. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  123. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  124. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  125. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  126. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  127. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  128. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  129. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  130. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  131. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  132. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  133. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  134. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  135. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  136. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  137. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  138. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  139. package/dist/flows/CostCalculator/api.d.ts +1 -1
  140. package/dist/flows/CostCalculator/api.js +1 -1
  141. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  142. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  143. package/dist/flows/CostCalculator/context.d.ts +3 -3
  144. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  145. package/dist/flows/CostCalculator/hooks.js +1 -1
  146. package/dist/flows/CostCalculator/index.d.ts +3 -3
  147. package/dist/flows/CostCalculator/index.js +1 -1
  148. package/dist/flows/CostCalculator/types.d.ts +1 -1
  149. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  150. package/dist/flows/CostCalculator/utils.js +1 -1
  151. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  152. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  153. package/dist/flows/Onboarding/api.d.ts +6 -6
  154. package/dist/flows/Onboarding/api.js +1 -1
  155. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  156. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  157. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  158. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  159. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  160. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  161. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  162. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  163. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  164. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  165. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  166. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  167. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  168. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  169. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  170. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  171. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  172. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  173. package/dist/flows/Onboarding/context.d.ts +4 -4
  174. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  175. package/dist/flows/Onboarding/hooks.js +1 -1
  176. package/dist/flows/Onboarding/index.d.ts +4 -4
  177. package/dist/flows/Onboarding/index.js +1 -1
  178. package/dist/flows/Onboarding/types.d.ts +4 -4
  179. package/dist/flows/Onboarding/utils.d.ts +4 -4
  180. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -5
  181. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  182. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -5
  183. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  184. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -5
  185. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  186. package/dist/flows/Termination/TerminationBack.js +1 -1
  187. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -5
  188. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  189. package/dist/flows/Termination/TerminationFlow.d.ts +4 -5
  190. package/dist/flows/Termination/TerminationFlow.js +1 -1
  191. package/dist/flows/Termination/TerminationForm.d.ts +4 -5
  192. package/dist/flows/Termination/TerminationForm.js +1 -1
  193. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  194. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +19 -0
  195. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +2 -0
  196. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +19 -0
  197. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +2 -0
  198. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -0
  199. package/dist/flows/Termination/components/PaidTimeOff/types.js +1 -0
  200. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +2 -0
  201. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js.map +1 -0
  202. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +2 -0
  203. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js.map +1 -0
  204. package/dist/flows/Termination/context.d.ts +4 -5
  205. package/dist/flows/Termination/hooks.d.ts +4 -5
  206. package/dist/flows/Termination/hooks.js +1 -1
  207. package/dist/flows/Termination/index.d.ts +10 -7
  208. package/dist/flows/Termination/index.js +1 -1
  209. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +10 -0
  210. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  211. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +10 -0
  212. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  213. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  214. package/dist/flows/Termination/types.d.ts +4 -5
  215. package/dist/flows/api.d.ts +4 -5
  216. package/dist/flows/api.js +1 -1
  217. package/dist/flows/types.d.ts +1 -1
  218. package/dist/index.css +1 -1
  219. package/dist/index.css.map +1 -1
  220. package/dist/index.d.ts +15 -38
  221. package/dist/index.js +1 -1
  222. package/dist/index.js.map +1 -1
  223. package/dist/internals.d.ts +45 -53
  224. package/dist/internals.js +1 -1
  225. package/dist/{mutations-BxS-iGnr.d.ts → mutations-CAhYrKGA.d.ts} +1 -1
  226. package/dist/{remoteFlows-DnbCoINb.d.ts → remoteFlows-HxRw2Djx.d.ts} +10 -2
  227. package/dist/types-1R2vg9SL.d.ts +179 -0
  228. package/dist/{types-BnLDzD9Z.d.ts → types-BsT_1de7.d.ts} +3 -3
  229. package/dist/{types-pEe84X2Z.d.ts → types-DU4HZ7C6.d.ts} +4 -4
  230. package/dist/{types-D31aAyFm.d.ts → types-r1cKZ-RE.d.ts} +2 -5
  231. package/dist/{types.gen-DOXoUj5J.d.ts → types.gen-oeDSqezz.d.ts} +104 -3
  232. package/package.json +1 -1
  233. package/dist/chunk-7XRPOR7L.js +0 -2
  234. package/dist/chunk-7XRPOR7L.js.map +0 -1
  235. package/dist/chunk-B25LAMRX.js +0 -2
  236. package/dist/chunk-B25LAMRX.js.map +0 -1
  237. package/dist/chunk-CELNQ7KS.js +0 -2
  238. package/dist/chunk-CELNQ7KS.js.map +0 -1
  239. package/dist/chunk-DKA2EUPQ.js +0 -2
  240. package/dist/chunk-E773NPNL.js +0 -2
  241. package/dist/chunk-E773NPNL.js.map +0 -1
  242. package/dist/chunk-GOB6DUFS.js.map +0 -1
  243. package/dist/chunk-HTCONTKZ.js +0 -2
  244. package/dist/chunk-HTCONTKZ.js.map +0 -1
  245. package/dist/chunk-MFKGLMRJ.js.map +0 -1
  246. package/dist/chunk-MISHDUB2.js +0 -2
  247. package/dist/chunk-MISHDUB2.js.map +0 -1
  248. package/dist/chunk-PSEOAELN.js +0 -2
  249. package/dist/chunk-PSEOAELN.js.map +0 -1
  250. package/dist/chunk-VXPJXQP3.js +0 -2
  251. package/dist/chunk-Z442TFR6.js +0 -2
  252. package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.js +0 -2
  253. package/dist/flows/Termination/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +0 -2
  254. package/dist/flows/Termination/TimeOff.d.ts +0 -11
  255. package/dist/flows/Termination/TimeOff.js +0 -2
  256. /package/dist/{chunk-2NGJN5IE.js.map → chunk-2M7EBC4K.js.map} +0 -0
  257. /package/dist/{chunk-A6X6N2G7.js.map → chunk-4DCENNLW.js.map} +0 -0
  258. /package/dist/{chunk-NHYBFEXA.js.map → chunk-4M4OJPUA.js.map} +0 -0
  259. /package/dist/{chunk-QU3NSFU5.js.map → chunk-4SIGN3ZP.js.map} +0 -0
  260. /package/dist/{chunk-JX3OQNNM.js.map → chunk-4URY37KB.js.map} +0 -0
  261. /package/dist/{chunk-FVFXPT3Y.js.map → chunk-5XHKOMX5.js.map} +0 -0
  262. /package/dist/{chunk-C4AVUIG2.js.map → chunk-5ZR7EFPY.js.map} +0 -0
  263. /package/dist/{chunk-5N4L2G7Q.js.map → chunk-6VRUYYUV.js.map} +0 -0
  264. /package/dist/{chunk-GLUERRJ2.js.map → chunk-A7HJICVX.js.map} +0 -0
  265. /package/dist/{chunk-EIVHHLR5.js.map → chunk-A7T27JCJ.js.map} +0 -0
  266. /package/dist/{chunk-C4SMHWP4.js.map → chunk-ANGJCT4I.js.map} +0 -0
  267. /package/dist/{chunk-QP36XXCQ.js.map → chunk-BDPCUDJB.js.map} +0 -0
  268. /package/dist/{chunk-22JS3T6G.js.map → chunk-BGU3LZ2S.js.map} +0 -0
  269. /package/dist/{chunk-DHJZVBVD.js.map → chunk-BMDZJNJV.js.map} +0 -0
  270. /package/dist/{chunk-WEYUB6DC.js.map → chunk-BVN2DKO5.js.map} +0 -0
  271. /package/dist/{chunk-2VWU5VNU.js.map → chunk-C2BBQDCU.js.map} +0 -0
  272. /package/dist/{chunk-D5KITGC6.js.map → chunk-D5RCRFJM.js.map} +0 -0
  273. /package/dist/{chunk-QIAZQLSG.js.map → chunk-DPY77ASH.js.map} +0 -0
  274. /package/dist/{chunk-XHOQSIXZ.js.map → chunk-DYWOG7Q2.js.map} +0 -0
  275. /package/dist/{chunk-TGUF5Q7J.js.map → chunk-EFPZOIQ2.js.map} +0 -0
  276. /package/dist/{chunk-BPJHPGTL.js.map → chunk-EKKRQI6B.js.map} +0 -0
  277. /package/dist/{chunk-V2PJW577.js.map → chunk-EZV6DOVQ.js.map} +0 -0
  278. /package/dist/{chunk-ULHGAKFT.js.map → chunk-GGXK727I.js.map} +0 -0
  279. /package/dist/{chunk-OOUYQLIE.js.map → chunk-HFI2MD3H.js.map} +0 -0
  280. /package/dist/{chunk-MRVBOQLW.js.map → chunk-HLPKGITX.js.map} +0 -0
  281. /package/dist/{chunk-T6BYBXQA.js.map → chunk-ISZQNKMD.js.map} +0 -0
  282. /package/dist/{chunk-J26AI33Z.js.map → chunk-IUJXAZHK.js.map} +0 -0
  283. /package/dist/{chunk-VE36I6G6.js.map → chunk-IUZ7DEXC.js.map} +0 -0
  284. /package/dist/{chunk-XTLLWD7O.js.map → chunk-KPTF6LPP.js.map} +0 -0
  285. /package/dist/{chunk-GECFDGI7.js.map → chunk-KYSKA2UK.js.map} +0 -0
  286. /package/dist/{chunk-5QP2BAUT.js.map → chunk-L2BJK3K5.js.map} +0 -0
  287. /package/dist/{chunk-XICA45G2.js.map → chunk-MP2T74PU.js.map} +0 -0
  288. /package/dist/{chunk-GUHBW4V3.js.map → chunk-NVYMAOQ7.js.map} +0 -0
  289. /package/dist/{chunk-V6I3EMYX.js.map → chunk-NYEZAOUI.js.map} +0 -0
  290. /package/dist/{chunk-X5DMQNEM.js.map → chunk-NYM7QGN2.js.map} +0 -0
  291. /package/dist/{chunk-2U4VW5TT.js.map → chunk-O5MKPE6I.js.map} +0 -0
  292. /package/dist/{chunk-2GCMLKO2.js.map → chunk-O7REUCKR.js.map} +0 -0
  293. /package/dist/{chunk-JG7FV7OZ.js.map → chunk-OEAHDUWE.js.map} +0 -0
  294. /package/dist/{chunk-IUU4MOLL.js.map → chunk-OIN3HGOQ.js.map} +0 -0
  295. /package/dist/{chunk-D52VU4UO.js.map → chunk-OW5QGJD4.js.map} +0 -0
  296. /package/dist/{chunk-BVCBX72U.js.map → chunk-P5WUODPR.js.map} +0 -0
  297. /package/dist/{chunk-Z442TFR6.js.map → chunk-Q3A4A2HL.js.map} +0 -0
  298. /package/dist/{chunk-XKSAKI3P.js.map → chunk-Q4BKFSTW.js.map} +0 -0
  299. /package/dist/{chunk-5EP45OQV.js.map → chunk-RC3XP5WU.js.map} +0 -0
  300. /package/dist/{chunk-2WDEVWIE.js.map → chunk-RINDVT6U.js.map} +0 -0
  301. /package/dist/{chunk-3I6ONATN.js.map → chunk-RQXKQTRD.js.map} +0 -0
  302. /package/dist/{chunk-IK6IRESD.js.map → chunk-SHF5L3PW.js.map} +0 -0
  303. /package/dist/{chunk-6L7JELHX.js.map → chunk-UIO6B4GN.js.map} +0 -0
  304. /package/dist/{chunk-RJGWAZBE.js.map → chunk-UPXJJBXZ.js.map} +0 -0
  305. /package/dist/{chunk-K4NAASBM.js.map → chunk-UTBVLDKY.js.map} +0 -0
  306. /package/dist/{chunk-PJUC5WAJ.js.map → chunk-VUP76ZMQ.js.map} +0 -0
  307. /package/dist/{chunk-5SKMAYLG.js.map → chunk-VYDVPM5S.js.map} +0 -0
  308. /package/dist/{chunk-KJSZIASL.js.map → chunk-WFMQ2IDE.js.map} +0 -0
  309. /package/dist/{chunk-TWD2IDAS.js.map → chunk-WNXB2Y65.js.map} +0 -0
  310. /package/dist/{chunk-7EDGHYMX.js.map → chunk-ZQ6MG635.js.map} +0 -0
  311. /package/dist/flows/Termination/{TerminationDialogInfoContent/TerminationDialogInfoContent.js.map → components/PaidTimeOff/PaidTimeOff.js.map} +0 -0
  312. /package/dist/flows/Termination/{TerminationReasonsDetailContent/TerminationReasonsDetailContent.js.map → components/PaidTimeOff/PaidTimeOffContainer.js.map} +0 -0
  313. /package/dist/flows/Termination/{TimeOff.js.map → components/PaidTimeOff/types.js.map} +0 -0
  314. /package/dist/flows/Termination/{TerminationDialogInfoContent → components/TerminationDialogInfoContent}/TerminationDialogInfoContent.d.ts +0 -0
  315. /package/dist/flows/Termination/{TerminationReasonsDetailContent → components/TerminationReasonsDetailContent}/TerminationReasonsDetailContent.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-5KHLOGTR.js";import{a as f}from"./chunk-22JS3T6G.js";import{a as n}from"./chunk-T6BYBXQA.js";import{a as p}from"./chunk-WEYUB6DC.js";import{a as s}from"./chunk-TGUF5Q7J.js";import{a as m}from"./chunk-7EDGHYMX.js";import{a}from"./chunk-2WDEVWIE.js";import{a as i}from"./chunk-IUU4MOLL.js";import{a as e}from"./chunk-5QP2BAUT.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
2
- //# sourceMappingURL=chunk-A6X6N2G7.js.map
1
+ import{a as m}from"./chunk-ZQ6MG635.js";import{a}from"./chunk-RINDVT6U.js";import{a as i}from"./chunk-OIN3HGOQ.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-5KHLOGTR.js";import{a as f}from"./chunk-BGU3LZ2S.js";import{a as n}from"./chunk-ISZQNKMD.js";import{a as p}from"./chunk-BVN2DKO5.js";import{a as s}from"./chunk-EFPZOIQ2.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-L2BJK3K5.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
2
+ //# sourceMappingURL=chunk-4DCENNLW.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-TOA3JILU.js";import{b as s}from"./chunk-CFIJKJXD.js";import{a as l}from"./chunk-EIVHHLR5.js";import{f as m,g as d}from"./chunk-CNDSIADP.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-NHYBFEXA.js.map
1
+ import{b as c}from"./chunk-TOA3JILU.js";import{a as l}from"./chunk-A7T27JCJ.js";import{b as s}from"./chunk-CFIJKJXD.js";import{f as m,g as d}from"./chunk-CNDSIADP.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-4M4OJPUA.js.map
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-BV3PGYSH.js";import{a as he,b as Ue,c as Ve,d as ze,e as Ge,f as Je,g as qe,h as Ke,i as Ye,j as ye,k as Xe,l as ve,m as Ce,o as xe,q as Qe,r as Ze,s as et}from"./chunk-D6X2WCEG.js";import{b as je}from"./chunk-HPHWQU34.js";import{a as _e,b as $}from"./chunk-E773NPNL.js";import{b}from"./chunk-3ZWDIEEM.js";import{a as re,b as ae,c as x,d as Le,e as He,f as Be,g as Ae,h as k,i as w,j as N,k as P,l as R,m as D}from"./chunk-CNDSIADP.js";import{g as Oe}from"./chunk-PAQW5BFW.js";import{a as _,e as ee}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Ht,jsx as O,jsxs as ne}from"react/jsx-runtime";function se({name:e,defaultValue:t,description:a,label:o,onChange:l,multiple:d,options:c,component:F,...f}){let{components:i}=b(),{control:n}=x(),u=r((m,s,g)=>{let p=g.value?[...g.value]:[];s?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:n,name:e,defaultValue:t,render:({field:m,fieldState:s})=>{let g=F||i?.checkbox;if(g){let p={name:e,description:a,label:o,defaultValue:t,multiple:d,options:c,...f};return O(g,{field:{...m,onChange:r(h=>{if(d){let{checked:S,value:C}=h.target;u(C,S,m),l?.(S);return}m.onChange(h),l?.(h)},"onChange")},fieldState:s,fieldData:p})}return ne(w,{"data-field":e,className:_(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(P,{children:ne(Ht,{children:[c&&d?O(N,{children:o}):null,c&&d?c.map(p=>ne("div",{className:"flex space-x-2",children:[O(he,{id:p.value,onCheckedChange:h=>{u(p.value,h===!0,m),l?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):ne("div",{className:"flex space-x-2",children:[O(he,{id:e,onCheckedChange:p=>{m.onChange(p),l?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:o})]})]})}),a&&O(R,{children:a}),s.error&&O(D,{})]})}})}r(se,"CheckBoxField");import{CalendarIcon as Ut}from"lucide-react";import{PopoverClose as Vt}from"@radix-ui/react-popover";import{ChevronLeft as Bt,ChevronRight as Ot}from"lucide-react";import{DayPicker as At}from"react-day-picker";import{jsx as be}from"react/jsx-runtime";function tt({className:e,classNames:t,showOutsideDays:a=!0,...o}){return be(At,{showOutsideDays:a,className:_("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:_(_e({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_(_e({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:l,...d})=>be(Bt,{className:_("size-4",l),...d}),"IconLeft"),IconRight:r(({className:l,...d})=>be(Ot,{className:_("size-4",l),...d}),"IconRight")},...o})}r(tt,"Calendar");import*as A from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function ie({...e}){return le(A.Root,{"data-slot":"popover",...e})}r(ie,"Popover");function me({...e}){return le(A.Trigger,{"data-slot":"popover-trigger",...e})}r(me,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:a=4,...o}){return le(A.Portal,{children:le(A.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:_("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}r(de,"PopoverContent");import{format as ot}from"date-fns";import{Fragment as zt,jsx as E,jsxs as Se}from"react/jsx-runtime";function rt({description:e,label:t,name:a,minDate:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x(),i;return c.meta?.mot&&typeof c.meta.mot=="number"?i=Oe(c.meta.mot):o&&(i=new Date(o)),E(k,{control:f,name:a,render:({field:n,fieldState:u})=>{let m=d||F?.date;if(m){let s={description:e,label:t,name:a,onChange:l,...i&&{minDate:i.toISOString()},...c};return E(m,{field:{...n,onChange:r(g=>{n.onChange(g),l?.(g)},"onChange")},fieldState:u,fieldData:s})}return Se(w,{"data-field":a,className:`flex flex-col RemoteFlows__DatePickerField__Item__${a}`,children:[E(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Se(ie,{children:[E(me,{asChild:!0,children:E(P,{children:E("div",{children:Se($,{type:"button",variant:"outline",className:_("w-full pl-3 text-left font-normal",!n.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${a}`,children:[n.value&&E(zt,{children:ot(n.value,"yyyy-MM-dd")}),E(Ut,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),E(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:E(tt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:n.value?new Date(n.value):void 0,onSelect:s=>{n.onChange(s?ot(s,"yyyy-MM-dd"):null),l?.(s)},defaultMonth:i,components:{DayContent:r(s=>E(Vt,{children:s.date.getDate()}),"DayContent")},...i&&{disabled:r(s=>s<i,"disabled")}})})]}),e?E(R,{children:e}):null,u.error&&E(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(rt,"DatePickerField");import{useState as Gt,useRef as Jt}from"react";import{Upload as qt,X as Kt}from"lucide-react";import{jsx as U,jsxs as ke}from"react/jsx-runtime";function at({onChange:e,className:t,multiple:a}){let[o,l]=Gt([]),d=Jt(null),c=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),F=r(i=>{if(i.target.files&&i.target.files.length>0){let n=Array.from(i.target.files);l(n),e(i)}},"handleChange"),f=r(i=>{l(n=>n.filter(u=>u!==i))},"onRemoveFile");return ke("div",{className:_("flex flex-col items-start gap-4",t),children:[U("input",{type:"file",ref:d,onChange:F,className:"hidden","aria-label":"File upload",multiple:a}),ke($,{type:"button",onClick:c,className:"gap-2",children:[U(qt,{className:"h-4 w-4"}),"Choose File"]}),o.length===0&&U("div",{className:"text-sm",children:a?U("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):U("span",{className:"font-medium",children:"No file selected."})}),o.length>0&&o.map((i,n)=>ke("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",U("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",U($,{variant:"ghost",onClick:()=>f(i),children:U(Kt,{})})]},n))]})}r(at,"FileUploader");import{jsx as V,jsxs as jt}from"react/jsx-runtime";var Yt=r(e=>new Promise((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result),o.onerror=l=>a(l)}),"toBase64"),nt=r(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async o=>{let l=await Yt(o);return{name:o.name,content:l.split(",")[1]}}))},"convertFilesToBase64");function st({name:e,description:t,label:a,multiple:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return V(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.file;if(u){let m={name:e,description:t,label:a,multiple:o,...c};return V(u,{field:{...i,value:null,onChange:r(async s=>{let g=await nt(s);i.onChange(g),l?.(g)},"onChange")},fieldState:n,fieldData:m})}return jt(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[V(N,{className:"RemoteFlows__FileUpload__Label",children:a}),V(P,{children:V(at,{onChange:async m=>{let s=await nt(m);i.onChange(s),l?.(s)},multiple:o,className:_("RemoteFlows__FileUpload__Input")})}),t&&V("div",{className:"flex items-center justify-between",children:V(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),n.error&&V(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(st,"FileUploadField");import{jsx as Ne}from"react/jsx-runtime";function ce(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.number;return o?Ne(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>Ne(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Ne(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ce,"NumberField");import{Fragment as Xt}from"react";import{jsx as W,jsxs as we}from"react/jsx-runtime";function lt({name:e,defaultValue:t,description:a,label:o,options:l,onChange:d,component:c,...F}){let{components:f}=b(),{control:i}=x();return W(k,{control:i,name:e,defaultValue:t,render:({field:n,fieldState:u})=>{let m=c||f?.radio;if(m){let s={name:e,defaultValue:t,description:a,label:o,options:l,...F};return W(m,{field:{...n,onChange:r(g=>{n.onChange(g),d?.(g)},"onChange")},fieldState:u,fieldData:s})}return we(w,{className:_("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:o}),W(P,{children:W(Ue,{"aria-label":o||e,onValueChange:s=>{n.onChange(s),d?.(s)},value:n.value,className:"flex flex-col space-y-3",children:l?.map(s=>W(Xt,{children:we(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(P,{children:W(Ve,{value:s.value,className:"RemoteFlows__RadioField__Input",disabled:s.disabled})}),we("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:s.label}),s.description&&W(R,{className:"mt-2",children:s.description})]})]})},s.value))})}),a&&W(R,{children:a}),u.error&&W(D,{})]})}})}r(lt,"RadioGroupField");import{jsx as M,jsxs as it}from"react/jsx-runtime";function mt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b();return M(k,{defaultValue:o,control:f,name:t,render:({field:n,fieldState:u})=>{let m=c||i?.select;if(m){let s={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return M(m,{field:{...n,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;n.onChange(p),d?.(p)},"onChange")},fieldState:u,fieldData:s})}return it(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[M(N,{className:"RemoteFlows__SelectField__Label",children:e}),M(P,{children:M("div",{className:"relative",children:it(ze,{value:n.value||"",onValueChange:s=>{let g=F.jsonType==="number"?Number(s):s;n.onChange(g),d?.(g)},children:[M(qe,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:M("span",{className:"absolute",children:M(Je,{placeholder:e})})}),M(Ke,{className:"RemoteFlows__SelectField__Content",children:M(Ge,{className:"RemoteFlows__SelectField__Group",children:a.map(s=>M(Ye,{value:s.value,className:"RemoteFlows__SelectField__SelectItem",disabled:s.disabled,children:s.label},s.value))})})]})})}),l&&M(R,{children:l}),u.error&&M(D,{})]})}})}r(mt,"SelectField");import{useState as ro}from"react";import{Fragment as Qt,useState as Zt}from"react";import{Check as eo,ChevronDownIcon as to,X as oo}from"lucide-react";import{Command as Y}from"cmdk";import{SearchIcon as jr}from"lucide-react";import{jsx as j,jsxs as ea}from"react/jsx-runtime";function dt({className:e,...t}){return j(Y,{"data-slot":"command",className:_("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(dt,"Command");function ct({className:e,...t}){return j(Y.List,{"data-slot":"command-list",className:_("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ct,"CommandList");function ut({...e}){return j(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ut,"CommandEmpty");function pt({className:e,...t}){return j(Y.Group,{"data-slot":"command-group",className:_("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(pt,"CommandGroup");function ft({className:e,...t}){return j(Y.Separator,{"data-slot":"command-separator",className:_("bg-border -mx-1 h-px",e),...t})}r(ft,"CommandSeparator");function Ft({className:e,...t}){return j(Y.Item,{"data-slot":"command-item",className:_("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(Ft,"CommandItem");import{jsx as L,jsxs as X}from"react/jsx-runtime";function ue({options:e,selected:t,onChange:a,placeholder:o,...l}){let[d,c]=Zt(!1),F=r(n=>{a(t.filter(u=>u.value!==n.value))},"handleUnselect"),f=e.some(n=>n.category),i=e.reduce((n,u)=>{let m=u.category||"Uncategorized";return n[m]||(n[m]=[]),n[m].push(u),n},{});return X(ie,{open:d,onOpenChange:c,...l,children:[L(me,{children:X($,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(n=>X(je,{variant:"secondary",className:"mr-1 mb-1",children:[n.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${n.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:u=>{u.key==="Enter"&&F(n)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>F(n),children:L(oo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},n.label)):L("span",{className:"text-foreground",children:o})}),L(to,{className:"size-4"})]})}),L(de,{align:"start",className:"w-full p-0",children:L(dt,{children:X(ct,{children:[L(ut,{children:"No item found."}),Object.entries(i).map(([n,u],m)=>X(Qt,{children:[m>0&&L(ft,{}),L(pt,{heading:f?n:void 0,children:u.map(s=>{let g=t.some(p=>p.value===s.value);return X(Ft,{onSelect:()=>{a(g?t.filter(p=>p.value!==s.value):[...t,s])},children:[L(eo,{className:_("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),s.label]},s.label)})})]},n))]})})})]})}r(ue,"MultiSelect");import{jsx as J,jsxs as ao}from"react/jsx-runtime";function gt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,component:F,...f}){let{control:i}=x(),{components:n}=b(),[u,m]=ro([]);return J(k,{defaultValue:o,control:i,name:t,render:({field:s,fieldState:g})=>{let p=F||n?.countries;if(p){let C={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,...f};return J(p,{field:{...s,onChange:r(T=>{s.onChange(T),d?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(c?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(c?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...a.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],S=r(C=>{let T=C.map(({value:G})=>G);s.onChange(T),d?.(T),m(C)},"handleChange");return ao(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[J(N,{className:"RemoteFlows__CountryField__Label",children:e}),J(P,{children:J(ue,{options:h,selected:u,onChange:S,...f})}),l&&J(R,{children:l}),g.error&&J(D,{})]})}})}r(gt,"CountryField");import*as ht from"react";import{jsx as no}from"react/jsx-runtime";var Pe=ht.forwardRef(({className:e,...t},a)=>no("textarea",{className:_("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));Pe.displayName="Textarea";import{jsx as q,jsxs as Re}from"react/jsx-runtime";function _t({name:e,description:t,label:a,onChange:o,maxLength:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return q(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.textarea;if(u){let s={name:e,description:t,label:a,maxLength:l,...c};return q(u,{field:{...i,onChange:r(g=>{i.onChange(g),o?.(g)},"onChange")},fieldState:n,fieldData:s})}let m=i.value?.length??0;return Re(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[q(N,{className:"RemoteFlows__TextArea__Label",children:a}),q(P,{children:q(Pe,{...i,value:i.value??"",onChange:s=>{i.onChange(s),o?.(s)},className:_(n.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:a})}),(t||l)&&Re("div",{className:"flex items-center justify-between",children:[t&&q(R,{className:"RemoteFlows__TextArea__Description",children:t}),l&&Re("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",l]})]}),n.error&&q(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(_t,"TextAreaField");import{jsx as De}from"react/jsx-runtime";function yt(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.email;return o?De(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>De(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):De(B,{...e,type:"email"})}r(yt,"EmailField");import{jsx as vt}from"react/jsx-runtime";function Ct(e){let{control:t}=x();return vt(k,{control:t,name:e.name,render:({field:a})=>vt("input",{...a,type:"hidden"})})}r(Ct,"HiddenField");import po,{useEffect as fo,useState as Dt}from"react";var xt=r((e,t,a)=>{if(e&&"reportValidity"in e){let o=re(a,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},"r"),Te=r((e,t)=>{for(let a in t.fields){let o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?xt(o.ref,a,e):o&&o.refs&&o.refs.forEach(l=>xt(l,a,e))}},"o"),St=r((e,t)=>{t.shouldUseNativeValidation&&Te(e,t);let a={};for(let o in e){let l=re(t.fields,o),d=Object.assign(e[o]||{},{ref:l&&l.ref});if(so(t.names||Object.keys(e),o)){let c=Object.assign({},re(a,o));ae(c,"root",d),ae(a,o,c)}else ae(a,o,d)}return a},"s"),so=r((e,t)=>{let a=bt(t);return e.some(o=>bt(o).match(`^${a}\\.\\d+`))},"i");function bt(e){return e.replace(/\]|\[/g,"")}r(bt,"n");function kt(e,t,a){return t===void 0&&(t={}),a===void 0&&(a={}),function(o,l,d){try{return Promise.resolve(function(c,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[a.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:l}))).then(function(i){return d.shouldUseNativeValidation&&Te({},d),{values:a.raw?Object.assign({},o):i,errors:{}}}))}catch(i){return F(i)}return f&&f.then?f.then(void 0,F):f}(0,function(c){if(!c.inner)throw c;return{values:{},errors:St((F=c,f=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(F.inner||[]).reduce(function(i,n){if(i[n.path]||(i[n.path]={message:n.message,type:n.type}),f){var u=i[n.path].types,m=u&&u[n.type];i[n.path]=Le(n.path,f,i,n.type,m?[].concat(m,n.message):n.message)}return i},{})),d)};var F,f}))}catch(c){return Promise.reject(c)}}}r(kt,"o");import*as I from"yup";import Nt from"lodash.groupby";import Q from"lodash.capitalize";var wt=60,pe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function lo(e){if(e<60)return`${e}m`;let t=Math.floor(e/wt),a=e%wt;return a>0?`${t}h${a}m`:`${t}h`}r(lo,"convertBreakDurationToHours");function Pt(e){let t=e.reduce((a,o)=>o.hours+a,0);return Number(t.toFixed(2))}r(Pt,"calculateTotalWorkHours");function io(e,t){let a=t.map(({day:d})=>d.toLowerCase()),o=a.indexOf(e),l=null;for(;o<a.length&&!l;){let d=a[o],c=a[o+1],F=pe.indexOf(d)+1;pe[F]===c||(l=d),o+=1}return l}r(io,"findLastConsecutiveDay");function mo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(mo,"shouldSummarizeSchedule");function co(e){return Number.parseInt(e.break_duration_minutes)>0}r(co,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(mo),a=Nt(t,F=>`${F.start_time}|${F.end_time}`),o=e.filter(co),l=Nt(o,"break_duration_minutes"),d=Object.keys(a).map(F=>{let f=a[F],i=f[0].day,[n,u]=F.split("|"),m=`from <span>${n.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,s=io(i,f),p=(s?f.findIndex(h=>h.day===s):-1)===f.length-1;return f.length===1?`${Q(i)}, ${m}`:!p||!s?f.reduce((h,S,C)=>{let T=Q(S.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${Q(i)}</span> to <span>${Q(s)}</span>, ${m}`}),c=Object.keys(l).reverse().map((F,f)=>{let i=f===0,n=l[F],u=lo(parseInt(F,10));if(Object.keys(l).length===1)return`With ${u} daily breaks`;if(n.length===1){let m=`${u} break on ${Q(n[0].day)}.`;return i?`With ${m}`:m}return n.reduce((m,s,g)=>{let p=Q(s.day);return g===0?`${m} ${p}`:g===n.length-1?`${m}, and ${p}.`:`${m}, ${p}`},i?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:d,breakSummary:c}}r(Rt,"buildWorkScheduleSummary");function Ie(e){let{checked:t,start_time:a,end_time:o,break_duration_minutes:l}=e;if(!t)return 0;let[d,c]=a.split(":").map(Number),[F,f]=o.split(":").map(Number),i=d*60+c,m=(F*60+f-i-Number.parseInt(l||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Ie,"calculateHours");var uo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function fe(e){return uo[e]}r(fe,"getShortWeekday");import{jsx as y,jsxs as H}from"react/jsx-runtime";var Fo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:I.number().default(0),break_duration_minutes:I.string().default("0")}),go=I.object({schedule:I.array(Fo)});function ho({defaultSchedule:e,onSubmit:t}){let[a,o]=Dt(!1),l=pe.map(p=>{let h=e.find(S=>S.day.toLowerCase()===fe(p).toLowerCase()||S.day.toLowerCase()===p.toLowerCase());return h?{...h,day:fe(p),checked:!0}:{...e[0],checked:!1,day:fe(p)}}),d=Be({defaultValues:{schedule:l},resolver:kt(go)}),{handleSubmit:c,watch:F,reset:f,control:i,formState:n}=d,{fields:u}=He({name:"schedule",control:i}),m=F("schedule");function s(p){let h=p.schedule.filter(({checked:S})=>S).map(S=>({...S,hours:Ie(S)}));t(h),o(!1)}r(s,"handleSubmitWorkingHours");function g(){f(),o(!1)}return r(g,"handleCancel"),y("div",{className:"flex items-center justify-between",children:H(ye,{open:a,onOpenChange:o,children:[y(Xe,{asChild:!0,children:y($,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(ve,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(Ce,{children:y(xe,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(Ae,{...d,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),H("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((p,h)=>{let S=m[h],C=Ie(S);return H(po.Fragment,{children:[H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(se,{label:p.day,name:`schedule.${h}.checked`})}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(B,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(n.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[y($,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),y($,{type:"button",className:"submit-button",onClick:c(s),children:"Save Schedule"})]})]})})]})]})})}r(ho,"WorkScheduleSelectionForm");function Tt(e){let{components:t}=b(),{setValue:a,control:o,watch:l}=x(),d=l(e.name),[c,F]=Dt(d),{workHoursSummary:f,breakSummary:i}=Rt(c),n=Pt(c);fo(()=>{a(e.name,c)},[c,e.name,a]);function u(s){F(s)}r(u,"onSubmit");let m=e.component||t?.["work-schedule"];return m?y(k,{control:o,name:e.name,render:({field:s,fieldState:g})=>y(m,{field:{...s,onChange:r(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:i,totalWorkHours:n}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:n})," hours per week"]}),y(ho,{defaultSchedule:c,onSubmit:u})]})]})}r(Tt,"WorkScheduleField");import{useState as _o}from"react";import{jsx as K,jsxs as yo}from"react/jsx-runtime";function It({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b(),[n,u]=_o();return K(k,{defaultValue:o,control:f,name:t,render:({field:m,fieldState:s})=>{let g=c||i?.["multi-select"];if(g){let h={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return K(g,{field:{...m,onChange:r(S=>{m.onChange(S),d?.(S)},"onChange")},fieldState:s,fieldData:h})}let p=n||a.filter(h=>m.value.includes(h.value));return yo(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(N,{className:"RemoteFlows__SelectField__Label",children:e}),K(P,{children:K(ue,{options:a,selected:p,onChange:h=>{let S=h.map(({value:C})=>C);m.onChange(S),d?.(S),u(h)},...F})}),l&&K(R,{children:l}),s.error&&K(D,{})]})}})}r(It,"MultiSelectField");import{jsx as vo}from"react/jsx-runtime";var $t=r(e=>vo(ce,{maxLength:15,...e}),"MoneyField");var $e={checkbox:se,text:B,email:yt,money:$t,select:mt,"multi-select":It,radio:lt,number:ce,file:st,date:rt,textarea:_t,countries:gt,hidden:Ct,"work-schedule":Tt};import{AlertCircle as Co}from"lucide-react";import{jsx as Fe,jsxs as xo}from"react/jsx-runtime";function Et({title:e,description:t,severity:a}){let{components:o}=b();if(o?.statement){let l=o?.statement;return Fe(l,{data:{title:e,description:ee(t),severity:a}})}return xo(Qe,{variant:"warning",children:[Fe(Co,{className:"h-4 w-4"}),e&&Fe(Ze,{children:e}),t&&Fe(et,{dangerouslySetInnerHTML:{__html:ee(t)}})]})}r(Et,"Statement");import{Fragment as bo,useEffect as So,useRef as Mt}from"react";import{jsx as z,jsxs as te}from"react/jsx-runtime";var ko=r(({isExpanded:e,onToggle:t,className:a,...o})=>z($,{type:"button",className:_("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",a),variant:"default",onClick:t,...o,children:e?"Remove":"Define"}),"DefaultToggleButton");function ss({label:e,name:t,fields:a,description:o,components:l,statement:d,isFlatFieldset:c,extra:F,variant:f="outset",features:i}){let{watch:n,setValue:u,trigger:m,formState:s}=x(),{components:g}=b(),p=i?.toggle?.stateField,h=p?n(p):i?.toggle?.defaultExpanded??!0,S=a.map(({name:v})=>`${t}.${v}`),C=n(S),T=Mt(C),G=Mt(null),Wt=r(()=>{p&&u(p,!h)},"toggleExpanded");So(()=>{let v=C,oe=T.current,ge=s.isSubmitted||s.submitCount>0,We=!1;for(let Z=0;Z<v.length;Z++)if(v[Z]!==void 0&&oe[Z]!==v[Z]){We=!0;break}return We&&ge&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{m()},50)),T.current=[...v],()=>{G.current&&clearTimeout(G.current)}},[C,m,s.isSubmitted,s.submitCount]);let Lt=g?.fieldsetToggle||ko,Ee=`${t}-content`,Me=`${t}-header`;return te("fieldset",{className:_("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[z("legend",{className:_("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),f==="inset"&&te("div",{className:"RemoteFlows__FieldSetField__Header",id:Me,"data-state":h?"expanded":"collapsed","aria-expanded":h,children:[z("h3",{className:_("RemoteFlows__FieldSetField__Title"),children:e}),i?.toggle?.enabled&&z(Lt,{isExpanded:h,onToggle:Wt,"aria-expanded":h,"aria-controls":Ee,"aria-label":`${h?"Hide":"Show"} ${e}`,className:_("RemoteFlows__FieldSetField__Toggle",i.toggle?.className),children:h?i.toggle.labels?.collapse??"Remove":i.toggle.labels?.expand??"Define"})]}),h&&te("div",{id:Ee,"aria-labelledby":Me,role:"region",children:[o?z("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:ee(o)}}):null,te("div",{className:"grid gap-4",children:[a.map(v=>{v.calculateDynamicProperties&&(v={...v,...v.calculateDynamicProperties(C,v)||{}});let oe=$e[v.type];if(v.isVisible===!1||v.deprecated)return null;if(v.Component){let{Component:ge}=v;return z(ge,{...v},v.name)}return v.type==="select"&&v.multiple&&(oe=$e["multi-select"]),te(bo,{children:[z(oe,{...v,name:`${c?v.name:`${t}.${v.name}`}`,component:l?.[v.type]}),v.extra?v.extra:null]},`${c?v.name:`${t}.${v.name}`}`)}),F||null,d?z(Et,{...d}):null]})]})]})}r(ss,"FieldSetField");export{$e as a,Et as b,ss as c};
2
- //# sourceMappingURL=chunk-QU3NSFU5.js.map
1
+ import{a as B}from"./chunk-BV3PGYSH.js";import{a as he,b as Ue,c as Ve,d as ze,e as Ge,f as Je,g as qe,h as Ke,i as Ye,j as ye,k as Xe,l as ve,m as Ce,o as xe,q as Qe,r as Ze,s as et}from"./chunk-D6X2WCEG.js";import{b as je}from"./chunk-HPHWQU34.js";import{a as _e,b as $}from"./chunk-WVDTHFGS.js";import{b}from"./chunk-3ZWDIEEM.js";import{a as re,b as ae,c as x,d as Le,e as He,f as Be,g as Ae,h as k,i as w,j as N,k as P,l as R,m as D}from"./chunk-CNDSIADP.js";import{g as Oe}from"./chunk-PAQW5BFW.js";import{a as _,e as ee}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Ht,jsx as O,jsxs as ne}from"react/jsx-runtime";function se({name:e,defaultValue:t,description:a,label:o,onChange:l,multiple:d,options:c,component:F,...f}){let{components:i}=b(),{control:n}=x(),u=r((m,s,g)=>{let p=g.value?[...g.value]:[];s?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:n,name:e,defaultValue:t,render:({field:m,fieldState:s})=>{let g=F||i?.checkbox;if(g){let p={name:e,description:a,label:o,defaultValue:t,multiple:d,options:c,...f};return O(g,{field:{...m,onChange:r(h=>{if(d){let{checked:S,value:C}=h.target;u(C,S,m),l?.(S);return}m.onChange(h),l?.(h)},"onChange")},fieldState:s,fieldData:p})}return ne(w,{"data-field":e,className:_(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(P,{children:ne(Ht,{children:[c&&d?O(N,{children:o}):null,c&&d?c.map(p=>ne("div",{className:"flex space-x-2",children:[O(he,{id:p.value,onCheckedChange:h=>{u(p.value,h===!0,m),l?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):ne("div",{className:"flex space-x-2",children:[O(he,{id:e,onCheckedChange:p=>{m.onChange(p),l?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:o})]})]})}),a&&O(R,{children:a}),s.error&&O(D,{})]})}})}r(se,"CheckBoxField");import{CalendarIcon as Ut}from"lucide-react";import{PopoverClose as Vt}from"@radix-ui/react-popover";import{ChevronLeft as Bt,ChevronRight as Ot}from"lucide-react";import{DayPicker as At}from"react-day-picker";import{jsx as be}from"react/jsx-runtime";function tt({className:e,classNames:t,showOutsideDays:a=!0,...o}){return be(At,{showOutsideDays:a,className:_("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:_(_e({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_(_e({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:l,...d})=>be(Bt,{className:_("size-4",l),...d}),"IconLeft"),IconRight:r(({className:l,...d})=>be(Ot,{className:_("size-4",l),...d}),"IconRight")},...o})}r(tt,"Calendar");import*as A from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function ie({...e}){return le(A.Root,{"data-slot":"popover",...e})}r(ie,"Popover");function me({...e}){return le(A.Trigger,{"data-slot":"popover-trigger",...e})}r(me,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:a=4,...o}){return le(A.Portal,{children:le(A.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:_("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}r(de,"PopoverContent");import{format as ot}from"date-fns";import{Fragment as zt,jsx as E,jsxs as Se}from"react/jsx-runtime";function rt({description:e,label:t,name:a,minDate:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x(),i;return c.meta?.mot&&typeof c.meta.mot=="number"?i=Oe(c.meta.mot):o&&(i=new Date(o)),E(k,{control:f,name:a,render:({field:n,fieldState:u})=>{let m=d||F?.date;if(m){let s={description:e,label:t,name:a,onChange:l,...i&&{minDate:i.toISOString()},...c};return E(m,{field:{...n,onChange:r(g=>{n.onChange(g),l?.(g)},"onChange")},fieldState:u,fieldData:s})}return Se(w,{"data-field":a,className:`flex flex-col RemoteFlows__DatePickerField__Item__${a}`,children:[E(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Se(ie,{children:[E(me,{asChild:!0,children:E(P,{children:E("div",{children:Se($,{type:"button",variant:"outline",className:_("w-full pl-3 text-left font-normal",!n.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${a}`,children:[n.value&&E(zt,{children:ot(n.value,"yyyy-MM-dd")}),E(Ut,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),E(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:E(tt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:n.value?new Date(n.value):void 0,onSelect:s=>{n.onChange(s?ot(s,"yyyy-MM-dd"):null),l?.(s)},defaultMonth:i,components:{DayContent:r(s=>E(Vt,{children:s.date.getDate()}),"DayContent")},...i&&{disabled:r(s=>s<i,"disabled")}})})]}),e?E(R,{children:e}):null,u.error&&E(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(rt,"DatePickerField");import{useState as Gt,useRef as Jt}from"react";import{Upload as qt,X as Kt}from"lucide-react";import{jsx as U,jsxs as ke}from"react/jsx-runtime";function at({onChange:e,className:t,multiple:a}){let[o,l]=Gt([]),d=Jt(null),c=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),F=r(i=>{if(i.target.files&&i.target.files.length>0){let n=Array.from(i.target.files);l(n),e(i)}},"handleChange"),f=r(i=>{l(n=>n.filter(u=>u!==i))},"onRemoveFile");return ke("div",{className:_("flex flex-col items-start gap-4",t),children:[U("input",{type:"file",ref:d,onChange:F,className:"hidden","aria-label":"File upload",multiple:a}),ke($,{type:"button",onClick:c,className:"gap-2",children:[U(qt,{className:"h-4 w-4"}),"Choose File"]}),o.length===0&&U("div",{className:"text-sm",children:a?U("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):U("span",{className:"font-medium",children:"No file selected."})}),o.length>0&&o.map((i,n)=>ke("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",U("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",U($,{variant:"ghost",onClick:()=>f(i),children:U(Kt,{})})]},n))]})}r(at,"FileUploader");import{jsx as V,jsxs as jt}from"react/jsx-runtime";var Yt=r(e=>new Promise((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result),o.onerror=l=>a(l)}),"toBase64"),nt=r(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async o=>{let l=await Yt(o);return{name:o.name,content:l.split(",")[1]}}))},"convertFilesToBase64");function st({name:e,description:t,label:a,multiple:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return V(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.file;if(u){let m={name:e,description:t,label:a,multiple:o,...c};return V(u,{field:{...i,value:null,onChange:r(async s=>{let g=await nt(s);i.onChange(g),l?.(g)},"onChange")},fieldState:n,fieldData:m})}return jt(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[V(N,{className:"RemoteFlows__FileUpload__Label",children:a}),V(P,{children:V(at,{onChange:async m=>{let s=await nt(m);i.onChange(s),l?.(s)},multiple:o,className:_("RemoteFlows__FileUpload__Input")})}),t&&V("div",{className:"flex items-center justify-between",children:V(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),n.error&&V(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(st,"FileUploadField");import{jsx as Ne}from"react/jsx-runtime";function ce(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.number;return o?Ne(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>Ne(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Ne(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ce,"NumberField");import{Fragment as Xt}from"react";import{jsx as W,jsxs as we}from"react/jsx-runtime";function lt({name:e,defaultValue:t,description:a,label:o,options:l,onChange:d,component:c,...F}){let{components:f}=b(),{control:i}=x();return W(k,{control:i,name:e,defaultValue:t,render:({field:n,fieldState:u})=>{let m=c||f?.radio;if(m){let s={name:e,defaultValue:t,description:a,label:o,options:l,...F};return W(m,{field:{...n,onChange:r(g=>{n.onChange(g),d?.(g)},"onChange")},fieldState:u,fieldData:s})}return we(w,{className:_("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:o}),W(P,{children:W(Ue,{"aria-label":o||e,onValueChange:s=>{n.onChange(s),d?.(s)},value:n.value,className:"flex flex-col space-y-3",children:l?.map(s=>W(Xt,{children:we(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(P,{children:W(Ve,{value:s.value,className:"RemoteFlows__RadioField__Input",disabled:s.disabled})}),we("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:s.label}),s.description&&W(R,{className:"mt-2",children:s.description})]})]})},s.value))})}),a&&W(R,{children:a}),u.error&&W(D,{})]})}})}r(lt,"RadioGroupField");import{jsx as M,jsxs as it}from"react/jsx-runtime";function mt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b();return M(k,{defaultValue:o,control:f,name:t,render:({field:n,fieldState:u})=>{let m=c||i?.select;if(m){let s={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return M(m,{field:{...n,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;n.onChange(p),d?.(p)},"onChange")},fieldState:u,fieldData:s})}return it(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[M(N,{className:"RemoteFlows__SelectField__Label",children:e}),M(P,{children:M("div",{className:"relative",children:it(ze,{value:n.value||"",onValueChange:s=>{let g=F.jsonType==="number"?Number(s):s;n.onChange(g),d?.(g)},children:[M(qe,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:M("span",{className:"absolute",children:M(Je,{placeholder:e})})}),M(Ke,{className:"RemoteFlows__SelectField__Content",children:M(Ge,{className:"RemoteFlows__SelectField__Group",children:a.map(s=>M(Ye,{value:s.value,className:"RemoteFlows__SelectField__SelectItem",disabled:s.disabled,children:s.label},s.value))})})]})})}),l&&M(R,{children:l}),u.error&&M(D,{})]})}})}r(mt,"SelectField");import{useState as ro}from"react";import{Fragment as Qt,useState as Zt}from"react";import{Check as eo,ChevronDownIcon as to,X as oo}from"lucide-react";import{Command as Y}from"cmdk";import{SearchIcon as jr}from"lucide-react";import{jsx as j,jsxs as ea}from"react/jsx-runtime";function dt({className:e,...t}){return j(Y,{"data-slot":"command",className:_("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(dt,"Command");function ct({className:e,...t}){return j(Y.List,{"data-slot":"command-list",className:_("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ct,"CommandList");function ut({...e}){return j(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ut,"CommandEmpty");function pt({className:e,...t}){return j(Y.Group,{"data-slot":"command-group",className:_("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(pt,"CommandGroup");function ft({className:e,...t}){return j(Y.Separator,{"data-slot":"command-separator",className:_("bg-border -mx-1 h-px",e),...t})}r(ft,"CommandSeparator");function Ft({className:e,...t}){return j(Y.Item,{"data-slot":"command-item",className:_("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(Ft,"CommandItem");import{jsx as L,jsxs as X}from"react/jsx-runtime";function ue({options:e,selected:t,onChange:a,placeholder:o,...l}){let[d,c]=Zt(!1),F=r(n=>{a(t.filter(u=>u.value!==n.value))},"handleUnselect"),f=e.some(n=>n.category),i=e.reduce((n,u)=>{let m=u.category||"Uncategorized";return n[m]||(n[m]=[]),n[m].push(u),n},{});return X(ie,{open:d,onOpenChange:c,...l,children:[L(me,{children:X($,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(n=>X(je,{variant:"secondary",className:"mr-1 mb-1",children:[n.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${n.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:u=>{u.key==="Enter"&&F(n)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>F(n),children:L(oo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},n.label)):L("span",{className:"text-foreground",children:o})}),L(to,{className:"size-4"})]})}),L(de,{align:"start",className:"w-full p-0",children:L(dt,{children:X(ct,{children:[L(ut,{children:"No item found."}),Object.entries(i).map(([n,u],m)=>X(Qt,{children:[m>0&&L(ft,{}),L(pt,{heading:f?n:void 0,children:u.map(s=>{let g=t.some(p=>p.value===s.value);return X(Ft,{onSelect:()=>{a(g?t.filter(p=>p.value!==s.value):[...t,s])},children:[L(eo,{className:_("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),s.label]},s.label)})})]},n))]})})})]})}r(ue,"MultiSelect");import{jsx as J,jsxs as ao}from"react/jsx-runtime";function gt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,component:F,...f}){let{control:i}=x(),{components:n}=b(),[u,m]=ro([]);return J(k,{defaultValue:o,control:i,name:t,render:({field:s,fieldState:g})=>{let p=F||n?.countries;if(p){let C={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,...f};return J(p,{field:{...s,onChange:r(T=>{s.onChange(T),d?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(c?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(c?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...a.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],S=r(C=>{let T=C.map(({value:G})=>G);s.onChange(T),d?.(T),m(C)},"handleChange");return ao(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[J(N,{className:"RemoteFlows__CountryField__Label",children:e}),J(P,{children:J(ue,{options:h,selected:u,onChange:S,...f})}),l&&J(R,{children:l}),g.error&&J(D,{})]})}})}r(gt,"CountryField");import*as ht from"react";import{jsx as no}from"react/jsx-runtime";var Pe=ht.forwardRef(({className:e,...t},a)=>no("textarea",{className:_("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));Pe.displayName="Textarea";import{jsx as q,jsxs as Re}from"react/jsx-runtime";function _t({name:e,description:t,label:a,onChange:o,maxLength:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return q(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.textarea;if(u){let s={name:e,description:t,label:a,maxLength:l,...c};return q(u,{field:{...i,onChange:r(g=>{i.onChange(g),o?.(g)},"onChange")},fieldState:n,fieldData:s})}let m=i.value?.length??0;return Re(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[q(N,{className:"RemoteFlows__TextArea__Label",children:a}),q(P,{children:q(Pe,{...i,value:i.value??"",onChange:s=>{i.onChange(s),o?.(s)},className:_(n.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:a})}),(t||l)&&Re("div",{className:"flex items-center justify-between",children:[t&&q(R,{className:"RemoteFlows__TextArea__Description",children:t}),l&&Re("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",l]})]}),n.error&&q(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(_t,"TextAreaField");import{jsx as De}from"react/jsx-runtime";function yt(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.email;return o?De(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>De(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):De(B,{...e,type:"email"})}r(yt,"EmailField");import{jsx as vt}from"react/jsx-runtime";function Ct(e){let{control:t}=x();return vt(k,{control:t,name:e.name,render:({field:a})=>vt("input",{...a,type:"hidden"})})}r(Ct,"HiddenField");import po,{useEffect as fo,useState as Dt}from"react";var xt=r((e,t,a)=>{if(e&&"reportValidity"in e){let o=re(a,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},"r"),Te=r((e,t)=>{for(let a in t.fields){let o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?xt(o.ref,a,e):o&&o.refs&&o.refs.forEach(l=>xt(l,a,e))}},"o"),St=r((e,t)=>{t.shouldUseNativeValidation&&Te(e,t);let a={};for(let o in e){let l=re(t.fields,o),d=Object.assign(e[o]||{},{ref:l&&l.ref});if(so(t.names||Object.keys(e),o)){let c=Object.assign({},re(a,o));ae(c,"root",d),ae(a,o,c)}else ae(a,o,d)}return a},"s"),so=r((e,t)=>{let a=bt(t);return e.some(o=>bt(o).match(`^${a}\\.\\d+`))},"i");function bt(e){return e.replace(/\]|\[/g,"")}r(bt,"n");function kt(e,t,a){return t===void 0&&(t={}),a===void 0&&(a={}),function(o,l,d){try{return Promise.resolve(function(c,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[a.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:l}))).then(function(i){return d.shouldUseNativeValidation&&Te({},d),{values:a.raw?Object.assign({},o):i,errors:{}}}))}catch(i){return F(i)}return f&&f.then?f.then(void 0,F):f}(0,function(c){if(!c.inner)throw c;return{values:{},errors:St((F=c,f=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(F.inner||[]).reduce(function(i,n){if(i[n.path]||(i[n.path]={message:n.message,type:n.type}),f){var u=i[n.path].types,m=u&&u[n.type];i[n.path]=Le(n.path,f,i,n.type,m?[].concat(m,n.message):n.message)}return i},{})),d)};var F,f}))}catch(c){return Promise.reject(c)}}}r(kt,"o");import*as I from"yup";import Nt from"lodash.groupby";import Q from"lodash.capitalize";var wt=60,pe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function lo(e){if(e<60)return`${e}m`;let t=Math.floor(e/wt),a=e%wt;return a>0?`${t}h${a}m`:`${t}h`}r(lo,"convertBreakDurationToHours");function Pt(e){let t=e.reduce((a,o)=>o.hours+a,0);return Number(t.toFixed(2))}r(Pt,"calculateTotalWorkHours");function io(e,t){let a=t.map(({day:d})=>d.toLowerCase()),o=a.indexOf(e),l=null;for(;o<a.length&&!l;){let d=a[o],c=a[o+1],F=pe.indexOf(d)+1;pe[F]===c||(l=d),o+=1}return l}r(io,"findLastConsecutiveDay");function mo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(mo,"shouldSummarizeSchedule");function co(e){return Number.parseInt(e.break_duration_minutes)>0}r(co,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(mo),a=Nt(t,F=>`${F.start_time}|${F.end_time}`),o=e.filter(co),l=Nt(o,"break_duration_minutes"),d=Object.keys(a).map(F=>{let f=a[F],i=f[0].day,[n,u]=F.split("|"),m=`from <span>${n.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,s=io(i,f),p=(s?f.findIndex(h=>h.day===s):-1)===f.length-1;return f.length===1?`${Q(i)}, ${m}`:!p||!s?f.reduce((h,S,C)=>{let T=Q(S.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${Q(i)}</span> to <span>${Q(s)}</span>, ${m}`}),c=Object.keys(l).reverse().map((F,f)=>{let i=f===0,n=l[F],u=lo(parseInt(F,10));if(Object.keys(l).length===1)return`With ${u} daily breaks`;if(n.length===1){let m=`${u} break on ${Q(n[0].day)}.`;return i?`With ${m}`:m}return n.reduce((m,s,g)=>{let p=Q(s.day);return g===0?`${m} ${p}`:g===n.length-1?`${m}, and ${p}.`:`${m}, ${p}`},i?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:d,breakSummary:c}}r(Rt,"buildWorkScheduleSummary");function Ie(e){let{checked:t,start_time:a,end_time:o,break_duration_minutes:l}=e;if(!t)return 0;let[d,c]=a.split(":").map(Number),[F,f]=o.split(":").map(Number),i=d*60+c,m=(F*60+f-i-Number.parseInt(l||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Ie,"calculateHours");var uo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function fe(e){return uo[e]}r(fe,"getShortWeekday");import{jsx as y,jsxs as H}from"react/jsx-runtime";var Fo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:I.number().default(0),break_duration_minutes:I.string().default("0")}),go=I.object({schedule:I.array(Fo)});function ho({defaultSchedule:e,onSubmit:t}){let[a,o]=Dt(!1),l=pe.map(p=>{let h=e.find(S=>S.day.toLowerCase()===fe(p).toLowerCase()||S.day.toLowerCase()===p.toLowerCase());return h?{...h,day:fe(p),checked:!0}:{...e[0],checked:!1,day:fe(p)}}),d=Be({defaultValues:{schedule:l},resolver:kt(go)}),{handleSubmit:c,watch:F,reset:f,control:i,formState:n}=d,{fields:u}=He({name:"schedule",control:i}),m=F("schedule");function s(p){let h=p.schedule.filter(({checked:S})=>S).map(S=>({...S,hours:Ie(S)}));t(h),o(!1)}r(s,"handleSubmitWorkingHours");function g(){f(),o(!1)}return r(g,"handleCancel"),y("div",{className:"flex items-center justify-between",children:H(ye,{open:a,onOpenChange:o,children:[y(Xe,{asChild:!0,children:y($,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(ve,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(Ce,{children:y(xe,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(Ae,{...d,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),H("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((p,h)=>{let S=m[h],C=Ie(S);return H(po.Fragment,{children:[H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(se,{label:p.day,name:`schedule.${h}.checked`})}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(B,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(n.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[y($,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),y($,{type:"button",className:"submit-button",onClick:c(s),children:"Save Schedule"})]})]})})]})]})})}r(ho,"WorkScheduleSelectionForm");function Tt(e){let{components:t}=b(),{setValue:a,control:o,watch:l}=x(),d=l(e.name),[c,F]=Dt(d),{workHoursSummary:f,breakSummary:i}=Rt(c),n=Pt(c);fo(()=>{a(e.name,c)},[c,e.name,a]);function u(s){F(s)}r(u,"onSubmit");let m=e.component||t?.["work-schedule"];return m?y(k,{control:o,name:e.name,render:({field:s,fieldState:g})=>y(m,{field:{...s,onChange:r(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:i,totalWorkHours:n}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:n})," hours per week"]}),y(ho,{defaultSchedule:c,onSubmit:u})]})]})}r(Tt,"WorkScheduleField");import{useState as _o}from"react";import{jsx as K,jsxs as yo}from"react/jsx-runtime";function It({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b(),[n,u]=_o();return K(k,{defaultValue:o,control:f,name:t,render:({field:m,fieldState:s})=>{let g=c||i?.["multi-select"];if(g){let h={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return K(g,{field:{...m,onChange:r(S=>{m.onChange(S),d?.(S)},"onChange")},fieldState:s,fieldData:h})}let p=n||a.filter(h=>m.value.includes(h.value));return yo(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(N,{className:"RemoteFlows__SelectField__Label",children:e}),K(P,{children:K(ue,{options:a,selected:p,onChange:h=>{let S=h.map(({value:C})=>C);m.onChange(S),d?.(S),u(h)},...F})}),l&&K(R,{children:l}),s.error&&K(D,{})]})}})}r(It,"MultiSelectField");import{jsx as vo}from"react/jsx-runtime";var $t=r(e=>vo(ce,{maxLength:15,...e}),"MoneyField");var $e={checkbox:se,text:B,email:yt,money:$t,select:mt,"multi-select":It,radio:lt,number:ce,file:st,date:rt,textarea:_t,countries:gt,hidden:Ct,"work-schedule":Tt};import{AlertCircle as Co}from"lucide-react";import{jsx as Fe,jsxs as xo}from"react/jsx-runtime";function Et({title:e,description:t,severity:a}){let{components:o}=b();if(o?.statement){let l=o?.statement;return Fe(l,{data:{title:e,description:ee(t),severity:a}})}return xo(Qe,{variant:"warning",children:[Fe(Co,{className:"h-4 w-4"}),e&&Fe(Ze,{children:e}),t&&Fe(et,{dangerouslySetInnerHTML:{__html:ee(t)}})]})}r(Et,"Statement");import{Fragment as bo,useEffect as So,useRef as Mt}from"react";import{jsx as z,jsxs as te}from"react/jsx-runtime";var ko=r(({isExpanded:e,onToggle:t,className:a,...o})=>z($,{type:"button",className:_("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",a),variant:"default",onClick:t,...o,children:e?"Remove":"Define"}),"DefaultToggleButton");function ss({label:e,name:t,fields:a,description:o,components:l,statement:d,isFlatFieldset:c,extra:F,variant:f="outset",features:i}){let{watch:n,setValue:u,trigger:m,formState:s}=x(),{components:g}=b(),p=i?.toggle?.stateField,h=p?n(p):i?.toggle?.defaultExpanded??!0,S=a.map(({name:v})=>`${t}.${v}`),C=n(S),T=Mt(C),G=Mt(null),Wt=r(()=>{p&&u(p,!h)},"toggleExpanded");So(()=>{let v=C,oe=T.current,ge=s.isSubmitted||s.submitCount>0,We=!1;for(let Z=0;Z<v.length;Z++)if(v[Z]!==void 0&&oe[Z]!==v[Z]){We=!0;break}return We&&ge&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{m()},50)),T.current=[...v],()=>{G.current&&clearTimeout(G.current)}},[C,m,s.isSubmitted,s.submitCount]);let Lt=g?.fieldsetToggle||ko,Ee=`${t}-content`,Me=`${t}-header`;return te("fieldset",{className:_("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[z("legend",{className:_("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),f==="inset"&&te("div",{className:"RemoteFlows__FieldSetField__Header",id:Me,"data-state":h?"expanded":"collapsed","aria-expanded":h,children:[z("h3",{className:_("RemoteFlows__FieldSetField__Title"),children:e}),i?.toggle?.enabled&&z(Lt,{isExpanded:h,onToggle:Wt,"aria-expanded":h,"aria-controls":Ee,"aria-label":`${h?"Hide":"Show"} ${e}`,className:_("RemoteFlows__FieldSetField__Toggle",i.toggle?.className),children:h?i.toggle.labels?.collapse??"Remove":i.toggle.labels?.expand??"Define"})]}),h&&te("div",{id:Ee,"aria-labelledby":Me,role:"region",children:[o?z("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:ee(o)}}):null,te("div",{className:"grid gap-4",children:[a.map(v=>{v.calculateDynamicProperties&&(v={...v,...v.calculateDynamicProperties(C,v)||{}});let oe=$e[v.type];if(v.isVisible===!1||v.deprecated)return null;if(v.Component){let{Component:ge}=v;return z(ge,{...v},v.name)}return v.type==="select"&&v.multiple&&(oe=$e["multi-select"]),te(bo,{children:[z(oe,{...v,name:`${c?v.name:`${t}.${v.name}`}`,component:l?.[v.type]}),v.extra?v.extra:null]},`${c?v.name:`${t}.${v.name}`}`)}),F||null,d?z(Et,{...d}):null]})]})]})}r(ss,"FieldSetField");export{$e as a,Et as b,ss as c};
2
+ //# sourceMappingURL=chunk-4SIGN3ZP.js.map
@@ -0,0 +1,2 @@
1
+ var e={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{agrees_to_pto_amount:{const:"no"}},required:["agrees_to_pto_amount"]},then:{properties:{agrees_to_pto_amount_notes:{type:"string"}},required:["agrees_to_pto_amount_notes"]},else:{properties:{agrees_to_pto_amount_notes:!1,timesheet_file:!1}}}],properties:{timeoff_statement:{type:"null",title:"Timeoff statement","x-jsf-presentation":{inputType:"hidden",statement:{title:"Make sure these paid time off records are correct",description:"You must pay the employee for any unused accrued paid time off, so please check these records carefully.",inputType:"statement",severity:"warning"},meta:{ignoreValue:!0}}},paid_time_off_info:{type:"null",title:"Paid time off info","x-jsf-presentation":{inputType:"hidden"},meta:{ignoreValue:!0}},agrees_to_pto_amount:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Are these paid time off records correct?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},agrees_to_pto_amount_notes:{description:"Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.",maxLength:1e3,title:"Provide time off details",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},timesheet_file:{description:"Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.",title:"Timesheet document",type:["string","null"],"x-jsf-presentation":{inputType:"file",accept:".pdf"}}},required:["agrees_to_pto_amount"],type:"object","x-jsf-order":["timeoff_statement","paid_time_off_info","agrees_to_pto_amount","agrees_to_pto_amount_notes","timesheet_file"]}}};export{e as a};
2
+ //# sourceMappingURL=chunk-4T6PRR6R.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/Termination/json-schemas/paidTimeOff.ts"],"sourcesContent":["export const paidTimeOffSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n timeoff_statement: {\n type: 'null',\n title: 'Timeoff statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n statement: {\n title: 'Make sure these paid time off records are correct',\n description:\n 'You must pay the employee for any unused accrued paid time off, so please check these records carefully.',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n },\n },\n },\n required: ['agrees_to_pto_amount'],\n type: 'object',\n 'x-jsf-order': [\n 'timeoff_statement',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAoB,CAC/B,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,kBAAmB,CACjB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,UAAW,CACT,MAAO,oDACP,YACE,2GACF,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQ,MACV,CACF,CACF,EACA,SAAU,CAAC,sBAAsB,EACjC,KAAM,SACN,cAAe,CACb,oBACA,uBACA,6BACA,gBACF,CACF,CACF,CACF","names":["paidTimeOffSchema"]}
1
+ {"version":3,"sources":["../src/flows/Termination/json-schemas/paidTimeOff.ts"],"sourcesContent":["export const paidTimeOffSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n timeoff_statement: {\n type: 'null',\n title: 'Timeoff statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n statement: {\n title: 'Make sure these paid time off records are correct',\n description:\n 'You must pay the employee for any unused accrued paid time off, so please check these records carefully.',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n paid_time_off_info: {\n type: 'null',\n title: 'Paid time off info',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n meta: {\n ignoreValue: true,\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n },\n },\n },\n required: ['agrees_to_pto_amount'],\n type: 'object',\n 'x-jsf-order': [\n 'timeoff_statement',\n 'paid_time_off_info',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAoB,CAC/B,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,kBAAmB,CACjB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,UAAW,CACT,MAAO,oDACP,YACE,2GACF,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,mBAAoB,CAClB,KAAM,OACN,MAAO,qBACP,qBAAsB,CACpB,UAAW,QACb,EACA,KAAM,CACJ,YAAa,EACf,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQ,MACV,CACF,CACF,EACA,SAAU,CAAC,sBAAsB,EACjC,KAAM,SACN,cAAe,CACb,oBACA,qBACA,uBACA,6BACA,gBACF,CACF,CACF,CACF","names":["paidTimeOffSchema"]}
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-5SKMAYLG.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function f({onSubmit:n}){let{terminationBag:i}=m();return e(r,{onSubmit:o(async a=>{await n?.(i?.parseFormValues(a)),i?.next()},"handleSubmit")})}o(f,"PaidTimeOffForm");export{f as a};
2
- //# sourceMappingURL=chunk-JX3OQNNM.js.map
1
+ import{a as r}from"./chunk-VYDVPM5S.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function f({onSubmit:n}){let{terminationBag:i}=m();return e(r,{onSubmit:o(async a=>{await n?.(i?.parseFormValues(a)),i?.next()},"handleSubmit")})}o(f,"PaidTimeOffForm");export{f as a};
2
+ //# sourceMappingURL=chunk-4URY37KB.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as o}from"./chunk-XICA45G2.js";import{b as i}from"./chunk-E773NPNL.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Info as u}from"lucide-react";import{Fragment as f,jsx as e,jsxs as t}from"react/jsx-runtime";function w({benefitsTotal:d,benefitsBreakdown:p,currency:n}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground-800",children:"Benefits"}),e("span",{className:"font-semibold text-lg",children:a(d,n)})]}),e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:p.map((s,c)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(f,{children:[e("span",{children:s.description})," ",s.zendesk_article_url&&e(o,{zendeskId:Number(s.zendesk_article_id),children:"Learn more"})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(u,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(s.amount,n)})]},c))})]})}r(w,"CostCalculatorBenefitsBreakdown");export{w as a};
2
- //# sourceMappingURL=chunk-FVFXPT3Y.js.map
1
+ import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as l}from"./chunk-ZSCKSEAA.js";import{a as o}from"./chunk-MP2T74PU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Info as u}from"lucide-react";import{Fragment as f,jsx as e,jsxs as t}from"react/jsx-runtime";function w({benefitsTotal:d,benefitsBreakdown:p,currency:n}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground-800",children:"Benefits"}),e("span",{className:"font-semibold text-lg",children:a(d,n)})]}),e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:p.map((s,c)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(f,{children:[e("span",{children:s.description})," ",s.zendesk_article_url&&e(o,{zendeskId:Number(s.zendesk_article_id),children:"Learn more"})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(u,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(s.amount,n)})]},c))})]})}r(w,"CostCalculatorBenefitsBreakdown");export{w as a};
2
+ //# sourceMappingURL=chunk-5XHKOMX5.js.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-TOA3JILU.js";import{b as u}from"./chunk-E773NPNL.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({children:o,onClick:a,...n}){let{contractorOnboardingBag:{back:m,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||m(),a?.(p)},"onBackHandler"),e=d?.button;return e?c(e,{...n,onClick:r,children:o}):c(u,{...n,onClick:r,children:o})}t(C,"OnboardingBack");export{C as a};
2
- //# sourceMappingURL=chunk-C4AVUIG2.js.map
1
+ import{b as s}from"./chunk-TOA3JILU.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({children:o,onClick:a,...n}){let{contractorOnboardingBag:{back:m,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||m(),a?.(p)},"onBackHandler"),e=d?.button;return e?c(e,{...n,onClick:r,children:o}):c(u,{...n,onClick:r,children:o})}t(C,"OnboardingBack");export{C as a};
2
+ //# sourceMappingURL=chunk-5ZR7EFPY.js.map
@@ -0,0 +1,2 @@
1
+ import{a as w}from"./chunk-347YWDTK.js";import{a as C}from"./chunk-EZWZMPD2.js";import{a as M}from"./chunk-VUP76ZMQ.js";import{a as k}from"./chunk-S4XU4SE7.js";import{a as V}from"./chunk-32GSS4UM.js";import{a as S}from"./chunk-LRGEEPGK.js";import{a as h}from"./chunk-2YTBWEC7.js";import{a as g}from"./chunk-MP2T74PU.js";import{a as x,b as j}from"./chunk-2M7EBC4K.js";import{a as P}from"./chunk-PJBAQZ6G.js";import{a as F}from"./chunk-Z5WMKCRJ.js";import{c as m}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-43WMZDDH.js";import{a as i}from"./chunk-P37U34EQ.js";import{createHeadlessForm as Z}from"@remoteoss/json-schema-form";import U from"lodash.omitby";import W from"lodash.isnull";import G from"lodash.omit";import{useMemo as b}from"react";import{jsx as N,jsxs as K}from"react/jsx-runtime";function u(t,e,d){return{"x-jsf-presentation":{inputType:"hidden",Component:i(()=>K("div",{className:r("RemoteFlows__InformationStatement",d?.className),children:[N("h3",{className:r("RemoteFlows__InformationStatement__Title"),children:t}),N("p",{className:r("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(u,"createInformationField");import{Fragment as X,jsx as f,jsxs as Y}from"react/jsx-runtime";function Q(t){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,...t}}i(Q,"buildInitialValues");var Me=i(({employmentId:t,options:e,initialValues:d})=>{let{fieldValues:c,setFieldValues:v,stepState:n,previousStep:R,nextStep:$}=P(k),{data:y}=S(t),p=Q({...n.values?.employee_communication,...n.values?.termination_details,...n.values?.paid_time_off,...n.values?.additional_information,...d}),_=b(()=>({...n.values?.[n.currentStep.name],...p,...c}),[n.values,n.currentStep.name,c,p]),E=b(()=>({fields:{risk_assesment_info:u("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:u("Proposed termination date",Y(X,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",f(g,{zendeskId:V.terminationNoticePeriods,className:r("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:i(()=>{let a=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return f(C,{employeeName:y?.basic_information?.name,proposedTerminationDate:_.proposed_termination_date,employmentId:t,render:o=>a?f(a,{...o}):f(w,{...o})})},"Component")}}}}),[y?.basic_information?.name,_.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,t]),{data:s,isLoading:D}=j({formValues:_,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...E?.fields}},step:n.currentStep.name}),l=Z(M.data.schema),T=x(),{mutateAsync:O}=h(T);async function I(a){if(!t)throw new Error("Employment id is missing");if(s){let o=m(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:B}=o,H=B==="yes"?{employee_awareness:{date:o.customer_informed_employee_date,note:o.customer_informed_employee_description}}:void 0,L=F(o,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),A=G(L,"customer_informed_employee_date","customer_informed_employee_description"),q=U({...A,...H},W);return O({employment_id:t,termination_details:q,type:"termination"})}}i(I,"onSubmit");function J(){R()}i(J,"back");function z(){$()}return i(z,"next"),{employmentId:t,stepState:n,fields:s?.fields||[],isLoading:D,isSubmitting:T.isPending,initialValues:p,handleValidation:i(a=>{if(s){let o=m(a,s?.fields);return s?.handleValidation(o)}return null},"handleValidation"),checkFieldUpdates:i(a=>{if(l){let o=m(a,l?.fields,{isPartialValidation:!0});v(o)}},"checkFieldUpdates"),parseFormValues:i(a=>m(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:I,back:J,next:z}},"useTermination");export{Me as a};
2
+ //# sourceMappingURL=chunk-6U2UCWVR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { useMemo } from 'react';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { useEmployment } from '@/src/flows/Onboarding/api';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmployment(employmentId);\n\n const initialValues = buildInitialValues({\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n });\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n },\n };\n }, [\n employment?.basic_information?.name,\n formValues.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n employmentId,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (entireTerminationSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema?.fields,\n { isPartialValidation: true },\n );\n setFieldValues(parsedValues as TerminationFormValues);\n }\n },\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (values: TerminationFormValues) => {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n });\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n 'x-jsf-presentation': {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },\n };\n}\n"],"mappings":"ujBAKA,OAAmB,sBAAAA,MAA0B,8BAC7C,OAAOC,MAAY,gBACnB,OAAOC,MAAY,gBAMnB,OAAOC,MAAU,cAMjB,OAAS,WAAAC,MAAe,QCUhB,OAME,OAAAC,EANF,QAAAC,MAAA,oBAXD,SAASC,EACdC,EACAC,EACAC,EAGgB,CAChB,MAAO,CACL,qBAAsB,CACpB,UAAW,SACX,UAAWC,EAAA,IACTL,EAAC,OACC,UAAWM,EACT,oCACAF,GAAS,SACX,EAEA,UAAAL,EAAC,MAAG,UAAWO,EAAG,0CAA0C,EACzD,SAAAJ,EACH,EACAH,EAAC,KAAE,UAAWO,EAAG,gDAAgD,EAC9D,SAAAH,EACH,GACF,EAbS,YAeb,CACF,CACF,CA3BgBE,EAAAJ,EAAA,0BD+EN,mBAAAM,EAKE,OAAAC,EALF,QAAAC,MAAA,oBAtEV,SAASC,EACPC,EACuB,CAsBvB,MArB6C,CAC3C,aAAc,GACd,2BAA4B,GAC5B,gCAAiC,GACjC,uCAAwC,GACxC,eAAgB,GAChB,mBAAoB,OACpB,mBAAoB,GACpB,yBAA0B,CAAC,EAC3B,2BAA4B,GAC5B,uCAAwC,KACxC,qBAAsB,GACtB,2BAA4B,KAC5B,kCAAmC,GACnC,oBAAqB,GACrB,0BAA2B,GAC3B,wBAAyB,CAAC,EAC1B,eAAgB,OAChB,GAAGA,CACL,CAGF,CAzBSC,EAAAF,EAAA,sBA6BF,IAAMG,GAAiBD,EAAA,CAAC,CAC7B,aAAAE,EACA,QAAAC,EACA,cAAeC,CACjB,IAA4B,CAC1B,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,UAAAC,EAAW,aAAAC,EAAc,SAAAC,CAAS,EACrEC,EAAwDC,CAAK,EAEzD,CAAE,KAAMC,CAAW,EAAIC,EAAcX,CAAY,EAEjDY,EAAgBhB,EAAmB,CACvC,GAAGS,EAAU,QAAQ,uBACrB,GAAGA,EAAU,QAAQ,oBACrB,GAAGA,EAAU,QAAQ,cACrB,GAAGA,EAAU,QAAQ,uBACrB,GAAGH,CACL,CAAC,EAEKW,EAAaC,EACjB,KAAO,CACL,GAAGT,EAAU,SAASA,EAAU,YAAY,IAA0B,EACtE,GAAGO,EACH,GAAGT,CACL,GACA,CAACE,EAAU,OAAQA,EAAU,YAAY,KAAMF,EAAaS,CAAa,CAC3E,EAEMG,EAAeD,EAAQ,KACpB,CACL,OAAQ,CACN,oBAAqBE,EACnB,8BACA,wNACA,CACE,UACEf,GAAS,WAAW,QAAQ,sBAC1B,oBAAoB,GAAG,SAC7B,CACF,EACA,+BAAgCe,EAC9B,4BACArB,EAAAF,EAAA,CAAE,4PAKAC,EAACuB,EAAA,CACC,UAAWC,EAAgB,yBAC3B,UAAWC,EACT,UAEElB,GAAS,WAAW,QAChB,iCACF,oBAAoB,GAAG,6BAC7B,EACD,sCAED,GACF,EACA,CACE,UACEA,GAAS,WAAW,QAChB,iCACF,oBAAoB,GAAG,SAC7B,CACF,EACA,mBAAoB,CAClB,GAAIA,GAAS,WAAW,QAAQ,mBAChC,qBAAsB,CACpB,GAAIA,GAAS,WAAW,QAAQ,qBAC9B,oBACF,EACA,UAAWH,EAAA,IAAM,CACf,IAAMsB,EACJnB,GAAS,WAAW,QAAQ,qBAC1B,oBAAoB,GAAG,UAE3B,OACEP,EAAC2B,EAAA,CACC,aAAcX,GAAY,mBAAmB,KAC7C,wBAAyBG,EAAW,0BACpC,aAAcb,EACd,OAASsB,GACHF,EACK1B,EAAC0B,EAAA,CAAiB,GAAGE,EAAO,EAE9B5B,EAAC6B,EAAA,CAAa,GAAGD,EAAO,EAEnC,CAEJ,EAlBW,YAmBb,CACF,CACF,CACF,GACC,CACDZ,GAAY,mBAAmB,KAC/BG,EAAW,0BACXZ,GAAS,WAAW,QAAQ,mBAC5BA,GAAS,WAAW,QAAQ,+BAC5BA,GAAS,WAAW,QAAQ,oBAC5BD,CACF,CAAC,EAEK,CAAE,KAAMwB,EAAyB,UAAWC,CAAqB,EACrEC,EAAqB,CACnB,WAAYb,EACZ,UAAW,CACT,GAAGZ,GAAS,UACZ,OAAQ,CACN,GAAGA,GAAS,WAAW,OACvB,GAAGc,GAAc,MACnB,CACF,EACA,KAAMV,EAAU,YAAY,IAC9B,CAAC,EAEGsB,EAA0BC,EAAmBC,EAAW,KAAK,MAAM,EAEnEC,EAAoBC,EAAqB,EACzC,CAAE,YAAAC,CAAY,EAAIC,EAAkBH,CAAiB,EAE3D,eAAeI,EAASC,EAA+B,CACrD,GAAI,CAACnC,EACH,MAAM,IAAI,MAAM,0BAA0B,EAG5C,GAAIwB,EAAyB,CAE3B,IAAMY,EAAeC,EACnBF,EACAR,EAAwB,OACxB,CAAE,oBAAqB,EAAK,CAC9B,EAEM,CAAE,2BAA4BW,CAAyB,EAC3DF,EAEIG,EACJD,IAA6B,MACzB,CACE,mBAAoB,CAClB,KAAMF,EAAa,gCACnB,KAAMA,EAAa,sCACrB,CACF,EACA,OASAI,EAAoBC,EACxBL,EARqB,CACrB,uBACA,eACA,6BACA,4BACF,CAKA,EAEMM,EAAmBC,EACvBH,EACA,kCACA,wCACF,EAEMI,EAA+CC,EACnD,CACE,GAAGH,EACH,GAAGH,CACL,EACAO,CACF,EAQA,OAAOd,EAN6C,CAClD,cAAehC,EACf,oBAAqB4C,EACrB,KAAM,aACR,CAEqC,CACvC,CAGF,CA9De9C,EAAAoC,EAAA,YAgEf,SAASa,GAAO,CACdzC,EAAa,CACf,CAFSR,EAAAiD,EAAA,QAIT,SAASC,GAAO,CACdzC,EAAS,CACX,CAFS,OAAAT,EAAAkD,EAAA,QAIF,CAIL,aAAAhD,EAIA,UAAAK,EAIA,OAAQmB,GAAyB,QAAU,CAAC,EAI5C,UAAWC,EAIX,aAAcK,EAAkB,UAIhC,cAAelB,EAMf,iBAAkBd,EAACqC,GAAkC,CACnD,GAAIX,EAAyB,CAC3B,IAAMY,EAAeC,EACnBF,EACAX,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBY,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAclB,kBAAmBtC,EAACqC,GAA2C,CAC7D,GAAIR,EAAyB,CAC3B,IAAMS,EAAeC,EACnBF,EACAR,GAAyB,OACzB,CAAE,oBAAqB,EAAK,CAC9B,EACAvB,EAAegC,CAAqC,CACtD,CACF,EATmB,qBAenB,gBAAiBtC,EAACqC,GACTE,EAAmBF,EAAQR,EAAwB,OAAQ,CAChE,oBAAqB,EACvB,CAAC,EAHc,mBAUjB,SAAAO,EAMA,KAAAa,EAMA,KAAAC,CACF,CACF,EArR8B","names":["createHeadlessForm","omitBy","isNull","omit","useMemo","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmployment","initialValues","formValues","useMemo","customFields","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next"]}
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-MRYRNB7Y.js";import{b as m}from"./chunk-E773NPNL.js";import{b as e}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function f({children:n,...t}){let{terminationBag:{back:i}}=c(),{components:B}=e(),r=B?.button;return r?s(r,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n}):s(m,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n})}u(f,"TerminationBack");export{f as a};
2
- //# sourceMappingURL=chunk-5N4L2G7Q.js.map
1
+ import{b as c}from"./chunk-MRYRNB7Y.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as e}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function f({children:n,...t}){let{terminationBag:{back:i}}=c(),{components:B}=e(),r=B?.button;return r?s(r,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n}):s(m,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n})}u(f,"TerminationBack");export{f as a};
2
+ //# sourceMappingURL=chunk-6VRUYYUV.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-NHYBFEXA.js";import{b as i}from"./chunk-TOA3JILU.js";import{b as n}from"./chunk-7XRPOR7L.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:d,onSuccess:l,onError:a}){let{contractorOnboardingBag:o}=i(),c=t(async e=>{try{await d?.(o.parseFormValues(e));let r=await o.onSubmit(e);if(r?.data){await l?.(r?.data),o?.next();return}if(r?.error){let p=n(r?.fieldErrors||[],o.meta?.fields?.contract_details);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),m=o.stepState.values?.contract_details||o.initialValues.contract_details;return u(s,{defaultValues:m,onSubmit:c})}t(F,"ContractDetailsStep");export{F as a};
2
- //# sourceMappingURL=chunk-GLUERRJ2.js.map
1
+ import{a as s}from"./chunk-4M4OJPUA.js";import{b as i}from"./chunk-TOA3JILU.js";import{b as n}from"./chunk-2YTBWEC7.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:d,onSuccess:l,onError:a}){let{contractorOnboardingBag:o}=i(),c=t(async e=>{try{await d?.(o.parseFormValues(e));let r=await o.onSubmit(e);if(r?.data){await l?.(r?.data),o?.next();return}if(r?.error){let p=n(r?.fieldErrors||[],o.meta?.fields?.contract_details);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),m=o.stepState.values?.contract_details||o.initialValues.contract_details;return u(s,{defaultValues:m,onSubmit:c})}t(F,"ContractDetailsStep");export{F as a};
2
+ //# sourceMappingURL=chunk-A7HJICVX.js.map
@@ -1,2 +1,2 @@
1
- import{a as d,b as _,c}from"./chunk-QU3NSFU5.js";import{c as F}from"./chunk-CNDSIADP.js";import{e as y}from"./chunk-PAQW5BFW.js";import{e as m}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{Fragment as V}from"react";var u={...d,fieldset:c,"fieldset-flat":c};import{useEffect as h}from"react";import{Fragment as x,jsx as i,jsxs as C}from"react/jsx-runtime";function g({name:t,value:a,description:s,statement:r,label:l}){let{setValue:e}=F();return h(()=>{e(t,a)},[]),i("div",{children:r?C(x,{children:[i("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:m(r?.title||l)}}),i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(r?.description||s)}})]}):i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(s)}})})}p(g,"ForcedValueField");import{Fragment as P,jsx as o,jsxs as S}from"react/jsx-runtime";function k(t){return t.const!==void 0&&t.const===t.default&&t.inputType!=="checkbox"&&t.inputType!=="hidden"}p(k,"checkFieldHasForcedValue");var q=p(({fields:t,fieldsets:a,fieldValues:s,components:r})=>{if(!t||t.length===0)return null;let l=a&&s?y({fields:t,fieldsets:a,values:s}):t;return o(P,{children:l.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(s,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(k(e))return o(g,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label},e.name);if(e.Component){let{Component:T}=e;return o(T,{...e},e.name)}let n=u[e.type];return e.type==="select"&&e.multiple&&(n=u["multi-select"]),e.type==="fieldset"?o(n,{...e,components:r},e.name):e.type==="fieldset-flat"?o(n,{...e,components:r,isFlatFieldset:!0},e.name):n?S(V,{children:[o(n,{...e,component:r&&r[e.type]}),e.statement?o(_,{...e.statement}):null,e.extra?e.extra:null]},e.name):S("p",{className:"error",children:["Field type ",e.type," not supported"]})})})},"JSONSchemaFormFields");export{q as a};
2
- //# sourceMappingURL=chunk-EIVHHLR5.js.map
1
+ import{a as d,b as _,c}from"./chunk-4SIGN3ZP.js";import{c as F}from"./chunk-CNDSIADP.js";import{e as y}from"./chunk-PAQW5BFW.js";import{e as m}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{Fragment as V}from"react";var u={...d,fieldset:c,"fieldset-flat":c};import{useEffect as h}from"react";import{Fragment as x,jsx as i,jsxs as C}from"react/jsx-runtime";function g({name:t,value:a,description:s,statement:r,label:l}){let{setValue:e}=F();return h(()=>{e(t,a)},[]),i("div",{children:r?C(x,{children:[i("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:m(r?.title||l)}}),i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(r?.description||s)}})]}):i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(s)}})})}p(g,"ForcedValueField");import{Fragment as P,jsx as o,jsxs as S}from"react/jsx-runtime";function k(t){return t.const!==void 0&&t.const===t.default&&t.inputType!=="checkbox"&&t.inputType!=="hidden"}p(k,"checkFieldHasForcedValue");var q=p(({fields:t,fieldsets:a,fieldValues:s,components:r})=>{if(!t||t.length===0)return null;let l=a&&s?y({fields:t,fieldsets:a,values:s}):t;return o(P,{children:l.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(s,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(k(e))return o(g,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label},e.name);if(e.Component){let{Component:T}=e;return o(T,{...e},e.name)}let n=u[e.type];return e.type==="select"&&e.multiple&&(n=u["multi-select"]),e.type==="fieldset"?o(n,{...e,components:r},e.name):e.type==="fieldset-flat"?o(n,{...e,components:r,isFlatFieldset:!0},e.name):n?S(V,{children:[o(n,{...e,component:r&&r[e.type]}),e.statement?o(_,{...e.statement}):null,e.extra?e.extra:null]},e.name):S("p",{className:"error",children:["Field type ",e.type," not supported"]})})})},"JSONSchemaFormFields");export{q as a};
2
+ //# sourceMappingURL=chunk-A7T27JCJ.js.map
@@ -1,2 +1,2 @@
1
- import{b as l}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-E773NPNL.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as c}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function R({children:e,...t}){let{form:r,formId:n,costCalculatorBag:s}=l(),{components:f}=i(),m=f?.button;return m?a(m,{...t,type:"reset",form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e}):a(C,{...t,type:"reset",className:c("RemoteFlows__CostCalculatorForm__ResetButton",t.className),form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e})}u(R,"CostCalculatorResetButton");export{R as a};
2
- //# sourceMappingURL=chunk-C4SMHWP4.js.map
1
+ import{b as l}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as c}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function R({children:e,...t}){let{form:r,formId:n,costCalculatorBag:s}=l(),{components:f}=i(),m=f?.button;return m?a(m,{...t,type:"reset",form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e}):a(C,{...t,type:"reset",className:c("RemoteFlows__CostCalculatorForm__ResetButton",t.className),form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e})}u(R,"CostCalculatorResetButton");export{R as a};
2
+ //# sourceMappingURL=chunk-ANGJCT4I.js.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-R2MHAPWD.js";import{E as C,e as d,k as y,z as p}from"./chunk-MISHDUB2.js";import{b as f}from"./chunk-Z5WMKCRJ.js";import{d as s}from"./chunk-3ZWDIEEM.js";import{a as l}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as g,modify as D}from"@remoteoss/json-schema-form";import{useMutation as F,useQuery as m}from"@tanstack/react-query";var G=e(({fieldValues:n,options:o})=>m({queryKey:["contract-document-signature"],queryFn:e(async()=>g(h,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),J=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>C({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),Q=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return m({queryKey:["contract-document",n,o],queryFn:e(async()=>y({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:i})=>i?.data,"select")})},"useGetShowContractDocument"),R=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,payload:t})=>p({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),T=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:i}=s();return m({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>d({client:i,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:b})=>{let a=b?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=D(a,t.jsfModify);a=c}let S=f(a.properties||{},"money").reduce((c,u)=>(c[u]=l(o[u]),c),{}),_={...o,...S};return{meta:{"x-jsf-fieldsets":a["x-jsf-fieldsets"]},...g(a,{initialValues:_})}},"select")})},"useContractorOnboardingDetailsSchema");export{G as a,J as b,Q as c,R as d,T as e};
2
- //# sourceMappingURL=chunk-QP36XXCQ.js.map
1
+ import{a as h}from"./chunk-R2MHAPWD.js";import{A as p,F as C,e as d,k as y}from"./chunk-3O3Q24JL.js";import{b as f}from"./chunk-Z5WMKCRJ.js";import{d as s}from"./chunk-3ZWDIEEM.js";import{a as l}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as g,modify as D}from"@remoteoss/json-schema-form";import{useMutation as F,useQuery as m}from"@tanstack/react-query";var G=e(({fieldValues:n,options:o})=>m({queryKey:["contract-document-signature"],queryFn:e(async()=>g(h,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),J=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>C({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),Q=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return m({queryKey:["contract-document",n,o],queryFn:e(async()=>y({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:i})=>i?.data,"select")})},"useGetShowContractDocument"),R=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,payload:t})=>p({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),T=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:i}=s();return m({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>d({client:i,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:b})=>{let a=b?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=D(a,t.jsfModify);a=c}let S=f(a.properties||{},"money").reduce((c,u)=>(c[u]=l(o[u]),c),{}),_={...o,...S};return{meta:{"x-jsf-fieldsets":a["x-jsf-fieldsets"]},...g(a,{initialValues:_})}},"select")})},"useContractorOnboardingDetailsSchema");export{G as a,J as b,Q as c,R as d,T as e};
2
+ //# sourceMappingURL=chunk-BDPCUDJB.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-XHOQSIXZ.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
- //# sourceMappingURL=chunk-22JS3T6G.js.map
1
+ import{a}from"./chunk-DYWOG7Q2.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
+ //# sourceMappingURL=chunk-BGU3LZ2S.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-RQXKQTRD.js";import{a as r}from"./chunk-P5WUODPR.js";import{a as t}from"./chunk-6U2UCWVR.js";import{a as f}from"./chunk-NYEZAOUI.js";import{a as e}from"./chunk-OEAHDUWE.js";import{a as p}from"./chunk-4URY37KB.js";import{a as n}from"./chunk-6VRUYYUV.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as F}from"react/jsx-runtime";var k=i(({employmentId:l,render:T,options:d,initialValues:s})=>{let u=c(),o=t({employmentId:l,options:d,initialValues:s});return F(m.Provider,{value:{formId:u,terminationBag:o},children:T({terminationBag:o,components:{SubmitButton:r,Back:n,EmployeeComunicationStep:e,TerminationDetailsStep:a,PaidTimeOffStep:p,AdditionalDetailsStep:f}})})},"TerminationFlow");export{k as a};
2
+ //# sourceMappingURL=chunk-BJOF6IEZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/TerminationFlow.tsx"],"sourcesContent":["import { TerminationContext } from '@/src/flows/Termination/context';\nimport { useId } from 'react';\nimport { useTermination } from '@/src/flows/Termination/hooks';\nimport { TerminationSubmit } from '@/src/flows/Termination/TerminationSubmit';\nimport { TerminationBack } from '@/src/flows/Termination/TerminationBack';\nimport { EmployeeCommunicationForm } from '@/src/flows/Termination/EmployeeComunicationForm';\nimport { TerminationDetailsForm } from '@/src/flows/Termination/TerminationDetailsForm';\nimport { PaidTimeOffForm } from '@/src/flows/Termination/PaidTimeOffForm';\nimport { AdditionalDetailsForm } from '@/src/flows/Termination/AdditionalDetailsForm';\nimport { TerminationFlowProps } from '@/src/flows/Termination/types';\n\nexport const TerminationFlow = ({\n employmentId,\n render,\n options,\n initialValues,\n}: TerminationFlowProps) => {\n const formId = useId();\n const terminationBag = useTermination({\n employmentId,\n options,\n initialValues,\n });\n\n return (\n <TerminationContext.Provider\n value={{\n formId: formId,\n terminationBag,\n }}\n >\n {render({\n terminationBag,\n components: {\n SubmitButton: TerminationSubmit,\n Back: TerminationBack,\n EmployeeComunicationStep: EmployeeCommunicationForm,\n TerminationDetailsStep: TerminationDetailsForm,\n PaidTimeOffStep: PaidTimeOffForm,\n AdditionalDetailsStep: AdditionalDetailsForm,\n },\n })}\n </TerminationContext.Provider>\n );\n};\n"],"mappings":"mWACA,OAAS,SAAAA,MAAa,QAwBlB,cAAAC,MAAA,oBAdG,IAAMC,EAAkBC,EAAA,CAAC,CAC9B,aAAAC,EACA,OAAAC,EACA,QAAAC,EACA,cAAAC,CACF,IAA4B,CAC1B,IAAMC,EAASC,EAAM,EACfC,EAAiBC,EAAe,CACpC,aAAAP,EACA,QAAAE,EACA,cAAAC,CACF,CAAC,EAED,OACEN,EAACW,EAAmB,SAAnB,CACC,MAAO,CACL,OAAQJ,EACR,eAAAE,CACF,EAEC,SAAAL,EAAO,CACN,eAAAK,EACA,WAAY,CACV,aAAcG,EACd,KAAMC,EACN,yBAA0BC,EAC1B,uBAAwBC,EACxB,gBAAiBC,EACjB,sBAAuBC,CACzB,CACF,CAAC,EACH,CAEJ,EAjC+B","names":["useId","jsx","TerminationFlow","__name","employmentId","render","options","initialValues","formId","useId","terminationBag","useTermination","TerminationContext","TerminationSubmit","TerminationBack","EmployeeCommunicationForm","TerminationDetailsForm","PaidTimeOffForm","AdditionalDetailsForm"]}
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-TOA3JILU.js";import{d as u}from"./chunk-VXPJXQP3.js";import{a as l}from"./chunk-7XRPOR7L.js";import{b as c}from"./chunk-E773NPNL.js";import{b as d}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as y}from"react/jsx-runtime";function k({onSubmit:f,onSuccess:E,onError:i,render:s,...o}){let{components:v}=d(),{contractorOnboardingBag:r}=p(),n=u(),{mutateAsync:b}=l(n),m=e(async()=>{try{if(await f?.(),r.employmentId){let t=await b({employment_id:r.employmentId});if(t.data){await E?.({data:t.data,employmentStatus:"invited"}),r.refetchEmployment();return}t.error&&i?.({error:t.error,rawError:t.rawError,fieldErrors:[]})}}catch(t){i?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),a=v?.button;return a?y(a,{...o,disabled:n.isPending||o.disabled,onClick:t=>{m(),o.onClick?.(t)},children:s({employmentStatus:"invited"})}):y(c,{...o,disabled:n.isPending||o.disabled,onClick:()=>{m()},children:s({employmentStatus:"invited"})})}e(k,"OnboardingInvite");export{k as a};
2
- //# sourceMappingURL=chunk-DHJZVBVD.js.map
1
+ import{b as p}from"./chunk-TOA3JILU.js";import{d as u}from"./chunk-LRGEEPGK.js";import{a as l}from"./chunk-2YTBWEC7.js";import{b as c}from"./chunk-WVDTHFGS.js";import{b as d}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as y}from"react/jsx-runtime";function k({onSubmit:f,onSuccess:E,onError:i,render:s,...o}){let{components:v}=d(),{contractorOnboardingBag:r}=p(),n=u(),{mutateAsync:b}=l(n),m=e(async()=>{try{if(await f?.(),r.employmentId){let t=await b({employment_id:r.employmentId});if(t.data){await E?.({data:t.data,employmentStatus:"invited"}),r.refetchEmployment();return}t.error&&i?.({error:t.error,rawError:t.rawError,fieldErrors:[]})}}catch(t){i?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),a=v?.button;return a?y(a,{...o,disabled:n.isPending||o.disabled,onClick:t=>{m(),o.onClick?.(t)},children:s({employmentStatus:"invited"})}):y(c,{...o,disabled:n.isPending||o.disabled,onClick:()=>{m()},children:s({employmentStatus:"invited"})})}e(k,"OnboardingInvite");export{k as a};
2
+ //# sourceMappingURL=chunk-BMDZJNJV.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-XHOQSIXZ.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{b as t}from"./chunk-7XRPOR7L.js";import{d as s}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=s(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=t(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
2
- //# sourceMappingURL=chunk-WEYUB6DC.js.map
1
+ import{a as m}from"./chunk-DYWOG7Q2.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{b as t}from"./chunk-2YTBWEC7.js";import{d as s}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=s(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=t(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
2
+ //# sourceMappingURL=chunk-BVN2DKO5.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-V2PJW577.js";import{a}from"./chunk-D52VU4UO.js";import{a as c}from"./chunk-2GCMLKO2.js";import{a as e}from"./chunk-BPJHPGTL.js";import{a as m}from"./chunk-LWGVLLBH.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-2VWU5VNU.js.map
1
+ import{a as r}from"./chunk-EZV6DOVQ.js";import{a}from"./chunk-OW5QGJD4.js";import{a as c}from"./chunk-O7REUCKR.js";import{a as e}from"./chunk-EKKRQI6B.js";import{a as m}from"./chunk-LWGVLLBH.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-C2BBQDCU.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-ZSCKSEAA.js";import{a as l}from"./chunk-ZE3YT3Q6.js";import{a as i}from"./chunk-XICA45G2.js";import{b as m}from"./chunk-E773NPNL.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as d,jsx as e,jsxs as s}from"react/jsx-runtime";function B({contributionsTotal:u,currency:n,contributionsBreakdown:r}){return s("div",{children:[s("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:a(u,n)})]}),r?s(d,{children:[e(p,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:r.map((t,c)=>s("div",{className:"flex justify-between items-start text-sm",children:[s("div",{className:"flex items-start gap-2",children:[e("span",{children:t.name}),t.description&&e(l,{content:s(d,{children:[e("span",{children:t.description})," ",t.zendesk_article_url&&e(i,{zendeskId:Number(t.zendesk_article_id),children:"Learn more"})]}),children:s(m,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(f,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(t.amount,n)})]},c))})]}):null]})}o(B,"CostCalculatorContributionsBreakdown");export{B as a};
2
- //# sourceMappingURL=chunk-D5KITGC6.js.map
1
+ import{a as l}from"./chunk-ZE3YT3Q6.js";import{a as p}from"./chunk-ZSCKSEAA.js";import{a as i}from"./chunk-MP2T74PU.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as d,jsx as e,jsxs as s}from"react/jsx-runtime";function B({contributionsTotal:u,currency:n,contributionsBreakdown:r}){return s("div",{children:[s("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:a(u,n)})]}),r?s(d,{children:[e(p,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:r.map((t,c)=>s("div",{className:"flex justify-between items-start text-sm",children:[s("div",{className:"flex items-start gap-2",children:[e("span",{children:t.name}),t.description&&e(l,{content:s(d,{children:[e("span",{children:t.description})," ",t.zendesk_article_url&&e(i,{zendeskId:Number(t.zendesk_article_id),children:"Learn more"})]}),children:s(m,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(f,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(t.amount,n)})]},c))})]}):null]})}o(B,"CostCalculatorContributionsBreakdown");export{B as a};
2
+ //# sourceMappingURL=chunk-D5RCRFJM.js.map
@@ -1,2 +1,2 @@
1
- import{b as e}from"./chunk-TOA3JILU.js";import{b as i}from"./chunk-E773NPNL.js";import{b as m}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({children:t,...o}){let{formId:n}=e(),{components:f}=m(),r=f?.button;return r?s(r,{...o,form:n,children:t}):s(i,{...o,form:n,children:t})}u(p,"OnboardingSubmit");export{p as a};
2
- //# sourceMappingURL=chunk-QIAZQLSG.js.map
1
+ import{b as e}from"./chunk-TOA3JILU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as m}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({children:t,...o}){let{formId:n}=e(),{components:f}=m(),r=f?.button;return r?s(r,{...o,form:n,children:t}):s(i,{...o,form:n,children:t})}u(p,"OnboardingSubmit");export{p as a};
2
+ //# sourceMappingURL=chunk-DPY77ASH.js.map
@@ -1,2 +1,2 @@
1
- import{b as y}from"./chunk-PGWKJ6FK.js";import{b as c}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-EIVHHLR5.js";import{b as u}from"./chunk-7XRPOR7L.js";import{f,g as p}from"./chunk-CNDSIADP.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as S}from"react";import{jsx as b}from"react/jsx-runtime";import{createElement as V}from"react";function U({defaultValues:d,onSubmit:g,components:E}){let{formId:k,onboardingBag:o}=y(),w=c(o.handleValidation),r=f({resolver:w,defaultValues:d,shouldUnregister:!1,mode:"onBlur"});S(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),S(()=>{let t=r?.watch(e=>{Object.keys(e).some(i=>e[i]!==d[i])&&o?.checkFieldUpdates(e)});return()=>t?.unsubscribe()},[]);let h=m(async(t,e)=>{let s=e?.nativeEvent;if(s?.isDraftSubmission){let{onSuccess:i,onError:l}=s.draftCallbacks;try{if(!await r.trigger())return;let n=await o.onSubmit(t);if(n?.data)i?.();else if(n?.error){let B=o.stepState.currentStep.name,P=o.meta?.fields?.[B],O=u(n?.fieldErrors||[],P);l?.({error:n.error,rawError:n.rawError,fieldErrors:O})}}catch(a){l?.({error:a,rawError:a,fieldErrors:[]})}}else g(t)},"handleSubmit");return V(p,{...r,key:`form-${o.stepState.currentStep.name}`},b("form",{id:k,onSubmit:r.handleSubmit(h),className:"space-y-4 RemoteFlows__OnboardingForm",children:b(F,{components:E,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}m(U,"OnboardingForm");export{U as a};
2
- //# sourceMappingURL=chunk-XHOQSIXZ.js.map
1
+ import{b as y}from"./chunk-PGWKJ6FK.js";import{a as F}from"./chunk-A7T27JCJ.js";import{b as c}from"./chunk-CFIJKJXD.js";import{b as u}from"./chunk-2YTBWEC7.js";import{f,g as p}from"./chunk-CNDSIADP.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as S}from"react";import{jsx as b}from"react/jsx-runtime";import{createElement as V}from"react";function U({defaultValues:d,onSubmit:g,components:E}){let{formId:k,onboardingBag:o}=y(),w=c(o.handleValidation),r=f({resolver:w,defaultValues:d,shouldUnregister:!1,mode:"onBlur"});S(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),S(()=>{let t=r?.watch(e=>{Object.keys(e).some(i=>e[i]!==d[i])&&o?.checkFieldUpdates(e)});return()=>t?.unsubscribe()},[]);let h=m(async(t,e)=>{let s=e?.nativeEvent;if(s?.isDraftSubmission){let{onSuccess:i,onError:l}=s.draftCallbacks;try{if(!await r.trigger())return;let n=await o.onSubmit(t);if(n?.data)i?.();else if(n?.error){let B=o.stepState.currentStep.name,P=o.meta?.fields?.[B],O=u(n?.fieldErrors||[],P);l?.({error:n.error,rawError:n.rawError,fieldErrors:O})}}catch(a){l?.({error:a,rawError:a,fieldErrors:[]})}}else g(t)},"handleSubmit");return V(p,{...r,key:`form-${o.stepState.currentStep.name}`},b("form",{id:k,onSubmit:r.handleSubmit(h),className:"space-y-4 RemoteFlows__OnboardingForm",children:b(F,{components:E,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}m(U,"OnboardingForm");export{U as a};
2
+ //# sourceMappingURL=chunk-DYWOG7Q2.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-XHOQSIXZ.js";import{b as n}from"./chunk-PGWKJ6FK.js";import{b as i}from"./chunk-7XRPOR7L.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function F({onSubmit:l,onError:t,onSuccess:d}){let{onboardingBag:o}=n(),m=e(async a=>{try{await l?.(o.parseFormValues(a));let r=await o.onSubmit(a);if(r?.data){await d?.(r.data),o?.next();return}if(r?.error){let c=i(r?.fieldErrors||[],o.meta?.fields?.contract_details);t?.({error:r.error,rawError:r.rawError,fieldErrors:c})}}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit");return p(s,{defaultValues:o.stepState.values?.contract_details||o.initialValues.contract_details,onSubmit:m})}e(F,"ContractDetailsStep");export{F as a};
2
- //# sourceMappingURL=chunk-TGUF5Q7J.js.map
1
+ import{a as s}from"./chunk-DYWOG7Q2.js";import{b as n}from"./chunk-PGWKJ6FK.js";import{b as i}from"./chunk-2YTBWEC7.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function F({onSubmit:l,onError:t,onSuccess:d}){let{onboardingBag:o}=n(),m=e(async a=>{try{await l?.(o.parseFormValues(a));let r=await o.onSubmit(a);if(r?.data){await d?.(r.data),o?.next();return}if(r?.error){let c=i(r?.fieldErrors||[],o.meta?.fields?.contract_details);t?.({error:r.error,rawError:r.rawError,fieldErrors:c})}}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit");return p(s,{defaultValues:o.stepState.values?.contract_details||o.initialValues.contract_details,onSubmit:m})}e(F,"ContractDetailsStep");export{F as a};
2
+ //# sourceMappingURL=chunk-EFPZOIQ2.js.map
@@ -1,2 +1,2 @@
1
- import{b as i}from"./chunk-E773NPNL.js";import{b as u}from"./chunk-3ZWDIEEM.js";import{b as c}from"./chunk-TVZAFTPT.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as C}from"react/jsx-runtime";function d({children:o,...t}){let{contractAmendment:{back:r}}=c(),{components:s}=u(),e=s?.button;return e?C(e,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o}):C(i,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o})}m(d,"ContractAmendmentBack");export{d as a};
2
- //# sourceMappingURL=chunk-BPJHPGTL.js.map
1
+ import{b as i}from"./chunk-WVDTHFGS.js";import{b as u}from"./chunk-3ZWDIEEM.js";import{b as c}from"./chunk-TVZAFTPT.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as C}from"react/jsx-runtime";function d({children:o,...t}){let{contractAmendment:{back:r}}=c(),{components:s}=u(),e=s?.button;return e?C(e,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o}):C(i,{...t,onClick:n=>{r(),t.onClick?.(n)},children:o})}m(d,"ContractAmendmentBack");export{d as a};
2
+ //# sourceMappingURL=chunk-EKKRQI6B.js.map
@@ -1,2 +1,2 @@
1
- import{b as u}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-EIVHHLR5.js";import{f as l,g as p}from"./chunk-CNDSIADP.js";import{c as f}from"./chunk-PAQW5BFW.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=u(y),e=l({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=f(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
- //# sourceMappingURL=chunk-V2PJW577.js.map
1
+ import{a as F}from"./chunk-A7T27JCJ.js";import{b as u}from"./chunk-CFIJKJXD.js";import{f as l,g as p}from"./chunk-CNDSIADP.js";import{c as f}from"./chunk-PAQW5BFW.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=u(y),e=l({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=f(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
+ //# sourceMappingURL=chunk-EZV6DOVQ.js.map
@@ -0,0 +1,2 @@
1
+ import{c as t,d as m,e as a,f as i}from"./chunk-REDYWUCC.js";import{a as n}from"./chunk-P37U34EQ.js";import{useState as T}from"react";var C=n(({proposedTerminationDate:e,employeeName:f,employmentId:o,render:s})=>{let[r,u]=T(!1),y=i({employmentId:o}),c=new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),d=t({employmentId:o,options:{enabled:r}}),P=m({employmentId:o,date:e}),l=a({employmentId:o,proposedTerminationDate:e});return s({leavePoliciesSummaryQuery:y,timeoffQuery:d,bookedTimeBeforeAndAfterTerminationQuery:P,formattedProposedTerminationDate:c,employeeName:f,proposedTerminationDate:e,summaryData:l,open:r,onOpenChange:n(()=>{u(O=>!O)},"onOpenChange")})},"PaidTimeOffContainer");export{C as a};
2
+ //# sourceMappingURL=chunk-EZWZMPD2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.tsx"],"sourcesContent":["import {\n useBookedTimeoffBeforeAndAfterTerminationQuery,\n usePaidTimeoffBreakdownQuery,\n useSummaryTimeOffDataQuery,\n useTimeOffLeavePoliciesSummaryQuery,\n} from '@/src/common/api';\nimport { PaidTimeOffContainerProps } from '@/src/flows/Termination/components/PaidTimeOff/types';\nimport { useState } from 'react';\n\n/**\n * PaidTimeOffContainer component\n *\n * This is a container component that manages paid time off (PTO) data retrieval and state\n * for the termination flow. It aggregates multiple time off-related queries and formats\n * the termination date for display.\n *\n */\nexport const PaidTimeOffContainer = ({\n proposedTerminationDate,\n employeeName,\n employmentId,\n render,\n}: PaidTimeOffContainerProps) => {\n const [open, setOpen] = useState(false);\n\n const leavePoliciesSummaryQuery = useTimeOffLeavePoliciesSummaryQuery({\n employmentId: employmentId,\n });\n\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n\n const timeoffQuery = usePaidTimeoffBreakdownQuery({\n employmentId: employmentId,\n options: {\n enabled: open,\n },\n });\n\n const bookedTimeBeforeAndAfterTerminationQuery =\n useBookedTimeoffBeforeAndAfterTerminationQuery({\n employmentId: employmentId,\n date: proposedTerminationDate,\n });\n\n const summaryData = useSummaryTimeOffDataQuery({\n employmentId: employmentId,\n proposedTerminationDate,\n });\n\n const onOpenChange = () => {\n setOpen((open) => !open);\n };\n\n return render({\n leavePoliciesSummaryQuery,\n timeoffQuery,\n bookedTimeBeforeAndAfterTerminationQuery,\n formattedProposedTerminationDate,\n employeeName,\n proposedTerminationDate,\n summaryData,\n open,\n onOpenChange,\n });\n};\n"],"mappings":"qGAOA,OAAS,YAAAA,MAAgB,QAUlB,IAAMC,EAAuBC,EAAA,CAAC,CACnC,wBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,OAAAC,CACF,IAAiC,CAC/B,GAAM,CAACC,EAAMC,CAAO,EAAIC,EAAS,EAAK,EAEhCC,EAA4BC,EAAoC,CACpE,aAAcN,CAChB,CAAC,EAEKO,EAAmC,IAAI,KAC3CT,CACF,EAAE,mBAAmB,QAAS,CAC5B,MAAO,OACP,IAAK,UACL,KAAM,SACR,CAAC,EAEKU,EAAeC,EAA6B,CAChD,aAAcT,EACd,QAAS,CACP,QAASE,CACX,CACF,CAAC,EAEKQ,EACJC,EAA+C,CAC7C,aAAcX,EACd,KAAMF,CACR,CAAC,EAEGc,EAAcC,EAA2B,CAC7C,aAAcb,EACd,wBAAAF,CACF,CAAC,EAMD,OAAOG,EAAO,CACZ,0BAAAI,EACA,aAAAG,EACA,yCAAAE,EACA,iCAAAH,EACA,aAAAR,EACA,wBAAAD,EACA,YAAAc,EACA,KAAAV,EACA,aAbmBL,EAAA,IAAM,CACzBM,EAASD,GAAS,CAACA,CAAI,CACzB,EAFqB,eAcrB,CAAC,CACH,EArDoC","names":["useState","PaidTimeOffContainer","__name","proposedTerminationDate","employeeName","employmentId","render","open","setOpen","useState","leavePoliciesSummaryQuery","useTimeOffLeavePoliciesSummaryQuery","formattedProposedTerminationDate","timeoffQuery","usePaidTimeoffBreakdownQuery","bookedTimeBeforeAndAfterTerminationQuery","useBookedTimeoffBeforeAndAfterTerminationQuery","summaryData","useSummaryTimeOffDataQuery"]}
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-QIAZQLSG.js";import{a as p}from"./chunk-XTLLWD7O.js";import{a as i}from"./chunk-GECFDGI7.js";import{a as e}from"./chunk-X5DMQNEM.js";import{a as c}from"./chunk-GLUERRJ2.js";import{a as d}from"./chunk-J26AI33Z.js";import{a as n}from"./chunk-C4AVUIG2.js";import{a as f}from"./chunk-DHJZVBVD.js";import{a as t}from"./chunk-TOA3JILU.js";import{a}from"./chunk-CHQK23RH.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as u}from"react";import{jsx as v}from"react/jsx-runtime";var A=r(({render:g,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O,options:l})=>{let o=a({options:l,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O}),P=u();return v(t.Provider,{value:{contractorOnboardingBag:o,formId:P},children:g({contractorOnboardingBag:o,components:{BasicInformationStep:e,SelectCountryStep:i,BackButton:n,SubmitButton:m,PricingPlanStep:p,ContractDetailsStep:c,ContractPreviewStep:d,OnboardingInvite:f}})})},"ContractorOnboardingFlow");export{A as a};
2
- //# sourceMappingURL=chunk-ULHGAKFT.js.map
1
+ import{a as p}from"./chunk-KPTF6LPP.js";import{a as i}from"./chunk-KYSKA2UK.js";import{a as e}from"./chunk-NYM7QGN2.js";import{a as c}from"./chunk-A7HJICVX.js";import{a as d}from"./chunk-IUJXAZHK.js";import{a as n}from"./chunk-5ZR7EFPY.js";import{a as f}from"./chunk-BMDZJNJV.js";import{a as m}from"./chunk-DPY77ASH.js";import{a as t}from"./chunk-TOA3JILU.js";import{a}from"./chunk-YPHOFQ5O.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as u}from"react";import{jsx as v}from"react/jsx-runtime";var A=r(({render:g,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O,options:l})=>{let o=a({options:l,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O}),P=u();return v(t.Provider,{value:{contractorOnboardingBag:o,formId:P},children:g({contractorOnboardingBag:o,components:{BasicInformationStep:e,SelectCountryStep:i,BackButton:n,SubmitButton:m,PricingPlanStep:p,ContractDetailsStep:c,ContractPreviewStep:d,OnboardingInvite:f}})})},"ContractorOnboardingFlow");export{A as a};
2
+ //# sourceMappingURL=chunk-GGXK727I.js.map