@remoteoss/remote-flows 1.39.0 → 1.40.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 (220) hide show
  1. package/dist/CheckboxFieldDefault-H6DFZZRM.js +2 -0
  2. package/dist/CountryFieldDefault-ZPDRAEWF.js +2 -0
  3. package/dist/DatePickerFieldDefault-BSMELDX2.js +2 -0
  4. package/dist/RadioGroupFieldDefault-SGZXCPSL.js +2 -0
  5. package/dist/TextAreaFieldDefault-TTCPVIBZ.js +2 -0
  6. package/dist/chunk-2Q462FT7.js +2 -0
  7. package/dist/chunk-2Q462FT7.js.map +1 -0
  8. package/dist/{chunk-Q5HDUQPX.js → chunk-32ERURM2.js} +2 -2
  9. package/dist/{chunk-NFIMSJPH.js → chunk-34U3WJ75.js} +2 -2
  10. package/dist/{chunk-53TM77OU.js → chunk-3EYFXA3W.js} +2 -2
  11. package/dist/{chunk-6HAWSFOM.js → chunk-3YTML5RG.js} +2 -2
  12. package/dist/{chunk-QSCW4IHJ.js → chunk-5DGTMYWR.js} +2 -2
  13. package/dist/{chunk-2DNWLRNL.js → chunk-6P536SW2.js} +2 -2
  14. package/dist/{chunk-MDOVS5WS.js → chunk-6Y5WCCMH.js} +2 -2
  15. package/dist/{chunk-Q6GJJRYG.js → chunk-75XZ4KIX.js} +2 -2
  16. package/dist/{chunk-BRI2ESJ3.js → chunk-7FCKRGGD.js} +2 -2
  17. package/dist/{chunk-BRN6MO77.js → chunk-AC4MDLIM.js} +2 -2
  18. package/dist/{chunk-UD3YR4VQ.js → chunk-DPXSK2UQ.js} +2 -2
  19. package/dist/{chunk-25PGBGEV.js → chunk-ELM6CPRT.js} +2 -2
  20. package/dist/{chunk-OR6ZPNF6.js → chunk-ENV2K73V.js} +2 -2
  21. package/dist/{chunk-27TI6URK.js → chunk-HK4LGSS7.js} +2 -2
  22. package/dist/{chunk-H3JUXG2J.js → chunk-HSVLNS27.js} +2 -2
  23. package/dist/{chunk-GGLJSAPH.js → chunk-ITDU6XPR.js} +2 -2
  24. package/dist/{chunk-HJOT7JXK.js → chunk-JBQOE3XL.js} +2 -2
  25. package/dist/{chunk-GKYQ3GAF.js → chunk-JFPOX7SW.js} +2 -2
  26. package/dist/{chunk-A2WWDGJJ.js → chunk-KN2Q5NOL.js} +2 -2
  27. package/dist/{chunk-LXKLBMHD.js → chunk-KXQVUSLI.js} +2 -2
  28. package/dist/{chunk-ASTB4YJL.js → chunk-KY4PEPYW.js} +2 -2
  29. package/dist/{chunk-YVS5MBND.js → chunk-LLHJODMO.js} +2 -2
  30. package/dist/{chunk-MHOV3CQN.js → chunk-M5ARBNKW.js} +2 -2
  31. package/dist/{chunk-SFJV4CFP.js → chunk-MF3W2PJ7.js} +2 -2
  32. package/dist/{chunk-XGECMN4V.js → chunk-NEKE5PRJ.js} +2 -2
  33. package/dist/{chunk-OEVMCP42.js → chunk-NG562U46.js} +2 -2
  34. package/dist/{chunk-I3P3NKFG.js → chunk-ODXNPBKO.js} +2 -2
  35. package/dist/{chunk-PIHCHWI7.js → chunk-PTPNWD53.js} +2 -2
  36. package/dist/{chunk-OBZMQWQA.js → chunk-QI4MWDJS.js} +2 -2
  37. package/dist/{chunk-SMBP7A4F.js → chunk-QIAK5VU7.js} +2 -2
  38. package/dist/{chunk-R3HBG6VK.js → chunk-QZFKUU4A.js} +2 -2
  39. package/dist/{chunk-VDH46ZCF.js → chunk-R2JJUSD3.js} +2 -2
  40. package/dist/chunk-SC7YWKOW.js +2 -0
  41. package/dist/{chunk-TLNE6GTG.js → chunk-TCFTRE7G.js} +2 -2
  42. package/dist/{chunk-VEMUIRKC.js → chunk-TOOCSXXQ.js} +2 -2
  43. package/dist/chunk-UEPT6OBL.js +2 -0
  44. package/dist/chunk-UEPT6OBL.js.map +1 -0
  45. package/dist/{chunk-VQ5PL5E3.js → chunk-UI4AZZD5.js} +2 -2
  46. package/dist/{chunk-TSZLYFYT.js → chunk-UOYIAURS.js} +2 -2
  47. package/dist/{chunk-QFXZTQL7.js → chunk-UW3TUDJR.js} +2 -2
  48. package/dist/{chunk-UHN3ELBL.js → chunk-V5EBEJON.js} +2 -2
  49. package/dist/{chunk-2A25NRQT.js → chunk-V62JQXIC.js} +2 -2
  50. package/dist/{chunk-TMBDUFOH.js → chunk-VNHXMVTF.js} +2 -2
  51. package/dist/{chunk-L2V4ZYCZ.js → chunk-VYZOGC65.js} +2 -2
  52. package/dist/{chunk-DJGO6WYW.js → chunk-W2WHWA5J.js} +2 -2
  53. package/dist/{chunk-KUKZNLCF.js → chunk-W5MWHAAI.js} +2 -2
  54. package/dist/{chunk-LTJSD2MC.js → chunk-W7MCRAQ4.js} +2 -2
  55. package/dist/{chunk-XEVHWVBT.js → chunk-XNDOPTDJ.js} +2 -2
  56. package/dist/{chunk-CFOXBJRN.js → chunk-Y34DKDJI.js} +2 -2
  57. package/dist/{chunk-3CLZOKEI.js → chunk-YD54NZIX.js} +2 -2
  58. package/dist/{chunk-5XVYIBJD.js → chunk-YQOONCKH.js} +2 -2
  59. package/dist/{chunk-PPRAWJMR.js → chunk-YWJS3RL5.js} +2 -2
  60. package/dist/{chunk-ZEC5X3RH.js → chunk-YYJH3TPJ.js} +2 -2
  61. package/dist/chunk-Z23FQVGN.js +1 -0
  62. package/dist/default-components.js +1 -1
  63. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  64. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  65. package/dist/flows/ContractAmendment/index.js +1 -1
  66. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +2 -2
  67. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  68. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +1 -1
  69. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  70. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +2 -2
  71. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  72. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +2 -2
  73. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  74. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +2 -2
  75. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  76. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +2 -2
  77. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
  78. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +2 -2
  79. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  80. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +1 -1
  81. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  82. package/dist/flows/ContractorOnboarding/context.d.ts +2 -2
  83. package/dist/flows/ContractorOnboarding/hooks.d.ts +2 -2
  84. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  85. package/dist/flows/ContractorOnboarding/index.d.ts +2 -2
  86. package/dist/flows/ContractorOnboarding/index.js +1 -1
  87. package/dist/flows/ContractorOnboarding/jsfModify.d.ts +2 -2
  88. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  89. package/dist/flows/ContractorOnboarding/types.d.ts +2 -2
  90. package/dist/flows/ContractorOnboarding/utils.d.ts +1 -1
  91. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  92. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  93. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  94. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  95. package/dist/flows/CostCalculator/hooks.js +1 -1
  96. package/dist/flows/CostCalculator/index.js +1 -1
  97. package/dist/flows/CostCalculator/utils.js +1 -1
  98. package/dist/flows/CreateCompany/CreateCompany.js +1 -1
  99. package/dist/flows/CreateCompany/components/AddressDetailsStep.js +1 -1
  100. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +1 -1
  101. package/dist/flows/CreateCompany/components/CreateCompanyForm.js +1 -1
  102. package/dist/flows/CreateCompany/index.js +1 -1
  103. package/dist/flows/Onboarding/OnboardingFlow.d.ts +3 -3
  104. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  105. package/dist/flows/Onboarding/api.d.ts +1 -1
  106. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
  107. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  108. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
  109. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  110. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
  111. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  112. package/dist/flows/Onboarding/components/EmploymentAgreementInfoContent.d.ts +5 -0
  113. package/dist/flows/Onboarding/components/EmploymentAgreementInfoContent.js +2 -0
  114. package/dist/flows/Onboarding/components/EmploymentAgreementInfoContent.js.map +1 -0
  115. package/dist/flows/Onboarding/components/EngagementAgreementDetailsStep.d.ts +1 -1
  116. package/dist/flows/Onboarding/components/EngagementAgreementDetailsStep.js +1 -1
  117. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
  118. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  119. package/dist/flows/Onboarding/components/PreviewEmploymentAgreementStep.js +1 -1
  120. package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
  121. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
  122. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  123. package/dist/flows/Onboarding/context.d.ts +1 -1
  124. package/dist/flows/Onboarding/hooks.d.ts +1 -1
  125. package/dist/flows/Onboarding/index.d.ts +4 -3
  126. package/dist/flows/Onboarding/index.js +1 -1
  127. package/dist/flows/Onboarding/types.d.ts +1 -1
  128. package/dist/flows/Onboarding/utils.d.ts +1 -1
  129. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  130. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  131. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  132. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  133. package/dist/flows/Termination/TerminationFlow.js +1 -1
  134. package/dist/flows/Termination/TerminationForm.js +1 -1
  135. package/dist/flows/Termination/api.d.ts +1 -1
  136. package/dist/flows/Termination/api.js +1 -1
  137. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  138. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +1 -1
  139. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +1 -1
  140. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  141. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +1 -1
  142. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  143. package/dist/flows/Termination/hooks.js +1 -1
  144. package/dist/flows/Termination/index.d.ts +1 -1
  145. package/dist/flows/Termination/index.js +1 -1
  146. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  147. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  148. package/dist/index.d.ts +10 -3
  149. package/dist/index.js +2 -2
  150. package/dist/index.js.map +1 -1
  151. package/dist/internals.js +1 -1
  152. package/dist/{types-HUdcwxhs.d.ts → types-5vsf9upM.d.ts} +1 -1
  153. package/dist/{types-Bptye63R.d.ts → types-BDhuq1UF.d.ts} +1 -1
  154. package/package.json +1 -1
  155. package/dist/CheckboxFieldDefault-O6OH63GG.js +0 -2
  156. package/dist/CountryFieldDefault-DVWWTDEO.js +0 -2
  157. package/dist/DatePickerFieldDefault-XY2SCOWG.js +0 -2
  158. package/dist/RadioGroupFieldDefault-4P4DRXR2.js +0 -2
  159. package/dist/TextAreaFieldDefault-A2LOPUE3.js +0 -2
  160. package/dist/chunk-5MPW7QWT.js +0 -2
  161. package/dist/chunk-GULCZWSK.js +0 -1
  162. package/dist/chunk-LOPZZUAF.js +0 -2
  163. package/dist/chunk-LOPZZUAF.js.map +0 -1
  164. /package/dist/{CheckboxFieldDefault-O6OH63GG.js.map → CheckboxFieldDefault-H6DFZZRM.js.map} +0 -0
  165. /package/dist/{CountryFieldDefault-DVWWTDEO.js.map → CountryFieldDefault-ZPDRAEWF.js.map} +0 -0
  166. /package/dist/{DatePickerFieldDefault-XY2SCOWG.js.map → DatePickerFieldDefault-BSMELDX2.js.map} +0 -0
  167. /package/dist/{RadioGroupFieldDefault-4P4DRXR2.js.map → RadioGroupFieldDefault-SGZXCPSL.js.map} +0 -0
  168. /package/dist/{TextAreaFieldDefault-A2LOPUE3.js.map → TextAreaFieldDefault-TTCPVIBZ.js.map} +0 -0
  169. /package/dist/{chunk-Q5HDUQPX.js.map → chunk-32ERURM2.js.map} +0 -0
  170. /package/dist/{chunk-NFIMSJPH.js.map → chunk-34U3WJ75.js.map} +0 -0
  171. /package/dist/{chunk-53TM77OU.js.map → chunk-3EYFXA3W.js.map} +0 -0
  172. /package/dist/{chunk-6HAWSFOM.js.map → chunk-3YTML5RG.js.map} +0 -0
  173. /package/dist/{chunk-QSCW4IHJ.js.map → chunk-5DGTMYWR.js.map} +0 -0
  174. /package/dist/{chunk-2DNWLRNL.js.map → chunk-6P536SW2.js.map} +0 -0
  175. /package/dist/{chunk-MDOVS5WS.js.map → chunk-6Y5WCCMH.js.map} +0 -0
  176. /package/dist/{chunk-Q6GJJRYG.js.map → chunk-75XZ4KIX.js.map} +0 -0
  177. /package/dist/{chunk-BRI2ESJ3.js.map → chunk-7FCKRGGD.js.map} +0 -0
  178. /package/dist/{chunk-BRN6MO77.js.map → chunk-AC4MDLIM.js.map} +0 -0
  179. /package/dist/{chunk-UD3YR4VQ.js.map → chunk-DPXSK2UQ.js.map} +0 -0
  180. /package/dist/{chunk-25PGBGEV.js.map → chunk-ELM6CPRT.js.map} +0 -0
  181. /package/dist/{chunk-OR6ZPNF6.js.map → chunk-ENV2K73V.js.map} +0 -0
  182. /package/dist/{chunk-27TI6URK.js.map → chunk-HK4LGSS7.js.map} +0 -0
  183. /package/dist/{chunk-H3JUXG2J.js.map → chunk-HSVLNS27.js.map} +0 -0
  184. /package/dist/{chunk-GGLJSAPH.js.map → chunk-ITDU6XPR.js.map} +0 -0
  185. /package/dist/{chunk-HJOT7JXK.js.map → chunk-JBQOE3XL.js.map} +0 -0
  186. /package/dist/{chunk-GKYQ3GAF.js.map → chunk-JFPOX7SW.js.map} +0 -0
  187. /package/dist/{chunk-A2WWDGJJ.js.map → chunk-KN2Q5NOL.js.map} +0 -0
  188. /package/dist/{chunk-LXKLBMHD.js.map → chunk-KXQVUSLI.js.map} +0 -0
  189. /package/dist/{chunk-ASTB4YJL.js.map → chunk-KY4PEPYW.js.map} +0 -0
  190. /package/dist/{chunk-YVS5MBND.js.map → chunk-LLHJODMO.js.map} +0 -0
  191. /package/dist/{chunk-MHOV3CQN.js.map → chunk-M5ARBNKW.js.map} +0 -0
  192. /package/dist/{chunk-SFJV4CFP.js.map → chunk-MF3W2PJ7.js.map} +0 -0
  193. /package/dist/{chunk-XGECMN4V.js.map → chunk-NEKE5PRJ.js.map} +0 -0
  194. /package/dist/{chunk-OEVMCP42.js.map → chunk-NG562U46.js.map} +0 -0
  195. /package/dist/{chunk-I3P3NKFG.js.map → chunk-ODXNPBKO.js.map} +0 -0
  196. /package/dist/{chunk-PIHCHWI7.js.map → chunk-PTPNWD53.js.map} +0 -0
  197. /package/dist/{chunk-OBZMQWQA.js.map → chunk-QI4MWDJS.js.map} +0 -0
  198. /package/dist/{chunk-SMBP7A4F.js.map → chunk-QIAK5VU7.js.map} +0 -0
  199. /package/dist/{chunk-R3HBG6VK.js.map → chunk-QZFKUU4A.js.map} +0 -0
  200. /package/dist/{chunk-VDH46ZCF.js.map → chunk-R2JJUSD3.js.map} +0 -0
  201. /package/dist/{chunk-5MPW7QWT.js.map → chunk-SC7YWKOW.js.map} +0 -0
  202. /package/dist/{chunk-TLNE6GTG.js.map → chunk-TCFTRE7G.js.map} +0 -0
  203. /package/dist/{chunk-VEMUIRKC.js.map → chunk-TOOCSXXQ.js.map} +0 -0
  204. /package/dist/{chunk-VQ5PL5E3.js.map → chunk-UI4AZZD5.js.map} +0 -0
  205. /package/dist/{chunk-TSZLYFYT.js.map → chunk-UOYIAURS.js.map} +0 -0
  206. /package/dist/{chunk-QFXZTQL7.js.map → chunk-UW3TUDJR.js.map} +0 -0
  207. /package/dist/{chunk-UHN3ELBL.js.map → chunk-V5EBEJON.js.map} +0 -0
  208. /package/dist/{chunk-2A25NRQT.js.map → chunk-V62JQXIC.js.map} +0 -0
  209. /package/dist/{chunk-TMBDUFOH.js.map → chunk-VNHXMVTF.js.map} +0 -0
  210. /package/dist/{chunk-L2V4ZYCZ.js.map → chunk-VYZOGC65.js.map} +0 -0
  211. /package/dist/{chunk-DJGO6WYW.js.map → chunk-W2WHWA5J.js.map} +0 -0
  212. /package/dist/{chunk-KUKZNLCF.js.map → chunk-W5MWHAAI.js.map} +0 -0
  213. /package/dist/{chunk-LTJSD2MC.js.map → chunk-W7MCRAQ4.js.map} +0 -0
  214. /package/dist/{chunk-XEVHWVBT.js.map → chunk-XNDOPTDJ.js.map} +0 -0
  215. /package/dist/{chunk-CFOXBJRN.js.map → chunk-Y34DKDJI.js.map} +0 -0
  216. /package/dist/{chunk-3CLZOKEI.js.map → chunk-YD54NZIX.js.map} +0 -0
  217. /package/dist/{chunk-5XVYIBJD.js.map → chunk-YQOONCKH.js.map} +0 -0
  218. /package/dist/{chunk-PPRAWJMR.js.map → chunk-YWJS3RL5.js.map} +0 -0
  219. /package/dist/{chunk-ZEC5X3RH.js.map → chunk-YYJH3TPJ.js.map} +0 -0
  220. /package/dist/{chunk-GULCZWSK.js.map → chunk-Z23FQVGN.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as L,b as H,c as U,e as O}from"./chunk-N6XLGYRK.js";import{f as W}from"./chunk-UYGDMJF2.js";import{a as oe}from"./chunk-54Z4QJ3Q.js";import{a as ie}from"./chunk-KUKZNLCF.js";import{a as _,c as I,d as k,e as J,f as j}from"./chunk-LJUWER2H.js";import{f as le,g as A,h as te}from"./chunk-Y3CJRZLA.js";import{n as g}from"./chunk-G2LZFGZA.js";import{e as ae}from"./chunk-H2O4CVKF.js";import{a as i}from"./chunk-P37U34EQ.js";import*as M from"@radix-ui/react-collapsible";var ge=M.Root,ye=M.CollapsibleTrigger,Se=M.CollapsibleContent;import*as y from"@radix-ui/react-dialog";import{XIcon as he}from"lucide-react";import{jsx as F,jsxs as K}from"react/jsx-runtime";function Ne({...e}){return F(y.Root,{"data-slot":"full-screen-dialog",...e})}i(Ne,"FullScreenDialog");function xe({...e}){return F(y.Trigger,{"data-slot":"full-screen-dialog-trigger",...e})}i(xe,"FullScreenDialogTrigger");function Te({...e}){return F(y.Portal,{"data-slot":"full-screen-dialog-portal",...e})}i(Te,"FullScreenDialogPortal");function Fe({className:e,...l}){return F(y.Overlay,{"data-slot":"full-screen-dialog-overlay",className:g("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...l})}i(Fe,"FullScreenDialogOverlay");function Ce({className:e,children:l,...a}){return K(Te,{"data-slot":"full-screen-dialog-portal",children:[F(Fe,{}),K(y.Content,{"data-slot":"full-screen-dialog-content",className:g("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 flex flex-col",e),...a,children:[l,K(y.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 RemoteFlows__FullScreenDialog__Close",children:[F(he,{}),F("span",{className:"sr-only",children:"Close"})]})]})]})}i(Ce,"FullScreenDialogContent");function De({className:e,...l}){return F("div",{"data-slot":"full-screen-dialog-header",className:g("flex flex-col gap-2 text-center sm:text-left",e),...l})}i(De,"FullScreenDialogHeader");function we({className:e,...l}){return F("div",{"data-slot":"full-screen-dialog-footer",className:g("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...l})}i(we,"FullScreenDialogFooter");function Re({className:e,...l}){return F(y.Title,{"data-slot":"full-screen-dialog-title",className:g("text-lg leading-none font-semibold",e),...l})}i(Re,"FullScreenDialogTitle");function Pe({className:e,...l}){return F(y.Description,{"data-slot":"full-screen-dialog-description",className:g("text-muted-foreground text-sm",e),...l})}i(Pe,"FullScreenDialogDescription");import*as R from"@radix-ui/react-tabs";import{jsx as B}from"react/jsx-runtime";function z({className:e,...l}){return B(R.Root,{"data-slot":"tabs",className:g("flex flex-col gap-2",e),...l})}i(z,"Tabs");function $({className:e,...l}){return B(R.List,{"data-slot":"tabs-list",className:g("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1",e),...l})}i($,"TabsList");function X({className:e,...l}){return B(R.Trigger,{"data-slot":"tabs-trigger",className:g("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l})}i(X,"TabsTrigger");function Ve({className:e,...l}){return B(R.Content,{"data-slot":"tabs-content",className:g("flex-1 outline-none",e),...l})}i(Ve,"TabsContent");import*as Z from"react";import*as x from"@radix-ui/react-scroll-area";import{jsx as q,jsxs as Ae}from"react/jsx-runtime";var ne=Z.forwardRef(({className:e,children:l,...a},s)=>Ae(x.Root,{ref:s,className:g("relative overflow-hidden",e),...a,children:[q(x.Viewport,{className:"h-full w-full rounded-[inherit]",children:l}),q(se,{}),q(x.Corner,{})]}));ne.displayName=x.Root.displayName;var se=Z.forwardRef(({className:e,orientation:l="vertical",...a},s)=>q(x.ScrollAreaScrollbar,{ref:s,orientation:l,className:g("flex touch-none select-none transition-colors",l==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:q(x.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));se.displayName=x.ScrollAreaScrollbar.displayName;import{useState as Y,useEffect as ke,useMemo as Je}from"react";import{useQuery as je}from"@tanstack/react-query";import E from"fast-deep-equal";var re=i(e=>e.name?e.type?!0:(console.warn(`Field "${e.name}" missing required "type" property`),!1):(console.warn('Field missing required "name" property:',e),!1),"validateField"),Le=i((e,l)=>{if(E(e,l))return;let a=new Map((e||[]).map(t=>[t.value,t])),s=new Map((l||[]).map(t=>[t.value,t])),u=[],m=[],p=[];if(s.forEach((t,c)=>{a.has(c)||u.push({value:t.value,label:t.label})}),a.forEach((t,c)=>{if(!s.has(c))m.push({value:t.value,label:t.label});else{let S=s.get(c);if(!E(t,S)){let b={};t.label!==S.label&&(b.label={old:t.label,new:S.label}),Object.keys(b).length>0&&p.push({value:c,changes:b})}}}),!(u.length===0&&m.length===0&&p.length===0))return{added:u,removed:m,modified:p}},"compareOptions"),Oe=i((e,l)=>{let a=e.fields,s=l.fields;if(!a&&!s)return;let u=G(a||[],s||[]);if(u.added.length>0||u.removed.length>0||u.modified.length>0)return Array.from(u.fieldDiffs.values())},"compareNestedFields"),Me=i((e,l)=>{let a={label:e.label!==l.label,required:e.required!==l.required,inputType:e.inputType!==l.inputType,type:e.type!==l.type,jsonType:!E(e.jsonType,l.jsonType),name:e.name!==l.name,defaultValue:e.defaultValue!==l.defaultValue,minDate:e.minDate!==l.minDate,maxDate:e.maxDate!==l.maxDate,maxLength:e.maxLength!==l.maxLength,multiple:e.multiple!==l.multiple,isVisible:e.isVisible!==l.isVisible,options:!E(e.options,l.options)},s=(()=>{let m=e.fields,p=l.fields;if(!m&&!p)return!1;if(!m||!p)return!0;let t=G(m,p);return t.added.length>0||t.removed.length>0||t.modified.length>0})();return Object.values(a).some(m=>m)||s},"isFieldModified"),Ee=i((e,l)=>{let a={};e.label!==l.label&&(a.label={old:e.label,new:l.label}),e.required!==l.required&&(a.required={old:e.required,new:l.required}),e.type!==l.type&&(a.type={old:e.type,new:l.type}),e.inputType!==l.inputType&&(a.inputType={old:e.inputType,new:l.inputType}),E(e.jsonType,l.jsonType)||(a.jsonType={old:e.jsonType,new:l.jsonType}),E(e.defaultValue,l.defaultValue)||(a.defaultValue={old:e.defaultValue,new:l.defaultValue}),e.minDate!==l.minDate&&(a.minDate={old:e.minDate||"",new:l.minDate||""}),e.maxDate!==l.maxDate&&(a.maxDate={old:e.maxDate||"",new:l.maxDate||""}),e.maxLength!==l.maxLength&&(a.maxLength={old:e.maxLength||0,new:l.maxLength||0}),e.multiple!==l.multiple&&(a.multiple={old:e.multiple||!1,new:l.multiple||!1}),e.isVisible!==l.isVisible&&(a.isVisible={old:e.isVisible,new:l.isVisible});let s=Le(e.options,l.options);s&&(a.options=s);let u=Oe(e,l);return u&&(a.nestedFields=u),Object.keys(a).length>0?a:void 0},"getFieldChanges"),G=i((e=[],l=[])=>{let a=e.filter(re),s=l.filter(re),u=new Map(a.map(f=>[f.name,{field:f}])),m=new Map(s.map(f=>[f.name,{field:f}])),p=[],t=[],c=[],S=[],b=new Map;return m.forEach((f,d)=>{u.has(d)||(p.push(d),b.set(d,{fieldName:d,diffType:"added"}))}),u.forEach(({field:f},d)=>{if(!m.has(d))t.push(d),b.set(d,{fieldName:d,diffType:"removed"});else{let{field:N}=m.get(d);Me(f,N)?(c.push(d),b.set(d,{fieldName:d,diffType:"modified",changes:Ee(f,N)})):(S.push(d),b.set(d,{fieldName:d,diffType:"unchanged"}))}}),{added:p,removed:t,modified:c,unchanged:S,fieldDiffs:b}},"compareFormFields"),de=i(e=>{switch(e){case"added":return"bg-green-50 border-l-4 border-green-500";case"removed":return"bg-red-50 border-l-4 border-red-500";case"modified":return"bg-yellow-50 border-l-4 border-yellow-500";default:return""}},"getDiffStyles");import{useMemo as ve,useRef as Q,useEffect as _e}from"react";import{jsx as o,jsxs as v}from"react/jsx-runtime";var Ie=i(({children:e,diffType:l,changes:a})=>{let s=de(l);if(l==="unchanged")return o("div",{children:e});let m={added:o("span",{className:"text-xs font-semibold text-green-700 bg-green-100 px-2 py-1 rounded",children:"NEW"}),removed:o("span",{className:"text-xs font-semibold text-red-700 bg-red-100 px-2 py-1 rounded",children:"REMOVED"}),modified:o("span",{className:"text-xs font-semibold text-yellow-700 bg-yellow-100 px-2 py-1 rounded",children:"MODIFIED"})}[l],p=i(()=>{if(!a||l!=="modified")return null;let t=[];if(a.label&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Label:"})," ",o("span",{className:"line-through text-red-600",children:a.label.old})," ","\u2192 ",o("span",{className:"text-green-600",children:a.label.new})]},"label")),a.required&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Required:"})," ",o("span",{className:"line-through text-red-600",children:a.required.old?"Yes":"No"})," ","\u2192"," ",o("span",{className:"text-green-600",children:a.required.new?"Yes":"No"})]},"required")),a.type&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Type:"})," ",o("span",{className:"line-through text-red-600",children:a.type.old})," ","\u2192 ",o("span",{className:"text-green-600",children:a.type.new})]},"type")),a.inputType&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Input Type:"})," ",o("span",{className:"line-through text-red-600",children:a.inputType.old})," ","\u2192 ",o("span",{className:"text-green-600",children:a.inputType.new})]},"inputType")),a.jsonType){let c=Array.isArray(a.jsonType.old)?a.jsonType.old.join(" | "):a.jsonType.old,S=Array.isArray(a.jsonType.new)?a.jsonType.new.join(" | "):a.jsonType.new;t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"JSON Type:"})," ",o("span",{className:"line-through text-red-600",children:c})," \u2192"," ",o("span",{className:"text-green-600",children:S})]},"jsonType"))}return a.defaultValue!==void 0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Default Value:"})," ",o("span",{className:"line-through text-red-600",children:JSON.stringify(a.defaultValue.old)})," ","\u2192"," ",o("span",{className:"text-green-600",children:JSON.stringify(a.defaultValue.new)})]},"defaultValue")),a.options&&(a.options.added.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold text-green-700",children:"Options Added:"})," ",a.options.added.map(c=>c.label).join(", ")]},"options-added")),a.options.removed.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold text-red-700",children:"Options Removed:"})," ",a.options.removed.map(c=>c.label).join(", ")]},"options-removed")),a.options.modified.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Options Modified:"})," ",a.options.modified.length," option(s)"]},"options-modified"))),a.nestedFields&&a.nestedFields.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Nested Fields:"})," ",a.nestedFields.length," field(s) changed"]},"nestedFields")),t.length===0?null:v("div",{className:"mt-2 p-2 bg-yellow-50 rounded border border-yellow-200 space-y-1",children:[o("div",{className:"text-xs font-semibold text-yellow-800 mb-1",children:"Changes:"}),t]})},"renderChanges");return v("div",{className:`p-3 mb-2 rounded ${s} relative`,children:[o("div",{className:"absolute top-2 right-2",children:m}),e,p()]})},"FieldWrapper"),ue=i(({version:e,fields:l,fieldsets:a,diffMap:s,title:u,scrollRef:m})=>{let p=le({mode:"onBlur"}),t=ve(()=>{let c=i((S,b)=>S.map(f=>{let d=b.get(f.name),N=d?.diffType||"unchanged",T=d?.changes,C=f.fields,P=f;if(C&&Array.isArray(C)){let V=new Map;T&&typeof T=="object"&&"nestedFields"in T&&Array.isArray(T.nestedFields)&&T.nestedFields.forEach(n=>{V.set(n.fieldName,{diffType:n.diffType,changes:n.changes})});let D=c(C,V);P={...f,fields:D}}return{...P,WrapperComponent:i(({children:V})=>o(Ie,{diffType:N,fieldName:f.name,changes:T,children:V}),"WrapperComponent")}}),"applyWrappers");return c(l,s)},[l,s]);return v(L,{className:"h-full",children:[o(H,{children:v(U,{children:[u," - Version ",e]})}),o(O,{ref:m,className:"overflow-y-auto max-h-[600px]",children:o(te,{...p,children:o("form",{className:"space-y-4",children:o(ie,{fields:t,fieldsets:a,fieldValues:{}})})})})]})},"FormPanel"),me=i(({topVersion:e,bottomVersion:l,topFields:a,bottomFields:s,topFieldsets:u,bottomFieldsets:m,isLoading:p})=>{let t=ve(()=>G(a,s),[a,s]),c=Q(null),S=Q(null),b=Q(!1);if(_e(()=>{let d=c.current,N=S.current;if(!d||!N)return;let T=i(()=>{b.current||(b.current=!0,N.scrollTop=d.scrollTop,requestAnimationFrame(()=>{b.current=!1}))},"handleLeftScroll"),C=i(()=>{b.current||(b.current=!0,d.scrollTop=N.scrollTop,requestAnimationFrame(()=>{b.current=!1}))},"handleRightScroll");return d.addEventListener("scroll",T),N.addEventListener("scroll",C),()=>{d.removeEventListener("scroll",T),N.removeEventListener("scroll",C)}},[a,s]),p)return o("div",{className:"flex items-center justify-center h-96",children:v("div",{className:"text-center",children:[o("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto"}),o("p",{className:"mt-4 text-gray-600",children:"Loading schemas..."})]})});let f=t.added.length===0&&t.removed.length===0&&t.modified.length===0;return v("div",{className:"space-y-6",children:[o(L,{children:o(O,{className:"pt-6",children:f?o("p",{className:"text-center text-gray-600",children:"No differences detected between the two versions"}):v("div",{className:"flex gap-6 justify-center",children:[t.added.length>0&&v("div",{className:"flex items-center gap-2",children:[o("span",{className:"w-4 h-4 bg-green-500 rounded"}),v("span",{className:"text-sm",children:[t.added.length," field",t.added.length>1?"s":""," ","added"]})]}),t.removed.length>0&&v("div",{className:"flex items-center gap-2",children:[o("span",{className:"w-4 h-4 bg-red-500 rounded"}),v("span",{className:"text-sm",children:[t.removed.length," field",t.removed.length>1?"s":""," removed"]})]}),t.modified.length>0&&v("div",{className:"flex items-center gap-2",children:[o("span",{className:"w-4 h-4 bg-yellow-500 rounded"}),v("span",{className:"text-sm",children:[t.modified.length," field",t.modified.length>1?"s":""," modified"]})]})]})})}),v("div",{className:"grid grid-cols-2 gap-6",children:[o(ue,{version:e,fields:a,fieldsets:u,diffMap:t.fieldDiffs,title:"Left",scrollRef:c}),o(ue,{version:l,fields:s,fieldsets:m,diffMap:t.fieldDiffs,title:"Right",scrollRef:S})]})]})},"SchemaFormComparison");var pe=[{value:1,label:"v1 (Legacy)"},{value:3,label:"v3 (Recommended)"}],ee={ALB:[{value:1,label:"v1"}],ARE:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],ARG:[{value:1,label:"v1"}],ARM:[{value:1,label:"v1"}],AUS:[{value:1,label:"v1"}],AUT:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BEL:[{value:1,label:"v1"},{value:2,label:"v2"}],BGD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BGR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BIH:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BLR:[{value:1,label:"v1"},{value:2,label:"v2"}],BOL:[{value:1,label:"v1"}],BRA:[{value:1,label:"v1"}],CAN:[{value:1,label:"v1"},{value:2,label:"v2"}],CHE:[{value:1,label:"v1"},{value:2,label:"v2"}],CHL:[{value:1,label:"v1"}],CHN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],COL:[{value:1,label:"v1"}],CRI:[{value:1,label:"v1"}],CYP:[{value:1,label:"v1"}],CZE:[{value:1,label:"v1"},{value:2,label:"v2"}],DEU:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],DNK:[{value:1,label:"v1"}],DOM:[{value:1,label:"v1"}],ECU:[{value:1,label:"v1"}],EGY:[{value:1,label:"v1"},{value:2,label:"v2"}],ESP:[{value:1,label:"v1"},{value:2,label:"v2"}],EST:[{value:1,label:"v1"}],FIN:[{value:1,label:"v1"}],FRA:[{value:1,label:"v1"},{value:2,label:"v2"}],GBR:[{value:1,label:"v1"},{value:2,label:"v2"}],GEO:[{value:1,label:"v1"}],GRC:[{value:1,label:"v1"}],GTM:[{value:1,label:"v1"}],HKG:[{value:1,label:"v1"},{value:2,label:"v2"}],HND:[{value:1,label:"v1"}],HRV:[{value:1,label:"v1"},{value:2,label:"v2"}],HUN:[{value:1,label:"v1"}],IDN:[{value:1,label:"v1"}],IND:[{value:1,label:"v1"},{value:2,label:"v2"}],IRL:[{value:1,label:"v1"}],ISL:[{value:1,label:"v1"},{value:2,label:"v2"}],ISR:[{value:1,label:"v1"}],ITA:[{value:1,label:"v1"}],JAM:[{value:1,label:"v1"},{value:2,label:"v2"}],JPN:[{value:1,label:"v1"},{value:2,label:"v2"}],KEN:[{value:1,label:"v1"},{value:2,label:"v2"}],KGZ:[{value:1,label:"v1"}],KHM:[{value:1,label:"v1"}],KOR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],LBN:[{value:1,label:"v1"},{value:2,label:"v2"}],LKA:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],LTU:[{value:1,label:"v1"}],LUX:[{value:1,label:"v1"}],LVA:[{value:1,label:"v1"},{value:2,label:"v2"}],MAR:[{value:1,label:"v1"}],MDA:[{value:1,label:"v1"}],MEX:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],MKD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],MLT:[{value:1,label:"v1"}],MNG:[{value:1,label:"v1"}],MUS:[{value:1,label:"v1"},{value:2,label:"v2"}],MYS:[{value:1,label:"v1"},{value:2,label:"v2"}],NGA:[{value:1,label:"v1"},{value:2,label:"v2"}],NIC:[{value:1,label:"v1"}],NLD:[{value:1,label:"v1"}],NOR:[{value:1,label:"v1"},{value:2,label:"v2"}],NZL:[{value:1,label:"v1"},{value:2,label:"v2"}],PAK:[{value:1,label:"v1"},{value:2,label:"v2"}],PAN:[{value:1,label:"v1"}],PER:[{value:1,label:"v1"}],PHL:[{value:1,label:"v1"}],POL:[{value:1,label:"v1"}],PRI:[{value:1,label:"v1"}],PRT:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],PRY:[{value:1,label:"v1"}],ROU:[{value:1,label:"v1"}],SAU:[{value:1,label:"v1"},{value:2,label:"v2"}],SGP:[{value:1,label:"v1"},{value:2,label:"v2"}],SLV:[{value:1,label:"v1"}],SRB:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],SVK:[{value:1,label:"v1"}],SVN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],SWE:[{value:1,label:"v1"},{value:2,label:"v2"}],THA:[{value:1,label:"v1"},{value:2,label:"v2"}],TUN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],TUR:[{value:1,label:"v1"}],TWN:[{value:1,label:"v1"}],UGA:[{value:1,label:"v1"}],UKR:[{value:1,label:"v1"}],URY:[{value:1,label:"v1"}],USA:[{value:1,label:"v1"}],VNM:[{value:1,label:"v1"},{value:2,label:"v2"}],XKX:[{value:1,label:"v1"}],ZAF:[{value:1,label:"v1"}],ZWE:[{value:1,label:"v1"}]},ce=Object.fromEntries(Object.entries(ee).filter(([,e])=>e.length>1)),be=[{value:"employment_basic_information",label:"Basic Information"},{value:"contract_details",label:"Contract Details"}];import{jsx as r,jsxs as h}from"react/jsx-runtime";var fe=i(()=>{let[e,l]=Y("employment_basic_information"),[a,s]=Y(1),[u,m]=Y(1),[p,t]=Y("ARE"),{client:c}=ae(),{data:S}=je({...oe(c,"schema-comparison"),select:i(n=>n.data?.data?.filter(w=>w.eor_onboarding).filter(w=>Object.keys(ce).includes(w.code)).map(w=>({label:w.name,value:w.code}))||[],"select")}),b=e==="contract_details",{data:f,isLoading:d}=W({countryCode:p,form:e,fieldValues:{},jsonSchemaVersion:a,options:{queryOptions:{enabled:!0}}}),{data:N,isLoading:T}=W({countryCode:p,form:e,fieldValues:{},jsonSchemaVersion:u,options:{queryOptions:{enabled:!0}}}),C=d||T,P=ee[p],V=P!==void 0,D=Je(()=>e==="employment_basic_information"?pe:P||[{value:"latest",label:"Latest"}],[e,P]);return ke(()=>{let n=D.map(w=>w.value);n.includes(a)||s(D[0].value),n.includes(u)||m(D[0].value)},[e,p,D,a,u]),h("div",{className:"space-y-6",children:[h(L,{children:[r(H,{children:r(U,{children:"Configuration"})}),h(O,{className:"space-y-4",children:[h("div",{children:[r(A,{className:"mb-2 block",children:"Form Type"}),r(z,{value:e,onValueChange:n=>l(n),children:r($,{className:"grid w-full grid-cols-2",children:be.map(n=>r(X,{value:n.value,children:n.label},n.value))})})]}),b&&!V&&r("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-200",children:h("div",{className:"flex",children:[r("div",{className:"flex-shrink-0",children:r("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),h("div",{className:"ml-3",children:[r("h3",{className:"text-sm font-medium text-yellow-800",children:"Version mappings not found"}),r("div",{className:"mt-2 text-sm text-yellow-700",children:h("p",{children:["Country"," ",r("span",{className:"font-semibold",children:p})," is not configured in COUNTRY_CONTRACT_VERSIONS. Using default (latest only)."]})})]})]})}),b&&h("div",{children:[r(A,{htmlFor:"country-select",className:"mb-2 block",children:"Country"}),h(_,{value:p,onValueChange:t,children:[r(k,{id:"country-select",children:r(I,{placeholder:"Select a country"})}),r(J,{children:S?.map(n=>r(j,{value:n.value,children:n.label},n.value))})]})]}),h("div",{className:"grid grid-cols-2 gap-4",children:[h("div",{children:[r(A,{htmlFor:"top-version",className:"mb-2 block",children:"Left Version"}),h(_,{value:String(a),onValueChange:n=>s(n==="latest"?"latest":Number(n)),children:[r(k,{id:"top-version",children:r(I,{placeholder:"Select version"})}),r(J,{children:D.map(n=>r(j,{value:String(n.value),children:n.label},String(n.value)))})]})]}),h("div",{children:[r(A,{htmlFor:"bottom-version",className:"mb-2 block",children:"Right Version"}),h(_,{value:String(u),onValueChange:n=>m(n==="latest"?"latest":Number(n)),children:[r(k,{id:"bottom-version",children:r(I,{placeholder:"Select version"})}),r(J,{children:D.map(n=>r(j,{value:String(n.value),children:n.label},String(n.value)))})]})]})]})]})]}),r(me,{topVersion:a,bottomVersion:u,topFields:f?.fields||[],bottomFields:N?.fields||[],topFieldsets:f?.meta?.["x-jsf-fieldsets"],bottomFieldsets:N?.meta?.["x-jsf-fieldsets"],isLoading:C})]})},"JsonSchemaComparison");export{ge as a,ye as b,Se as c,Ne as d,xe as e,Ce as f,De as g,we as h,Re as i,Pe as j,z as k,$ as l,X as m,Ve as n,ne as o,fe as p};
2
- //# sourceMappingURL=chunk-VDH46ZCF.js.map
1
+ import{a as L,b as H,c as U,e as O}from"./chunk-N6XLGYRK.js";import{f as W}from"./chunk-UYGDMJF2.js";import{a as oe}from"./chunk-54Z4QJ3Q.js";import{a as ie}from"./chunk-W5MWHAAI.js";import{a as _,c as I,d as k,e as J,f as j}from"./chunk-LJUWER2H.js";import{f as le,g as A,h as te}from"./chunk-Y3CJRZLA.js";import{n as g}from"./chunk-G2LZFGZA.js";import{e as ae}from"./chunk-H2O4CVKF.js";import{a as i}from"./chunk-P37U34EQ.js";import*as M from"@radix-ui/react-collapsible";var ge=M.Root,ye=M.CollapsibleTrigger,Se=M.CollapsibleContent;import*as y from"@radix-ui/react-dialog";import{XIcon as he}from"lucide-react";import{jsx as F,jsxs as K}from"react/jsx-runtime";function Ne({...e}){return F(y.Root,{"data-slot":"full-screen-dialog",...e})}i(Ne,"FullScreenDialog");function xe({...e}){return F(y.Trigger,{"data-slot":"full-screen-dialog-trigger",...e})}i(xe,"FullScreenDialogTrigger");function Te({...e}){return F(y.Portal,{"data-slot":"full-screen-dialog-portal",...e})}i(Te,"FullScreenDialogPortal");function Fe({className:e,...l}){return F(y.Overlay,{"data-slot":"full-screen-dialog-overlay",className:g("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...l})}i(Fe,"FullScreenDialogOverlay");function Ce({className:e,children:l,...a}){return K(Te,{"data-slot":"full-screen-dialog-portal",children:[F(Fe,{}),K(y.Content,{"data-slot":"full-screen-dialog-content",className:g("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 flex flex-col",e),...a,children:[l,K(y.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 RemoteFlows__FullScreenDialog__Close",children:[F(he,{}),F("span",{className:"sr-only",children:"Close"})]})]})]})}i(Ce,"FullScreenDialogContent");function De({className:e,...l}){return F("div",{"data-slot":"full-screen-dialog-header",className:g("flex flex-col gap-2 text-center sm:text-left",e),...l})}i(De,"FullScreenDialogHeader");function we({className:e,...l}){return F("div",{"data-slot":"full-screen-dialog-footer",className:g("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...l})}i(we,"FullScreenDialogFooter");function Re({className:e,...l}){return F(y.Title,{"data-slot":"full-screen-dialog-title",className:g("text-lg leading-none font-semibold",e),...l})}i(Re,"FullScreenDialogTitle");function Pe({className:e,...l}){return F(y.Description,{"data-slot":"full-screen-dialog-description",className:g("text-muted-foreground text-sm",e),...l})}i(Pe,"FullScreenDialogDescription");import*as R from"@radix-ui/react-tabs";import{jsx as B}from"react/jsx-runtime";function z({className:e,...l}){return B(R.Root,{"data-slot":"tabs",className:g("flex flex-col gap-2",e),...l})}i(z,"Tabs");function $({className:e,...l}){return B(R.List,{"data-slot":"tabs-list",className:g("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1",e),...l})}i($,"TabsList");function X({className:e,...l}){return B(R.Trigger,{"data-slot":"tabs-trigger",className:g("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l})}i(X,"TabsTrigger");function Ve({className:e,...l}){return B(R.Content,{"data-slot":"tabs-content",className:g("flex-1 outline-none",e),...l})}i(Ve,"TabsContent");import*as Z from"react";import*as x from"@radix-ui/react-scroll-area";import{jsx as q,jsxs as Ae}from"react/jsx-runtime";var ne=Z.forwardRef(({className:e,children:l,...a},s)=>Ae(x.Root,{ref:s,className:g("relative overflow-hidden",e),...a,children:[q(x.Viewport,{className:"h-full w-full rounded-[inherit]",children:l}),q(se,{}),q(x.Corner,{})]}));ne.displayName=x.Root.displayName;var se=Z.forwardRef(({className:e,orientation:l="vertical",...a},s)=>q(x.ScrollAreaScrollbar,{ref:s,orientation:l,className:g("flex touch-none select-none transition-colors",l==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:q(x.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));se.displayName=x.ScrollAreaScrollbar.displayName;import{useState as Y,useEffect as ke,useMemo as Je}from"react";import{useQuery as je}from"@tanstack/react-query";import E from"fast-deep-equal";var re=i(e=>e.name?e.type?!0:(console.warn(`Field "${e.name}" missing required "type" property`),!1):(console.warn('Field missing required "name" property:',e),!1),"validateField"),Le=i((e,l)=>{if(E(e,l))return;let a=new Map((e||[]).map(t=>[t.value,t])),s=new Map((l||[]).map(t=>[t.value,t])),u=[],m=[],p=[];if(s.forEach((t,c)=>{a.has(c)||u.push({value:t.value,label:t.label})}),a.forEach((t,c)=>{if(!s.has(c))m.push({value:t.value,label:t.label});else{let S=s.get(c);if(!E(t,S)){let b={};t.label!==S.label&&(b.label={old:t.label,new:S.label}),Object.keys(b).length>0&&p.push({value:c,changes:b})}}}),!(u.length===0&&m.length===0&&p.length===0))return{added:u,removed:m,modified:p}},"compareOptions"),Oe=i((e,l)=>{let a=e.fields,s=l.fields;if(!a&&!s)return;let u=G(a||[],s||[]);if(u.added.length>0||u.removed.length>0||u.modified.length>0)return Array.from(u.fieldDiffs.values())},"compareNestedFields"),Me=i((e,l)=>{let a={label:e.label!==l.label,required:e.required!==l.required,inputType:e.inputType!==l.inputType,type:e.type!==l.type,jsonType:!E(e.jsonType,l.jsonType),name:e.name!==l.name,defaultValue:e.defaultValue!==l.defaultValue,minDate:e.minDate!==l.minDate,maxDate:e.maxDate!==l.maxDate,maxLength:e.maxLength!==l.maxLength,multiple:e.multiple!==l.multiple,isVisible:e.isVisible!==l.isVisible,options:!E(e.options,l.options)},s=(()=>{let m=e.fields,p=l.fields;if(!m&&!p)return!1;if(!m||!p)return!0;let t=G(m,p);return t.added.length>0||t.removed.length>0||t.modified.length>0})();return Object.values(a).some(m=>m)||s},"isFieldModified"),Ee=i((e,l)=>{let a={};e.label!==l.label&&(a.label={old:e.label,new:l.label}),e.required!==l.required&&(a.required={old:e.required,new:l.required}),e.type!==l.type&&(a.type={old:e.type,new:l.type}),e.inputType!==l.inputType&&(a.inputType={old:e.inputType,new:l.inputType}),E(e.jsonType,l.jsonType)||(a.jsonType={old:e.jsonType,new:l.jsonType}),E(e.defaultValue,l.defaultValue)||(a.defaultValue={old:e.defaultValue,new:l.defaultValue}),e.minDate!==l.minDate&&(a.minDate={old:e.minDate||"",new:l.minDate||""}),e.maxDate!==l.maxDate&&(a.maxDate={old:e.maxDate||"",new:l.maxDate||""}),e.maxLength!==l.maxLength&&(a.maxLength={old:e.maxLength||0,new:l.maxLength||0}),e.multiple!==l.multiple&&(a.multiple={old:e.multiple||!1,new:l.multiple||!1}),e.isVisible!==l.isVisible&&(a.isVisible={old:e.isVisible,new:l.isVisible});let s=Le(e.options,l.options);s&&(a.options=s);let u=Oe(e,l);return u&&(a.nestedFields=u),Object.keys(a).length>0?a:void 0},"getFieldChanges"),G=i((e=[],l=[])=>{let a=e.filter(re),s=l.filter(re),u=new Map(a.map(f=>[f.name,{field:f}])),m=new Map(s.map(f=>[f.name,{field:f}])),p=[],t=[],c=[],S=[],b=new Map;return m.forEach((f,d)=>{u.has(d)||(p.push(d),b.set(d,{fieldName:d,diffType:"added"}))}),u.forEach(({field:f},d)=>{if(!m.has(d))t.push(d),b.set(d,{fieldName:d,diffType:"removed"});else{let{field:N}=m.get(d);Me(f,N)?(c.push(d),b.set(d,{fieldName:d,diffType:"modified",changes:Ee(f,N)})):(S.push(d),b.set(d,{fieldName:d,diffType:"unchanged"}))}}),{added:p,removed:t,modified:c,unchanged:S,fieldDiffs:b}},"compareFormFields"),de=i(e=>{switch(e){case"added":return"bg-green-50 border-l-4 border-green-500";case"removed":return"bg-red-50 border-l-4 border-red-500";case"modified":return"bg-yellow-50 border-l-4 border-yellow-500";default:return""}},"getDiffStyles");import{useMemo as ve,useRef as Q,useEffect as _e}from"react";import{jsx as o,jsxs as v}from"react/jsx-runtime";var Ie=i(({children:e,diffType:l,changes:a})=>{let s=de(l);if(l==="unchanged")return o("div",{children:e});let m={added:o("span",{className:"text-xs font-semibold text-green-700 bg-green-100 px-2 py-1 rounded",children:"NEW"}),removed:o("span",{className:"text-xs font-semibold text-red-700 bg-red-100 px-2 py-1 rounded",children:"REMOVED"}),modified:o("span",{className:"text-xs font-semibold text-yellow-700 bg-yellow-100 px-2 py-1 rounded",children:"MODIFIED"})}[l],p=i(()=>{if(!a||l!=="modified")return null;let t=[];if(a.label&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Label:"})," ",o("span",{className:"line-through text-red-600",children:a.label.old})," ","\u2192 ",o("span",{className:"text-green-600",children:a.label.new})]},"label")),a.required&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Required:"})," ",o("span",{className:"line-through text-red-600",children:a.required.old?"Yes":"No"})," ","\u2192"," ",o("span",{className:"text-green-600",children:a.required.new?"Yes":"No"})]},"required")),a.type&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Type:"})," ",o("span",{className:"line-through text-red-600",children:a.type.old})," ","\u2192 ",o("span",{className:"text-green-600",children:a.type.new})]},"type")),a.inputType&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Input Type:"})," ",o("span",{className:"line-through text-red-600",children:a.inputType.old})," ","\u2192 ",o("span",{className:"text-green-600",children:a.inputType.new})]},"inputType")),a.jsonType){let c=Array.isArray(a.jsonType.old)?a.jsonType.old.join(" | "):a.jsonType.old,S=Array.isArray(a.jsonType.new)?a.jsonType.new.join(" | "):a.jsonType.new;t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"JSON Type:"})," ",o("span",{className:"line-through text-red-600",children:c})," \u2192"," ",o("span",{className:"text-green-600",children:S})]},"jsonType"))}return a.defaultValue!==void 0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Default Value:"})," ",o("span",{className:"line-through text-red-600",children:JSON.stringify(a.defaultValue.old)})," ","\u2192"," ",o("span",{className:"text-green-600",children:JSON.stringify(a.defaultValue.new)})]},"defaultValue")),a.options&&(a.options.added.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold text-green-700",children:"Options Added:"})," ",a.options.added.map(c=>c.label).join(", ")]},"options-added")),a.options.removed.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold text-red-700",children:"Options Removed:"})," ",a.options.removed.map(c=>c.label).join(", ")]},"options-removed")),a.options.modified.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Options Modified:"})," ",a.options.modified.length," option(s)"]},"options-modified"))),a.nestedFields&&a.nestedFields.length>0&&t.push(v("div",{className:"text-xs",children:[o("span",{className:"font-semibold",children:"Nested Fields:"})," ",a.nestedFields.length," field(s) changed"]},"nestedFields")),t.length===0?null:v("div",{className:"mt-2 p-2 bg-yellow-50 rounded border border-yellow-200 space-y-1",children:[o("div",{className:"text-xs font-semibold text-yellow-800 mb-1",children:"Changes:"}),t]})},"renderChanges");return v("div",{className:`p-3 mb-2 rounded ${s} relative`,children:[o("div",{className:"absolute top-2 right-2",children:m}),e,p()]})},"FieldWrapper"),ue=i(({version:e,fields:l,fieldsets:a,diffMap:s,title:u,scrollRef:m})=>{let p=le({mode:"onBlur"}),t=ve(()=>{let c=i((S,b)=>S.map(f=>{let d=b.get(f.name),N=d?.diffType||"unchanged",T=d?.changes,C=f.fields,P=f;if(C&&Array.isArray(C)){let V=new Map;T&&typeof T=="object"&&"nestedFields"in T&&Array.isArray(T.nestedFields)&&T.nestedFields.forEach(n=>{V.set(n.fieldName,{diffType:n.diffType,changes:n.changes})});let D=c(C,V);P={...f,fields:D}}return{...P,WrapperComponent:i(({children:V})=>o(Ie,{diffType:N,fieldName:f.name,changes:T,children:V}),"WrapperComponent")}}),"applyWrappers");return c(l,s)},[l,s]);return v(L,{className:"h-full",children:[o(H,{children:v(U,{children:[u," - Version ",e]})}),o(O,{ref:m,className:"overflow-y-auto max-h-[600px]",children:o(te,{...p,children:o("form",{className:"space-y-4",children:o(ie,{fields:t,fieldsets:a,fieldValues:{}})})})})]})},"FormPanel"),me=i(({topVersion:e,bottomVersion:l,topFields:a,bottomFields:s,topFieldsets:u,bottomFieldsets:m,isLoading:p})=>{let t=ve(()=>G(a,s),[a,s]),c=Q(null),S=Q(null),b=Q(!1);if(_e(()=>{let d=c.current,N=S.current;if(!d||!N)return;let T=i(()=>{b.current||(b.current=!0,N.scrollTop=d.scrollTop,requestAnimationFrame(()=>{b.current=!1}))},"handleLeftScroll"),C=i(()=>{b.current||(b.current=!0,d.scrollTop=N.scrollTop,requestAnimationFrame(()=>{b.current=!1}))},"handleRightScroll");return d.addEventListener("scroll",T),N.addEventListener("scroll",C),()=>{d.removeEventListener("scroll",T),N.removeEventListener("scroll",C)}},[a,s]),p)return o("div",{className:"flex items-center justify-center h-96",children:v("div",{className:"text-center",children:[o("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto"}),o("p",{className:"mt-4 text-gray-600",children:"Loading schemas..."})]})});let f=t.added.length===0&&t.removed.length===0&&t.modified.length===0;return v("div",{className:"space-y-6",children:[o(L,{children:o(O,{className:"pt-6",children:f?o("p",{className:"text-center text-gray-600",children:"No differences detected between the two versions"}):v("div",{className:"flex gap-6 justify-center",children:[t.added.length>0&&v("div",{className:"flex items-center gap-2",children:[o("span",{className:"w-4 h-4 bg-green-500 rounded"}),v("span",{className:"text-sm",children:[t.added.length," field",t.added.length>1?"s":""," ","added"]})]}),t.removed.length>0&&v("div",{className:"flex items-center gap-2",children:[o("span",{className:"w-4 h-4 bg-red-500 rounded"}),v("span",{className:"text-sm",children:[t.removed.length," field",t.removed.length>1?"s":""," removed"]})]}),t.modified.length>0&&v("div",{className:"flex items-center gap-2",children:[o("span",{className:"w-4 h-4 bg-yellow-500 rounded"}),v("span",{className:"text-sm",children:[t.modified.length," field",t.modified.length>1?"s":""," modified"]})]})]})})}),v("div",{className:"grid grid-cols-2 gap-6",children:[o(ue,{version:e,fields:a,fieldsets:u,diffMap:t.fieldDiffs,title:"Left",scrollRef:c}),o(ue,{version:l,fields:s,fieldsets:m,diffMap:t.fieldDiffs,title:"Right",scrollRef:S})]})]})},"SchemaFormComparison");var pe=[{value:1,label:"v1 (Legacy)"},{value:3,label:"v3 (Recommended)"}],ee={ALB:[{value:1,label:"v1"}],ARE:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],ARG:[{value:1,label:"v1"}],ARM:[{value:1,label:"v1"}],AUS:[{value:1,label:"v1"}],AUT:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BEL:[{value:1,label:"v1"},{value:2,label:"v2"}],BGD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BGR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BIH:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],BLR:[{value:1,label:"v1"},{value:2,label:"v2"}],BOL:[{value:1,label:"v1"}],BRA:[{value:1,label:"v1"}],CAN:[{value:1,label:"v1"},{value:2,label:"v2"}],CHE:[{value:1,label:"v1"},{value:2,label:"v2"}],CHL:[{value:1,label:"v1"}],CHN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],COL:[{value:1,label:"v1"}],CRI:[{value:1,label:"v1"}],CYP:[{value:1,label:"v1"}],CZE:[{value:1,label:"v1"},{value:2,label:"v2"}],DEU:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],DNK:[{value:1,label:"v1"}],DOM:[{value:1,label:"v1"}],ECU:[{value:1,label:"v1"}],EGY:[{value:1,label:"v1"},{value:2,label:"v2"}],ESP:[{value:1,label:"v1"},{value:2,label:"v2"}],EST:[{value:1,label:"v1"}],FIN:[{value:1,label:"v1"}],FRA:[{value:1,label:"v1"},{value:2,label:"v2"}],GBR:[{value:1,label:"v1"},{value:2,label:"v2"}],GEO:[{value:1,label:"v1"}],GRC:[{value:1,label:"v1"}],GTM:[{value:1,label:"v1"}],HKG:[{value:1,label:"v1"},{value:2,label:"v2"}],HND:[{value:1,label:"v1"}],HRV:[{value:1,label:"v1"},{value:2,label:"v2"}],HUN:[{value:1,label:"v1"}],IDN:[{value:1,label:"v1"}],IND:[{value:1,label:"v1"},{value:2,label:"v2"}],IRL:[{value:1,label:"v1"}],ISL:[{value:1,label:"v1"},{value:2,label:"v2"}],ISR:[{value:1,label:"v1"}],ITA:[{value:1,label:"v1"}],JAM:[{value:1,label:"v1"},{value:2,label:"v2"}],JPN:[{value:1,label:"v1"},{value:2,label:"v2"}],KEN:[{value:1,label:"v1"},{value:2,label:"v2"}],KGZ:[{value:1,label:"v1"}],KHM:[{value:1,label:"v1"}],KOR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],LBN:[{value:1,label:"v1"},{value:2,label:"v2"}],LKA:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],LTU:[{value:1,label:"v1"}],LUX:[{value:1,label:"v1"}],LVA:[{value:1,label:"v1"},{value:2,label:"v2"}],MAR:[{value:1,label:"v1"}],MDA:[{value:1,label:"v1"}],MEX:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],MKD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],MLT:[{value:1,label:"v1"}],MNG:[{value:1,label:"v1"}],MUS:[{value:1,label:"v1"},{value:2,label:"v2"}],MYS:[{value:1,label:"v1"},{value:2,label:"v2"}],NGA:[{value:1,label:"v1"},{value:2,label:"v2"}],NIC:[{value:1,label:"v1"}],NLD:[{value:1,label:"v1"}],NOR:[{value:1,label:"v1"},{value:2,label:"v2"}],NZL:[{value:1,label:"v1"},{value:2,label:"v2"}],PAK:[{value:1,label:"v1"},{value:2,label:"v2"}],PAN:[{value:1,label:"v1"}],PER:[{value:1,label:"v1"}],PHL:[{value:1,label:"v1"}],POL:[{value:1,label:"v1"}],PRI:[{value:1,label:"v1"}],PRT:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],PRY:[{value:1,label:"v1"}],ROU:[{value:1,label:"v1"}],SAU:[{value:1,label:"v1"},{value:2,label:"v2"}],SGP:[{value:1,label:"v1"},{value:2,label:"v2"}],SLV:[{value:1,label:"v1"}],SRB:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],SVK:[{value:1,label:"v1"}],SVN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],SWE:[{value:1,label:"v1"},{value:2,label:"v2"}],THA:[{value:1,label:"v1"},{value:2,label:"v2"}],TUN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:3,label:"v3"}],TUR:[{value:1,label:"v1"}],TWN:[{value:1,label:"v1"}],UGA:[{value:1,label:"v1"}],UKR:[{value:1,label:"v1"}],URY:[{value:1,label:"v1"}],USA:[{value:1,label:"v1"}],VNM:[{value:1,label:"v1"},{value:2,label:"v2"}],XKX:[{value:1,label:"v1"}],ZAF:[{value:1,label:"v1"}],ZWE:[{value:1,label:"v1"}]},ce=Object.fromEntries(Object.entries(ee).filter(([,e])=>e.length>1)),be=[{value:"employment_basic_information",label:"Basic Information"},{value:"contract_details",label:"Contract Details"}];import{jsx as r,jsxs as h}from"react/jsx-runtime";var fe=i(()=>{let[e,l]=Y("employment_basic_information"),[a,s]=Y(1),[u,m]=Y(1),[p,t]=Y("ARE"),{client:c}=ae(),{data:S}=je({...oe(c,"schema-comparison"),select:i(n=>n.data?.data?.filter(w=>w.eor_onboarding).filter(w=>Object.keys(ce).includes(w.code)).map(w=>({label:w.name,value:w.code}))||[],"select")}),b=e==="contract_details",{data:f,isLoading:d}=W({countryCode:p,form:e,fieldValues:{},jsonSchemaVersion:a,options:{queryOptions:{enabled:!0}}}),{data:N,isLoading:T}=W({countryCode:p,form:e,fieldValues:{},jsonSchemaVersion:u,options:{queryOptions:{enabled:!0}}}),C=d||T,P=ee[p],V=P!==void 0,D=Je(()=>e==="employment_basic_information"?pe:P||[{value:"latest",label:"Latest"}],[e,P]);return ke(()=>{let n=D.map(w=>w.value);n.includes(a)||s(D[0].value),n.includes(u)||m(D[0].value)},[e,p,D,a,u]),h("div",{className:"space-y-6",children:[h(L,{children:[r(H,{children:r(U,{children:"Configuration"})}),h(O,{className:"space-y-4",children:[h("div",{children:[r(A,{className:"mb-2 block",children:"Form Type"}),r(z,{value:e,onValueChange:n=>l(n),children:r($,{className:"grid w-full grid-cols-2",children:be.map(n=>r(X,{value:n.value,children:n.label},n.value))})})]}),b&&!V&&r("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-200",children:h("div",{className:"flex",children:[r("div",{className:"flex-shrink-0",children:r("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),h("div",{className:"ml-3",children:[r("h3",{className:"text-sm font-medium text-yellow-800",children:"Version mappings not found"}),r("div",{className:"mt-2 text-sm text-yellow-700",children:h("p",{children:["Country"," ",r("span",{className:"font-semibold",children:p})," is not configured in COUNTRY_CONTRACT_VERSIONS. Using default (latest only)."]})})]})]})}),b&&h("div",{children:[r(A,{htmlFor:"country-select",className:"mb-2 block",children:"Country"}),h(_,{value:p,onValueChange:t,children:[r(k,{id:"country-select",children:r(I,{placeholder:"Select a country"})}),r(J,{children:S?.map(n=>r(j,{value:n.value,children:n.label},n.value))})]})]}),h("div",{className:"grid grid-cols-2 gap-4",children:[h("div",{children:[r(A,{htmlFor:"top-version",className:"mb-2 block",children:"Left Version"}),h(_,{value:String(a),onValueChange:n=>s(n==="latest"?"latest":Number(n)),children:[r(k,{id:"top-version",children:r(I,{placeholder:"Select version"})}),r(J,{children:D.map(n=>r(j,{value:String(n.value),children:n.label},String(n.value)))})]})]}),h("div",{children:[r(A,{htmlFor:"bottom-version",className:"mb-2 block",children:"Right Version"}),h(_,{value:String(u),onValueChange:n=>m(n==="latest"?"latest":Number(n)),children:[r(k,{id:"bottom-version",children:r(I,{placeholder:"Select version"})}),r(J,{children:D.map(n=>r(j,{value:String(n.value),children:n.label},String(n.value)))})]})]})]})]})]}),r(me,{topVersion:a,bottomVersion:u,topFields:f?.fields||[],bottomFields:N?.fields||[],topFieldsets:f?.meta?.["x-jsf-fieldsets"],bottomFieldsets:N?.meta?.["x-jsf-fieldsets"],isLoading:C})]})},"JsonSchemaComparison");export{ge as a,ye as b,Se as c,Ne as d,xe as e,Ce as f,De as g,we as h,Re as i,Pe as j,z as k,$ as l,X as m,Ve as n,ne as o,fe as p};
2
+ //# sourceMappingURL=chunk-R2JJUSD3.js.map
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-TC7EQZJK.js";import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";import{a as i}from"./chunk-LMYJ6V44.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
+ //# sourceMappingURL=chunk-SC7YWKOW.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-Q6GJJRYG.js";import{a as m}from"./chunk-HJOT7JXK.js";import{a as p}from"./chunk-IFIJ7OVJ.js";import{a as e}from"./chunk-76ZDXC2T.js";import{a as r}from"./chunk-JSTCIALQ.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as y}from"react";import{jsx as d}from"react/jsx-runtime";var P=t(({render:n,countryCode:C,options:i,initialValues:s})=>{let o=r({options:i,countryCode:C,initialValues:s}),f=y();return d(e.Provider,{value:{createCompanyBag:o,formId:f},children:n({createCompanyBag:o,components:{CompanyBasicInformationStep:m,AddressDetailsStep:a,SubmitButton:p}})})},"CreateCompanyFlow");export{P as a};
2
- //# sourceMappingURL=chunk-TLNE6GTG.js.map
1
+ import{a}from"./chunk-75XZ4KIX.js";import{a as m}from"./chunk-JBQOE3XL.js";import{a as p}from"./chunk-IFIJ7OVJ.js";import{a as e}from"./chunk-76ZDXC2T.js";import{a as r}from"./chunk-JSTCIALQ.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as y}from"react";import{jsx as d}from"react/jsx-runtime";var P=t(({render:n,countryCode:C,options:i,initialValues:s})=>{let o=r({options:i,countryCode:C,initialValues:s}),f=y();return d(e.Provider,{value:{createCompanyBag:o,formId:f},children:n({createCompanyBag:o,components:{CompanyBasicInformationStep:m,AddressDetailsStep:a,SubmitButton:p}})})},"CreateCompanyFlow");export{P as a};
2
+ //# sourceMappingURL=chunk-TCFTRE7G.js.map
@@ -1,2 +1,2 @@
1
- import{a as y}from"./chunk-HAACNERA.js";import{a as l,b as m}from"./chunk-LOPZZUAF.js";import{c}from"./chunk-Y3CJRZLA.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(m,{className:"text-sm",zendeskId:l.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(y,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
2
- //# sourceMappingURL=chunk-VEMUIRKC.js.map
1
+ import{a as y}from"./chunk-HAACNERA.js";import{a as l,c as m}from"./chunk-2Q462FT7.js";import{c}from"./chunk-Y3CJRZLA.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(m,{className:"text-sm",zendeskId:l.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(y,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
2
+ //# sourceMappingURL=chunk-TOOCSXXQ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as m,b as s}from"./chunk-2Q462FT7.js";import{n as e}from"./chunk-G2LZFGZA.js";import{a as t}from"./chunk-P37U34EQ.js";import{Fragment as a,jsx as n,jsxs as o}from"react/jsx-runtime";var l=t(()=>o(a,{children:[n("div",{className:e("RemoteFlows__EmploymentAgreementInfoContent__InfoBox"),children:n("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__InfoBoxText"),children:"You are previewing a draft version of our employment agreement template for this specific hire in this specific country, based on the selections you made on the previous screens."})}),n("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__Description"),children:"Remote's agreements are drafted by local employment and labor law experts to ensure compliance, balance, and efficiency."}),o("div",{children:[n("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__WarningTitle"),children:"We strongly discourage customizations or redlining."}),n("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__Description"),children:"Modifying agreements can:"}),o("ul",{className:e("RemoteFlows__EmploymentAgreementInfoContent__List list-disc list-inside"),children:[n("li",{className:e("RemoteFlows__EmploymentAgreementInfoContent__ListItem"),children:"Create compliance risks"}),n("li",{className:e("RemoteFlows__EmploymentAgreementInfoContent__ListItem"),children:"Jeopardize enforceability"}),n("li",{className:e("RemoteFlows__EmploymentAgreementInfoContent__ListItem"),children:"Increase the risk of misemployment"})]})]}),n("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__Description"),children:"If you have questions or believe a change is necessary, please do not invite the employee. Instead, save this invitation as a draft and contact your Account Executive or Customer Success Manager at Remote."}),o("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__Description"),children:["If neither is available, please reach out to"," ",n("a",{href:"mailto:help@remote.com",className:e("RemoteFlows__EmploymentAgreementInfoContent__Link"),target:"_blank",rel:"noopener noreferrer",children:"help@remote.com \u2197"}),". Our Legal team will review and, where possible, align your needs with local compliance requirements, before inviting the employee, ensuring a smooth onboarding process."]}),o("p",{className:e("RemoteFlows__EmploymentAgreementInfoContent__Description"),children:["For guidance, see our"," ",n("a",{className:e("RemoteFlows__EmploymentAgreementInfoContent__Link"),href:s(m.employmentAgreements),target:"_blank",rel:"noopener noreferrer",children:"Agreement Engagement Guide \u2197"})," ","to understand what can (and can't) be modified."]})]}),"EmploymentAgreementInfoContent");export{l as a};
2
+ //# sourceMappingURL=chunk-UEPT6OBL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/components/EmploymentAgreementInfoContent.tsx"],"sourcesContent":["import {\n buildZendeskURL,\n zendeskArticles,\n} from '@/src/components/shared/zendesk-drawer/utils';\nimport { cn } from '@/src/internals';\n\nexport const EmploymentAgreementInfoContent = () => {\n return (\n <>\n <div\n className={cn('RemoteFlows__EmploymentAgreementInfoContent__InfoBox')}\n >\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__InfoBoxText',\n )}\n >\n You are previewing a draft version of our employment agreement\n template for this specific hire in this specific country, based on the\n selections you made on the previous screens.\n </p>\n </div>\n\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__Description',\n )}\n >\n Remote's agreements are drafted by local employment and labor law\n experts to ensure compliance, balance, and efficiency.\n </p>\n\n <div>\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__WarningTitle',\n )}\n >\n We strongly discourage customizations or redlining.\n </p>\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__Description',\n )}\n >\n Modifying agreements can:\n </p>\n <ul\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__List list-disc list-inside',\n )}\n >\n <li\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__ListItem',\n )}\n >\n Create compliance risks\n </li>\n <li\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__ListItem',\n )}\n >\n Jeopardize enforceability\n </li>\n <li\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__ListItem',\n )}\n >\n Increase the risk of misemployment\n </li>\n </ul>\n </div>\n\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__Description',\n )}\n >\n If you have questions or believe a change is necessary, please do not\n invite the employee. Instead, save this invitation as a draft and\n contact your Account Executive or Customer Success Manager at Remote.\n </p>\n\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__Description',\n )}\n >\n If neither is available, please reach out to{' '}\n <a\n href='mailto:help@remote.com'\n className={cn('RemoteFlows__EmploymentAgreementInfoContent__Link')}\n target='_blank'\n rel='noopener noreferrer'\n >\n help@remote.com ↗\n </a>\n . Our Legal team will review and, where possible, align your needs with\n local compliance requirements, before inviting the employee, ensuring a\n smooth onboarding process.\n </p>\n\n <p\n className={cn(\n 'RemoteFlows__EmploymentAgreementInfoContent__Description',\n )}\n >\n For guidance, see our{' '}\n <a\n className={cn('RemoteFlows__EmploymentAgreementInfoContent__Link')}\n href={buildZendeskURL(zendeskArticles.employmentAgreements)}\n target='_blank'\n rel='noopener noreferrer'\n >\n Agreement Engagement Guide ↗\n </a>{' '}\n to understand what can (and can't) be modified.\n </p>\n </>\n );\n};\n"],"mappings":"+HAQI,mBAAAA,EAII,OAAAC,EAmCA,QAAAC,MAvCJ,oBAFG,IAAMC,EAAiCC,EAAA,IAE1CF,EAAAF,EAAA,CACE,UAAAC,EAAC,OACC,UAAWI,EAAG,sDAAsD,EAEpE,SAAAJ,EAAC,KACC,UAAWI,EACT,0DACF,EACD,8LAID,EACF,EAEAJ,EAAC,KACC,UAAWI,EACT,0DACF,EACD,oIAGD,EAEAH,EAAC,OACC,UAAAD,EAAC,KACC,UAAWI,EACT,2DACF,EACD,+DAED,EACAJ,EAAC,KACC,UAAWI,EACT,0DACF,EACD,qCAED,EACAH,EAAC,MACC,UAAWG,EACT,yEACF,EAEA,UAAAJ,EAAC,MACC,UAAWI,EACT,uDACF,EACD,mCAED,EACAJ,EAAC,MACC,UAAWI,EACT,uDACF,EACD,qCAED,EACAJ,EAAC,MACC,UAAWI,EACT,uDACF,EACD,8CAED,GACF,GACF,EAEAJ,EAAC,KACC,UAAWI,EACT,0DACF,EACD,yNAID,EAEAH,EAAC,KACC,UAAWG,EACT,0DACF,EACD,yDAC8C,IAC7CJ,EAAC,KACC,KAAK,yBACL,UAAWI,EAAG,mDAAmD,EACjE,OAAO,SACP,IAAI,sBACL,kCAED,EAAI,8KAIN,EAEAH,EAAC,KACC,UAAWG,EACT,0DACF,EACD,kCACuB,IACtBJ,EAAC,KACC,UAAWI,EAAG,mDAAmD,EACjE,KAAMC,EAAgBC,EAAgB,oBAAoB,EAC1D,OAAO,SACP,IAAI,sBACL,6CAED,EAAK,IAAI,mDAEX,GACF,EAnH0C","names":["Fragment","jsx","jsxs","EmploymentAgreementInfoContent","__name","cn","buildZendeskURL","zendeskArticles"]}
@@ -1,2 +1,2 @@
1
- import{a as Yt,b as re,c as oe,d as ae,e as se,f as ce,g as le,i as ue,j as de,k as pe,l as me,m as fe,n as ye,o as _e,p as ge,q as be,r as Se,s as Ce,t as we,u as ve}from"./chunk-XYCFKCVZ.js";import{a as he,b as Pe,c as Ee}from"./chunk-27TI6URK.js";import{a as Zt,b as te,f as ee,g as ne,h as ie}from"./chunk-G556HMVA.js";import{a as $,b as at,c as m,d as zt,g as Xt}from"./chunk-Q2OGLLBA.js";import{a as Wt}from"./chunk-PJ6KPGIE.js";import{f as Kt,h as Gt,i as Ht}from"./chunk-UYGDMJF2.js";import{Q as Ut}from"./chunk-GZUP2IE6.js";import{a as Nt,b as w,d as Qt,h as _,i as k,u as V,v}from"./chunk-G2LZFGZA.js";import{a as $t}from"./chunk-JDIKYCN6.js";import{e as Jt}from"./chunk-H2O4CVKF.js";import{a as d}from"./chunk-P37U34EQ.js";import{useEffect as A,useMemo as a,useRef as Me,useState as R}from"react";import Ve from"lodash.omit";import{useQuery as Pn}from"@tanstack/react-query";var En=d(()=>{let{client:T}=Jt(),{data:q}=re(),u=oe(q)?q?.company?.id??"":"";return Pn({queryKey:["legal-entities",u],queryFn:d(()=>Ut({client:T,path:{company_id:u},query:{page_size:100}}),"queryFn"),select:d(z=>z.data?.data?.legal_entities,"select"),enabled:!!u})},"useLegalEntities"),Fe=d(()=>{let{data:T}=En();return T?.find(q=>q.is_default)},"useDefaultLegalEntity");var Fn={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},Mn={employment_basic_information:"basic_information"},ii=d(({countryCode:T,externalId:q,employmentId:u,skipSteps:z,options:f,initialValues:p})=>{let Oe=f?.excludeProducts||[],_t=Me(f?.onContractReviewed);A(()=>{_t.current=f?.onContractReviewed},[f?.onContractReviewed]);let[l,gt]=R(T||null),[r,De]=R(u),[g,bt]=R(void 0),X=Me({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[Y,Ie]=R(void 0),[St,Z]=R(!1),[Ct,ke]=R(!0),[st,wt]=R(null),{steps:Ae,stepsArray:Re}=a(()=>Zt({includeSelectCountry:!z?.includes("select_country"),includeEligibilityQuestionnaire:St,includeContractPreview:Ct}),[St,Ct,z]),{fieldValues:c,stepState:e,setFieldValues:vt,previousStep:qe,nextStep:Te,goToStep:L,setStepValues:ht}=$t(Ae);A(()=>{st&&(L(st),wt(null))},[st,L]);let{data:o,isLoading:Le,refetch:Pt}=Wt({employmentId:r,queryParams:{exclude_files:!0}}),je=Fe(),{status:O}=o||{},h=O&&ee.includes(O),xe=O&&!ne.includes(O),Be=a(()=>O&&["invited","initiated"].includes(O)?"invited":"not_invited",[O]),Et=Gt(),Ft=Ht(l,f),ct=de(),Mt=Yt(),{mutateAsync:Vt}=fe(ct,Mt,c),Ot=be(),Dt=Se(),{mutateAsyncOrThrow:Ne}=w(Ft),It=se(),kt=ue(),At=Ce(),{mutateAsyncOrThrow:Qe}=w(Et),{mutateAsyncOrThrow:Je}=w(ct),{mutateAsyncOrThrow:Ue}=w(It),{mutateAsyncOrThrow:Rt}=w(kt),{mutateAsyncOrThrow:Ke}=w(Ot),{mutateAsyncOrThrow:qt}=w(Dt),{mutateAsyncOrThrow:Ge}=w(At);u&&o?.country?.code&&!l&&gt(o.country.code);let{selectCountryForm:j,isLoading:He,countries:Tt}=we({jsfModify:f?.jsfModify?.select_country}),lt=a(()=>Tt?.find(t=>t.value===l),[Tt,l]),We=a(()=>lt?.label,[lt]),$e=e.currentStep.name==="pricing_plan"||!!u&&h,{form:P,isLoading:ze,contractorSubscriptions:tt,filteredContractorSubscriptions:x,refetch:ut,isEligibilityQuestionnaireBlocked:B}=me(r,lt,{jsonSchemaVersion:f?.jsonSchemaVersion,queryOptions:{enabled:$e},excludeProducts:Oe,jsfModify:f?.jsfModify?.pricing_plan}),D=a(()=>!!tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.submitted_at,[tt]);A(()=>{if(D){Z(!1);return}else Z(Y===m)},[D,Y]),A(()=>{let t=o?.contractor_type==="cor";ke(!t)},[o?.contractor_type]);let et=a(()=>tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.responses,[tt]),Xe=Fn[e.currentStep.name]||"contractor_basic_information",Ye=Mn[Xe],Ze=o?.[Ye]||{},tn=d(({form:t,options:i={},query:s={}})=>{let M=Object.keys(c).length>0?{...p,...e.values?.[e.currentStep.name],...c}:{...p,...Ze};return Kt({countryCode:l,form:t,fieldValues:M,query:s,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}}})},"useJSONSchema"),en=!!(l&&(e.currentStep.name==="basic_information"||u)),nn=!!(l==="GBR"&&u&&e.currentStep.name==="basic_information"),{data:N,isLoading:rn}=ye(u,{enabled:nn}),{data:nt,isLoading:on}=_e(r,{enabled:!!r});A(()=>{nt&&nt.length>0&&!g&&bt(nt[0].id)},[nt,g]);let{data:b,isLoading:an}=tn({form:"contractor_basic_information",options:{jsfModify:Pe(l,We,f),queryOptions:{enabled:en}}}),sn=a(()=>te(o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date),[o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date]),y=a(()=>{let t={standard:$,plus:at,cor:m};if(c.subscription)return c.subscription;let i=e.values?.pricing_plan?.subscription;if(i&&!B)return i;if(D&&!B)return m;if(B&&D)return $;if(x&&x.length>0)return t[o?.contractor_type]||$},[c,e.values,D,o?.contractor_type,B,x]);A(()=>{y&&y!==Y&&Ie(y)},[y,Y]);let cn=a(()=>({...et,...p,...e.values?.eligibility_questionnaire,...c}),[et,p,e.values?.eligibility_questionnaire,c]),ln=a(()=>y===m&&e.currentStep.name==="eligibility_questionnaire"||!!u&&h&&y===m,[y,e.currentStep.name,u,h]),{data:E,isLoading:un}=ge({options:{queryOptions:{enabled:ln},jsfModify:f?.jsfModify?.eligibility_questionnaire},fieldValues:cn}),dn=!!(l&&e.currentStep.name==="contract_details"||h),{data:S,isLoading:pn}=ve({countryCode:l,fieldValues:c,employmentId:r,options:{queryOptions:{enabled:dn},jsfModify:he(f?.jsfModify?.contract_details,sn,y,c,y===m)}}),mn=a(()=>e.currentStep.name==="contract_preview"||!!u&&h,[e.currentStep.name,u,h]),{data:F}=ae({fieldValues:c,options:{queryOptions:{enabled:mn},jsfModify:Ee(f,c)}}),{data:dt,isLoading:fn,refetch:yn}=ce({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),{hasCompanySignedContract:_n}=le({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),n=a(()=>({select_country:j?.fields||[],basic_information:b?.fields||[],pricing_plan:P?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:S?.fields||[],contract_preview:F?.fields||[],review:[]}),[j?.fields,b?.fields,P?.fields,S?.fields,F?.fields,E?.fields]),gn={select_country:null,basic_information:b?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:S?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},bn={select_country:j?.meta?.["x-jsf-presentation"],basic_information:b?.meta?.["x-jsf-presentation"],pricing_plan:P?.meta?.["x-jsf-presentation"],eligibility_questionnaire:E?.meta?.["x-jsf-presentation"],contract_details:S?.meta?.["x-jsf-presentation"],contract_preview:F?.meta?.["x-jsf-presentation"],review:null},{country:Sn,basic_information:it={},contract_details:Lt={}}=o||{},jt=Sn?.code,Q=a(()=>k(n.select_country,{country:l||jt||""}),[n.select_country,l,jt]),pt=a(()=>N?.content?Qt(N.content,N.name):null,[N?.content,N?.name]),J=a(()=>{let t={...p,...it,ir35:o?.contract_details?.ir_35,nationality_status:o?.contract_details?.nationality,...pt&&{ir35_sds_file:[pt]}};return k(n.basic_information,t)},[p,it,o?.contract_details?.ir_35,o?.contract_details?.nationality,pt,n.basic_information]),U=a(()=>{let i={...{service_duration:{provisional_start_date:it.provisional_start_date}},...p,...Lt};return k(n.contract_details,i)},[n.contract_details,Lt,p,it]),K=a(()=>{let t=dt?.contract_document?.signatories?.find(s=>s.type==="company"),i={...p,signature:t?.signature};return k(n.contract_preview,i)},[n.contract_preview,p,dt]),G=a(()=>{let i={...{subscription:y},...p};return k(n.pricing_plan,i)},[n.pricing_plan,p,y]),H=a(()=>{let t={...p,...et};return k(n.eligibility_questionnaire,t)},[n.eligibility_questionnaire,p,et]),Cn=a(()=>({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H}),[Q,J,U,K,G,H]),mt=!!(u&&h&&e.currentStep.name!=="review"),ft=He||an||Le||pn||ze||fn||rn||on||un,xt=a(()=>{let i=o?.contractor_type==="cor"||n.contract_preview.length>0;return!!(mt&&!ft&&g&&n.basic_information.length>0&&n.contract_details.length>0&&i)},[mt,ft,g,n.basic_information.length,n.contract_details.length,n.contract_preview.length,o?.contractor_type]);A(()=>{xt&&(X.current={select_country:V(Q,n.select_country,{skipMoneyConversion:!0}),basic_information:V(J,n.basic_information,{skipMoneyConversion:!0}),contract_details:V(U,n.contract_details,{skipMoneyConversion:!0}),contract_preview:V(K,n.contract_preview,{skipMoneyConversion:!0}),pricing_plan:V(G,n.pricing_plan,{skipMoneyConversion:!0}),eligibility_questionnaire:V(H,n.eligibility_questionnaire,{skipMoneyConversion:!0})},ht({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H,review:{}}),L("review"))},[xt,L,Q,J,U,ht,n.select_country,n.basic_information,n.contract_details,n.pricing_plan,G,n.contract_preview,K,n.eligibility_questionnaire,H]);let wn=d(t=>{L(t)},"goTo"),Bt=d(async t=>j&&e.currentStep.name==="select_country"?t:b&&e.currentStep.name==="basic_information"?await _(t,b?.fields,{isPartialValidation:!1}):S&&e.currentStep.name==="contract_details"?await _(t,S?.fields,{isPartialValidation:!1}):F&&e.currentStep.name==="contract_preview"?await _(t,F?.fields,{isPartialValidation:!1}):P&&e.currentStep.name==="pricing_plan"?await _(t,P?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await _(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues"),vn=d(t=>{if(!Nt(t))return null;let i=t.normalizedErrors.services_and_deliverables,s=Array.isArray(i)?i[0]:i;return s?.source===Xt?{error:s.error,source:s.source,skippable:s.skippable}:null},"extractAiValidationError");async function hn(t){let i=e.currentStep.name,s=await Bt(t);switch(i in X.current&&(X.current[i]=V(s,n[i])),e.currentStep.name){case"select_country":return gt(s.country),Promise.resolve({data:{countryCode:s.country}});case"basic_information":{let I=!r&&l,M=r&&l&&o?.country&&o?.country.code!==l;if(I||M){let yt={basic_information:Ve(s,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:l,external_id:q},ot=await Qe(yt),C=ot?.data?.employment?.id;if(!C)throw v("Employment ID not found");return await Vt({employmentId:C}),De(C),ot}else if(r){let rt=Ve(s,"nationality_status","ir35","ir35_sds_file");return await Vt({employmentId:r}),Ne({employmentId:r,basic_information:rt})}return}case"contract_details":{let{services_and_deliverables_ai_warning:I,services_and_deliverables_error_skippable:M,...rt}=s,yt=c.services_and_deliverables_error_skippable===!0,ot={contract_document:rt,skip_ai_checks:yt};try{let C=await Je({employmentId:r,payload:ot}),W=C?.data?.contract_document?.id;if(!W)throw v("Contract document ID not found");return bt(W),C}catch(C){let W=vn(C);throw W&&vt({...t,services_and_deliverables_ai_warning:ie(y===m),services_and_deliverables_error_skippable:W.skippable}),C}}case"contract_preview":{if(_n)return Promise.resolve({data:{contract_document:{id:g}}});let I=await Ue({employmentId:r,contractDocumentId:g,payload:{signature:s.signature}});return await yn(),I}case"pricing_plan":{if(t.subscription===zt)return Promise.resolve({data:{subscription:t.subscription}});if(x.length===0)throw v("No available subscriptions.");if(!t.subscription&&x.length>0)throw v("Please select a subscription plan.");if(B&&[m,at].includes(t.subscription))throw v(`This individual is not eligible for ${pe[t.subscription]}.`);if(D&&t.subscription!==m)try{await Ge({employmentId:r}),await ut()}catch(M){if(M?.response?.status!==404)throw M;await ut()}if(t.subscription==$)return Rt({employmentId:r,payload:{operation:"downgrade"}});if(t.subscription==at)return Rt({employmentId:r,payload:{operation:"upgrade"}});if(t.subscription==m)return D&&o?.contractor_type!=="cor"?qt({employmentId:r}):Promise.resolve({data:{subscription:t.subscription}});throw v("invalid selection")}case"eligibility_questionnaire":try{if((await Ke({employmentId:r,payload:s}))?.data?.is_blocking)throw Z(!1),wt("pricing_plan"),v("This individual is not eligible for Contractor of Record.");return await qt({employmentId:r})}finally{await ut()}default:throw v("Invalid step state")}}return d(hn,"onSubmit"),{isLoading:ft||mt,fieldValues:c,stepState:e,checkFieldUpdates:vt,markContractAsReviewed:d(()=>{_t.current?.()},"markContractAsReviewed"),back:qe,next:d(()=>{r&&Pt(),Te()},"handleNextStep"),goTo:wn,onSubmit:hn,fields:n[e.currentStep.name],meta:{fields:X.current,fieldsets:gn[e.currentStep.name],presentation:bn[e.currentStep.name]},parseFormValues:Bt,canSkipAiValidation:c.services_and_deliverables_error_skippable===!0,handleValidation:d(async t=>{if(e.currentStep.name==="select_country")return j.handleValidation(t);if(b&&e.currentStep.name==="basic_information"){let i=await _(t,b?.fields,{isPartialValidation:!1});return b?.handleValidation(i)}if(S&&e.currentStep.name==="contract_details"){let i=await _(t,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}if(F&&e.currentStep.name==="contract_preview"){let i=await _(t,F?.fields,{isPartialValidation:!0});return F?.handleValidation(i)}if(P&&e.currentStep.name==="pricing_plan"){let i=await _(t,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let i=await _(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(i)}return null},"handleValidation"),initialValues:Cn,employmentId:r,refetchEmployment:Pt,isSubmitting:Et.isPending||Ft.isPending||ct.isPending||It.isPending||kt.isPending||Mt.isPending||Ot.isPending||Dt.isPending||At.isPending,documentPreviewPdf:dt,canInvite:xe,isEmploymentReadOnly:h,invitedStatus:Be,employment:o,defaultLegalEntity:je,steps:Re}},"useContractorOnboarding");export{ii as a};
2
- //# sourceMappingURL=chunk-VQ5PL5E3.js.map
1
+ import{a as Yt,b as re,c as oe,d as ae,e as se,f as ce,g as le,i as ue,j as de,k as pe,l as me,m as fe,n as ye,o as _e,p as ge,q as be,r as Se,s as Ce,t as we,u as ve}from"./chunk-XYCFKCVZ.js";import{a as he,b as Pe,c as Ee}from"./chunk-HK4LGSS7.js";import{a as Zt,b as te,f as ee,g as ne,h as ie}from"./chunk-G556HMVA.js";import{a as $,b as at,c as m,d as zt,g as Xt}from"./chunk-Q2OGLLBA.js";import{a as Wt}from"./chunk-PJ6KPGIE.js";import{f as Kt,h as Gt,i as Ht}from"./chunk-UYGDMJF2.js";import{Q as Ut}from"./chunk-GZUP2IE6.js";import{a as Nt,b as w,d as Qt,h as _,i as k,u as V,v}from"./chunk-G2LZFGZA.js";import{a as $t}from"./chunk-JDIKYCN6.js";import{e as Jt}from"./chunk-H2O4CVKF.js";import{a as d}from"./chunk-P37U34EQ.js";import{useEffect as A,useMemo as a,useRef as Me,useState as R}from"react";import Ve from"lodash.omit";import{useQuery as Pn}from"@tanstack/react-query";var En=d(()=>{let{client:T}=Jt(),{data:q}=re(),u=oe(q)?q?.company?.id??"":"";return Pn({queryKey:["legal-entities",u],queryFn:d(()=>Ut({client:T,path:{company_id:u},query:{page_size:100}}),"queryFn"),select:d(z=>z.data?.data?.legal_entities,"select"),enabled:!!u})},"useLegalEntities"),Fe=d(()=>{let{data:T}=En();return T?.find(q=>q.is_default)},"useDefaultLegalEntity");var Fn={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},Mn={employment_basic_information:"basic_information"},ii=d(({countryCode:T,externalId:q,employmentId:u,skipSteps:z,options:f,initialValues:p})=>{let Oe=f?.excludeProducts||[],_t=Me(f?.onContractReviewed);A(()=>{_t.current=f?.onContractReviewed},[f?.onContractReviewed]);let[l,gt]=R(T||null),[r,De]=R(u),[g,bt]=R(void 0),X=Me({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[Y,Ie]=R(void 0),[St,Z]=R(!1),[Ct,ke]=R(!0),[st,wt]=R(null),{steps:Ae,stepsArray:Re}=a(()=>Zt({includeSelectCountry:!z?.includes("select_country"),includeEligibilityQuestionnaire:St,includeContractPreview:Ct}),[St,Ct,z]),{fieldValues:c,stepState:e,setFieldValues:vt,previousStep:qe,nextStep:Te,goToStep:L,setStepValues:ht}=$t(Ae);A(()=>{st&&(L(st),wt(null))},[st,L]);let{data:o,isLoading:Le,refetch:Pt}=Wt({employmentId:r,queryParams:{exclude_files:!0}}),je=Fe(),{status:O}=o||{},h=O&&ee.includes(O),xe=O&&!ne.includes(O),Be=a(()=>O&&["invited","initiated"].includes(O)?"invited":"not_invited",[O]),Et=Gt(),Ft=Ht(l,f),ct=de(),Mt=Yt(),{mutateAsync:Vt}=fe(ct,Mt,c),Ot=be(),Dt=Se(),{mutateAsyncOrThrow:Ne}=w(Ft),It=se(),kt=ue(),At=Ce(),{mutateAsyncOrThrow:Qe}=w(Et),{mutateAsyncOrThrow:Je}=w(ct),{mutateAsyncOrThrow:Ue}=w(It),{mutateAsyncOrThrow:Rt}=w(kt),{mutateAsyncOrThrow:Ke}=w(Ot),{mutateAsyncOrThrow:qt}=w(Dt),{mutateAsyncOrThrow:Ge}=w(At);u&&o?.country?.code&&!l&&gt(o.country.code);let{selectCountryForm:j,isLoading:He,countries:Tt}=we({jsfModify:f?.jsfModify?.select_country}),lt=a(()=>Tt?.find(t=>t.value===l),[Tt,l]),We=a(()=>lt?.label,[lt]),$e=e.currentStep.name==="pricing_plan"||!!u&&h,{form:P,isLoading:ze,contractorSubscriptions:tt,filteredContractorSubscriptions:x,refetch:ut,isEligibilityQuestionnaireBlocked:B}=me(r,lt,{jsonSchemaVersion:f?.jsonSchemaVersion,queryOptions:{enabled:$e},excludeProducts:Oe,jsfModify:f?.jsfModify?.pricing_plan}),D=a(()=>!!tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.submitted_at,[tt]);A(()=>{if(D){Z(!1);return}else Z(Y===m)},[D,Y]),A(()=>{let t=o?.contractor_type==="cor";ke(!t)},[o?.contractor_type]);let et=a(()=>tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.responses,[tt]),Xe=Fn[e.currentStep.name]||"contractor_basic_information",Ye=Mn[Xe],Ze=o?.[Ye]||{},tn=d(({form:t,options:i={},query:s={}})=>{let M=Object.keys(c).length>0?{...p,...e.values?.[e.currentStep.name],...c}:{...p,...Ze};return Kt({countryCode:l,form:t,fieldValues:M,query:s,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}}})},"useJSONSchema"),en=!!(l&&(e.currentStep.name==="basic_information"||u)),nn=!!(l==="GBR"&&u&&e.currentStep.name==="basic_information"),{data:N,isLoading:rn}=ye(u,{enabled:nn}),{data:nt,isLoading:on}=_e(r,{enabled:!!r});A(()=>{nt&&nt.length>0&&!g&&bt(nt[0].id)},[nt,g]);let{data:b,isLoading:an}=tn({form:"contractor_basic_information",options:{jsfModify:Pe(l,We,f),queryOptions:{enabled:en}}}),sn=a(()=>te(o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date),[o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date]),y=a(()=>{let t={standard:$,plus:at,cor:m};if(c.subscription)return c.subscription;let i=e.values?.pricing_plan?.subscription;if(i&&!B)return i;if(D&&!B)return m;if(B&&D)return $;if(x&&x.length>0)return t[o?.contractor_type]||$},[c,e.values,D,o?.contractor_type,B,x]);A(()=>{y&&y!==Y&&Ie(y)},[y,Y]);let cn=a(()=>({...et,...p,...e.values?.eligibility_questionnaire,...c}),[et,p,e.values?.eligibility_questionnaire,c]),ln=a(()=>y===m&&e.currentStep.name==="eligibility_questionnaire"||!!u&&h&&y===m,[y,e.currentStep.name,u,h]),{data:E,isLoading:un}=ge({options:{queryOptions:{enabled:ln},jsfModify:f?.jsfModify?.eligibility_questionnaire},fieldValues:cn}),dn=!!(l&&e.currentStep.name==="contract_details"||h),{data:S,isLoading:pn}=ve({countryCode:l,fieldValues:c,employmentId:r,options:{queryOptions:{enabled:dn},jsfModify:he(f?.jsfModify?.contract_details,sn,y,c,y===m)}}),mn=a(()=>e.currentStep.name==="contract_preview"||!!u&&h,[e.currentStep.name,u,h]),{data:F}=ae({fieldValues:c,options:{queryOptions:{enabled:mn},jsfModify:Ee(f,c)}}),{data:dt,isLoading:fn,refetch:yn}=ce({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),{hasCompanySignedContract:_n}=le({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),n=a(()=>({select_country:j?.fields||[],basic_information:b?.fields||[],pricing_plan:P?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:S?.fields||[],contract_preview:F?.fields||[],review:[]}),[j?.fields,b?.fields,P?.fields,S?.fields,F?.fields,E?.fields]),gn={select_country:null,basic_information:b?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:S?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},bn={select_country:j?.meta?.["x-jsf-presentation"],basic_information:b?.meta?.["x-jsf-presentation"],pricing_plan:P?.meta?.["x-jsf-presentation"],eligibility_questionnaire:E?.meta?.["x-jsf-presentation"],contract_details:S?.meta?.["x-jsf-presentation"],contract_preview:F?.meta?.["x-jsf-presentation"],review:null},{country:Sn,basic_information:it={},contract_details:Lt={}}=o||{},jt=Sn?.code,Q=a(()=>k(n.select_country,{country:l||jt||""}),[n.select_country,l,jt]),pt=a(()=>N?.content?Qt(N.content,N.name):null,[N?.content,N?.name]),J=a(()=>{let t={...p,...it,ir35:o?.contract_details?.ir_35,nationality_status:o?.contract_details?.nationality,...pt&&{ir35_sds_file:[pt]}};return k(n.basic_information,t)},[p,it,o?.contract_details?.ir_35,o?.contract_details?.nationality,pt,n.basic_information]),U=a(()=>{let i={...{service_duration:{provisional_start_date:it.provisional_start_date}},...p,...Lt};return k(n.contract_details,i)},[n.contract_details,Lt,p,it]),K=a(()=>{let t=dt?.contract_document?.signatories?.find(s=>s.type==="company"),i={...p,signature:t?.signature};return k(n.contract_preview,i)},[n.contract_preview,p,dt]),G=a(()=>{let i={...{subscription:y},...p};return k(n.pricing_plan,i)},[n.pricing_plan,p,y]),H=a(()=>{let t={...p,...et};return k(n.eligibility_questionnaire,t)},[n.eligibility_questionnaire,p,et]),Cn=a(()=>({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H}),[Q,J,U,K,G,H]),mt=!!(u&&h&&e.currentStep.name!=="review"),ft=He||an||Le||pn||ze||fn||rn||on||un,xt=a(()=>{let i=o?.contractor_type==="cor"||n.contract_preview.length>0;return!!(mt&&!ft&&g&&n.basic_information.length>0&&n.contract_details.length>0&&i)},[mt,ft,g,n.basic_information.length,n.contract_details.length,n.contract_preview.length,o?.contractor_type]);A(()=>{xt&&(X.current={select_country:V(Q,n.select_country,{skipMoneyConversion:!0}),basic_information:V(J,n.basic_information,{skipMoneyConversion:!0}),contract_details:V(U,n.contract_details,{skipMoneyConversion:!0}),contract_preview:V(K,n.contract_preview,{skipMoneyConversion:!0}),pricing_plan:V(G,n.pricing_plan,{skipMoneyConversion:!0}),eligibility_questionnaire:V(H,n.eligibility_questionnaire,{skipMoneyConversion:!0})},ht({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H,review:{}}),L("review"))},[xt,L,Q,J,U,ht,n.select_country,n.basic_information,n.contract_details,n.pricing_plan,G,n.contract_preview,K,n.eligibility_questionnaire,H]);let wn=d(t=>{L(t)},"goTo"),Bt=d(async t=>j&&e.currentStep.name==="select_country"?t:b&&e.currentStep.name==="basic_information"?await _(t,b?.fields,{isPartialValidation:!1}):S&&e.currentStep.name==="contract_details"?await _(t,S?.fields,{isPartialValidation:!1}):F&&e.currentStep.name==="contract_preview"?await _(t,F?.fields,{isPartialValidation:!1}):P&&e.currentStep.name==="pricing_plan"?await _(t,P?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await _(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues"),vn=d(t=>{if(!Nt(t))return null;let i=t.normalizedErrors.services_and_deliverables,s=Array.isArray(i)?i[0]:i;return s?.source===Xt?{error:s.error,source:s.source,skippable:s.skippable}:null},"extractAiValidationError");async function hn(t){let i=e.currentStep.name,s=await Bt(t);switch(i in X.current&&(X.current[i]=V(s,n[i])),e.currentStep.name){case"select_country":return gt(s.country),Promise.resolve({data:{countryCode:s.country}});case"basic_information":{let I=!r&&l,M=r&&l&&o?.country&&o?.country.code!==l;if(I||M){let yt={basic_information:Ve(s,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:l,external_id:q},ot=await Qe(yt),C=ot?.data?.employment?.id;if(!C)throw v("Employment ID not found");return await Vt({employmentId:C}),De(C),ot}else if(r){let rt=Ve(s,"nationality_status","ir35","ir35_sds_file");return await Vt({employmentId:r}),Ne({employmentId:r,basic_information:rt})}return}case"contract_details":{let{services_and_deliverables_ai_warning:I,services_and_deliverables_error_skippable:M,...rt}=s,yt=c.services_and_deliverables_error_skippable===!0,ot={contract_document:rt,skip_ai_checks:yt};try{let C=await Je({employmentId:r,payload:ot}),W=C?.data?.contract_document?.id;if(!W)throw v("Contract document ID not found");return bt(W),C}catch(C){let W=vn(C);throw W&&vt({...t,services_and_deliverables_ai_warning:ie(y===m),services_and_deliverables_error_skippable:W.skippable}),C}}case"contract_preview":{if(_n)return Promise.resolve({data:{contract_document:{id:g}}});let I=await Ue({employmentId:r,contractDocumentId:g,payload:{signature:s.signature}});return await yn(),I}case"pricing_plan":{if(t.subscription===zt)return Promise.resolve({data:{subscription:t.subscription}});if(x.length===0)throw v("No available subscriptions.");if(!t.subscription&&x.length>0)throw v("Please select a subscription plan.");if(B&&[m,at].includes(t.subscription))throw v(`This individual is not eligible for ${pe[t.subscription]}.`);if(D&&t.subscription!==m)try{await Ge({employmentId:r}),await ut()}catch(M){if(M?.response?.status!==404)throw M;await ut()}if(t.subscription==$)return Rt({employmentId:r,payload:{operation:"downgrade"}});if(t.subscription==at)return Rt({employmentId:r,payload:{operation:"upgrade"}});if(t.subscription==m)return D&&o?.contractor_type!=="cor"?qt({employmentId:r}):Promise.resolve({data:{subscription:t.subscription}});throw v("invalid selection")}case"eligibility_questionnaire":try{if((await Ke({employmentId:r,payload:s}))?.data?.is_blocking)throw Z(!1),wt("pricing_plan"),v("This individual is not eligible for Contractor of Record.");return await qt({employmentId:r})}finally{await ut()}default:throw v("Invalid step state")}}return d(hn,"onSubmit"),{isLoading:ft||mt,fieldValues:c,stepState:e,checkFieldUpdates:vt,markContractAsReviewed:d(()=>{_t.current?.()},"markContractAsReviewed"),back:qe,next:d(()=>{r&&Pt(),Te()},"handleNextStep"),goTo:wn,onSubmit:hn,fields:n[e.currentStep.name],meta:{fields:X.current,fieldsets:gn[e.currentStep.name],presentation:bn[e.currentStep.name]},parseFormValues:Bt,canSkipAiValidation:c.services_and_deliverables_error_skippable===!0,handleValidation:d(async t=>{if(e.currentStep.name==="select_country")return j.handleValidation(t);if(b&&e.currentStep.name==="basic_information"){let i=await _(t,b?.fields,{isPartialValidation:!1});return b?.handleValidation(i)}if(S&&e.currentStep.name==="contract_details"){let i=await _(t,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}if(F&&e.currentStep.name==="contract_preview"){let i=await _(t,F?.fields,{isPartialValidation:!0});return F?.handleValidation(i)}if(P&&e.currentStep.name==="pricing_plan"){let i=await _(t,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let i=await _(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(i)}return null},"handleValidation"),initialValues:Cn,employmentId:r,refetchEmployment:Pt,isSubmitting:Et.isPending||Ft.isPending||ct.isPending||It.isPending||kt.isPending||Mt.isPending||Ot.isPending||Dt.isPending||At.isPending,documentPreviewPdf:dt,canInvite:xe,isEmploymentReadOnly:h,invitedStatus:Be,employment:o,defaultLegalEntity:je,steps:Re}},"useContractorOnboarding");export{ii as a};
2
+ //# sourceMappingURL=chunk-UI4AZZD5.js.map
@@ -1,2 +1,2 @@
1
- import{a as F}from"./chunk-DJIQISA2.js";import{a as u}from"./chunk-YVS5MBND.js";import{j as p,k as l,l as i,n as a,o as c}from"./chunk-Y3CJRZLA.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as $,useState as v}from"react";import{jsx as n,jsxs as C}from"react/jsx-runtime";function L({field:t,fieldState:b,fieldData:o}){let[g,s]=v([]),_=m(e=>{let r=e.map(({value:S})=>S);t.onChange(r),s(e)},"handleChange");$(()=>{t.value&&o.options&&s(t.value.map(e=>o?.options?.find(r=>r.value===e)))},[t.value,o.options]);let y=[...Object.entries(o.$meta?.regions||{}).map(([e,r])=>({value:r,label:e,category:"Regions"})),...Object.entries(o.$meta?.subregions||{}).map(([e,r])=>({value:r,label:e,category:"Subregions"})),...o.options?.map(e=>({...e,value:e.value,label:e.label,category:"Countries"}))||[]];return C(p,{"data-field":t.name,className:`RemoteFlows__CountryField__Item__${t.name}`,children:[n(l,{className:"RemoteFlows__CountryField__Label",children:o.label}),n(i,{children:n(F,{options:y,selected:g,onChange:_})}),o.description&&C(a,{children:[o.description," ",n(u,{helpCenter:o.meta?.helpCenter})]}),b.error&&n(c,{})]})}m(L,"CountryFieldDefault");export{L as a};
2
- //# sourceMappingURL=chunk-TSZLYFYT.js.map
1
+ import{a as F}from"./chunk-DJIQISA2.js";import{a as u}from"./chunk-LLHJODMO.js";import{j as p,k as l,l as i,n as a,o as c}from"./chunk-Y3CJRZLA.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as $,useState as v}from"react";import{jsx as n,jsxs as C}from"react/jsx-runtime";function L({field:t,fieldState:b,fieldData:o}){let[g,s]=v([]),_=m(e=>{let r=e.map(({value:S})=>S);t.onChange(r),s(e)},"handleChange");$(()=>{t.value&&o.options&&s(t.value.map(e=>o?.options?.find(r=>r.value===e)))},[t.value,o.options]);let y=[...Object.entries(o.$meta?.regions||{}).map(([e,r])=>({value:r,label:e,category:"Regions"})),...Object.entries(o.$meta?.subregions||{}).map(([e,r])=>({value:r,label:e,category:"Subregions"})),...o.options?.map(e=>({...e,value:e.value,label:e.label,category:"Countries"}))||[]];return C(p,{"data-field":t.name,className:`RemoteFlows__CountryField__Item__${t.name}`,children:[n(l,{className:"RemoteFlows__CountryField__Label",children:o.label}),n(i,{children:n(F,{options:y,selected:g,onChange:_})}),o.description&&C(a,{children:[o.description," ",n(u,{helpCenter:o.meta?.helpCenter})]}),b.error&&n(c,{})]})}m(L,"CountryFieldDefault");export{L as a};
2
+ //# sourceMappingURL=chunk-UOYIAURS.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-KFYWUBRS.js";import{a as F}from"./chunk-KUKZNLCF.js";import{f as l,h as f}from"./chunk-Y3CJRZLA.js";import{h as u}from"./chunk-G2LZFGZA.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a}from"./chunk-P37U34EQ.js";import{useEffect as w}from"react";import{jsx as r}from"react/jsx-runtime";var R=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:s,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:m,onSubmit:y,stepState:S,initialValues:i,handleValidation:V}}=_(),g=p(V),e=l({resolver:g,defaultValues:S.values?.form||i,shouldUnregister:!0,mode:"onBlur"});w(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=a(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!R.includes(c)&&i[c]!==P){o=!0;break}if(!o)return s?.({message:"no_changes_detected_contract_details"});let d=await u(t,m,{isPartialValidation:!1});await b?.(d);let n=await y(t);n.error?s?.(n.error):await A?.(n.data)},"handleSubmit");return r(f,{...e,children:r("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:r(F,{fields:m})})})}a(x,"ContractAmendmentForm");export{x as a};
2
- //# sourceMappingURL=chunk-QFXZTQL7.js.map
1
+ import{b as p}from"./chunk-KFYWUBRS.js";import{a as F}from"./chunk-W5MWHAAI.js";import{f as l,h as f}from"./chunk-Y3CJRZLA.js";import{h as u}from"./chunk-G2LZFGZA.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a}from"./chunk-P37U34EQ.js";import{useEffect as w}from"react";import{jsx as r}from"react/jsx-runtime";var R=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:s,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:m,onSubmit:y,stepState:S,initialValues:i,handleValidation:V}}=_(),g=p(V),e=l({resolver:g,defaultValues:S.values?.form||i,shouldUnregister:!0,mode:"onBlur"});w(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=a(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!R.includes(c)&&i[c]!==P){o=!0;break}if(!o)return s?.({message:"no_changes_detected_contract_details"});let d=await u(t,m,{isPartialValidation:!1});await b?.(d);let n=await y(t);n.error?s?.(n.error):await A?.(n.data)},"handleSubmit");return r(f,{...e,children:r("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:r(F,{fields:m})})})}a(x,"ContractAmendmentForm");export{x as a};
2
+ //# sourceMappingURL=chunk-UW3TUDJR.js.map
@@ -1,2 +1,2 @@
1
- import{a as Z}from"./chunk-VEMUIRKC.js";import{a as I}from"./chunk-VFRHMNLJ.js";import{a as Q,b as W,c as X,f as Y}from"./chunk-VTWVHO4F.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as G}from"./chunk-KFYWUBRS.js";import{c as ee}from"./chunk-6HAWSFOM.js";import{a as z}from"./chunk-LKVQ32ZK.js";import{b as K,h as M}from"./chunk-G2LZFGZA.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Be,object as se}from"yup";import{useCallback as je,useEffect as te,useMemo as we,useRef as Re,useState as j}from"react";import{string as ne,ValidationError as re}from"yup";import{jsx as ie}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},Pe=o(t=>z(I.data.schema,void 0,t),"useStaticSchema");function xe(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(xe,"getSalaryTitle");var ze=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let u=Re({fields:{}}),[k,h]=j(t),[w,R]=j(),[m,q]=j(),[H,le]=j(),{data:_,isLoading:ue}=Q({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=W(),me=k||w?.value,{data:P,isLoading:de}=Y(me,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=X(),{mutateAsync:fe}=K(U),b=w?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=je(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,ge=we(()=>{let{from:e,to:r,shouldSwapOrder:c}=L(),g=xe(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>ie(Z,{...y,shouldSwapOrder:c,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>ie(ee,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=Pe({jsfModify:{fields:{...n?.jsfModify?.fields,...ge?.fields}}});te(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&R(e)}},[t,_]),te(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ye(e){return fe(oe(e,s,a))}o(ye,"onSubmit");function pe(e){let r=_?.find(({value:c})=>c===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?h(r.regionSlug):h(void 0),R(r)}o(pe,"onCountryChange");function Ce(e){h(e)}o(Ce,"onRegionChange");function _e(e){le(e.target.value)}o(_e,"onHiringBudgetChange");function be(e){let r=d?.find(c=>c.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(be,"onChangeCurrency");let E=f.fields.find(e=>e.name==="region");if(E){let e=w?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];E.options=e,E.isVisible=e.length>0,E.required=e.length>0,E.onChange=Ce,E.schema=e.length>0?ne().transform(r=>typeof r=="string"?r:"").required("Region is required"):ne()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=be)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=_e),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=pe)}let Ee=o(()=>{R(void 0),h(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...P?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ae(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let c=await M(e,D);try{await N.validate(c,{abortEarly:!1}),r={formErrors:{},yupError:new re([],e)}}catch(S){let B=G(S);r={formErrors:Object.entries(B).reduce((T,[A,V])=>({...T,[A]:V.message}),{}),yupError:S}}let g=P?.handleValidation(c),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new re(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(async e=>{let{country:r,region:c,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:S,management:B,estimation_title:T,...A}=e,V=e.salary;y==="salary_conversion"&&(V=S);let he=await M({country:r,region:c,salary:V,salary_converted:y,salary_conversion:S,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Fe=await M(A,P?.fields||[]),Ve={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Fe,...Ve}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:ue&&ce&&de,onSubmit:ye,resetForm:Ee,currencies:d,meta:{fields:u.current?.fields}}},"useCostCalculator");function ae(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(u=>u===a.name,"is"),then:o(u=>u.required("Required field"),"then"),otherwise:o(u=>u.optional(),"otherwise")}):a.name==="management"?n[a.name]=se({management_fee:Be().transform(u=>isNaN(u)?void 0:u).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return se(s)}o(ae,"buildValidationSchema");function Te(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let u={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,u]},[])}o(Te,"formatBenefits");function Ae(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Te(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...Oe(t,l)}}o(Ae,"mapValueToEmployment");function Oe(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(Oe,"getSalaryFields");function oe(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Ae(n,i,l))}}o(oe,"buildPayload");export{ae as a,oe as b,O as c,ze as d};
2
- //# sourceMappingURL=chunk-UHN3ELBL.js.map
1
+ import{a as Z}from"./chunk-TOOCSXXQ.js";import{a as I}from"./chunk-VFRHMNLJ.js";import{a as Q,b as W,c as X,f as Y}from"./chunk-VTWVHO4F.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as G}from"./chunk-KFYWUBRS.js";import{c as ee}from"./chunk-3YTML5RG.js";import{a as z}from"./chunk-LKVQ32ZK.js";import{b as K,h as M}from"./chunk-G2LZFGZA.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Be,object as se}from"yup";import{useCallback as je,useEffect as te,useMemo as we,useRef as Re,useState as j}from"react";import{string as ne,ValidationError as re}from"yup";import{jsx as ie}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},Pe=o(t=>z(I.data.schema,void 0,t),"useStaticSchema");function xe(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(xe,"getSalaryTitle");var ze=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let u=Re({fields:{}}),[k,h]=j(t),[w,R]=j(),[m,q]=j(),[H,le]=j(),{data:_,isLoading:ue}=Q({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=W(),me=k||w?.value,{data:P,isLoading:de}=Y(me,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=X(),{mutateAsync:fe}=K(U),b=w?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=je(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,ge=we(()=>{let{from:e,to:r,shouldSwapOrder:c}=L(),g=xe(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>ie(Z,{...y,shouldSwapOrder:c,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>ie(ee,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=Pe({jsfModify:{fields:{...n?.jsfModify?.fields,...ge?.fields}}});te(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&R(e)}},[t,_]),te(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ye(e){return fe(oe(e,s,a))}o(ye,"onSubmit");function pe(e){let r=_?.find(({value:c})=>c===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?h(r.regionSlug):h(void 0),R(r)}o(pe,"onCountryChange");function Ce(e){h(e)}o(Ce,"onRegionChange");function _e(e){le(e.target.value)}o(_e,"onHiringBudgetChange");function be(e){let r=d?.find(c=>c.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(be,"onChangeCurrency");let E=f.fields.find(e=>e.name==="region");if(E){let e=w?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];E.options=e,E.isVisible=e.length>0,E.required=e.length>0,E.onChange=Ce,E.schema=e.length>0?ne().transform(r=>typeof r=="string"?r:"").required("Region is required"):ne()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=be)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=_e),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=pe)}let Ee=o(()=>{R(void 0),h(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...P?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ae(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let c=await M(e,D);try{await N.validate(c,{abortEarly:!1}),r={formErrors:{},yupError:new re([],e)}}catch(S){let B=G(S);r={formErrors:Object.entries(B).reduce((T,[A,V])=>({...T,[A]:V.message}),{}),yupError:S}}let g=P?.handleValidation(c),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new re(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(async e=>{let{country:r,region:c,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:S,management:B,estimation_title:T,...A}=e,V=e.salary;y==="salary_conversion"&&(V=S);let he=await M({country:r,region:c,salary:V,salary_converted:y,salary_conversion:S,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Fe=await M(A,P?.fields||[]),Ve={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Fe,...Ve}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:ue&&ce&&de,onSubmit:ye,resetForm:Ee,currencies:d,meta:{fields:u.current?.fields}}},"useCostCalculator");function ae(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(u=>u===a.name,"is"),then:o(u=>u.required("Required field"),"then"),otherwise:o(u=>u.optional(),"otherwise")}):a.name==="management"?n[a.name]=se({management_fee:Be().transform(u=>isNaN(u)?void 0:u).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return se(s)}o(ae,"buildValidationSchema");function Te(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let u={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,u]},[])}o(Te,"formatBenefits");function Ae(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Te(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...Oe(t,l)}}o(Ae,"mapValueToEmployment");function Oe(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(Oe,"getSalaryFields");function oe(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Ae(n,i,l))}}o(oe,"buildPayload");export{ae as a,oe as b,O as c,ze as d};
2
+ //# sourceMappingURL=chunk-V5EBEJON.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-CFOXBJRN.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{x as n}from"./chunk-G2LZFGZA.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async(i,f)=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information,f);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return u(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
2
- //# sourceMappingURL=chunk-2A25NRQT.js.map
1
+ import{a as s}from"./chunk-Y34DKDJI.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{x as n}from"./chunk-G2LZFGZA.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async(i,f)=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information,f);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return u(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
2
+ //# sourceMappingURL=chunk-V62JQXIC.js.map
@@ -1,2 +1,2 @@
1
- import{a as Q}from"./chunk-4MB3FE3T.js";import{a as J}from"./chunk-25PGBGEV.js";import{a as H}from"./chunk-XGECMN4V.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as W}from"./chunk-PQG6KZIO.js";import{a as Y}from"./chunk-OBZMQWQA.js";import{a as q,b as B,c as L,d as z}from"./chunk-WLPWXK7I.js";import{f as Z,g as K}from"./chunk-BRI2ESJ3.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-6PWZ4TBI.js";import{a as N}from"./chunk-PJ6KPGIE.js";import{a as E}from"./chunk-LKVQ32ZK.js";import{a as _,b as v}from"./chunk-LOPZZUAF.js";import{s as O}from"./chunk-GZUP2IE6.js";import{b as w,h as u,n as D}from"./chunk-G2LZFGZA.js";import{a as A}from"./chunk-JDIKYCN6.js";import{a as I}from"./chunk-626FTNKA.js";import{e as $}from"./chunk-H2O4CVKF.js";import{a as o}from"./chunk-P37U34EQ.js";import xe from"lodash.omitby";import je from"lodash.isnull";import{format as x,isFuture as Ve,parseISO as j,subDays as Pe}from"date-fns";import{useMemo as V}from"react";import be from"lodash.omit";import{useQuery as Fe}from"@tanstack/react-query";var G=o(({query:t,options:e})=>{let{client:y}=$();return Fe({queryKey:["payroll-calendars"],queryFn:o(()=>O({client:y,query:{year:t?.year,country_code:t?.countryCode}}),"queryFn"),enabled:e?.enabled,select:o(c=>c.data?.data?.payroll_calendars?.[0],"select")})},"usePayrollCalendars");import{isFuture as Me,isToday as ge,parseISO as Se}from"date-fns";var X=o(t=>{if(!t)return!1;let e=Se(t);return Me(e)||ge(e)},"isInProbationPeriod");import{Fragment as ke,jsx as m,jsxs as Ce}from"react/jsx-runtime";var lo=o(({employmentId:t,options:e,initialValues:y})=>{let{fieldValues:c,setFieldValues:ee,stepState:l,previousStep:oe,nextStep:ie}=A(q),{data:n,isLoading:te}=N({employmentId:t,queryParams:{exclude_files:!0}}),{data:ne}=G({query:{year:new Date().getFullYear().toString(),countryCode:n?.country?.code},options:{enabled:!!n?.country?.code}}),T=X(n?.probation_period_end_date),F=B(ne),P=V(()=>T?x(new Date,"yyyy-MM-dd"):x(F,"yyyy-MM-dd"),[T,F]),M=!!(n?.provisional_start_date&&Ve(j(n.provisional_start_date))),ae={personal_email:n?.basic_information?.email},g=z({...ae,...y,...l.values?.employee_communication,...l.values?.termination_details,...l.values?.paid_time_off,...l.values?.additional_information},M),d=V(()=>({...g,...c}),[c,g]),b=L({minTerminationDate:F,isEmployeeInProbationPeriod:T,selectedDate:j(d.proposed_termination_date)}),re=V(()=>{let s=R.data.schema.properties.termination_reason.oneOf,a=M?s.filter(i=>i.const==="cancellation_before_start_date"):s.filter(i=>i.const!=="cancellation_before_start_date");return{fields:{risk_assesment_info:S("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),termination_reason:{...e?.jsfModify?.fields?.termination_reason,oneOf:a},proposed_termination_date_info:S("Proposed termination date",Ce(ke,{children:["In most cases, Remote must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",m(v,{external:!0,zendeskId:_.terminationNoticePeriods,className:D("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:P,...d.termination_reason==="cancellation_before_start_date"&&n?.provisional_start_date?{maxDate:x(Pe(j(n.provisional_start_date),1),"yyyy-MM-dd")}:{},...b},...d.termination_reason==="cancellation_before_start_date"?{"x-jsf-errorMessage":{maximum:"The proposed termination date must be before the employee's start date."}}:{}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return m(J,{employeeName:n?.basic_information?.name,proposedTerminationDate:d.proposed_termination_date,employmentId:t,employment:n,render:r=>i?m(i,{...r}):m(Q,{...r})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return m(U,{render:r=>i?m(i,{...r}):m(W,{...r})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:o(()=>{let i={involuntaryOffboardingServiceChargeZendeskId:_.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:_.reconciliationInvoice},r=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return r?m(r,{...i}):m(Y,{...i})},"Component")}}}}},[n,t,d.proposed_termination_date,d.termination_reason,M,P,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.termination_reason,b]),{data:f,isLoading:se}=K({formValues:d,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...re?.fields}},step:l.currentStep.name}),me=E(H.data.schema),k=Z(),{mutateAsync:de}=w(k);async function fe(s){if(!t)throw new Error("Employment id is missing");if(f){let a=await C(s,!0),{customer_informed_employee:i}=a,r=i==="yes"?{employee_awareness:{date:a.customer_informed_employee_date,note:a.customer_informed_employee_description}}:void 0,ue=await I(a,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),_e=be(ue,"customer_informed_employee_date","customer_informed_employee_description"),ye=xe({..._e,...r},je),p=a.timesheet_file??[],h=Array.isArray(p)&&p.length>0?{content:p[0].content,name:p[0].name}:void 0,Te={employment_id:t,termination_details:{...ye,timesheet_file:h||void 0},type:"termination"};return de(Te)}}o(fe,"onSubmit");function le(){oe()}o(le,"back");function ce(){ie()}o(ce,"next");let pe=Object.keys(c).length>0,C=o(async(s,a=!1)=>a?await u(s,me.fields,{isPartialValidation:!0}):f?await u(s,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");return{employmentId:t,employment:n,fieldValues:d,isDirty:pe,stepState:l,fields:f?.fields||[],isLoading:se||te,isSubmitting:k.isPending,initialValues:g,handleValidation:o(async s=>{if(f){let a=await u(s,f?.fields);return f?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:ee,parseFormValues:C,onSubmit:fe,back:le,next:ce}},"useTermination");export{lo as a};
2
- //# sourceMappingURL=chunk-TMBDUFOH.js.map
1
+ import{a as Q}from"./chunk-4MB3FE3T.js";import{a as J}from"./chunk-ELM6CPRT.js";import{a as H}from"./chunk-NEKE5PRJ.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as W}from"./chunk-PQG6KZIO.js";import{a as Y}from"./chunk-QI4MWDJS.js";import{a as q,b as B,c as L,d as z}from"./chunk-WLPWXK7I.js";import{f as Z,g as K}from"./chunk-7FCKRGGD.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-6PWZ4TBI.js";import{a as N}from"./chunk-PJ6KPGIE.js";import{a as E}from"./chunk-LKVQ32ZK.js";import{a as _,c as v}from"./chunk-2Q462FT7.js";import{s as O}from"./chunk-GZUP2IE6.js";import{b as w,h as u,n as D}from"./chunk-G2LZFGZA.js";import{a as A}from"./chunk-JDIKYCN6.js";import{a as I}from"./chunk-626FTNKA.js";import{e as $}from"./chunk-H2O4CVKF.js";import{a as o}from"./chunk-P37U34EQ.js";import xe from"lodash.omitby";import je from"lodash.isnull";import{format as x,isFuture as Ve,parseISO as j,subDays as Pe}from"date-fns";import{useMemo as V}from"react";import be from"lodash.omit";import{useQuery as Fe}from"@tanstack/react-query";var G=o(({query:t,options:e})=>{let{client:y}=$();return Fe({queryKey:["payroll-calendars"],queryFn:o(()=>O({client:y,query:{year:t?.year,country_code:t?.countryCode}}),"queryFn"),enabled:e?.enabled,select:o(c=>c.data?.data?.payroll_calendars?.[0],"select")})},"usePayrollCalendars");import{isFuture as Me,isToday as ge,parseISO as Se}from"date-fns";var X=o(t=>{if(!t)return!1;let e=Se(t);return Me(e)||ge(e)},"isInProbationPeriod");import{Fragment as ke,jsx as m,jsxs as Ce}from"react/jsx-runtime";var lo=o(({employmentId:t,options:e,initialValues:y})=>{let{fieldValues:c,setFieldValues:ee,stepState:l,previousStep:oe,nextStep:ie}=A(q),{data:n,isLoading:te}=N({employmentId:t,queryParams:{exclude_files:!0}}),{data:ne}=G({query:{year:new Date().getFullYear().toString(),countryCode:n?.country?.code},options:{enabled:!!n?.country?.code}}),T=X(n?.probation_period_end_date),F=B(ne),P=V(()=>T?x(new Date,"yyyy-MM-dd"):x(F,"yyyy-MM-dd"),[T,F]),M=!!(n?.provisional_start_date&&Ve(j(n.provisional_start_date))),ae={personal_email:n?.basic_information?.email},g=z({...ae,...y,...l.values?.employee_communication,...l.values?.termination_details,...l.values?.paid_time_off,...l.values?.additional_information},M),d=V(()=>({...g,...c}),[c,g]),b=L({minTerminationDate:F,isEmployeeInProbationPeriod:T,selectedDate:j(d.proposed_termination_date)}),re=V(()=>{let s=R.data.schema.properties.termination_reason.oneOf,a=M?s.filter(i=>i.const==="cancellation_before_start_date"):s.filter(i=>i.const!=="cancellation_before_start_date");return{fields:{risk_assesment_info:S("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),termination_reason:{...e?.jsfModify?.fields?.termination_reason,oneOf:a},proposed_termination_date_info:S("Proposed termination date",Ce(ke,{children:["In most cases, Remote must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",m(v,{external:!0,zendeskId:_.terminationNoticePeriods,className:D("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:P,...d.termination_reason==="cancellation_before_start_date"&&n?.provisional_start_date?{maxDate:x(Pe(j(n.provisional_start_date),1),"yyyy-MM-dd")}:{},...b},...d.termination_reason==="cancellation_before_start_date"?{"x-jsf-errorMessage":{maximum:"The proposed termination date must be before the employee's start date."}}:{}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return m(J,{employeeName:n?.basic_information?.name,proposedTerminationDate:d.proposed_termination_date,employmentId:t,employment:n,render:r=>i?m(i,{...r}):m(Q,{...r})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return m(U,{render:r=>i?m(i,{...r}):m(W,{...r})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:o(()=>{let i={involuntaryOffboardingServiceChargeZendeskId:_.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:_.reconciliationInvoice},r=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return r?m(r,{...i}):m(Y,{...i})},"Component")}}}}},[n,t,d.proposed_termination_date,d.termination_reason,M,P,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.termination_reason,b]),{data:f,isLoading:se}=K({formValues:d,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...re?.fields}},step:l.currentStep.name}),me=E(H.data.schema),k=Z(),{mutateAsync:de}=w(k);async function fe(s){if(!t)throw new Error("Employment id is missing");if(f){let a=await C(s,!0),{customer_informed_employee:i}=a,r=i==="yes"?{employee_awareness:{date:a.customer_informed_employee_date,note:a.customer_informed_employee_description}}:void 0,ue=await I(a,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),_e=be(ue,"customer_informed_employee_date","customer_informed_employee_description"),ye=xe({..._e,...r},je),p=a.timesheet_file??[],h=Array.isArray(p)&&p.length>0?{content:p[0].content,name:p[0].name}:void 0,Te={employment_id:t,termination_details:{...ye,timesheet_file:h||void 0},type:"termination"};return de(Te)}}o(fe,"onSubmit");function le(){oe()}o(le,"back");function ce(){ie()}o(ce,"next");let pe=Object.keys(c).length>0,C=o(async(s,a=!1)=>a?await u(s,me.fields,{isPartialValidation:!0}):f?await u(s,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");return{employmentId:t,employment:n,fieldValues:d,isDirty:pe,stepState:l,fields:f?.fields||[],isLoading:se||te,isSubmitting:k.isPending,initialValues:g,handleValidation:o(async s=>{if(f){let a=await u(s,f?.fields);return f?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:ee,parseFormValues:C,onSubmit:fe,back:le,next:ce}},"useTermination");export{lo as a};
2
+ //# sourceMappingURL=chunk-VNHXMVTF.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-A2WWDGJJ.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:t,onSuccess:s,onError:m}){let{terminationBag:o}=e(),d=r(async a=>{let l=await o?.parseFormValues(a,!0);await t?.(l);let i=await o?.onSubmit(a);i?.error?m?.(i.rawError):i?.data&&await s?.(i.data)},"handleSubmit");return u(n,{defaultValues:o.fieldValues,fields:o?.fields,onSubmit:d})}r(F,"AdditionalDetailsForm");export{F as a};
2
- //# sourceMappingURL=chunk-L2V4ZYCZ.js.map
1
+ import{a as n}from"./chunk-KN2Q5NOL.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:t,onSuccess:s,onError:m}){let{terminationBag:o}=e(),d=r(async a=>{let l=await o?.parseFormValues(a,!0);await t?.(l);let i=await o?.onSubmit(a);i?.error?m?.(i.rawError):i?.data&&await s?.(i.data)},"handleSubmit");return u(n,{defaultValues:o.fieldValues,fields:o?.fields,onSubmit:d})}r(F,"AdditionalDetailsForm");export{F as a};
2
+ //# sourceMappingURL=chunk-VYZOGC65.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-BRN6MO77.js";import{b as s}from"./chunk-PGWKJ6FK.js";import{c as n}from"./chunk-G2LZFGZA.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function S({onSubmit:d,onError:a,onSuccess:m}){let{onboardingBag:r}=s(),c=t(async i=>{try{let e=await r.parseFormValues(i);await d?.(e);let o=await r.onSubmit(i);if(o?.data){await m?.(o.data),r?.next();return}if(o?.error){let p=n(o?.fieldErrors||[],r.meta?.fields?.contract_details);a?.({error:o.error,rawError:o.rawError,fieldErrors:p})}}catch(e){a?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit");return E(l,{defaultValues:r.stepState.values?.contract_details||r.initialValues.contract_details,onSubmit:c})}t(S,"ContractDetailsStep");export{S as a};
2
- //# sourceMappingURL=chunk-DJGO6WYW.js.map
1
+ import{a as l}from"./chunk-AC4MDLIM.js";import{b as s}from"./chunk-PGWKJ6FK.js";import{c as n}from"./chunk-G2LZFGZA.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function S({onSubmit:d,onError:a,onSuccess:m}){let{onboardingBag:r}=s(),c=t(async i=>{try{let e=await r.parseFormValues(i);await d?.(e);let o=await r.onSubmit(i);if(o?.data){await m?.(o.data),r?.next();return}if(o?.error){let p=n(o?.fieldErrors||[],r.meta?.fields?.contract_details);a?.({error:o.error,rawError:o.rawError,fieldErrors:p})}}catch(e){a?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit");return E(l,{defaultValues:r.stepState.values?.contract_details||r.initialValues.contract_details,onSubmit:c})}t(S,"ContractDetailsStep");export{S as a};
2
+ //# sourceMappingURL=chunk-W2WHWA5J.js.map
@@ -1,2 +1,2 @@
1
- import{a as P,b as W,c as u}from"./chunk-6HAWSFOM.js";import{a as l}from"./chunk-OXTA4W4J.js";import{c as y}from"./chunk-Y3CJRZLA.js";import{j as h,m as x}from"./chunk-G2LZFGZA.js";import{a as c}from"./chunk-P37U34EQ.js";import{Fragment as $}from"react";import a from"lodash.omit";var C={...P,fieldset:u,"fieldset-flat":u};import{Fragment as S,jsx as n,jsxs as g}from"react/jsx-runtime";var B=c(({fields:p,fieldsets:d,fieldValues:i,components:m})=>{let{setValue:T,watch:M}=y();if(!p||p.length===0)return null;let J=d&&i?h({fields:p,fieldsets:d,values:i}):p,r=c((e,F,o)=>F.WrapperComponent?n(F.WrapperComponent,{children:e},o):n($,{children:e},o),"wrapWithCustomWrapper");return n(S,{children:J.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(i,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(x(e)){let t=a(e,"WrapperComponent");return r(n(W,{name:t.name,description:t.description,value:t.const,statement:t.statement,label:t.label,helpCenter:t.meta?.helpCenter}),e,e.name)}if(e.Component){let{Component:t}=e,R=a(e,["Component","WrapperComponent"]);return r(g(S,{children:[n(t,{...R,value:M(e.name),setValue:V=>T(e.name,V)}),e.statement?n(l,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)}let o=e.type,s=C[o];if(!s)return g("p",{className:"error",children:["Field type ",o," not supported"]});if(o==="fieldset"){let t=a(e,"WrapperComponent");return r(n(s,{...t,components:m}),e,e.name)}if(o==="fieldset-flat"){let t=a(e,"WrapperComponent");return r(n(s,{...t,components:m,isFlatFieldset:!0}),e,e.name)}o==="select"&&e.multiple&&(s=C["multi-select"]);let k=a(e,"WrapperComponent");return r(g(S,{children:[n(s,{...k,component:m&&m[o]}),e.statement?n(l,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)})})},"JSONSchemaFormFields");export{B as a};
2
- //# sourceMappingURL=chunk-KUKZNLCF.js.map
1
+ import{a as P,b as W,c as u}from"./chunk-3YTML5RG.js";import{a as l}from"./chunk-OXTA4W4J.js";import{c as y}from"./chunk-Y3CJRZLA.js";import{j as h,m as x}from"./chunk-G2LZFGZA.js";import{a as c}from"./chunk-P37U34EQ.js";import{Fragment as $}from"react";import a from"lodash.omit";var C={...P,fieldset:u,"fieldset-flat":u};import{Fragment as S,jsx as n,jsxs as g}from"react/jsx-runtime";var B=c(({fields:p,fieldsets:d,fieldValues:i,components:m})=>{let{setValue:T,watch:M}=y();if(!p||p.length===0)return null;let J=d&&i?h({fields:p,fieldsets:d,values:i}):p,r=c((e,F,o)=>F.WrapperComponent?n(F.WrapperComponent,{children:e},o):n($,{children:e},o),"wrapWithCustomWrapper");return n(S,{children:J.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(i,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(x(e)){let t=a(e,"WrapperComponent");return r(n(W,{name:t.name,description:t.description,value:t.const,statement:t.statement,label:t.label,helpCenter:t.meta?.helpCenter}),e,e.name)}if(e.Component){let{Component:t}=e,R=a(e,["Component","WrapperComponent"]);return r(g(S,{children:[n(t,{...R,value:M(e.name),setValue:V=>T(e.name,V)}),e.statement?n(l,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)}let o=e.type,s=C[o];if(!s)return g("p",{className:"error",children:["Field type ",o," not supported"]});if(o==="fieldset"){let t=a(e,"WrapperComponent");return r(n(s,{...t,components:m}),e,e.name)}if(o==="fieldset-flat"){let t=a(e,"WrapperComponent");return r(n(s,{...t,components:m,isFlatFieldset:!0}),e,e.name)}o==="select"&&e.multiple&&(s=C["multi-select"]);let k=a(e,"WrapperComponent");return r(g(S,{children:[n(s,{...k,component:m&&m[o]}),e.statement?n(l,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)})})},"JSONSchemaFormFields");export{B as a};
2
+ //# sourceMappingURL=chunk-W5MWHAAI.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-CFOXBJRN.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{x as a}from"./chunk-G2LZFGZA.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as g}from"react/jsx-runtime";function E({components:m,onSubmit:p,onSuccess:l,onError:c}){let{contractorOnboardingBag:r}=e(),d=i(async(t,P)=>{try{let n=await r.parseFormValues(t);await p?.(n);let o=await r.onSubmit(t);if(o?.data){await l?.(o?.data),r?.next();return}}catch(n){let o=a(n,r.meta?.fields?.pricing_plan,P);c?.(o)}},"handleSubmit"),u=r.stepState.values?.pricing_plan||r.initialValues.pricing_plan;return g(s,{components:m,defaultValues:u,onSubmit:d})}i(E,"PricingPlanStep");export{E as a};
2
- //# sourceMappingURL=chunk-LTJSD2MC.js.map
1
+ import{a as s}from"./chunk-Y34DKDJI.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{x as a}from"./chunk-G2LZFGZA.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as g}from"react/jsx-runtime";function E({components:m,onSubmit:p,onSuccess:l,onError:c}){let{contractorOnboardingBag:r}=e(),d=i(async(t,P)=>{try{let n=await r.parseFormValues(t);await p?.(n);let o=await r.onSubmit(t);if(o?.data){await l?.(o?.data),r?.next();return}}catch(n){let o=a(n,r.meta?.fields?.pricing_plan,P);c?.(o)}},"handleSubmit"),u=r.stepState.values?.pricing_plan||r.initialValues.pricing_plan;return g(s,{components:m,defaultValues:u,onSubmit:d})}i(E,"PricingPlanStep");export{E as a};
2
+ //# sourceMappingURL=chunk-W7MCRAQ4.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-A2WWDGJJ.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({onSubmit:t}){let{terminationBag:o}=a(),n=i(async r=>{let m=await o?.parseFormValues(r);await t?.(m),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:n})}i(p,"TerminationDetailsForm");export{p as a};
2
- //# sourceMappingURL=chunk-XEVHWVBT.js.map
1
+ import{a as e}from"./chunk-KN2Q5NOL.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({onSubmit:t}){let{terminationBag:o}=a(),n=i(async r=>{let m=await o?.parseFormValues(r);await t?.(m),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:n})}i(p,"TerminationDetailsForm");export{p as a};
2
+ //# sourceMappingURL=chunk-XNDOPTDJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-J2ARI3NQ.js";import{b as c}from"./chunk-Q3ALCPJN.js";import{a as l}from"./chunk-KUKZNLCF.js";import{h as m}from"./chunk-Y3CJRZLA.js";import{c as s}from"./chunk-G2LZFGZA.js";import{a}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as F}from"react/jsx-runtime";import{createElement as V}from"react";function B({defaultValues:p,onSubmit:u,components:S}){let{formId:y,contractorOnboardingBag:o,formRef:t}=c(),r=d({handleValidation:o.handleValidation,defaultValues:p,checkFieldUpdates:o.checkFieldUpdates});f(()=>{t?.setValue&&(t.setValue.current=r.setValue)},[r.setValue,t]),f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]);let g=a(async(n,b)=>{let i=b?.nativeEvent;if(i?.isDraftSubmission){let{onSuccess:P,onError:E}=i.draftCallbacks;try{await o.onSubmit(n),P?.()}catch(e){let C=o.stepState.currentStep.name,h=o.meta?.fields?.[C],O=s(e?.fieldErrors||[],h);E?.({error:e?.error||e,rawError:e?.rawError||e,fieldErrors:O})}}else await u(n,r)},"handleSubmit");return V(m,{...r,key:`form-${o.stepState.currentStep.name}`},F("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:F(l,{components:S,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}a(B,"ContractorOnboardingForm");export{B as a};
2
- //# sourceMappingURL=chunk-CFOXBJRN.js.map
1
+ import{a as d}from"./chunk-J2ARI3NQ.js";import{b as c}from"./chunk-Q3ALCPJN.js";import{a as l}from"./chunk-W5MWHAAI.js";import{h as m}from"./chunk-Y3CJRZLA.js";import{c as s}from"./chunk-G2LZFGZA.js";import{a}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as F}from"react/jsx-runtime";import{createElement as V}from"react";function B({defaultValues:p,onSubmit:u,components:S}){let{formId:y,contractorOnboardingBag:o,formRef:t}=c(),r=d({handleValidation:o.handleValidation,defaultValues:p,checkFieldUpdates:o.checkFieldUpdates});f(()=>{t?.setValue&&(t.setValue.current=r.setValue)},[r.setValue,t]),f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]);let g=a(async(n,b)=>{let i=b?.nativeEvent;if(i?.isDraftSubmission){let{onSuccess:P,onError:E}=i.draftCallbacks;try{await o.onSubmit(n),P?.()}catch(e){let C=o.stepState.currentStep.name,h=o.meta?.fields?.[C],O=s(e?.fieldErrors||[],h);E?.({error:e?.error||e,rawError:e?.rawError||e,fieldErrors:O})}}else await u(n,r)},"handleSubmit");return V(m,{...r,key:`form-${o.stepState.currentStep.name}`},F("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:F(l,{components:S,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}a(B,"ContractorOnboardingForm");export{B as a};
2
+ //# sourceMappingURL=chunk-Y34DKDJI.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-KUKZNLCF.js";import{h as C}from"./chunk-Y3CJRZLA.js";import{c as f,u as E}from"./chunk-G2LZFGZA.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as n}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:u,shouldResetForm:c,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=p(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&c){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,c,o,a]);let b=m(async d=>{try{let t=await o?.parseFormValues(d);o?.meta?.fields&&(o.meta.fields=E(t,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let i={data:{...r.data.data,employments:r.data.data.employments?.map(l=>({...l,title:t.estimation_title}))}};await y?.(i)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,i=r.fieldErrors;if(u){let l=o?.meta?.fields,h=f(i,l);u({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return n(C,{...e,children:n("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:n(F,{fields:o?.fields??[]})})})}m(T,"CostCalculatorForm");export{T as a};
2
- //# sourceMappingURL=chunk-3CLZOKEI.js.map
1
+ import{b as p}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-W5MWHAAI.js";import{h as C}from"./chunk-Y3CJRZLA.js";import{c as f,u as E}from"./chunk-G2LZFGZA.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as n}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:u,shouldResetForm:c,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=p(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&c){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,c,o,a]);let b=m(async d=>{try{let t=await o?.parseFormValues(d);o?.meta?.fields&&(o.meta.fields=E(t,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let i={data:{...r.data.data,employments:r.data.data.employments?.map(l=>({...l,title:t.estimation_title}))}};await y?.(i)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,i=r.fieldErrors;if(u){let l=o?.meta?.fields,h=f(i,l);u({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return n(C,{...e,children:n("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:n(F,{fields:o?.fields??[]})})})}m(T,"CostCalculatorForm");export{T as a};
2
+ //# sourceMappingURL=chunk-YD54NZIX.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-A2WWDGJJ.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function d({onSubmit:m}){let{terminationBag:o}=a(),r=i(async t=>{let n=await o?.parseFormValues(t);await m?.(n),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:r})}i(d,"PaidTimeOffForm");export{d as a};
2
- //# sourceMappingURL=chunk-5XVYIBJD.js.map
1
+ import{a as e}from"./chunk-KN2Q5NOL.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function d({onSubmit:m}){let{terminationBag:o}=a(),r=i(async t=>{let n=await o?.parseFormValues(t);await m?.(n),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:r})}i(d,"PaidTimeOffForm");export{d as a};
2
+ //# sourceMappingURL=chunk-YQOONCKH.js.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-BRN6MO77.js";import{b as o}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as r}from"react/jsx-runtime";function u(){let{onboardingBag:e}=o();return r(t,{defaultValues:{},onSubmit:n(async()=>{e?.next()},"handleSubmit")})}n(u,"PreviewEmploymentAgreementStep");export{u as a};
2
- //# sourceMappingURL=chunk-PPRAWJMR.js.map
1
+ import{a as t}from"./chunk-AC4MDLIM.js";import{b as o}from"./chunk-PGWKJ6FK.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as r}from"react/jsx-runtime";function u(){let{onboardingBag:e}=o();return r(t,{defaultValues:{},onSubmit:n(async()=>{e?.next()},"handleSubmit")})}n(u,"PreviewEmploymentAgreementStep");export{u as a};
2
+ //# sourceMappingURL=chunk-YWJS3RL5.js.map
@@ -1,2 +1,2 @@
1
- import{a as R,b as x,c as N,d as A}from"./chunk-DMNKKWLY.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as C}from"./chunk-N6XLGYRK.js";import{b as B}from"./chunk-T5J2Z6ZR.js";import{a as w,b as f}from"./chunk-LOPZZUAF.js";import{n as i,o as n,r as F}from"./chunk-G2LZFGZA.js";import{a as m}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:a,"data-testid":l}){let[_,d]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":l,variant:"ghost","aria-label":a,className:"h-8 w-8 p-0",onClick:()=>d(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>d(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${l}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),d(!1)},disabled:c.disabled,children:c.label},u))})]})]})}m(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=m(({title:e,country:r,region:a,annualGrossSalary:l,onDelete:_,onExportPdf:d,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:d},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",a?` (${a.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",l]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=m(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:a}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(l=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(f,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}m(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:a,country:l}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[a&&o("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}m(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}m(J,"EstimationHeaders");function I({label:e,amounts:r,className:a,children:l}){let[_,d]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",a),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>d(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&l&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:l})]})}m(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:a=0}){let[l,_]=O(!1),d=e.children&&e.children.length>0,c=a>0,u=e.isCollapsible||d;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!l),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${l?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),d&&l&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:a+1})})]})}m(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:a,level:l}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",a),children:e.map((_,d)=>o(Q,{item:_,isMultipleCurrency:r,level:l},d))})}m(k,"BreakdownList");var pe=m(({estimation:e,title:r,components:a,onDelete:l,onExportPdf:_,onEdit:d})=>{let c=a?.HiringSection||q,u=a?.OnboardingTimeline||Y,z=a?.Header||K,h=a?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:l,onExportPdf:_,onEdit:d})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.code)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.code),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.code)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.code)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
2
- //# sourceMappingURL=chunk-ZEC5X3RH.js.map
1
+ import{a as R,b as x,c as N,d as A}from"./chunk-DMNKKWLY.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as C}from"./chunk-N6XLGYRK.js";import{b as B}from"./chunk-T5J2Z6ZR.js";import{a as w,c as f}from"./chunk-2Q462FT7.js";import{n as i,o as n,r as F}from"./chunk-G2LZFGZA.js";import{a as m}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:a,"data-testid":l}){let[_,d]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":l,variant:"ghost","aria-label":a,className:"h-8 w-8 p-0",onClick:()=>d(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>d(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${l}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),d(!1)},disabled:c.disabled,children:c.label},u))})]})]})}m(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=m(({title:e,country:r,region:a,annualGrossSalary:l,onDelete:_,onExportPdf:d,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:d},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",a?` (${a.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",l]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=m(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:a}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(l=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(f,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}m(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:a,country:l}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[a&&o("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}m(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}m(J,"EstimationHeaders");function I({label:e,amounts:r,className:a,children:l}){let[_,d]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",a),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>d(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&l&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:l})]})}m(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:a=0}){let[l,_]=O(!1),d=e.children&&e.children.length>0,c=a>0,u=e.isCollapsible||d;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!l),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${l?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),d&&l&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:a+1})})]})}m(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:a,level:l}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",a),children:e.map((_,d)=>o(Q,{item:_,isMultipleCurrency:r,level:l},d))})}m(k,"BreakdownList");var pe=m(({estimation:e,title:r,components:a,onDelete:l,onExportPdf:_,onEdit:d})=>{let c=a?.HiringSection||q,u=a?.OnboardingTimeline||Y,z=a?.Header||K,h=a?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:l,onExportPdf:_,onEdit:d})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.code)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.code),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.code)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.code)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:n(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.code),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
2
+ //# sourceMappingURL=chunk-YYJH3TPJ.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-Z23FQVGN.js.map