@remoteoss/remote-flows 1.24.0 → 1.24.1

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 (198) hide show
  1. package/README.md +0 -4
  2. package/dist/CheckboxFieldDefault-55JIXW4D.js +2 -0
  3. package/dist/CountryFieldDefault-NX5GNCKS.js +2 -0
  4. package/dist/DatePickerFieldDefault-PRJ4Z72O.js +2 -0
  5. package/dist/RadioGroupFieldDefault-B2ZRFHJ4.js +2 -0
  6. package/dist/{chunk-B2BH4JUO.js → chunk-2AYGZ4RY.js} +2 -2
  7. package/dist/{chunk-PNEB74RP.js → chunk-2K2RK7RF.js} +2 -2
  8. package/dist/{chunk-RGRCYSYE.js → chunk-4FMQTOXJ.js} +2 -2
  9. package/dist/{chunk-HLSQCUMS.js → chunk-6GCLDEJP.js} +2 -2
  10. package/dist/chunk-6GCLDEJP.js.map +1 -0
  11. package/dist/{chunk-3LCASKDS.js → chunk-6QEF52IP.js} +2 -2
  12. package/dist/{chunk-D7CBR52B.js → chunk-7BGANM2R.js} +2 -2
  13. package/dist/{chunk-CS5TJWQM.js → chunk-7QXULBD7.js} +2 -2
  14. package/dist/{chunk-WQVZXTW3.js → chunk-7SO6WCYM.js} +2 -2
  15. package/dist/{chunk-CHHHYLCB.js → chunk-7V2QPZ2F.js} +2 -2
  16. package/dist/{chunk-T2KDFAAY.js → chunk-ADTGWDQ7.js} +2 -2
  17. package/dist/{chunk-XRN6752K.js → chunk-AS77PXWM.js} +2 -2
  18. package/dist/{chunk-BK44KHBJ.js → chunk-B4E43MXD.js} +2 -2
  19. package/dist/{chunk-QB6OI74K.js → chunk-BI4RFXFL.js} +2 -2
  20. package/dist/{chunk-VFB3RR5I.js → chunk-BZAO32QW.js} +2 -2
  21. package/dist/{chunk-O6H66UM2.js → chunk-C32W6TCT.js} +2 -2
  22. package/dist/{chunk-T4QDKI7V.js → chunk-C4MRFGQG.js} +2 -2
  23. package/dist/{chunk-5CFU6XTU.js → chunk-DZXU45AS.js} +2 -2
  24. package/dist/{chunk-YUJBCOLO.js → chunk-G5O2CM6V.js} +2 -2
  25. package/dist/{chunk-HYDNZQOV.js → chunk-GOTY4N6S.js} +2 -2
  26. package/dist/{chunk-WQ4H5V7U.js → chunk-H2RAK6F7.js} +1 -1
  27. package/dist/chunk-H2RAK6F7.js.map +1 -0
  28. package/dist/{chunk-Z7J6NJY2.js → chunk-H5PRUDCX.js} +2 -2
  29. package/dist/{chunk-MKPKDACH.js → chunk-HDH5PEOK.js} +2 -2
  30. package/dist/chunk-HDH5PEOK.js.map +1 -0
  31. package/dist/{chunk-PZUCONZ4.js → chunk-HNCOYMS5.js} +2 -2
  32. package/dist/{chunk-6ZHKAS7X.js → chunk-IJ2BGCAF.js} +2 -2
  33. package/dist/{chunk-RVADUHPA.js → chunk-JF3KLAB5.js} +2 -2
  34. package/dist/{chunk-ZO34QFKD.js → chunk-JI5PQLWS.js} +2 -2
  35. package/dist/{chunk-TVCIAQTC.js → chunk-JKB4KOVF.js} +2 -2
  36. package/dist/{chunk-6MJVXTLI.js → chunk-JQJBDHAL.js} +2 -2
  37. package/dist/{chunk-OXKAGVWK.js → chunk-JTMJKRH7.js} +2 -2
  38. package/dist/chunk-JTMJKRH7.js.map +1 -0
  39. package/dist/{chunk-DJPCJ3YR.js → chunk-K4YQQMHD.js} +2 -2
  40. package/dist/{chunk-53KG3SOU.js → chunk-K5Y67GIG.js} +2 -2
  41. package/dist/{chunk-4IE7XN74.js → chunk-KKMW7Q42.js} +2 -2
  42. package/dist/{chunk-NUID2T57.js → chunk-KM7CQTD5.js} +2 -2
  43. package/dist/{chunk-MGZWMJMP.js → chunk-LSVH4U4W.js} +2 -2
  44. package/dist/{chunk-X3PUZFYX.js → chunk-MG4PHNSS.js} +2 -2
  45. package/dist/{chunk-YIOLMWB5.js → chunk-MSEHAEEK.js} +2 -2
  46. package/dist/{chunk-D7W4VBSV.js → chunk-NKMO2WW3.js} +2 -2
  47. package/dist/{chunk-IORVZBRC.js → chunk-OK2NP3L5.js} +2 -2
  48. package/dist/{chunk-VRW22LTU.js → chunk-OQ5WZBDA.js} +2 -2
  49. package/dist/{chunk-UNKCOOE4.js → chunk-PZAYG2DF.js} +2 -2
  50. package/dist/{chunk-NOTLTHHZ.js → chunk-QLYFMDLB.js} +2 -2
  51. package/dist/{chunk-6ABCDOFB.js → chunk-R3BBN7TV.js} +2 -2
  52. package/dist/{chunk-OELREIVJ.js → chunk-RDYN6W2A.js} +2 -2
  53. package/dist/{chunk-EP6FL2L3.js → chunk-SADMJJDB.js} +2 -2
  54. package/dist/{chunk-SPQM2TCX.js → chunk-SXKIRVA2.js} +2 -2
  55. package/dist/{chunk-J7MCWMDD.js → chunk-SXM3GJ5M.js} +2 -2
  56. package/dist/{chunk-N4IPXHFM.js → chunk-T4YYYCSD.js} +2 -2
  57. package/dist/{chunk-M4TBX2FU.js → chunk-TNYFIB6U.js} +2 -2
  58. package/dist/{chunk-W5YNJOSB.js → chunk-UJXUKEQU.js} +2 -2
  59. package/dist/{chunk-G3HUFVSG.js → chunk-UMLRTS3B.js} +2 -2
  60. package/dist/{chunk-VN535FEZ.js → chunk-UOA5WU4S.js} +2 -2
  61. package/dist/{chunk-NLBQ7CZC.js → chunk-UQBKFWUI.js} +2 -2
  62. package/dist/{chunk-AR5X2YWE.js → chunk-VK7T332E.js} +2 -2
  63. package/dist/{chunk-26IIK5U2.js → chunk-VWBA3U4U.js} +2 -2
  64. package/dist/{chunk-2JVZYQ6Z.js → chunk-VY6W6W6F.js} +2 -2
  65. package/dist/{chunk-IYL6TSUF.js → chunk-W6OOI5NF.js} +2 -2
  66. package/dist/{chunk-RYVRMH6C.js → chunk-WFZGKBFS.js} +2 -2
  67. package/dist/{chunk-AXV7YMZ3.js → chunk-XBPTFEGC.js} +2 -2
  68. package/dist/{chunk-VU6C3EU2.js → chunk-XGRFWXUU.js} +2 -2
  69. package/dist/{chunk-S6IMK3LL.js → chunk-YMJ3HQTG.js} +2 -2
  70. package/dist/{chunk-IFX5XLPZ.js → chunk-YOFBRZUZ.js} +2 -2
  71. package/dist/default-components.js +1 -1
  72. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  73. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  74. package/dist/flows/ContractAmendment/hooks.js +1 -1
  75. package/dist/flows/ContractAmendment/index.js +1 -1
  76. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  77. package/dist/flows/ContractorOnboarding/api.js +1 -1
  78. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  79. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  80. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  81. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  82. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
  83. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  84. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  85. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  86. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  87. package/dist/flows/ContractorOnboarding/index.js +1 -1
  88. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  89. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  90. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  91. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  92. package/dist/flows/CostCalculator/api.js +1 -1
  93. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  94. package/dist/flows/CostCalculator/hooks.js +1 -1
  95. package/dist/flows/CostCalculator/index.js +1 -1
  96. package/dist/flows/CostCalculator/utils.js +1 -1
  97. package/dist/flows/CreateCompany/CreateCompany.js +1 -1
  98. package/dist/flows/CreateCompany/api.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/hooks.js +1 -1
  103. package/dist/flows/CreateCompany/index.js +1 -1
  104. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  105. package/dist/flows/Onboarding/api.js +1 -1
  106. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  107. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  108. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  109. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  110. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  111. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  112. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  113. package/dist/flows/Onboarding/hooks.js +1 -1
  114. package/dist/flows/Onboarding/index.js +1 -1
  115. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  116. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  117. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  118. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  119. package/dist/flows/Termination/TerminationFlow.js +1 -1
  120. package/dist/flows/Termination/TerminationForm.js +1 -1
  121. package/dist/flows/Termination/api.js +1 -1
  122. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  123. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  124. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  125. package/dist/flows/Termination/hooks.js +1 -1
  126. package/dist/flows/Termination/index.js +1 -1
  127. package/dist/index.js +2 -2
  128. package/dist/internals.js +1 -1
  129. package/package.json +10 -9
  130. package/dist/CheckboxFieldDefault-XSBJF4HQ.js +0 -2
  131. package/dist/CountryFieldDefault-K5X6MFP3.js +0 -2
  132. package/dist/DatePickerFieldDefault-G6FWA64N.js +0 -2
  133. package/dist/RadioGroupFieldDefault-XSPBKOS6.js +0 -2
  134. package/dist/chunk-HLSQCUMS.js.map +0 -1
  135. package/dist/chunk-MKPKDACH.js.map +0 -1
  136. package/dist/chunk-OXKAGVWK.js.map +0 -1
  137. package/dist/chunk-WQ4H5V7U.js.map +0 -1
  138. /package/dist/{CheckboxFieldDefault-XSBJF4HQ.js.map → CheckboxFieldDefault-55JIXW4D.js.map} +0 -0
  139. /package/dist/{CountryFieldDefault-K5X6MFP3.js.map → CountryFieldDefault-NX5GNCKS.js.map} +0 -0
  140. /package/dist/{DatePickerFieldDefault-G6FWA64N.js.map → DatePickerFieldDefault-PRJ4Z72O.js.map} +0 -0
  141. /package/dist/{RadioGroupFieldDefault-XSPBKOS6.js.map → RadioGroupFieldDefault-B2ZRFHJ4.js.map} +0 -0
  142. /package/dist/{chunk-B2BH4JUO.js.map → chunk-2AYGZ4RY.js.map} +0 -0
  143. /package/dist/{chunk-PNEB74RP.js.map → chunk-2K2RK7RF.js.map} +0 -0
  144. /package/dist/{chunk-RGRCYSYE.js.map → chunk-4FMQTOXJ.js.map} +0 -0
  145. /package/dist/{chunk-3LCASKDS.js.map → chunk-6QEF52IP.js.map} +0 -0
  146. /package/dist/{chunk-D7CBR52B.js.map → chunk-7BGANM2R.js.map} +0 -0
  147. /package/dist/{chunk-CS5TJWQM.js.map → chunk-7QXULBD7.js.map} +0 -0
  148. /package/dist/{chunk-WQVZXTW3.js.map → chunk-7SO6WCYM.js.map} +0 -0
  149. /package/dist/{chunk-CHHHYLCB.js.map → chunk-7V2QPZ2F.js.map} +0 -0
  150. /package/dist/{chunk-T2KDFAAY.js.map → chunk-ADTGWDQ7.js.map} +0 -0
  151. /package/dist/{chunk-XRN6752K.js.map → chunk-AS77PXWM.js.map} +0 -0
  152. /package/dist/{chunk-BK44KHBJ.js.map → chunk-B4E43MXD.js.map} +0 -0
  153. /package/dist/{chunk-QB6OI74K.js.map → chunk-BI4RFXFL.js.map} +0 -0
  154. /package/dist/{chunk-VFB3RR5I.js.map → chunk-BZAO32QW.js.map} +0 -0
  155. /package/dist/{chunk-O6H66UM2.js.map → chunk-C32W6TCT.js.map} +0 -0
  156. /package/dist/{chunk-T4QDKI7V.js.map → chunk-C4MRFGQG.js.map} +0 -0
  157. /package/dist/{chunk-5CFU6XTU.js.map → chunk-DZXU45AS.js.map} +0 -0
  158. /package/dist/{chunk-YUJBCOLO.js.map → chunk-G5O2CM6V.js.map} +0 -0
  159. /package/dist/{chunk-HYDNZQOV.js.map → chunk-GOTY4N6S.js.map} +0 -0
  160. /package/dist/{chunk-Z7J6NJY2.js.map → chunk-H5PRUDCX.js.map} +0 -0
  161. /package/dist/{chunk-PZUCONZ4.js.map → chunk-HNCOYMS5.js.map} +0 -0
  162. /package/dist/{chunk-6ZHKAS7X.js.map → chunk-IJ2BGCAF.js.map} +0 -0
  163. /package/dist/{chunk-RVADUHPA.js.map → chunk-JF3KLAB5.js.map} +0 -0
  164. /package/dist/{chunk-ZO34QFKD.js.map → chunk-JI5PQLWS.js.map} +0 -0
  165. /package/dist/{chunk-TVCIAQTC.js.map → chunk-JKB4KOVF.js.map} +0 -0
  166. /package/dist/{chunk-6MJVXTLI.js.map → chunk-JQJBDHAL.js.map} +0 -0
  167. /package/dist/{chunk-DJPCJ3YR.js.map → chunk-K4YQQMHD.js.map} +0 -0
  168. /package/dist/{chunk-53KG3SOU.js.map → chunk-K5Y67GIG.js.map} +0 -0
  169. /package/dist/{chunk-4IE7XN74.js.map → chunk-KKMW7Q42.js.map} +0 -0
  170. /package/dist/{chunk-NUID2T57.js.map → chunk-KM7CQTD5.js.map} +0 -0
  171. /package/dist/{chunk-MGZWMJMP.js.map → chunk-LSVH4U4W.js.map} +0 -0
  172. /package/dist/{chunk-X3PUZFYX.js.map → chunk-MG4PHNSS.js.map} +0 -0
  173. /package/dist/{chunk-YIOLMWB5.js.map → chunk-MSEHAEEK.js.map} +0 -0
  174. /package/dist/{chunk-D7W4VBSV.js.map → chunk-NKMO2WW3.js.map} +0 -0
  175. /package/dist/{chunk-IORVZBRC.js.map → chunk-OK2NP3L5.js.map} +0 -0
  176. /package/dist/{chunk-VRW22LTU.js.map → chunk-OQ5WZBDA.js.map} +0 -0
  177. /package/dist/{chunk-UNKCOOE4.js.map → chunk-PZAYG2DF.js.map} +0 -0
  178. /package/dist/{chunk-NOTLTHHZ.js.map → chunk-QLYFMDLB.js.map} +0 -0
  179. /package/dist/{chunk-6ABCDOFB.js.map → chunk-R3BBN7TV.js.map} +0 -0
  180. /package/dist/{chunk-OELREIVJ.js.map → chunk-RDYN6W2A.js.map} +0 -0
  181. /package/dist/{chunk-EP6FL2L3.js.map → chunk-SADMJJDB.js.map} +0 -0
  182. /package/dist/{chunk-SPQM2TCX.js.map → chunk-SXKIRVA2.js.map} +0 -0
  183. /package/dist/{chunk-J7MCWMDD.js.map → chunk-SXM3GJ5M.js.map} +0 -0
  184. /package/dist/{chunk-N4IPXHFM.js.map → chunk-T4YYYCSD.js.map} +0 -0
  185. /package/dist/{chunk-M4TBX2FU.js.map → chunk-TNYFIB6U.js.map} +0 -0
  186. /package/dist/{chunk-W5YNJOSB.js.map → chunk-UJXUKEQU.js.map} +0 -0
  187. /package/dist/{chunk-G3HUFVSG.js.map → chunk-UMLRTS3B.js.map} +0 -0
  188. /package/dist/{chunk-VN535FEZ.js.map → chunk-UOA5WU4S.js.map} +0 -0
  189. /package/dist/{chunk-NLBQ7CZC.js.map → chunk-UQBKFWUI.js.map} +0 -0
  190. /package/dist/{chunk-AR5X2YWE.js.map → chunk-VK7T332E.js.map} +0 -0
  191. /package/dist/{chunk-26IIK5U2.js.map → chunk-VWBA3U4U.js.map} +0 -0
  192. /package/dist/{chunk-2JVZYQ6Z.js.map → chunk-VY6W6W6F.js.map} +0 -0
  193. /package/dist/{chunk-IYL6TSUF.js.map → chunk-W6OOI5NF.js.map} +0 -0
  194. /package/dist/{chunk-RYVRMH6C.js.map → chunk-WFZGKBFS.js.map} +0 -0
  195. /package/dist/{chunk-AXV7YMZ3.js.map → chunk-XBPTFEGC.js.map} +0 -0
  196. /package/dist/{chunk-VU6C3EU2.js.map → chunk-XGRFWXUU.js.map} +0 -0
  197. /package/dist/{chunk-S6IMK3LL.js.map → chunk-YMJ3HQTG.js.map} +0 -0
  198. /package/dist/{chunk-IFX5XLPZ.js.map → chunk-YOFBRZUZ.js.map} +0 -0
package/README.md CHANGED
@@ -246,7 +246,3 @@ We have created an entry point in the package `@remoteoss/remote-flows/internals
246
246
  This entry endpoint exports internals utils and shadcn components to avoid duplicating these on the `example` folder.
247
247
 
248
248
  We don't guarantee `semver` compatiblity if you used them in your project.
249
-
250
- ```
251
-
252
- ```
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-YMJ3HQTG.js";import"./chunk-C4MRFGQG.js";import"./chunk-R4X2WQXX.js";import"./chunk-G5O2CM6V.js";import"./chunk-CWAFRJAQ.js";import"./chunk-VIGKOVHP.js";import"./chunk-H2RAK6F7.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as CheckboxFieldDefault};
2
+ //# sourceMappingURL=CheckboxFieldDefault-55JIXW4D.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-T4YYYCSD.js";import"./chunk-VPSESR6G.js";import"./chunk-C4MRFGQG.js";import"./chunk-MSBCYMSH.js";import"./chunk-6JTHV4QS.js";import"./chunk-547UHEDI.js";import"./chunk-MP3VDCI7.js";import"./chunk-G5O2CM6V.js";import"./chunk-CWAFRJAQ.js";import"./chunk-VIGKOVHP.js";import"./chunk-H2RAK6F7.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as CountryFieldDefault};
2
+ //# sourceMappingURL=CountryFieldDefault-NX5GNCKS.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-UOA5WU4S.js";import"./chunk-C4MRFGQG.js";import"./chunk-MSBCYMSH.js";import"./chunk-MP3VDCI7.js";import"./chunk-G5O2CM6V.js";import"./chunk-CWAFRJAQ.js";import"./chunk-VIGKOVHP.js";import"./chunk-H2RAK6F7.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as DatePickerFieldDefault};
2
+ //# sourceMappingURL=DatePickerFieldDefault-PRJ4Z72O.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-W6OOI5NF.js";import"./chunk-C4MRFGQG.js";import"./chunk-SNBAM7SA.js";import"./chunk-G5O2CM6V.js";import"./chunk-CWAFRJAQ.js";import"./chunk-VIGKOVHP.js";import"./chunk-H2RAK6F7.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as RadioGroupFieldDefault};
2
+ //# sourceMappingURL=RadioGroupFieldDefault-B2ZRFHJ4.js.map
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-D7CBR52B.js";import{a as e}from"./chunk-VAWEOFUO.js";import{a as s}from"./chunk-53KG3SOU.js";import{a as p}from"./chunk-WD5DNUSS.js";import{a as c}from"./chunk-PNEB74RP.js";import{a as l}from"./chunk-DPVXSN7T.js";import{a as i}from"./chunk-Z7J6NJY2.js";import{a as m}from"./chunk-X3PUZFYX.js";import{a as f}from"./chunk-T2KDFAAY.js";import{a as u}from"./chunk-VFB3RR5I.js";import{a as d}from"./chunk-P3QDMRCC.js";import{a as n}from"./chunk-Q3ALCPJN.js";import{a}from"./chunk-OXKAGVWK.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as I,useRef as F,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var J=t(({render:g,employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O,options:w})=>{let P=I(),o=F(void 0),R=y(()=>({setValue:o}),[]),r=a({options:{...w,onContractReviewed:t(()=>{o.current&&o.current("review_completed",!0)},"onContractReviewed")},employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O});return D(n.Provider,{value:{contractorOnboardingBag:r,formId:P,formRef:R},children:g({contractorOnboardingBag:r,components:{BasicInformationStep:m,SelectCountryStep:i,BackButton:e,SubmitButton:p,PricingPlanStep:c,EligibilityQuestionnaireStep:S,ContractDetailsStep:f,ContractPreviewStep:u,OnboardingInvite:s,ContractReviewButton:d,SaveDraftButton:l}})})},"ContractorOnboardingFlow");export{J as a};
2
- //# sourceMappingURL=chunk-B2BH4JUO.js.map
1
+ import{a as S}from"./chunk-7BGANM2R.js";import{a as e}from"./chunk-VAWEOFUO.js";import{a as s}from"./chunk-K5Y67GIG.js";import{a as p}from"./chunk-WD5DNUSS.js";import{a as c}from"./chunk-2K2RK7RF.js";import{a as l}from"./chunk-DPVXSN7T.js";import{a as i}from"./chunk-H5PRUDCX.js";import{a as m}from"./chunk-MG4PHNSS.js";import{a as f}from"./chunk-ADTGWDQ7.js";import{a as u}from"./chunk-BZAO32QW.js";import{a as d}from"./chunk-P3QDMRCC.js";import{a as n}from"./chunk-Q3ALCPJN.js";import{a}from"./chunk-JTMJKRH7.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as I,useRef as F,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var J=t(({render:g,employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O,options:w})=>{let P=I(),o=F(void 0),R=y(()=>({setValue:o}),[]),r=a({options:{...w,onContractReviewed:t(()=>{o.current&&o.current("review_completed",!0)},"onContractReviewed")},employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O});return D(n.Provider,{value:{contractorOnboardingBag:r,formId:P,formRef:R},children:g({contractorOnboardingBag:r,components:{BasicInformationStep:m,SelectCountryStep:i,BackButton:e,SubmitButton:p,PricingPlanStep:c,EligibilityQuestionnaireStep:S,ContractDetailsStep:f,ContractPreviewStep:u,OnboardingInvite:s,ContractReviewButton:d,SaveDraftButton:l}})})},"ContractorOnboardingFlow");export{J as a};
2
+ //# sourceMappingURL=chunk-2AYGZ4RY.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-RYVRMH6C.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{k as t}from"./chunk-VIGKOVHP.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function E({components:l,onSubmit:p,onSuccess:c,onError:m}){let{contractorOnboardingBag:r}=e(),d=i(async a=>{try{let n=await r.parseFormValues(a);await p?.(n);let o=await r.onSubmit(a);if(o?.data){await c?.(o?.data),r?.next();return}}catch(n){let o=t(n,r.meta?.fields?.pricing_plan);m?.(o)}},"handleSubmit"),P=r.stepState.values?.pricing_plan||r.initialValues.pricing_plan;return u(s,{components:l,defaultValues:P,onSubmit:d})}i(E,"PricingPlanStep");export{E as a};
2
- //# sourceMappingURL=chunk-PNEB74RP.js.map
1
+ import{a as s}from"./chunk-WFZGKBFS.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{k as t}from"./chunk-VIGKOVHP.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function E({components:l,onSubmit:p,onSuccess:c,onError:m}){let{contractorOnboardingBag:r}=e(),d=i(async a=>{try{let n=await r.parseFormValues(a);await p?.(n);let o=await r.onSubmit(a);if(o?.data){await c?.(o?.data),r?.next();return}}catch(n){let o=t(n,r.meta?.fields?.pricing_plan);m?.(o)}},"handleSubmit"),P=r.stepState.values?.pricing_plan||r.initialValues.pricing_plan;return u(s,{components:l,defaultValues:P,onSubmit:d})}i(E,"PricingPlanStep");export{E as a};
2
+ //# sourceMappingURL=chunk-2K2RK7RF.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-NOTLTHHZ.js";import{b as i}from"./chunk-76ZDXC2T.js";import{k as a}from"./chunk-VIGKOVHP.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({onSubmit:m,onSuccess:l,onError:t}){let{createCompanyBag:e}=i(),p=o(async d=>{try{await m?.(d);let r=await e.onSubmit(d);if(r?.data){await l?.(r?.data);return}if(r?.error){let s=a(r,e.meta?.fields?.address_details);t?.(s)}}catch(r){let s=a(r,e.meta?.fields?.address_details);t?.(s)}},"handleSubmit"),u=e.stepState.values?.address_details||e.initialValues.address_details;return c(n,{defaultValues:u,onSubmit:p})}o(C,"AddressDetailsStep");export{C as a};
2
- //# sourceMappingURL=chunk-RGRCYSYE.js.map
1
+ import{a as n}from"./chunk-QLYFMDLB.js";import{b as i}from"./chunk-76ZDXC2T.js";import{k as a}from"./chunk-VIGKOVHP.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({onSubmit:m,onSuccess:l,onError:t}){let{createCompanyBag:e}=i(),p=o(async d=>{try{await m?.(d);let r=await e.onSubmit(d);if(r?.data){await l?.(r?.data);return}if(r?.error){let s=a(r,e.meta?.fields?.address_details);t?.(s)}}catch(r){let s=a(r,e.meta?.fields?.address_details);t?.(s)}},"handleSubmit"),u=e.stepState.values?.address_details||e.initialValues.address_details;return c(n,{defaultValues:u,onSubmit:p})}o(C,"AddressDetailsStep");export{C as a};
2
+ //# sourceMappingURL=chunk-4FMQTOXJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as W}from"./chunk-WRRTZ2AL.js";import{a as Y}from"./chunk-TVCIAQTC.js";import{a as Q}from"./chunk-YWOJ4NKF.js";import{a as J}from"./chunk-IFX5XLPZ.js";import{a as H}from"./chunk-IF42CZJH.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as q,b as B,c as L,d as z}from"./chunk-L5DII4MV.js";import{f as Z,g as K}from"./chunk-SPQM2TCX.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-RAH453TV.js";import{a as N}from"./chunk-YIOLMWB5.js";import{a as E}from"./chunk-NAF6LRSS.js";import{e as _}from"./chunk-D5AO6SOM.js";import{a as u,b as v}from"./chunk-YUJBCOLO.js";import{a as D}from"./chunk-VIGKOVHP.js";import{q as $}from"./chunk-WQ4H5V7U.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as A}from"./chunk-TSPDJUGG.js";import{a as I}from"./chunk-Z5WMKCRJ.js";import{d as O}from"./chunk-KQPDXXG3.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}=O();return Fe({queryKey:["payroll-calendars"],queryFn: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:u.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:u.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:u.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 _(s,me.fields,{isPartialValidation:!0}):f?await _(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 _(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-HLSQCUMS.js.map
1
+ import{a as W}from"./chunk-WRRTZ2AL.js";import{a as Y}from"./chunk-JKB4KOVF.js";import{a as Q}from"./chunk-YWOJ4NKF.js";import{a as J}from"./chunk-YOFBRZUZ.js";import{a as H}from"./chunk-IF42CZJH.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as q,b as B,c as L,d as z}from"./chunk-L5DII4MV.js";import{f as Z,g as K}from"./chunk-SXKIRVA2.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-RAH453TV.js";import{a as N}from"./chunk-MSEHAEEK.js";import{a as E}from"./chunk-NAF6LRSS.js";import{e as _}from"./chunk-D5AO6SOM.js";import{a as u,b as v}from"./chunk-G5O2CM6V.js";import{a as D}from"./chunk-VIGKOVHP.js";import{q as $}from"./chunk-H2RAK6F7.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as A}from"./chunk-TSPDJUGG.js";import{a as I}from"./chunk-Z5WMKCRJ.js";import{d as O}from"./chunk-KQPDXXG3.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}=O();return Fe({queryKey:["payroll-calendars"],queryFn: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:u.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:u.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:u.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 _(s,me.fields,{isPartialValidation:!0}):f?await _(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 _(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-6GCLDEJP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/common/api/payroll-calendars.ts","../src/common/employment.ts"],"sourcesContent":["import { $TSFixMe } from '@/src/types/remoteFlows';\nimport { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format, isFuture, parseISO, subDays } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n EmployeeCommunicationFormValues,\n PaidTimeOffFormValues,\n TerminationDetailsFormValues,\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport {\n buildInitialValues,\n calculateMinTerminationDate,\n calculateProposedTerminationDateStatement,\n STEPS,\n} from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { terminationDetailsSchema } from '@/src/flows/Termination/json-schemas/terminationDetails';\nimport {\n useCreateTermination,\n useTerminationSchema,\n} from '@/src/flows/Termination/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api/employment';\nimport { AcknowledgeInformationContainer } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer';\nimport { AcknowledgeInformation } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation';\nimport { AcknowledgeInformationFees } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees';\nimport { usePayrollCalendars } from '@/src/common/api/payroll-calendars';\nimport { isInProbationPeriod } from '@/src/common/employment';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment, isLoading: isLoadingEmployment } =\n useEmploymentQuery({ employmentId, queryParams: { exclude_files: true } });\n\n const { data: payrollCalendars } = usePayrollCalendars({\n query: {\n year: new Date().getFullYear().toString(),\n countryCode: employment?.country?.code,\n },\n options: {\n enabled: Boolean(employment?.country?.code),\n },\n });\n\n const isEmployeeInProbationPeriod = isInProbationPeriod(\n employment?.probation_period_end_date,\n );\n\n const minTerminationDate = calculateMinTerminationDate(payrollCalendars);\n const minDate = useMemo(\n () =>\n isEmployeeInProbationPeriod\n ? format(new Date(), 'yyyy-MM-dd')\n : format(minTerminationDate, 'yyyy-MM-dd'),\n [isEmployeeInProbationPeriod, minTerminationDate],\n );\n\n const hasFutureStartDate = Boolean(\n employment?.provisional_start_date &&\n isFuture(parseISO(employment.provisional_start_date)),\n );\n\n const employmentValues = {\n personal_email: employment?.basic_information?.email as string,\n } as Partial<TerminationFormValues>;\n\n const initialValues = buildInitialValues(\n {\n ...employmentValues,\n ...terminationInitialValues,\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n },\n hasFutureStartDate,\n );\n\n const formValues = useMemo(\n () => ({\n ...initialValues,\n ...fieldValues,\n }),\n [fieldValues, initialValues],\n );\n\n const proposedTerminationDateStatement =\n calculateProposedTerminationDateStatement({\n minTerminationDate,\n isEmployeeInProbationPeriod,\n selectedDate: parseISO(formValues.proposed_termination_date),\n });\n\n const customFields = useMemo(() => {\n const originalTerminationReasonOptions =\n terminationDetailsSchema.data.schema.properties.termination_reason.oneOf;\n\n const terminationReasonOptions = hasFutureStartDate\n ? originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const === 'cancellation_before_start_date',\n )\n : originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const !== 'cancellation_before_start_date',\n );\n\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n termination_reason: {\n ...(options?.jsfModify?.fields?.termination_reason as $TSFixMe),\n oneOf: terminationReasonOptions,\n },\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, Remote must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n external\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: minDate,\n ...(formValues.termination_reason ===\n 'cancellation_before_start_date' &&\n employment?.provisional_start_date\n ? {\n maxDate: format(\n subDays(parseISO(employment.provisional_start_date), 1),\n 'yyyy-MM-dd',\n ),\n }\n : {}),\n ...proposedTerminationDateStatement,\n },\n ...(formValues.termination_reason === 'cancellation_before_start_date'\n ? {\n 'x-jsf-errorMessage': {\n maximum:\n \"The proposed termination date must be before the employee's start date.\",\n },\n }\n : {}),\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <AcknowledgeInformationContainer\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <AcknowledgeInformation {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_fees_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const zendeskIds = {\n involuntaryOffboardingServiceChargeZendeskId:\n zendeskArticles.involuntaryOffboardingServiceCharge,\n reconciliationInvoiceZendeskId:\n zendeskArticles.reconciliationInvoice,\n };\n\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n if (CustomComponent) {\n return <CustomComponent {...zendeskIds} />;\n }\n\n return <AcknowledgeInformationFees {...zendeskIds} />;\n },\n },\n },\n },\n };\n }, [\n employment,\n employmentId,\n formValues.proposed_termination_date,\n formValues.termination_reason,\n hasFutureStartDate,\n minDate,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_info,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.termination_reason,\n proposedTerminationDateStatement,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n const parsedValues = (await parseFormValues(\n values,\n true,\n )) as TerminationFormValues;\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = await parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const files = (parsedValues.timesheet_file as $TSFixMe) ?? [];\n const timesheetFile =\n Array.isArray(files) && files.length > 0\n ? { content: files[0].content, name: files[0].name }\n : undefined;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: {\n ...terminationDetails,\n timesheet_file: timesheetFile ? timesheetFile : undefined,\n },\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n const isDirty = Boolean(Object.keys(fieldValues).length > 0);\n\n const parseFormValues = async (\n values: TerminationFormValues,\n includeAllFields: boolean = false,\n ): Promise<\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues\n | TerminationFormValues\n > => {\n if (includeAllFields) {\n return (await parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n })) as TerminationFormValues;\n }\n\n if (terminationHeadlessForm) {\n return (await parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n {\n isPartialValidation: true,\n },\n )) as\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues;\n }\n return {} as $TSFixMe;\n };\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Employment data\n */\n employment,\n\n /**\n * Current form field values, we use formValues to let the user know about all the current form values\n */\n fieldValues: formValues,\n\n /**\n * Indicates if the form is dirty\n */\n isDirty,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination || isLoadingEmployment,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: async (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = await parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { getIndexEorPayrollCalendar } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@/src/client/client';\n\nexport const usePayrollCalendars = ({\n query,\n options,\n}: {\n query?: {\n year?: string;\n countryCode?: string;\n };\n options?: {\n enabled?: boolean;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['payroll-calendars'],\n queryFn: () =>\n getIndexEorPayrollCalendar({\n client: client as Client,\n query: {\n year: query?.year,\n country_code: query?.countryCode,\n },\n }),\n enabled: options?.enabled,\n select: (data) => data.data?.data?.payroll_calendars?.[0],\n });\n};\n","import { isFuture, isToday, parseISO } from 'date-fns';\n\nexport const isInProbationPeriod = (probationEndDate: string | undefined) => {\n if (!probationEndDate) return false;\n\n const parsedProbationEndDate = parseISO(probationEndDate);\n\n return isFuture(parsedProbationEndDate) || isToday(parsedProbationEndDate);\n};\n"],"mappings":"22BAEA,OAAOA,OAAY,gBACnB,OAAOC,OAAY,gBACnB,OAAS,UAAAC,EAAQ,YAAAC,GAAU,YAAAC,EAAU,WAAAC,OAAe,WACpD,OAAS,WAAAC,MAAe,QAcxB,OAAOC,OAAU,cCnBjB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,EAAsBC,EAAA,CAAC,CAClC,MAAAC,EACA,QAAAC,CACF,IAQM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,GAAS,CACd,SAAU,CAAC,mBAAmB,EAC9B,QAASL,EAAA,IACPM,EAA2B,CACzB,OAAQH,EACR,MAAO,CACL,KAAMF,GAAO,KACb,aAAcA,GAAO,WACvB,CACF,CAAC,EAPM,WAQT,QAASC,GAAS,QAClB,OAAQF,EAACO,GAASA,EAAK,MAAM,MAAM,oBAAoB,CAAC,EAAhD,SACV,CAAC,CACH,EA1BmC,uBCLnC,OAAS,YAAAC,GAAU,WAAAC,GAAS,YAAAC,OAAgB,WAErC,IAAMC,EAAsBC,EAACC,GAAyC,CAC3E,GAAI,CAACA,EAAkB,MAAO,GAE9B,IAAMC,EAAyBC,GAASF,CAAgB,EAExD,OAAOG,GAASF,CAAsB,GAAKG,GAAQH,CAAsB,CAC3E,EANmC,uBFoJzB,mBAAAI,GAKE,OAAAC,EALF,QAAAC,OAAA,oBArGH,IAAMC,GAAiBC,EAAA,CAAC,CAC7B,aAAAC,EACA,QAAAC,EACA,cAAeC,CACjB,IAA4B,CAC1B,GAAM,CAAE,YAAAC,EAAa,eAAAC,GAAgB,UAAAC,EAAW,aAAAC,GAAc,SAAAC,EAAS,EACrEC,EAAwDC,CAAK,EAEzD,CAAE,KAAMC,EAAY,UAAWC,EAAoB,EACvDC,EAAmB,CAAE,aAAAZ,EAAc,YAAa,CAAE,cAAe,EAAK,CAAE,CAAC,EAErE,CAAE,KAAMa,EAAiB,EAAIC,EAAoB,CACrD,MAAO,CACL,KAAM,IAAI,KAAK,EAAE,YAAY,EAAE,SAAS,EACxC,YAAaJ,GAAY,SAAS,IACpC,EACA,QAAS,CACP,QAAS,EAAQA,GAAY,SAAS,IACxC,CACF,CAAC,EAEKK,EAA8BC,EAClCN,GAAY,yBACd,EAEMO,EAAqBC,EAA4BL,EAAgB,EACjEM,EAAUC,EACd,IACEL,EACIM,EAAO,IAAI,KAAQ,YAAY,EAC/BA,EAAOJ,EAAoB,YAAY,EAC7C,CAACF,EAA6BE,CAAkB,CAClD,EAEMK,EAAqB,GACzBZ,GAAY,wBACZa,GAASC,EAASd,EAAW,sBAAsB,CAAC,GAGhDe,GAAmB,CACvB,eAAgBf,GAAY,mBAAmB,KACjD,EAEMgB,EAAgBC,EACpB,CACE,GAAGF,GACH,GAAGvB,EACH,GAAGG,EAAU,QAAQ,uBACrB,GAAGA,EAAU,QAAQ,oBACrB,GAAGA,EAAU,QAAQ,cACrB,GAAGA,EAAU,QAAQ,sBACvB,EACAiB,CACF,EAEMM,EAAaR,EACjB,KAAO,CACL,GAAGM,EACH,GAAGvB,CACL,GACA,CAACA,EAAauB,CAAa,CAC7B,EAEMG,EACJC,EAA0C,CACxC,mBAAAb,EACA,4BAAAF,EACA,aAAcS,EAASI,EAAW,yBAAyB,CAC7D,CAAC,EAEGG,GAAeX,EAAQ,IAAM,CACjC,IAAMY,EACJC,EAAyB,KAAK,OAAO,WAAW,mBAAmB,MAE/DC,EAA2BZ,EAC7BU,EAAiC,OAC9BG,GACCA,EAAO,QAAU,gCACrB,EACAH,EAAiC,OAC9BG,GACCA,EAAO,QAAU,gCACrB,EAEJ,MAAO,CACL,OAAQ,CACN,oBAAqBC,EACnB,8BACA,wNACA,CACE,UACEnC,GAAS,WAAW,QAAQ,sBAC1B,oBAAoB,GAAG,SAC7B,CACF,EACA,mBAAoB,CAClB,GAAIA,GAAS,WAAW,QAAQ,mBAChC,MAAOiC,CACT,EACA,+BAAgCE,EAC9B,4BACAvC,GAAAF,GAAA,CAAE,gQAKAC,EAACyC,EAAA,CACC,SAAQ,GACR,UAAWC,EAAgB,yBAC3B,UAAWC,EACT,UAEEtC,GAAS,WAAW,QAChB,iCACF,oBAAoB,GAAG,6BAC7B,EACD,sCAED,GACF,EACA,CACE,UACEA,GAAS,WAAW,QAChB,iCACF,oBAAoB,GAAG,SAC7B,CACF,EACA,0BAA2B,CACzB,GAAIA,GAAS,WAAW,QACpB,0BACJ,qBAAsB,CACpB,GACEA,GAAS,WAAW,QAAQ,4BAC1B,oBAAoB,EACxB,QAASkB,EACT,GAAIS,EAAW,qBACb,kCACFlB,GAAY,uBACR,CACE,QAASW,EACPmB,GAAQhB,EAASd,EAAW,sBAAsB,EAAG,CAAC,EACtD,YACF,CACF,EACA,CAAC,EACL,GAAGmB,CACL,EACA,GAAID,EAAW,qBAAuB,iCAClC,CACE,qBAAsB,CACpB,QACE,yEACJ,CACF,EACA,CAAC,CACP,EACA,mBAAoB,CAClB,GAAI3B,GAAS,WAAW,QAAQ,mBAChC,qBAAsB,CACpB,GAAIA,GAAS,WAAW,QAAQ,qBAC9B,oBACF,EACA,UAAWF,EAAA,IAAM,CACf,IAAM0C,EACJxC,GAAS,WAAW,QAAQ,qBAC1B,oBAAoB,GAAG,UAE3B,OACEL,EAAC8C,EAAA,CACC,aAAchC,GAAY,mBAAmB,KAC7C,wBAAyBkB,EAAW,0BACpC,aAAc5B,EACd,WAAYU,EACZ,OAASiC,GACHF,EACK7C,EAAC6C,EAAA,CAAiB,GAAGE,EAAO,EAE9B/C,EAACgD,EAAA,CAAa,GAAGD,EAAO,EAEnC,CAEJ,EAnBW,YAoBb,CACF,EACA,uCAAwC,CACtC,GAAI1C,GAAS,WAAW,QACpB,uCACJ,qBAAsB,CACpB,GACEA,GAAS,WAAW,QAChB,yCACF,oBAAoB,EACxB,UAAWF,EAAA,IAAM,CACf,IAAM0C,EACJxC,GAAS,WAAW,QAChB,yCACF,oBAAoB,GAAG,UAE3B,OACEL,EAACiD,EAAA,CACC,OAASF,GACHF,EACK7C,EAAC6C,EAAA,CAAiB,GAAGE,EAAO,EAE9B/C,EAACkD,EAAA,CAAwB,GAAGH,EAAO,EAE9C,CAEJ,EAhBW,YAiBb,CACF,EACA,4CAA6C,CAC3C,GAAI1C,GAAS,WAAW,QACpB,4CACJ,qBAAsB,CACpB,GACEA,GAAS,WAAW,QAChB,8CACF,oBAAoB,EACxB,UAAWF,EAAA,IAAM,CACf,IAAMgD,EAAa,CACjB,6CACET,EAAgB,oCAClB,+BACEA,EAAgB,qBACpB,EAEMG,EACJxC,GAAS,WAAW,QAChB,8CACF,oBAAoB,GAAG,UAE3B,OAAIwC,EACK7C,EAAC6C,EAAA,CAAiB,GAAGM,EAAY,EAGnCnD,EAACoD,EAAA,CAA4B,GAAGD,EAAY,CACrD,EAlBW,YAmBb,CACF,CACF,CACF,CACF,EAAG,CACDrC,EACAV,EACA4B,EAAW,0BACXA,EAAW,mBACXN,EACAH,EACAlB,GAAS,WAAW,QAAQ,4CAC5BA,GAAS,WAAW,QAAQ,uCAC5BA,GAAS,WAAW,QAAQ,mBAC5BA,GAAS,WAAW,QAAQ,0BAC5BA,GAAS,WAAW,QAAQ,+BAC5BA,GAAS,WAAW,QAAQ,oBAC5BA,GAAS,WAAW,QAAQ,mBAC5B4B,CACF,CAAC,EAEK,CAAE,KAAMoB,EAAyB,UAAWC,EAAqB,EACrEC,EAAqB,CACnB,WAAYvB,EACZ,UAAW,CACT,GAAG3B,GAAS,UACZ,OAAQ,CACN,GAAGA,GAAS,WAAW,OACvB,GAAG8B,IAAc,MACnB,CACF,EACA,KAAM1B,EAAU,YAAY,IAC9B,CAAC,EAEG+C,GAA0BC,EAAmBC,EAAW,KAAK,MAAM,EAEnEC,EAAoBC,EAAqB,EACzC,CAAE,YAAAC,EAAY,EAAIC,EAAkBH,CAAiB,EAE3D,eAAeI,GAASC,EAA+B,CACrD,GAAI,CAAC5D,EACH,MAAM,IAAI,MAAM,0BAA0B,EAG5C,GAAIiD,EAAyB,CAC3B,IAAMY,EAAgB,MAAMC,EAC1BF,EACA,EACF,EAEM,CAAE,2BAA4BG,CAAyB,EAC3DF,EAEIG,EACJD,IAA6B,MACzB,CACE,mBAAoB,CAClB,KAAMF,EAAa,gCACnB,KAAMA,EAAa,sCACrB,CACF,EACA,OASAI,GAAoB,MAAMC,EAC9BL,EARqB,CACrB,uBACA,eACA,6BACA,4BACF,CAKA,EAEMM,GAAmBC,GACvBH,GACA,kCACA,wCACF,EAEMI,GAA+CC,GACnD,CACE,GAAGH,GACH,GAAGH,CACL,EACAO,EACF,EAEMC,EAASX,EAAa,gBAA+B,CAAC,EACtDY,EACJ,MAAM,QAAQD,CAAK,GAAKA,EAAM,OAAS,EACnC,CAAE,QAASA,EAAM,CAAC,EAAE,QAAS,KAAMA,EAAM,CAAC,EAAE,IAAK,EACjD,OAEAE,GAA8C,CAClD,cAAe1E,EACf,oBAAqB,CACnB,GAAGqE,GACH,eAAgBI,GAAgC,MAClD,EACA,KAAM,aACR,EAEA,OAAOhB,GAAYiB,EAAkB,CACvC,CAGF,CArEe3E,EAAA4D,GAAA,YAuEf,SAASgB,IAAO,CACdrE,GAAa,CACf,CAFSP,EAAA4E,GAAA,QAIT,SAASC,IAAO,CACdrE,GAAS,CACX,CAFSR,EAAA6E,GAAA,QAIT,IAAMC,GAAkB,OAAO,KAAK1E,CAAW,EAAE,OAAS,EAEpD2D,EAAkB/D,EAAA,MACtB6D,EACAkB,EAA4B,KAOxBA,EACM,MAAMC,EAAmBnB,EAAQR,GAAwB,OAAQ,CACvE,oBAAqB,EACvB,CAAC,EAGCH,EACM,MAAM8B,EACZnB,EACAX,GAAyB,OACzB,CACE,oBAAqB,EACvB,CACF,EAKK,CAAC,EA3Bc,mBA8BxB,MAAO,CAIL,aAAAjD,EAIA,WAAAU,EAKA,YAAakB,EAKb,QAAAiD,GAIA,UAAAxE,EAIA,OAAQ4C,GAAyB,QAAU,CAAC,EAI5C,UAAWC,IAAwBvC,GAInC,aAAc4C,EAAkB,UAIhC,cAAe7B,EAMf,iBAAkB3B,EAAA,MAAO6D,GAAkC,CACzD,GAAIX,EAAyB,CAC3B,IAAMY,EAAe,MAAMkB,EACzBnB,EACAX,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBY,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAclB,kBAAmBzD,GAMnB,gBAAA0D,EAMA,SAAAH,GAMA,KAAAgB,GAMA,KAAAC,EACF,CACF,EAxd8B","names":["omitBy","isNull","format","isFuture","parseISO","subDays","useMemo","omit","useQuery","usePayrollCalendars","__name","query","options","client","useClient","useQuery","getIndexEorPayrollCalendar","data","isFuture","isToday","parseISO","isInProbationPeriod","__name","probationEndDate","parsedProbationEndDate","parseISO","isFuture","isToday","Fragment","jsx","jsxs","useTermination","__name","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","isLoadingEmployment","useEmploymentQuery","payrollCalendars","usePayrollCalendars","isEmployeeInProbationPeriod","isInProbationPeriod","minTerminationDate","calculateMinTerminationDate","minDate","useMemo","format","hasFutureStartDate","isFuture","parseISO","employmentValues","initialValues","buildInitialValues","formValues","proposedTerminationDateStatement","calculateProposedTerminationDateStatement","customFields","originalTerminationReasonOptions","terminationDetailsSchema","terminationReasonOptions","option","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","subDays","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","AcknowledgeInformationContainer","AcknowledgeInformation","zendeskIds","AcknowledgeInformationFees","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseFormValues","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","files","timesheetFile","terminationPayload","back","next","isDirty","includeAllFields","parseJSFToValidate"]}
@@ -1,2 +1,2 @@
1
- import{b as w}from"./chunk-PGWKJ6FK.js";import{d as v,e as y}from"./chunk-G3HUFVSG.js";import{a as i}from"./chunk-X6ZAR7ZL.js";import{b as l}from"./chunk-KQPDXXG3.js";import{a as s}from"./chunk-P37U34EQ.js";import{jsx as _}from"react/jsx-runtime";function P({onSubmit:f,onSuccess:a,onError:t,render:E,...o}){let{components:R}=l(),{onboardingBag:r,setCreditScore:m}=w(),d=v(),u=y(),{mutateAsync:g}=i(d),{mutateAsync:S}=i(u),c=r.creditRiskStatus==="deposit_required"||r.onboardingReservesStatus==="deposit_required",I=s(async()=>{try{if(await f?.(),c&&r.employmentId&&r.employment?.status&&!r.isEmploymentReadOnly){let e=await S({employment_slug:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),m?.(n=>({...n,showReserveInvoice:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(r.employmentId){let e=await g({employment_id:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"invited"}),m?.(n=>({...n,showInviteSuccessful:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){t?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),b=c&&r.employment?.status&&!r.isEmploymentReadOnly,p=R?.button;if(!p)throw new Error("Button component not found");return _(p,{...o,disabled:d.isPending||u.isPending||o.disabled,onClick:e=>{I(),o.onClick?.(e)},children:E({employmentStatus:b?"created_awaiting_reserve":"invited"})})}s(P,"OnboardingInvite");export{P as a};
2
- //# sourceMappingURL=chunk-3LCASKDS.js.map
1
+ import{b as w}from"./chunk-PGWKJ6FK.js";import{d as v,e as y}from"./chunk-UMLRTS3B.js";import{a as i}from"./chunk-X6ZAR7ZL.js";import{b as l}from"./chunk-KQPDXXG3.js";import{a as s}from"./chunk-P37U34EQ.js";import{jsx as _}from"react/jsx-runtime";function P({onSubmit:f,onSuccess:a,onError:t,render:E,...o}){let{components:R}=l(),{onboardingBag:r,setCreditScore:m}=w(),d=v(),u=y(),{mutateAsync:g}=i(d),{mutateAsync:S}=i(u),c=r.creditRiskStatus==="deposit_required"||r.onboardingReservesStatus==="deposit_required",I=s(async()=>{try{if(await f?.(),c&&r.employmentId&&r.employment?.status&&!r.isEmploymentReadOnly){let e=await S({employment_slug:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),m?.(n=>({...n,showReserveInvoice:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(r.employmentId){let e=await g({employment_id:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"invited"}),m?.(n=>({...n,showInviteSuccessful:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){t?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),b=c&&r.employment?.status&&!r.isEmploymentReadOnly,p=R?.button;if(!p)throw new Error("Button component not found");return _(p,{...o,disabled:d.isPending||u.isPending||o.disabled,onClick:e=>{I(),o.onClick?.(e)},children:E({employmentStatus:b?"created_awaiting_reserve":"invited"})})}s(P,"OnboardingInvite");export{P as a};
2
+ //# sourceMappingURL=chunk-6QEF52IP.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-RYVRMH6C.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function g({onSubmit:l,onSuccess:u,onError:d}){let{contractorOnboardingBag:i}=a(),m=e(async t=>{try{let o=await i.parseFormValues(t);await l?.(o);let r=await i.onSubmit(t);if(r?.data){await u?.(r?.data),r?._skipNextStep||i?.next();return}}catch(o){let r=n(o,i.meta?.fields?.eligibility_questionnaire);d?.(r)}},"handleSubmit"),p=i.stepState.values?.eligibility_questionnaire||i.initialValues.eligibility_questionnaire;return b(s,{defaultValues:p,onSubmit:m})}e(g,"EligibilityQuestionnaireStep");export{g as a};
2
- //# sourceMappingURL=chunk-D7CBR52B.js.map
1
+ import{a as s}from"./chunk-WFZGKBFS.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function g({onSubmit:l,onSuccess:u,onError:d}){let{contractorOnboardingBag:i}=a(),m=e(async t=>{try{let o=await i.parseFormValues(t);await l?.(o);let r=await i.onSubmit(t);if(r?.data){await u?.(r?.data),r?._skipNextStep||i?.next();return}}catch(o){let r=n(o,i.meta?.fields?.eligibility_questionnaire);d?.(r)}},"handleSubmit"),p=i.stepState.values?.eligibility_questionnaire||i.initialValues.eligibility_questionnaire;return b(s,{defaultValues:p,onSubmit:m})}e(g,"EligibilityQuestionnaireStep");export{g as a};
2
+ //# sourceMappingURL=chunk-7BGANM2R.js.map
@@ -1,2 +1,2 @@
1
- import{a as n,b as i}from"./chunk-YUJBCOLO.js";import{a as e}from"./chunk-VIGKOVHP.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as r}from"react/jsx-runtime";var l=["You submit your termination request.","Remote reviews your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, Remote may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","Remote shares termination documents with the employee.","The employee signs the termination documents if required.","Remote processes the final salary and offboards the employee."],f=o(()=>r(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. Remote will lead communication with them after you submit this form and they finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. Remote will ask for the details regarding that communication and they'll take it from there."}),t(i,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:n.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:l.map((a,m)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},m))})]}),"TerminationDialogInfoContent");export{f as a};
2
- //# sourceMappingURL=chunk-CS5TJWQM.js.map
1
+ import{a as n,b as i}from"./chunk-G5O2CM6V.js";import{a as e}from"./chunk-VIGKOVHP.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as r}from"react/jsx-runtime";var l=["You submit your termination request.","Remote reviews your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, Remote may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","Remote shares termination documents with the employee.","The employee signs the termination documents if required.","Remote processes the final salary and offboards the employee."],f=o(()=>r(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. Remote will lead communication with them after you submit this form and they finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. Remote will ask for the details regarding that communication and they'll take it from there."}),t(i,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:n.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:l.map((a,m)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},m))})]}),"TerminationDialogInfoContent");export{f as a};
2
+ //# sourceMappingURL=chunk-7QXULBD7.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-OELREIVJ.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{f as t}from"./chunk-D5AO6SOM.js";import{b as s}from"./chunk-X6ZAR7ZL.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=t(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=s(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
2
- //# sourceMappingURL=chunk-WQVZXTW3.js.map
1
+ import{a as m}from"./chunk-RDYN6W2A.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{f as t}from"./chunk-D5AO6SOM.js";import{b as s}from"./chunk-X6ZAR7ZL.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=t(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=s(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
2
+ //# sourceMappingURL=chunk-7SO6WCYM.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-NAF6LRSS.js";import{C as c,I as m,M as C,R as d,m as l,v as u}from"./chunk-WQ4H5V7U.js";import{d as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as a,useQuery as r}from"@tanstack/react-query";var h=t(({includePremiumBenefits:e})=>{let{client:i}=o();return r({queryKey:["cost-calculator-countries",e],queryFn:t(()=>c({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(s=>s.data?.data.filter(n=>n.availability==="active").map(n=>({value:n.region_slug,label:n.name,childRegions:n.child_regions,hasAdditionalFields:n.has_additional_fields,regionSlug:n.region_slug,currency:n.currency.code})),"select")})},"useCostCalculatorCountries"),q=t(()=>{let{client:e}=o();return r({queryKey:["company-currencies"],queryFn:t(()=>d({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(s=>({value:s.slug,label:s.code})),"select")})},"useCompanyCurrencies"),x=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>l({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),P=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),v=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>C({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),S=t((e,{includePremiumBenefits:i,options:s})=>{let{client:n}=o();return r({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>m({client:n,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:f})=>{let y=f?.data?.schema||{};return p(y,void 0,s)},"select")})},"useRegionFields");export{h as a,q as b,x as c,P as d,v as e,S as f};
2
- //# sourceMappingURL=chunk-CHHHYLCB.js.map
1
+ import{a as p}from"./chunk-NAF6LRSS.js";import{C as c,I as m,M as C,R as d,m as l,v as u}from"./chunk-H2RAK6F7.js";import{d as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as a,useQuery as r}from"@tanstack/react-query";var h=t(({includePremiumBenefits:e})=>{let{client:i}=o();return r({queryKey:["cost-calculator-countries",e],queryFn:t(()=>c({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(s=>s.data?.data.filter(n=>n.availability==="active").map(n=>({value:n.region_slug,label:n.name,childRegions:n.child_regions,hasAdditionalFields:n.has_additional_fields,regionSlug:n.region_slug,currency:n.currency.code})),"select")})},"useCostCalculatorCountries"),q=t(()=>{let{client:e}=o();return r({queryKey:["company-currencies"],queryFn:t(()=>d({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(s=>({value:s.slug,label:s.code})),"select")})},"useCompanyCurrencies"),x=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>l({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),P=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),v=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>C({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),S=t((e,{includePremiumBenefits:i,options:s})=>{let{client:n}=o();return r({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>m({client:n,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:f})=>{let y=f?.data?.schema||{};return p(y,void 0,s)},"select")})},"useRegionFields");export{h as a,q as b,x as c,P as d,v as e,S as f};
2
+ //# sourceMappingURL=chunk-7V2QPZ2F.js.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-3C6N7DK6.js";import{a as c}from"./chunk-RYVRMH6C.js";import{b as s}from"./chunk-Q3ALCPJN.js";import{c as l}from"./chunk-AHRG5QCS.js";import{k as e}from"./chunk-VIGKOVHP.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as m,jsxs as g}from"react/jsx-runtime";function O({onSubmit:p,onSuccess:u,onError:S}){let{contractorOnboardingBag:r}=s(),C=a(async n=>{try{let t=await r.parseFormValues(n);await p?.(t);let o=await r.onSubmit(n);if(o?.data){await u?.(o?.data),r?.next();return}}catch(t){let o=e(t,r.meta?.fields?.contract_details);S?.(o)}},"handleSubmit"),f=r.stepState.values?.contract_details||r.initialValues.contract_details,i=r.stepState.values?.pricing_plan?.subscription,b=l(i);return g("div",{className:"space-y-4",children:[m(c,{defaultValues:f,onSubmit:C}),b&&m(d,{subscription:i})]})}a(O,"ContractDetailsStep");export{O as a};
2
- //# sourceMappingURL=chunk-T2KDFAAY.js.map
1
+ import{a as d}from"./chunk-3C6N7DK6.js";import{a as c}from"./chunk-WFZGKBFS.js";import{b as s}from"./chunk-Q3ALCPJN.js";import{c as l}from"./chunk-AHRG5QCS.js";import{k as e}from"./chunk-VIGKOVHP.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as m,jsxs as g}from"react/jsx-runtime";function O({onSubmit:p,onSuccess:u,onError:S}){let{contractorOnboardingBag:r}=s(),C=a(async n=>{try{let t=await r.parseFormValues(n);await p?.(t);let o=await r.onSubmit(n);if(o?.data){await u?.(o?.data),r?.next();return}}catch(t){let o=e(t,r.meta?.fields?.contract_details);S?.(o)}},"handleSubmit"),f=r.stepState.values?.contract_details||r.initialValues.contract_details,i=r.stepState.values?.pricing_plan?.subscription,b=l(i);return g("div",{className:"space-y-4",children:[m(c,{defaultValues:f,onSubmit:C}),b&&m(d,{subscription:i})]})}a(O,"ContractDetailsStep");export{O as a};
2
+ //# sourceMappingURL=chunk-ADTGWDQ7.js.map
@@ -1,2 +1,2 @@
1
- import{b as f}from"./chunk-MRYRNB7Y.js";import{b as l}from"./chunk-LNV36S6D.js";import{a as F}from"./chunk-QB6OI74K.js";import{f as s,h as a}from"./chunk-CWAFRJAQ.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as y}from"react";import{jsx as r}from"react/jsx-runtime";function A({defaultValues:u,fields:m,onSubmit:d}){let{formId:c,terminationBag:o}=f(),p=l(o.handleValidation),e=s({resolver:p,defaultValues:u,shouldUnregister:!1,mode:"onBlur"});y(()=>{let V=e?.watch(i=>{Object.keys(i).some(n=>i[n]!==o?.initialValues?.[n])&&o?.checkFieldUpdates(i)});return()=>V?.unsubscribe()},[]);let T=m||(o?.fields??[]);return r(a,{...e,children:r("form",{id:c,onSubmit:e.handleSubmit(d),className:"space-y-4 RemoteFlows__TerminationForm",children:r(F,{fields:T})})})}t(A,"TerminationForm");export{A as a};
2
- //# sourceMappingURL=chunk-XRN6752K.js.map
1
+ import{b as f}from"./chunk-MRYRNB7Y.js";import{b as l}from"./chunk-LNV36S6D.js";import{a as F}from"./chunk-BI4RFXFL.js";import{f as s,h as a}from"./chunk-CWAFRJAQ.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as y}from"react";import{jsx as r}from"react/jsx-runtime";function A({defaultValues:u,fields:m,onSubmit:d}){let{formId:c,terminationBag:o}=f(),p=l(o.handleValidation),e=s({resolver:p,defaultValues:u,shouldUnregister:!1,mode:"onBlur"});y(()=>{let V=e?.watch(i=>{Object.keys(i).some(n=>i[n]!==o?.initialValues?.[n])&&o?.checkFieldUpdates(i)});return()=>V?.unsubscribe()},[]);let T=m||(o?.fields??[]);return r(a,{...e,children:r("form",{id:c,onSubmit:e.handleSubmit(d),className:"space-y-4 RemoteFlows__TerminationForm",children:r(F,{fields:T})})})}t(A,"TerminationForm");export{A as a};
2
+ //# sourceMappingURL=chunk-AS77PXWM.js.map
@@ -1,2 +1,2 @@
1
- import{b as I}from"./chunk-TXSUZLOI.js";import{a as N}from"./chunk-A3LRPGV3.js";import{a as j,b as v,c as D,d as O}from"./chunk-RVADUHPA.js";import{e as p,f as F}from"./chunk-D5AO6SOM.js";import{h as R,i as b}from"./chunk-VIGKOVHP.js";import{a as C}from"./chunk-X6ZAR7ZL.js";import{a as k}from"./chunk-TSPDJUGG.js";import{a as c}from"./chunk-P37U34EQ.js";import{useMemo as S,useRef as ee,useState as A}from"react";var pe=c(({countryCode:L,options:u,initialValues:l})=>{let P=j(),g=v(),{mutateAsync:q}=C(P),{mutateAsync:J}=C(g),[y,U]=A(L||null),[f,B]=A(null),w=ee({company_basic_information:{},address_details:{}}),{fieldValues:V,stepState:a,setFieldValues:W,previousStep:z,nextStep:G,goToStep:H}=k(N),{companyBasicInformationForm:d,isLoading:K}=D({jsfModify:u?.jsfModify?.company_basic_information,queryOptions:{enabled:a.currentStep.name==="company_basic_information"}}),{data:s,isLoading:Q}=O({countryCode:y,fieldValues:a.currentStep.name==="address_details"?{...a.values?.address_details||{},...V}:a.values?.address_details||{},options:{...u,jsfModify:u?.jsfModify?.address_details,queryOptions:{enabled:a.currentStep.name==="address_details"&&!!y&&!!f}}}),i=S(()=>({company_basic_information:d?.fields||[],address_details:s?.fields||[]}),[d?.fields,s?.fields]),X={company_basic_information:null,address_details:s?.meta?.["x-jsf-fieldsets"]||null},h=S(()=>F(i.company_basic_information,{...l,country_code:y||l?.country_code||""}),[i.company_basic_information,y,l]),E=S(()=>F(i.address_details,l||{}),[i.address_details,l]),Y=S(()=>({company_basic_information:h,address_details:E}),[h,E]),Z=c(t=>{H(t)},"goTo"),M=c(async t=>{let r=a.currentStep.name,e=i[r];return d&&r==="company_basic_information"?await p(t,e,{isPartialValidation:!1}):s&&r==="address_details"?await p(t,e,{isPartialValidation:!1}):{}},"parseFormValues");async function $(t){let r=a.currentStep.name;r in w.current&&(w.current[r]=R(t,i[r]));let e=await M(t);switch(a.currentStep.name){case"company_basic_information":{if(U(e.country_code),f)return Promise.resolve({data:{countryCode:e.country_code??"",companyOwnerEmail:e.company_owner_email??"",companyOwnerName:e.company_owner_name??"",desiredCurrency:e.desired_currency??"",name:e.name??"",phoneNumber:e.phone_number??"",taxNumber:e.tax_number??""}});let x={country_code:e.country_code,company_owner_email:e.company_owner_email,company_owner_name:e.company_owner_name,desired_currency:e.desired_currency,name:e.name,phone_number:e.phone_number,tax_number:e.tax_number,terms_of_service_accepted_at:I()},n=await q(x);if(n.error)return Promise.resolve({data:null,error:n.error,rawError:n.rawError,fieldErrors:n.fieldErrors});let m=n.data?.data,_,o;if(m)if("data"in m&&m.data){let T=m.data.company;o=T,_=T?.id}else"company"in m&&(o=m.company,_=o?.id);return _&&B(_),Promise.resolve({data:{countryCode:o?.country_code??e.country_code??"",companyOwnerEmail:o?.company_owner_email??e.company_owner_email??"",companyOwnerName:o?.company_owner_name??e.company_owner_name??"",desiredCurrency:o?.desired_currency??e.desired_currency??"",name:o?.name??e.name??"",phoneNumber:o?.phone_number??e.phone_number??"",taxNumber:o?.tax_number??e.tax_number??""}})}case"address_details":{if(!f)throw b("Company ID is required to update address details");let n=await J({companyId:f,payload:{address_details:e},jsonSchemaVersion:u?.jsonSchemaVersion?.form_schema?.address_details});return n.error?Promise.resolve({data:null,error:n.error,rawError:n.rawError,fieldErrors:n.fieldErrors}):Promise.resolve({data:n.data})}default:throw b("Invalid step state")}}return c($,"onSubmit"),{isLoading:K||Q,isSubmitting:P.isPending||g.isPending,fieldValues:V,stepState:a,checkFieldUpdates:W,back:z,next:G,goTo:Z,onSubmit:$,fields:i[a.currentStep.name],meta:{fields:w.current,fieldsets:X[a.currentStep.name]},parseFormValues:M,handleValidation:c(async t=>{if(a.currentStep.name==="company_basic_information"&&d){let r=await p(t,d.fields,{isPartialValidation:!1});return d.handleValidation(r)}if(a.currentStep.name==="address_details"&&s){let r=await p(t,s.fields,{isPartialValidation:!1});return s.handleValidation(r)}return null},"handleValidation"),initialValues:Y}},"useCreateCompany");export{pe as a};
2
- //# sourceMappingURL=chunk-BK44KHBJ.js.map
1
+ import{b as I}from"./chunk-TXSUZLOI.js";import{a as N}from"./chunk-A3LRPGV3.js";import{a as j,b as v,c as D,d as O}from"./chunk-JF3KLAB5.js";import{e as p,f as F}from"./chunk-D5AO6SOM.js";import{h as R,i as b}from"./chunk-VIGKOVHP.js";import{a as C}from"./chunk-X6ZAR7ZL.js";import{a as k}from"./chunk-TSPDJUGG.js";import{a as c}from"./chunk-P37U34EQ.js";import{useMemo as S,useRef as ee,useState as A}from"react";var pe=c(({countryCode:L,options:u,initialValues:l})=>{let P=j(),g=v(),{mutateAsync:q}=C(P),{mutateAsync:J}=C(g),[y,U]=A(L||null),[f,B]=A(null),w=ee({company_basic_information:{},address_details:{}}),{fieldValues:V,stepState:a,setFieldValues:W,previousStep:z,nextStep:G,goToStep:H}=k(N),{companyBasicInformationForm:d,isLoading:K}=D({jsfModify:u?.jsfModify?.company_basic_information,queryOptions:{enabled:a.currentStep.name==="company_basic_information"}}),{data:s,isLoading:Q}=O({countryCode:y,fieldValues:a.currentStep.name==="address_details"?{...a.values?.address_details||{},...V}:a.values?.address_details||{},options:{...u,jsfModify:u?.jsfModify?.address_details,queryOptions:{enabled:a.currentStep.name==="address_details"&&!!y&&!!f}}}),i=S(()=>({company_basic_information:d?.fields||[],address_details:s?.fields||[]}),[d?.fields,s?.fields]),X={company_basic_information:null,address_details:s?.meta?.["x-jsf-fieldsets"]||null},h=S(()=>F(i.company_basic_information,{...l,country_code:y||l?.country_code||""}),[i.company_basic_information,y,l]),E=S(()=>F(i.address_details,l||{}),[i.address_details,l]),Y=S(()=>({company_basic_information:h,address_details:E}),[h,E]),Z=c(t=>{H(t)},"goTo"),M=c(async t=>{let r=a.currentStep.name,e=i[r];return d&&r==="company_basic_information"?await p(t,e,{isPartialValidation:!1}):s&&r==="address_details"?await p(t,e,{isPartialValidation:!1}):{}},"parseFormValues");async function $(t){let r=a.currentStep.name;r in w.current&&(w.current[r]=R(t,i[r]));let e=await M(t);switch(a.currentStep.name){case"company_basic_information":{if(U(e.country_code),f)return Promise.resolve({data:{countryCode:e.country_code??"",companyOwnerEmail:e.company_owner_email??"",companyOwnerName:e.company_owner_name??"",desiredCurrency:e.desired_currency??"",name:e.name??"",phoneNumber:e.phone_number??"",taxNumber:e.tax_number??""}});let x={country_code:e.country_code,company_owner_email:e.company_owner_email,company_owner_name:e.company_owner_name,desired_currency:e.desired_currency,name:e.name,phone_number:e.phone_number,tax_number:e.tax_number,terms_of_service_accepted_at:I()},n=await q(x);if(n.error)return Promise.resolve({data:null,error:n.error,rawError:n.rawError,fieldErrors:n.fieldErrors});let m=n.data?.data,_,o;if(m)if("data"in m&&m.data){let T=m.data.company;o=T,_=T?.id}else"company"in m&&(o=m.company,_=o?.id);return _&&B(_),Promise.resolve({data:{countryCode:o?.country_code??e.country_code??"",companyOwnerEmail:o?.company_owner_email??e.company_owner_email??"",companyOwnerName:o?.company_owner_name??e.company_owner_name??"",desiredCurrency:o?.desired_currency??e.desired_currency??"",name:o?.name??e.name??"",phoneNumber:o?.phone_number??e.phone_number??"",taxNumber:o?.tax_number??e.tax_number??""}})}case"address_details":{if(!f)throw b("Company ID is required to update address details");let n=await J({companyId:f,payload:{address_details:e},jsonSchemaVersion:u?.jsonSchemaVersion?.form_schema?.address_details});return n.error?Promise.resolve({data:null,error:n.error,rawError:n.rawError,fieldErrors:n.fieldErrors}):Promise.resolve({data:n.data})}default:throw b("Invalid step state")}}return c($,"onSubmit"),{isLoading:K||Q,isSubmitting:P.isPending||g.isPending,fieldValues:V,stepState:a,checkFieldUpdates:W,back:z,next:G,goTo:Z,onSubmit:$,fields:i[a.currentStep.name],meta:{fields:w.current,fieldsets:X[a.currentStep.name]},parseFormValues:M,handleValidation:c(async t=>{if(a.currentStep.name==="company_basic_information"&&d){let r=await p(t,d.fields,{isPartialValidation:!1});return d.handleValidation(r)}if(a.currentStep.name==="address_details"&&s){let r=await p(t,s.fields,{isPartialValidation:!1});return s.handleValidation(r)}return null},"handleValidation"),initialValues:Y}},"useCreateCompany");export{pe as a};
2
+ //# sourceMappingURL=chunk-B4E43MXD.js.map
@@ -1,2 +1,2 @@
1
- import{a as h,b as x,c as u}from"./chunk-VU6C3EU2.js";import{a as F}from"./chunk-SNECOPBD.js";import{g as P,j as W}from"./chunk-D5AO6SOM.js";import{c as g}from"./chunk-CWAFRJAQ.js";import{a as c}from"./chunk-P37U34EQ.js";import{Fragment as V}from"react";import a from"lodash.omit";var C={...h,fieldset:u,"fieldset-flat":u};import{Fragment as S,jsx as n,jsxs as y}from"react/jsx-runtime";var A=c(({fields:p,fieldsets:d,fieldValues:i,components:m})=>{let{setValue:J}=g();if(!p||p.length===0)return null;let f=d&&i?P({fields:p,fieldsets:d,values:i}):p,r=c((e,l,o)=>l.WrapperComponent?n(l.WrapperComponent,{children:e},o):n(V,{children:e},o),"wrapWithCustomWrapper");return n(S,{children:f.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(i,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(W(e)){let t=a(e,"WrapperComponent");return r(n(x,{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(y(S,{children:[n(t,{setValue:T=>J(e.name,T),...R}),e.statement?n(F,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)}let o=e.type,s=C[o];if(!s)return y("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(y(S,{children:[n(s,{...k,component:m&&m[o]}),e.statement?n(F,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)})})},"JSONSchemaFormFields");export{A as a};
2
- //# sourceMappingURL=chunk-QB6OI74K.js.map
1
+ import{a as h,b as x,c as u}from"./chunk-XGRFWXUU.js";import{a as F}from"./chunk-SNECOPBD.js";import{g as P,j as W}from"./chunk-D5AO6SOM.js";import{c as g}from"./chunk-CWAFRJAQ.js";import{a as c}from"./chunk-P37U34EQ.js";import{Fragment as V}from"react";import a from"lodash.omit";var C={...h,fieldset:u,"fieldset-flat":u};import{Fragment as S,jsx as n,jsxs as y}from"react/jsx-runtime";var A=c(({fields:p,fieldsets:d,fieldValues:i,components:m})=>{let{setValue:J}=g();if(!p||p.length===0)return null;let f=d&&i?P({fields:p,fieldsets:d,values:i}):p,r=c((e,l,o)=>l.WrapperComponent?n(l.WrapperComponent,{children:e},o):n(V,{children:e},o),"wrapWithCustomWrapper");return n(S,{children:f.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(i,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(W(e)){let t=a(e,"WrapperComponent");return r(n(x,{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(y(S,{children:[n(t,{setValue:T=>J(e.name,T),...R}),e.statement?n(F,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)}let o=e.type,s=C[o];if(!s)return y("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(y(S,{children:[n(s,{...k,component:m&&m[o]}),e.statement?n(F,{...e.statement}):null,e.extra?e.extra:null]}),e,e.name)})})},"JSONSchemaFormFields");export{A as a};
2
+ //# sourceMappingURL=chunk-BI4RFXFL.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-RYVRMH6C.js";import{b as n}from"./chunk-Q3ALCPJN.js";import{k as i}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function P({onSubmit:d,onSuccess:m,onError:p}){let{contractorOnboardingBag:r}=n(),l=e(async a=>{try{let t=await r.parseFormValues(a);await d?.(t);let o=await r.onSubmit(a);if(o?.data){await m?.(o?.data),r?.next();return}}catch(t){let o=i(t,r.meta?.fields?.contract_preview);p?.(o)}},"handleSubmit"),u=r.stepState.values?.contract_preview||r.initialValues.contract_preview;return c("div",{className:"space-y-4",children:c(s,{defaultValues:u,onSubmit:l})})}e(P,"ContractPreviewStep");export{P as a};
2
- //# sourceMappingURL=chunk-VFB3RR5I.js.map
1
+ import{a as s}from"./chunk-WFZGKBFS.js";import{b as n}from"./chunk-Q3ALCPJN.js";import{k as i}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function P({onSubmit:d,onSuccess:m,onError:p}){let{contractorOnboardingBag:r}=n(),l=e(async a=>{try{let t=await r.parseFormValues(a);await d?.(t);let o=await r.onSubmit(a);if(o?.data){await m?.(o?.data),r?.next();return}}catch(t){let o=i(t,r.meta?.fields?.contract_preview);p?.(o)}},"handleSubmit"),u=r.stepState.values?.contract_preview||r.initialValues.contract_preview;return c("div",{className:"space-y-4",children:c(s,{defaultValues:u,onSubmit:l})})}e(P,"ContractPreviewStep");export{P as a};
2
+ //# sourceMappingURL=chunk-BZAO32QW.js.map
@@ -1,2 +1,2 @@
1
- import{K as e}from"./chunk-WQ4H5V7U.js";import{a as t}from"./chunk-P37U34EQ.js";import{queryOptions as i}from"@tanstack/react-query";var a=t((o,n="default")=>i({queryKey:["countries",n],retry:!1,queryFn:t(async()=>{let r=await e({client:o,headers:{Authorization:""}});if(r.error||!r.data)throw new Error("Failed to fetch supported countries");return r},"queryFn")}),"countriesOptions");export{a};
2
- //# sourceMappingURL=chunk-O6H66UM2.js.map
1
+ import{K as e}from"./chunk-H2RAK6F7.js";import{a as t}from"./chunk-P37U34EQ.js";import{queryOptions as i}from"@tanstack/react-query";var a=t((o,n="default")=>i({queryKey:["countries",n],retry:!1,queryFn:t(async()=>{let r=await e({client:o,headers:{Authorization:""}});if(r.error||!r.data)throw new Error("Failed to fetch supported countries");return r},"queryFn")}),"countriesOptions");export{a};
2
+ //# sourceMappingURL=chunk-C32W6TCT.js.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-YUJBCOLO.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as t}from"react/jsx-runtime";function p({helpCenter:r}){return!r||!r.id||!r.callToAction?null:t(o,{zendeskId:r.id,children:r.callToAction})}e(p,"HelpCenter");export{p as a};
2
- //# sourceMappingURL=chunk-T4QDKI7V.js.map
1
+ import{b as o}from"./chunk-G5O2CM6V.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as t}from"react/jsx-runtime";function p({helpCenter:r}){return!r||!r.id||!r.callToAction?null:t(o,{zendeskId:r.id,children:r.callToAction})}e(p,"HelpCenter");export{p as a};
2
+ //# sourceMappingURL=chunk-C4MRFGQG.js.map
@@ -1,2 +1,2 @@
1
- import{a as V,b as J,c as j,e as D}from"./chunk-H5QXOIKS.js";import{f as q}from"./chunk-G3HUFVSG.js";import{a as te}from"./chunk-O6H66UM2.js";import{a as ae}from"./chunk-QB6OI74K.js";import{a as P,c as E,d as M,e as I,f as _}from"./chunk-DXIJUMLU.js";import{f as X,g as R,h as Q}from"./chunk-CWAFRJAQ.js";import{a as S}from"./chunk-VIGKOVHP.js";import{d as ee}from"./chunk-KQPDXXG3.js";import{a as c}from"./chunk-P37U34EQ.js";import*as A from"@radix-ui/react-collapsible";var be=A.Root,fe=A.CollapsibleTrigger,ge=A.CollapsibleContent;import*as F from"@radix-ui/react-tabs";import{jsx as H}from"react/jsx-runtime";function G({className:e,...t}){return H(F.Root,{"data-slot":"tabs",className:S("flex flex-col gap-2",e),...t})}c(G,"Tabs");function Y({className:e,...t}){return H(F.List,{"data-slot":"tabs-list",className:S("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1",e),...t})}c(Y,"TabsList");function W({className:e,...t}){return H(F.Trigger,{"data-slot":"tabs-trigger",className:S("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),...t})}c(W,"TabsTrigger");function ye({className:e,...t}){return H(F.Content,{"data-slot":"tabs-content",className:S("flex-1 outline-none",e),...t})}c(ye,"TabsContent");import*as K from"react";import*as x from"@radix-ui/react-scroll-area";import{jsx as k,jsxs as he}from"react/jsx-runtime";var le=K.forwardRef(({className:e,children:t,...s},a)=>he(x.Root,{ref:a,className:S("relative overflow-hidden",e),...s,children:[k(x.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),k(se,{}),k(x.Corner,{})]}));le.displayName=x.Root.displayName;var se=K.forwardRef(({className:e,orientation:t="vertical",...s},a)=>k(x.ScrollAreaScrollbar,{ref:a,orientation:t,className:S("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...s,children:k(x.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));se.displayName=x.ScrollAreaScrollbar.displayName;import{useState as B,useEffect as Ce,useMemo as Fe}from"react";import{useQuery as we}from"@tanstack/react-query";import O from"lodash.isequal";var ne=c(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=c((e,t)=>{if(O(e,t))return;let s=new Map((e||[]).map(l=>[l.value,l])),a=new Map((t||[]).map(l=>[l.value,l])),o=[],y=[],f=[];if(a.forEach((l,v)=>{s.has(v)||o.push({value:l.value,label:l.label})}),s.forEach((l,v)=>{if(!a.has(v))y.push({value:l.value,label:l.label});else{let r=a.get(v);if(!O(l,r)){let p={};l.label!==r.label&&(p.label={old:l.label,new:r.label}),Object.keys(p).length>0&&f.push({value:v,changes:p})}}}),!(o.length===0&&y.length===0&&f.length===0))return{added:o,removed:y,modified:f}},"compareOptions"),xe=c((e,t)=>{let s=e.fields,a=t.fields;if(!s&&!a)return;let o=U(s||[],a||[]);if(o.added.length>0||o.removed.length>0||o.modified.length>0||o.reordered.length>0)return Array.from(o.fieldDiffs.values())},"compareNestedFields"),re=c((e,t,s,a)=>{if(s!==a)return!0;let o={label:e.label!==t.label,required:e.required!==t.required,inputType:e.inputType!==t.inputType,type:e.type!==t.type,jsonType:!O(e.jsonType,t.jsonType),name:e.name!==t.name,defaultValue:e.defaultValue!==t.defaultValue,minDate:e.minDate!==t.minDate,maxDate:e.maxDate!==t.maxDate,maxLength:e.maxLength!==t.maxLength,multiple:e.multiple!==t.multiple,isVisible:e.isVisible!==t.isVisible,options:!O(e.options,t.options)},y=(()=>{let l=e.fields,v=t.fields;if(!l&&!v)return!1;if(!l||!v)return!0;let r=U(l,v);return r.added.length>0||r.removed.length>0||r.modified.length>0||r.reordered.length>0})();return Object.values(o).some(l=>l)||y},"isFieldModified"),Ne=c((e,t)=>{let s={};e.label!==t.label&&(s.label={old:e.label,new:t.label}),e.required!==t.required&&(s.required={old:e.required,new:t.required}),e.type!==t.type&&(s.type={old:e.type,new:t.type}),e.inputType!==t.inputType&&(s.inputType={old:e.inputType,new:t.inputType}),O(e.jsonType,t.jsonType)||(s.jsonType={old:e.jsonType,new:t.jsonType}),O(e.defaultValue,t.defaultValue)||(s.defaultValue={old:e.defaultValue,new:t.defaultValue}),e.minDate!==t.minDate&&(s.minDate={old:e.minDate||"",new:t.minDate||""}),e.maxDate!==t.maxDate&&(s.maxDate={old:e.maxDate||"",new:t.maxDate||""}),e.maxLength!==t.maxLength&&(s.maxLength={old:e.maxLength||0,new:t.maxLength||0}),e.multiple!==t.multiple&&(s.multiple={old:e.multiple||!1,new:t.multiple||!1}),e.isVisible!==t.isVisible&&(s.isVisible={old:e.isVisible,new:t.isVisible});let a=Le(e.options,t.options);a&&(s.options=a);let o=xe(e,t);return o&&(s.nestedFields=o),Object.keys(s).length>0?s:void 0},"getFieldChanges"),U=c((e=[],t=[])=>{let s=e.filter(ne),a=t.filter(ne),o=new Map(s.map((b,u)=>[b.name,{field:b,index:u}])),y=new Map(a.map((b,u)=>[b.name,{field:b,index:u}])),f=[],l=[],v=[],r=[],p=[],h=new Map;return y.forEach((b,u)=>{o.has(u)||(f.push(u),h.set(u,{fieldName:u,diffType:"added"}))}),o.forEach(({field:b,index:u},g)=>{if(!y.has(g))l.push(g),h.set(g,{fieldName:g,diffType:"removed"});else{let{field:T,index:N}=y.get(g);re(b,T,u,N)?u!==N&&!re(b,T,u,u)?(p.push(g),h.set(g,{fieldName:g,diffType:"unchanged",orderChanged:{oldIndex:u,newIndex:N}})):(v.push(g),h.set(g,{fieldName:g,diffType:"modified",orderChanged:u!==N?{oldIndex:u,newIndex:N}:void 0,changes:Ne(b,T)})):(r.push(g),h.set(g,{fieldName:g,diffType:"unchanged"}))}}),{added:f,removed:l,modified:v,unchanged:r,reordered:p,fieldDiffs:h}},"compareFormFields"),oe=c((e,t)=>{if(t&&e==="unchanged")return"bg-blue-50 border-l-4 border-blue-500";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";case"unchanged":default:return""}},"getDiffStyles");import{useMemo as de,useRef as $,useEffect as Se}from"react";import{jsx as n,jsxs as m}from"react/jsx-runtime";var Te=c(({children:e,diffType:t,orderChanged:s,changes:a})=>{let o=oe(t,!!s);if(t==="unchanged"&&!s)return n("div",{children:e});let l=s&&t==="unchanged"&&n("span",{className:"text-xs font-semibold text-blue-700 bg-blue-100 px-2 py-1 rounded",children:"MOVED"})||t!=="unchanged"&&{added:n("span",{className:"text-xs font-semibold text-green-700 bg-green-100 px-2 py-1 rounded",children:"NEW"}),removed:n("span",{className:"text-xs font-semibold text-red-700 bg-red-100 px-2 py-1 rounded",children:"REMOVED"}),modified:n("span",{className:"text-xs font-semibold text-yellow-700 bg-yellow-100 px-2 py-1 rounded",children:"MODIFIED"})}[t],v=c(()=>{if(!a||t!=="modified")return null;let r=[];if(a.label&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Label:"})," ",n("span",{className:"line-through text-red-600",children:a.label.old})," ","\u2192 ",n("span",{className:"text-green-600",children:a.label.new})]},"label")),a.required&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Required:"})," ",n("span",{className:"line-through text-red-600",children:a.required.old?"Yes":"No"})," ","\u2192"," ",n("span",{className:"text-green-600",children:a.required.new?"Yes":"No"})]},"required")),a.type&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Type:"})," ",n("span",{className:"line-through text-red-600",children:a.type.old})," ","\u2192 ",n("span",{className:"text-green-600",children:a.type.new})]},"type")),a.inputType&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Input Type:"})," ",n("span",{className:"line-through text-red-600",children:a.inputType.old})," ","\u2192 ",n("span",{className:"text-green-600",children:a.inputType.new})]},"inputType")),a.jsonType){let p=Array.isArray(a.jsonType.old)?a.jsonType.old.join(" | "):a.jsonType.old,h=Array.isArray(a.jsonType.new)?a.jsonType.new.join(" | "):a.jsonType.new;r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"JSON Type:"})," ",n("span",{className:"line-through text-red-600",children:p})," \u2192"," ",n("span",{className:"text-green-600",children:h})]},"jsonType"))}return a.defaultValue!==void 0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Default Value:"})," ",n("span",{className:"line-through text-red-600",children:JSON.stringify(a.defaultValue.old)})," ","\u2192"," ",n("span",{className:"text-green-600",children:JSON.stringify(a.defaultValue.new)})]},"defaultValue")),a.options&&(a.options.added.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold text-green-700",children:"Options Added:"})," ",a.options.added.map(p=>p.label).join(", ")]},"options-added")),a.options.removed.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold text-red-700",children:"Options Removed:"})," ",a.options.removed.map(p=>p.label).join(", ")]},"options-removed")),a.options.modified.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Options Modified:"})," ",a.options.modified.length," option(s)"]},"options-modified"))),a.nestedFields&&a.nestedFields.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Nested Fields:"})," ",a.nestedFields.length," field(s) changed"]},"nestedFields")),r.length===0?null:m("div",{className:"mt-2 p-2 bg-yellow-50 rounded border border-yellow-200 space-y-1",children:[n("div",{className:"text-xs font-semibold text-yellow-800 mb-1",children:"Changes:"}),r]})},"renderChanges");return m("div",{className:`p-3 mb-2 rounded ${o} relative`,children:[m("div",{className:"absolute top-2 right-2",children:[l,s&&t!=="unchanged"&&n("span",{className:"ml-2 text-xs text-gray-600",children:"(position changed)"})]}),e,v()]})},"FieldWrapper"),ie=c(({version:e,fields:t,fieldsets:s,diffMap:a,title:o,scrollRef:y})=>{let f=X({mode:"onBlur"}),l=de(()=>t.map(v=>{let r=a.get(v.name),p=r?.diffType||"unchanged",h=r?.orderChanged,b=r?.changes;return{...v,WrapperComponent:c(({children:u})=>n(Te,{diffType:p,fieldName:v.name,orderChanged:h,changes:b,children:u}),"WrapperComponent")}}),[t,a]);return m(V,{className:"h-full",children:[n(J,{children:m(j,{children:[o," - Version ",e]})}),n(D,{ref:y,className:"overflow-y-auto max-h-[600px]",children:n(Q,{...f,children:n("form",{className:"space-y-4",children:n(ae,{fields:l,fieldsets:s,fieldValues:{}})})})})]})},"FormPanel"),ue=c(({topVersion:e,bottomVersion:t,topFields:s,bottomFields:a,topFieldsets:o,bottomFieldsets:y,isLoading:f})=>{let l=de(()=>U(s,a),[s,a]),v=$(null),r=$(null),p=$(!1);if(Se(()=>{let b=v.current,u=r.current;if(!b||!u)return;let g=c(()=>{p.current||(p.current=!0,u.scrollTop=b.scrollTop,requestAnimationFrame(()=>{p.current=!1}))},"handleLeftScroll"),T=c(()=>{p.current||(p.current=!0,b.scrollTop=u.scrollTop,requestAnimationFrame(()=>{p.current=!1}))},"handleRightScroll");return b.addEventListener("scroll",g),u.addEventListener("scroll",T),()=>{b.removeEventListener("scroll",g),u.removeEventListener("scroll",T)}},[s,a]),f)return n("div",{className:"flex items-center justify-center h-96",children:m("div",{className:"text-center",children:[n("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto"}),n("p",{className:"mt-4 text-gray-600",children:"Loading schemas..."})]})});let h=l.added.length===0&&l.removed.length===0&&l.modified.length===0&&l.reordered.length===0;return m("div",{className:"space-y-6",children:[n(V,{children:n(D,{className:"pt-6",children:h?n("p",{className:"text-center text-gray-600",children:"No differences detected between the two versions"}):m("div",{className:"flex gap-6 justify-center",children:[l.added.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-green-500 rounded"}),m("span",{className:"text-sm",children:[l.added.length," field",l.added.length>1?"s":""," ","added"]})]}),l.removed.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-red-500 rounded"}),m("span",{className:"text-sm",children:[l.removed.length," field",l.removed.length>1?"s":""," removed"]})]}),l.modified.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-yellow-500 rounded"}),m("span",{className:"text-sm",children:[l.modified.length," field",l.modified.length>1?"s":""," modified"]})]}),l.reordered.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-blue-500 rounded"}),m("span",{className:"text-sm",children:[l.reordered.length," field",l.reordered.length>1?"s":""," reordered"]})]})]})})}),m("div",{className:"grid grid-cols-2 gap-6",children:[n(ie,{version:e,fields:s,fieldsets:o,diffMap:l.fieldDiffs,title:"Left",scrollRef:v}),n(ie,{version:t,fields:a,fieldsets:y,diffMap:l.fieldDiffs,title:"Right",scrollRef:r})]})]})},"SchemaFormComparison");var me=[{value:1,label:"v1 (Legacy)"},{value:3,label:"v3 (Recommended)"},{value:"latest",label:"Latest"}],z={ALB:[{value:"latest",label:"Latest"}],ARE:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],ARG:[{value:"latest",label:"Latest"}],ARM:[{value:"latest",label:"Latest"}],AUS:[{value:"latest",label:"Latest"}],AUT:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],BEL:[{value:"latest",label:"Latest"}],BGD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],BGR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],BIH:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],BLR:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],BOL:[{value:"latest",label:"Latest"}],BRA:[{value:"latest",label:"Latest"}],CAN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],CHE:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],CHL:[{value:"latest",label:"Latest"}],CHN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],COL:[{value:"latest",label:"Latest"}],CRI:[{value:"latest",label:"Latest"}],CYP:[{value:"latest",label:"Latest"}],CZE:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],DEU:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],DNK:[{value:"latest",label:"Latest"}],DOM:[{value:"latest",label:"Latest"}],ECU:[{value:"latest",label:"Latest"}],EGY:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],ESP:[{value:"latest",label:"Latest"}],EST:[{value:"latest",label:"Latest"}],FIN:[{value:"latest",label:"Latest"}],FRA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],FRA_SAS:[{value:"latest",label:"Latest"}],GBR:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],GEO:[{value:"latest",label:"Latest"}],GRC:[{value:"latest",label:"Latest"}],GTM:[{value:"latest",label:"Latest"}],HKG:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],HND:[{value:"latest",label:"Latest"}],HRV:[{value:"latest",label:"Latest"}],HUN:[{value:"latest",label:"Latest"}],IDN:[{value:"latest",label:"Latest"}],IND:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],IRL:[{value:"latest",label:"Latest"}],ISL:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],ISR:[{value:"latest",label:"Latest"}],ITA:[{value:"latest",label:"Latest"}],ITA_APL:[{value:"latest",label:"Latest"}],JAM:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],JPN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],KEN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],KGZ:[{value:"latest",label:"Latest"}],KHM:[{value:"latest",label:"Latest"}],KOR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],LBN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],LKA:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],LTU:[{value:"latest",label:"Latest"}],LUX:[{value:"latest",label:"Latest"}],LVA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],MAR:[{value:"latest",label:"Latest"}],MDA:[{value:"latest",label:"Latest"}],MEX:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],MKD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],MLT:[{value:"latest",label:"Latest"}],MNG:[{value:"latest",label:"Latest"}],MUS:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],MYS:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],NGA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],NIC:[{value:"latest",label:"Latest"}],NLD:[{value:"latest",label:"Latest"}],NOR:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],NZL:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],PAK:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],PAN:[{value:"latest",label:"Latest"}],PER:[{value:"latest",label:"Latest"}],PHL:[{value:"latest",label:"Latest"}],POL:[{value:"latest",label:"Latest"}],PRI:[{value:"latest",label:"Latest"}],PRT:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],PRY:[{value:"latest",label:"Latest"}],ROU:[{value:"latest",label:"Latest"}],SAU:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],SGP:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],SLV:[{value:"latest",label:"Latest"}],SRB:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],SVK:[{value:"latest",label:"Latest"}],SVN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],SWE:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],THA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],TUN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],TUR:[{value:"latest",label:"Latest"}],TWN:[{value:"latest",label:"Latest"}],UGA:[{value:"latest",label:"Latest"}],UKR:[{value:"latest",label:"Latest"}],URY:[{value:"latest",label:"Latest"}],USA:[{value:"latest",label:"Latest"}],VNM:[{value:"latest",label:"Latest"}],XKX:[{value:"latest",label:"Latest"}],ZAF:[{value:"latest",label:"Latest"}],ZWE:[{value:"latest",label:"Latest"}]},pe=Object.fromEntries(Object.entries(z).filter(([,e])=>e.length>1)),ce=[{value:"employment_basic_information",label:"Basic Information"},{value:"contract_details",label:"Contract Details"}];import{jsx as i,jsxs as L}from"react/jsx-runtime";var ve=c(()=>{let[e,t]=B("employment_basic_information"),[s,a]=B(1),[o,y]=B(1),[f,l]=B("ARE"),{client:v}=ee(),{data:r}=we({...te(v,"schema-comparison"),select:c(d=>d.data?.data?.filter(C=>C.eor_onboarding).filter(C=>Object.keys(pe).includes(C.code)).map(C=>({label:C.name,value:C.code}))||[],"select")}),p=e==="contract_details",{data:h,isLoading:b}=q({countryCode:f,form:e,fieldValues:{},jsonSchemaVersion:s,options:{queryOptions:{enabled:!0}}}),{data:u,isLoading:g}=q({countryCode:f,form:e,fieldValues:{},jsonSchemaVersion:o,options:{queryOptions:{enabled:!0}}}),T=b||g,N=z[f],Z=N!==void 0,w=Fe(()=>e==="employment_basic_information"?me:N||[{value:"latest",label:"Latest"}],[e,N]);return Ce(()=>{let d=w.map(C=>C.value);d.includes(s)||a(w[0].value),d.includes(o)||y(w[0].value)},[e,f,w,s,o]),L("div",{className:"space-y-6",children:[L(V,{children:[i(J,{children:i(j,{children:"Configuration"})}),L(D,{className:"space-y-4",children:[L("div",{children:[i(R,{className:"mb-2 block",children:"Form Type"}),i(G,{value:e,onValueChange:d=>t(d),children:i(Y,{className:"grid w-full grid-cols-2",children:ce.map(d=>i(W,{value:d.value,children:d.label},d.value))})})]}),p&&!Z&&i("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-200",children:L("div",{className:"flex",children:[i("div",{className:"flex-shrink-0",children:i("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:i("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"})})}),L("div",{className:"ml-3",children:[i("h3",{className:"text-sm font-medium text-yellow-800",children:"Version mappings not found"}),i("div",{className:"mt-2 text-sm text-yellow-700",children:L("p",{children:["Country"," ",i("span",{className:"font-semibold",children:f})," is not configured in COUNTRY_CONTRACT_VERSIONS. Using default (latest only)."]})})]})]})}),p&&L("div",{children:[i(R,{htmlFor:"country-select",className:"mb-2 block",children:"Country"}),L(P,{value:f,onValueChange:l,children:[i(M,{id:"country-select",children:i(E,{placeholder:"Select a country"})}),i(I,{children:r?.map(d=>i(_,{value:d.value,children:d.label},d.value))})]})]}),L("div",{className:"grid grid-cols-2 gap-4",children:[L("div",{children:[i(R,{htmlFor:"top-version",className:"mb-2 block",children:"Left Version"}),L(P,{value:String(s),onValueChange:d=>a(d==="latest"?"latest":Number(d)),children:[i(M,{id:"top-version",children:i(E,{placeholder:"Select version"})}),i(I,{children:w.map(d=>i(_,{value:String(d.value),children:d.label},String(d.value)))})]})]}),L("div",{children:[i(R,{htmlFor:"bottom-version",className:"mb-2 block",children:"Right Version"}),L(P,{value:String(o),onValueChange:d=>y(d==="latest"?"latest":Number(d)),children:[i(M,{id:"bottom-version",children:i(E,{placeholder:"Select version"})}),i(I,{children:w.map(d=>i(_,{value:String(d.value),children:d.label},String(d.value)))})]})]})]})]})]}),i(ue,{topVersion:s,bottomVersion:o,topFields:h?.fields||[],bottomFields:u?.fields||[],topFieldsets:h?.meta?.["x-jsf-fieldsets"],bottomFieldsets:u?.meta?.["x-jsf-fieldsets"],isLoading:T})]})},"JsonSchemaComparison");export{be as a,fe as b,ge as c,G as d,Y as e,W as f,ye as g,le as h,ve as i};
2
- //# sourceMappingURL=chunk-5CFU6XTU.js.map
1
+ import{a as V,b as J,c as j,e as D}from"./chunk-H5QXOIKS.js";import{f as q}from"./chunk-UMLRTS3B.js";import{a as te}from"./chunk-C32W6TCT.js";import{a as ae}from"./chunk-BI4RFXFL.js";import{a as P,c as E,d as M,e as I,f as _}from"./chunk-DXIJUMLU.js";import{f as X,g as R,h as Q}from"./chunk-CWAFRJAQ.js";import{a as S}from"./chunk-VIGKOVHP.js";import{d as ee}from"./chunk-KQPDXXG3.js";import{a as c}from"./chunk-P37U34EQ.js";import*as A from"@radix-ui/react-collapsible";var be=A.Root,fe=A.CollapsibleTrigger,ge=A.CollapsibleContent;import*as F from"@radix-ui/react-tabs";import{jsx as H}from"react/jsx-runtime";function G({className:e,...t}){return H(F.Root,{"data-slot":"tabs",className:S("flex flex-col gap-2",e),...t})}c(G,"Tabs");function Y({className:e,...t}){return H(F.List,{"data-slot":"tabs-list",className:S("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1",e),...t})}c(Y,"TabsList");function W({className:e,...t}){return H(F.Trigger,{"data-slot":"tabs-trigger",className:S("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),...t})}c(W,"TabsTrigger");function ye({className:e,...t}){return H(F.Content,{"data-slot":"tabs-content",className:S("flex-1 outline-none",e),...t})}c(ye,"TabsContent");import*as K from"react";import*as x from"@radix-ui/react-scroll-area";import{jsx as k,jsxs as he}from"react/jsx-runtime";var le=K.forwardRef(({className:e,children:t,...s},a)=>he(x.Root,{ref:a,className:S("relative overflow-hidden",e),...s,children:[k(x.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),k(se,{}),k(x.Corner,{})]}));le.displayName=x.Root.displayName;var se=K.forwardRef(({className:e,orientation:t="vertical",...s},a)=>k(x.ScrollAreaScrollbar,{ref:a,orientation:t,className:S("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...s,children:k(x.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));se.displayName=x.ScrollAreaScrollbar.displayName;import{useState as B,useEffect as Ce,useMemo as Fe}from"react";import{useQuery as we}from"@tanstack/react-query";import O from"lodash.isequal";var ne=c(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=c((e,t)=>{if(O(e,t))return;let s=new Map((e||[]).map(l=>[l.value,l])),a=new Map((t||[]).map(l=>[l.value,l])),o=[],y=[],f=[];if(a.forEach((l,v)=>{s.has(v)||o.push({value:l.value,label:l.label})}),s.forEach((l,v)=>{if(!a.has(v))y.push({value:l.value,label:l.label});else{let r=a.get(v);if(!O(l,r)){let p={};l.label!==r.label&&(p.label={old:l.label,new:r.label}),Object.keys(p).length>0&&f.push({value:v,changes:p})}}}),!(o.length===0&&y.length===0&&f.length===0))return{added:o,removed:y,modified:f}},"compareOptions"),xe=c((e,t)=>{let s=e.fields,a=t.fields;if(!s&&!a)return;let o=U(s||[],a||[]);if(o.added.length>0||o.removed.length>0||o.modified.length>0||o.reordered.length>0)return Array.from(o.fieldDiffs.values())},"compareNestedFields"),re=c((e,t,s,a)=>{if(s!==a)return!0;let o={label:e.label!==t.label,required:e.required!==t.required,inputType:e.inputType!==t.inputType,type:e.type!==t.type,jsonType:!O(e.jsonType,t.jsonType),name:e.name!==t.name,defaultValue:e.defaultValue!==t.defaultValue,minDate:e.minDate!==t.minDate,maxDate:e.maxDate!==t.maxDate,maxLength:e.maxLength!==t.maxLength,multiple:e.multiple!==t.multiple,isVisible:e.isVisible!==t.isVisible,options:!O(e.options,t.options)},y=(()=>{let l=e.fields,v=t.fields;if(!l&&!v)return!1;if(!l||!v)return!0;let r=U(l,v);return r.added.length>0||r.removed.length>0||r.modified.length>0||r.reordered.length>0})();return Object.values(o).some(l=>l)||y},"isFieldModified"),Ne=c((e,t)=>{let s={};e.label!==t.label&&(s.label={old:e.label,new:t.label}),e.required!==t.required&&(s.required={old:e.required,new:t.required}),e.type!==t.type&&(s.type={old:e.type,new:t.type}),e.inputType!==t.inputType&&(s.inputType={old:e.inputType,new:t.inputType}),O(e.jsonType,t.jsonType)||(s.jsonType={old:e.jsonType,new:t.jsonType}),O(e.defaultValue,t.defaultValue)||(s.defaultValue={old:e.defaultValue,new:t.defaultValue}),e.minDate!==t.minDate&&(s.minDate={old:e.minDate||"",new:t.minDate||""}),e.maxDate!==t.maxDate&&(s.maxDate={old:e.maxDate||"",new:t.maxDate||""}),e.maxLength!==t.maxLength&&(s.maxLength={old:e.maxLength||0,new:t.maxLength||0}),e.multiple!==t.multiple&&(s.multiple={old:e.multiple||!1,new:t.multiple||!1}),e.isVisible!==t.isVisible&&(s.isVisible={old:e.isVisible,new:t.isVisible});let a=Le(e.options,t.options);a&&(s.options=a);let o=xe(e,t);return o&&(s.nestedFields=o),Object.keys(s).length>0?s:void 0},"getFieldChanges"),U=c((e=[],t=[])=>{let s=e.filter(ne),a=t.filter(ne),o=new Map(s.map((b,u)=>[b.name,{field:b,index:u}])),y=new Map(a.map((b,u)=>[b.name,{field:b,index:u}])),f=[],l=[],v=[],r=[],p=[],h=new Map;return y.forEach((b,u)=>{o.has(u)||(f.push(u),h.set(u,{fieldName:u,diffType:"added"}))}),o.forEach(({field:b,index:u},g)=>{if(!y.has(g))l.push(g),h.set(g,{fieldName:g,diffType:"removed"});else{let{field:T,index:N}=y.get(g);re(b,T,u,N)?u!==N&&!re(b,T,u,u)?(p.push(g),h.set(g,{fieldName:g,diffType:"unchanged",orderChanged:{oldIndex:u,newIndex:N}})):(v.push(g),h.set(g,{fieldName:g,diffType:"modified",orderChanged:u!==N?{oldIndex:u,newIndex:N}:void 0,changes:Ne(b,T)})):(r.push(g),h.set(g,{fieldName:g,diffType:"unchanged"}))}}),{added:f,removed:l,modified:v,unchanged:r,reordered:p,fieldDiffs:h}},"compareFormFields"),oe=c((e,t)=>{if(t&&e==="unchanged")return"bg-blue-50 border-l-4 border-blue-500";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";case"unchanged":default:return""}},"getDiffStyles");import{useMemo as de,useRef as $,useEffect as Se}from"react";import{jsx as n,jsxs as m}from"react/jsx-runtime";var Te=c(({children:e,diffType:t,orderChanged:s,changes:a})=>{let o=oe(t,!!s);if(t==="unchanged"&&!s)return n("div",{children:e});let l=s&&t==="unchanged"&&n("span",{className:"text-xs font-semibold text-blue-700 bg-blue-100 px-2 py-1 rounded",children:"MOVED"})||t!=="unchanged"&&{added:n("span",{className:"text-xs font-semibold text-green-700 bg-green-100 px-2 py-1 rounded",children:"NEW"}),removed:n("span",{className:"text-xs font-semibold text-red-700 bg-red-100 px-2 py-1 rounded",children:"REMOVED"}),modified:n("span",{className:"text-xs font-semibold text-yellow-700 bg-yellow-100 px-2 py-1 rounded",children:"MODIFIED"})}[t],v=c(()=>{if(!a||t!=="modified")return null;let r=[];if(a.label&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Label:"})," ",n("span",{className:"line-through text-red-600",children:a.label.old})," ","\u2192 ",n("span",{className:"text-green-600",children:a.label.new})]},"label")),a.required&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Required:"})," ",n("span",{className:"line-through text-red-600",children:a.required.old?"Yes":"No"})," ","\u2192"," ",n("span",{className:"text-green-600",children:a.required.new?"Yes":"No"})]},"required")),a.type&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Type:"})," ",n("span",{className:"line-through text-red-600",children:a.type.old})," ","\u2192 ",n("span",{className:"text-green-600",children:a.type.new})]},"type")),a.inputType&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Input Type:"})," ",n("span",{className:"line-through text-red-600",children:a.inputType.old})," ","\u2192 ",n("span",{className:"text-green-600",children:a.inputType.new})]},"inputType")),a.jsonType){let p=Array.isArray(a.jsonType.old)?a.jsonType.old.join(" | "):a.jsonType.old,h=Array.isArray(a.jsonType.new)?a.jsonType.new.join(" | "):a.jsonType.new;r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"JSON Type:"})," ",n("span",{className:"line-through text-red-600",children:p})," \u2192"," ",n("span",{className:"text-green-600",children:h})]},"jsonType"))}return a.defaultValue!==void 0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Default Value:"})," ",n("span",{className:"line-through text-red-600",children:JSON.stringify(a.defaultValue.old)})," ","\u2192"," ",n("span",{className:"text-green-600",children:JSON.stringify(a.defaultValue.new)})]},"defaultValue")),a.options&&(a.options.added.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold text-green-700",children:"Options Added:"})," ",a.options.added.map(p=>p.label).join(", ")]},"options-added")),a.options.removed.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold text-red-700",children:"Options Removed:"})," ",a.options.removed.map(p=>p.label).join(", ")]},"options-removed")),a.options.modified.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Options Modified:"})," ",a.options.modified.length," option(s)"]},"options-modified"))),a.nestedFields&&a.nestedFields.length>0&&r.push(m("div",{className:"text-xs",children:[n("span",{className:"font-semibold",children:"Nested Fields:"})," ",a.nestedFields.length," field(s) changed"]},"nestedFields")),r.length===0?null:m("div",{className:"mt-2 p-2 bg-yellow-50 rounded border border-yellow-200 space-y-1",children:[n("div",{className:"text-xs font-semibold text-yellow-800 mb-1",children:"Changes:"}),r]})},"renderChanges");return m("div",{className:`p-3 mb-2 rounded ${o} relative`,children:[m("div",{className:"absolute top-2 right-2",children:[l,s&&t!=="unchanged"&&n("span",{className:"ml-2 text-xs text-gray-600",children:"(position changed)"})]}),e,v()]})},"FieldWrapper"),ie=c(({version:e,fields:t,fieldsets:s,diffMap:a,title:o,scrollRef:y})=>{let f=X({mode:"onBlur"}),l=de(()=>t.map(v=>{let r=a.get(v.name),p=r?.diffType||"unchanged",h=r?.orderChanged,b=r?.changes;return{...v,WrapperComponent:c(({children:u})=>n(Te,{diffType:p,fieldName:v.name,orderChanged:h,changes:b,children:u}),"WrapperComponent")}}),[t,a]);return m(V,{className:"h-full",children:[n(J,{children:m(j,{children:[o," - Version ",e]})}),n(D,{ref:y,className:"overflow-y-auto max-h-[600px]",children:n(Q,{...f,children:n("form",{className:"space-y-4",children:n(ae,{fields:l,fieldsets:s,fieldValues:{}})})})})]})},"FormPanel"),ue=c(({topVersion:e,bottomVersion:t,topFields:s,bottomFields:a,topFieldsets:o,bottomFieldsets:y,isLoading:f})=>{let l=de(()=>U(s,a),[s,a]),v=$(null),r=$(null),p=$(!1);if(Se(()=>{let b=v.current,u=r.current;if(!b||!u)return;let g=c(()=>{p.current||(p.current=!0,u.scrollTop=b.scrollTop,requestAnimationFrame(()=>{p.current=!1}))},"handleLeftScroll"),T=c(()=>{p.current||(p.current=!0,b.scrollTop=u.scrollTop,requestAnimationFrame(()=>{p.current=!1}))},"handleRightScroll");return b.addEventListener("scroll",g),u.addEventListener("scroll",T),()=>{b.removeEventListener("scroll",g),u.removeEventListener("scroll",T)}},[s,a]),f)return n("div",{className:"flex items-center justify-center h-96",children:m("div",{className:"text-center",children:[n("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto"}),n("p",{className:"mt-4 text-gray-600",children:"Loading schemas..."})]})});let h=l.added.length===0&&l.removed.length===0&&l.modified.length===0&&l.reordered.length===0;return m("div",{className:"space-y-6",children:[n(V,{children:n(D,{className:"pt-6",children:h?n("p",{className:"text-center text-gray-600",children:"No differences detected between the two versions"}):m("div",{className:"flex gap-6 justify-center",children:[l.added.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-green-500 rounded"}),m("span",{className:"text-sm",children:[l.added.length," field",l.added.length>1?"s":""," ","added"]})]}),l.removed.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-red-500 rounded"}),m("span",{className:"text-sm",children:[l.removed.length," field",l.removed.length>1?"s":""," removed"]})]}),l.modified.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-yellow-500 rounded"}),m("span",{className:"text-sm",children:[l.modified.length," field",l.modified.length>1?"s":""," modified"]})]}),l.reordered.length>0&&m("div",{className:"flex items-center gap-2",children:[n("span",{className:"w-4 h-4 bg-blue-500 rounded"}),m("span",{className:"text-sm",children:[l.reordered.length," field",l.reordered.length>1?"s":""," reordered"]})]})]})})}),m("div",{className:"grid grid-cols-2 gap-6",children:[n(ie,{version:e,fields:s,fieldsets:o,diffMap:l.fieldDiffs,title:"Left",scrollRef:v}),n(ie,{version:t,fields:a,fieldsets:y,diffMap:l.fieldDiffs,title:"Right",scrollRef:r})]})]})},"SchemaFormComparison");var me=[{value:1,label:"v1 (Legacy)"},{value:3,label:"v3 (Recommended)"},{value:"latest",label:"Latest"}],z={ALB:[{value:"latest",label:"Latest"}],ARE:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],ARG:[{value:"latest",label:"Latest"}],ARM:[{value:"latest",label:"Latest"}],AUS:[{value:"latest",label:"Latest"}],AUT:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],BEL:[{value:"latest",label:"Latest"}],BGD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],BGR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],BIH:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],BLR:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],BOL:[{value:"latest",label:"Latest"}],BRA:[{value:"latest",label:"Latest"}],CAN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],CHE:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],CHL:[{value:"latest",label:"Latest"}],CHN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],COL:[{value:"latest",label:"Latest"}],CRI:[{value:"latest",label:"Latest"}],CYP:[{value:"latest",label:"Latest"}],CZE:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],DEU:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],DNK:[{value:"latest",label:"Latest"}],DOM:[{value:"latest",label:"Latest"}],ECU:[{value:"latest",label:"Latest"}],EGY:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],ESP:[{value:"latest",label:"Latest"}],EST:[{value:"latest",label:"Latest"}],FIN:[{value:"latest",label:"Latest"}],FRA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],FRA_SAS:[{value:"latest",label:"Latest"}],GBR:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],GEO:[{value:"latest",label:"Latest"}],GRC:[{value:"latest",label:"Latest"}],GTM:[{value:"latest",label:"Latest"}],HKG:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],HND:[{value:"latest",label:"Latest"}],HRV:[{value:"latest",label:"Latest"}],HUN:[{value:"latest",label:"Latest"}],IDN:[{value:"latest",label:"Latest"}],IND:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],IRL:[{value:"latest",label:"Latest"}],ISL:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],ISR:[{value:"latest",label:"Latest"}],ITA:[{value:"latest",label:"Latest"}],ITA_APL:[{value:"latest",label:"Latest"}],JAM:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],JPN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],KEN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],KGZ:[{value:"latest",label:"Latest"}],KHM:[{value:"latest",label:"Latest"}],KOR:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],LBN:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],LKA:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],LTU:[{value:"latest",label:"Latest"}],LUX:[{value:"latest",label:"Latest"}],LVA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],MAR:[{value:"latest",label:"Latest"}],MDA:[{value:"latest",label:"Latest"}],MEX:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],MKD:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],MLT:[{value:"latest",label:"Latest"}],MNG:[{value:"latest",label:"Latest"}],MUS:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],MYS:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],NGA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],NIC:[{value:"latest",label:"Latest"}],NLD:[{value:"latest",label:"Latest"}],NOR:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],NZL:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],PAK:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],PAN:[{value:"latest",label:"Latest"}],PER:[{value:"latest",label:"Latest"}],PHL:[{value:"latest",label:"Latest"}],POL:[{value:"latest",label:"Latest"}],PRI:[{value:"latest",label:"Latest"}],PRT:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],PRY:[{value:"latest",label:"Latest"}],ROU:[{value:"latest",label:"Latest"}],SAU:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],SGP:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],SLV:[{value:"latest",label:"Latest"}],SRB:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],SVK:[{value:"latest",label:"Latest"}],SVN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],SWE:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],THA:[{value:1,label:"v1"},{value:"latest",label:"Latest"}],TUN:[{value:1,label:"v1"},{value:2,label:"v2"},{value:"latest",label:"Latest"}],TUR:[{value:"latest",label:"Latest"}],TWN:[{value:"latest",label:"Latest"}],UGA:[{value:"latest",label:"Latest"}],UKR:[{value:"latest",label:"Latest"}],URY:[{value:"latest",label:"Latest"}],USA:[{value:"latest",label:"Latest"}],VNM:[{value:"latest",label:"Latest"}],XKX:[{value:"latest",label:"Latest"}],ZAF:[{value:"latest",label:"Latest"}],ZWE:[{value:"latest",label:"Latest"}]},pe=Object.fromEntries(Object.entries(z).filter(([,e])=>e.length>1)),ce=[{value:"employment_basic_information",label:"Basic Information"},{value:"contract_details",label:"Contract Details"}];import{jsx as i,jsxs as L}from"react/jsx-runtime";var ve=c(()=>{let[e,t]=B("employment_basic_information"),[s,a]=B(1),[o,y]=B(1),[f,l]=B("ARE"),{client:v}=ee(),{data:r}=we({...te(v,"schema-comparison"),select:c(d=>d.data?.data?.filter(C=>C.eor_onboarding).filter(C=>Object.keys(pe).includes(C.code)).map(C=>({label:C.name,value:C.code}))||[],"select")}),p=e==="contract_details",{data:h,isLoading:b}=q({countryCode:f,form:e,fieldValues:{},jsonSchemaVersion:s,options:{queryOptions:{enabled:!0}}}),{data:u,isLoading:g}=q({countryCode:f,form:e,fieldValues:{},jsonSchemaVersion:o,options:{queryOptions:{enabled:!0}}}),T=b||g,N=z[f],Z=N!==void 0,w=Fe(()=>e==="employment_basic_information"?me:N||[{value:"latest",label:"Latest"}],[e,N]);return Ce(()=>{let d=w.map(C=>C.value);d.includes(s)||a(w[0].value),d.includes(o)||y(w[0].value)},[e,f,w,s,o]),L("div",{className:"space-y-6",children:[L(V,{children:[i(J,{children:i(j,{children:"Configuration"})}),L(D,{className:"space-y-4",children:[L("div",{children:[i(R,{className:"mb-2 block",children:"Form Type"}),i(G,{value:e,onValueChange:d=>t(d),children:i(Y,{className:"grid w-full grid-cols-2",children:ce.map(d=>i(W,{value:d.value,children:d.label},d.value))})})]}),p&&!Z&&i("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-200",children:L("div",{className:"flex",children:[i("div",{className:"flex-shrink-0",children:i("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:i("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"})})}),L("div",{className:"ml-3",children:[i("h3",{className:"text-sm font-medium text-yellow-800",children:"Version mappings not found"}),i("div",{className:"mt-2 text-sm text-yellow-700",children:L("p",{children:["Country"," ",i("span",{className:"font-semibold",children:f})," is not configured in COUNTRY_CONTRACT_VERSIONS. Using default (latest only)."]})})]})]})}),p&&L("div",{children:[i(R,{htmlFor:"country-select",className:"mb-2 block",children:"Country"}),L(P,{value:f,onValueChange:l,children:[i(M,{id:"country-select",children:i(E,{placeholder:"Select a country"})}),i(I,{children:r?.map(d=>i(_,{value:d.value,children:d.label},d.value))})]})]}),L("div",{className:"grid grid-cols-2 gap-4",children:[L("div",{children:[i(R,{htmlFor:"top-version",className:"mb-2 block",children:"Left Version"}),L(P,{value:String(s),onValueChange:d=>a(d==="latest"?"latest":Number(d)),children:[i(M,{id:"top-version",children:i(E,{placeholder:"Select version"})}),i(I,{children:w.map(d=>i(_,{value:String(d.value),children:d.label},String(d.value)))})]})]}),L("div",{children:[i(R,{htmlFor:"bottom-version",className:"mb-2 block",children:"Right Version"}),L(P,{value:String(o),onValueChange:d=>y(d==="latest"?"latest":Number(d)),children:[i(M,{id:"bottom-version",children:i(E,{placeholder:"Select version"})}),i(I,{children:w.map(d=>i(_,{value:String(d.value),children:d.label},String(d.value)))})]})]})]})]})]}),i(ue,{topVersion:s,bottomVersion:o,topFields:h?.fields||[],bottomFields:u?.fields||[],topFieldsets:h?.meta?.["x-jsf-fieldsets"],bottomFieldsets:u?.meta?.["x-jsf-fieldsets"],isLoading:T})]})},"JsonSchemaComparison");export{be as a,fe as b,ge as c,G as d,Y as e,W as f,ye as g,le as h,ve as i};
2
+ //# sourceMappingURL=chunk-DZXU45AS.js.map
@@ -1,2 +1,2 @@
1
- import{a as m,f as u}from"./chunk-VIGKOVHP.js";import{k as g}from"./chunk-WQ4H5V7U.js";import{b as f,d as b}from"./chunk-KQPDXXG3.js";import{a as e}from"./chunk-P37U34EQ.js";var P={disclaimerCostCalculator:4668194326797,engagingContractors:43161434169613,employeeOnboardingTimeline:4411262104589,extraPayments:4466822781709,internationalPricing:4410698586893,pricingPlanOptions:43161720465421,ir35Status:42810224523917,remoteFxRate:33271144977421,terminationEmployeeCommunication:4411585179661,terminationNoticePeriods:5831900985613,involuntaryOffboardingServiceCharge:4406932229133,reconciliationInvoice:17604014808589},l=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL");import{useQuery as y}from"@tanstack/react-query";var k=e((r,t)=>{let{client:i}=b();return y({queryKey:["zendesk-article",r],queryFn:e(async()=>{let n=await g({client:i,path:{id:Number(r)}});if(n.error)throw new Error(n.error.message||"Failed to fetch article");return n},"queryFn"),select:e(n=>{let o=n.data?.data.help_center_article;return o&&{...o,body:u(o.body||"")}},"select"),retry:!1,...t})},"useZendeskArticle");import{jsx as R}from"react/jsx-runtime";var C=e(({Trigger:r,zendeskId:t,open:i,onClose:n})=>{let{components:o}=f(),c=l(t),s=e(()=>{n?.()},"handleClose"),{data:a,isLoading:h,error:w}=k(t,{enabled:i}),p=o?.zendeskDrawer;if(!p)throw new Error("Zendesk drawer component not found");return R(p,{open:i,onClose:s,data:a,isLoading:h,error:w,zendeskURL:c,Trigger:r})},"ZendeskDrawer");import{useState as x}from"react";import{jsx as d}from"react/jsx-runtime";var Z="RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block text-xs bg-transparent border-none cursor-pointer p-0";function Q({zendeskId:r,className:t,onClick:i,children:n,external:o=!1}){let[c,s]=x(!1),a=e(()=>{o||s(!0),i?.(r)},"handleClick");return o?d("a",{href:l(r),target:"_blank",rel:"noopener noreferrer",onClick:a,className:m(Z,t),children:n}):d(C,{zendeskId:r,open:c,onClose:()=>s(!1),Trigger:d("button",{onClick:a,className:m(Z,t),children:n})})}e(Q,"ZendeskTriggerButton");export{P as a,Q as b};
2
- //# sourceMappingURL=chunk-YUJBCOLO.js.map
1
+ import{a as m,f as u}from"./chunk-VIGKOVHP.js";import{k as g}from"./chunk-H2RAK6F7.js";import{b as f,d as b}from"./chunk-KQPDXXG3.js";import{a as e}from"./chunk-P37U34EQ.js";var P={disclaimerCostCalculator:4668194326797,engagingContractors:43161434169613,employeeOnboardingTimeline:4411262104589,extraPayments:4466822781709,internationalPricing:4410698586893,pricingPlanOptions:43161720465421,ir35Status:42810224523917,remoteFxRate:33271144977421,terminationEmployeeCommunication:4411585179661,terminationNoticePeriods:5831900985613,involuntaryOffboardingServiceCharge:4406932229133,reconciliationInvoice:17604014808589},l=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL");import{useQuery as y}from"@tanstack/react-query";var k=e((r,t)=>{let{client:i}=b();return y({queryKey:["zendesk-article",r],queryFn:e(async()=>{let n=await g({client:i,path:{id:Number(r)}});if(n.error)throw new Error(n.error.message||"Failed to fetch article");return n},"queryFn"),select:e(n=>{let o=n.data?.data.help_center_article;return o&&{...o,body:u(o.body||"")}},"select"),retry:!1,...t})},"useZendeskArticle");import{jsx as R}from"react/jsx-runtime";var C=e(({Trigger:r,zendeskId:t,open:i,onClose:n})=>{let{components:o}=f(),c=l(t),s=e(()=>{n?.()},"handleClose"),{data:a,isLoading:h,error:w}=k(t,{enabled:i}),p=o?.zendeskDrawer;if(!p)throw new Error("Zendesk drawer component not found");return R(p,{open:i,onClose:s,data:a,isLoading:h,error:w,zendeskURL:c,Trigger:r})},"ZendeskDrawer");import{useState as x}from"react";import{jsx as d}from"react/jsx-runtime";var Z="RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block text-xs bg-transparent border-none cursor-pointer p-0";function Q({zendeskId:r,className:t,onClick:i,children:n,external:o=!1}){let[c,s]=x(!1),a=e(()=>{o||s(!0),i?.(r)},"handleClick");return o?d("a",{href:l(r),target:"_blank",rel:"noopener noreferrer",onClick:a,className:m(Z,t),children:n}):d(C,{zendeskId:r,open:c,onClose:()=>s(!1),Trigger:d("button",{onClick:a,className:m(Z,t),children:n})})}e(Q,"ZendeskTriggerButton");export{P as a,Q as b};
2
+ //# sourceMappingURL=chunk-G5O2CM6V.js.map
@@ -1,2 +1,2 @@
1
- import{a as R,b as x,c as N,d as A}from"./chunk-AYC6DTFV.js";import{a as C}from"./chunk-H5QXOIKS.js";import{b as B}from"./chunk-MP3VDCI7.js";import{a as w,b as f}from"./chunk-YUJBCOLO.js";import{a as i,b as t,e as F}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-P37U34EQ.js";import{MoreHorizontal as P}from"lucide-react";import{useState as U}from"react";import{Fragment as $,jsx as g,jsxs as T}from"react/jsx-runtime";function E({actions:e=[],className:n,label:a,"data-testid":l}){let[_,d]=U(!1);return T("div",{className:i("relative",n),children:[g(B,{"data-testid":l,variant:"ghost","aria-label":a,className:"h-8 w-8 p-0",onClick:()=>d(!_),children:g(P,{className:"h-4 w-4"})}),_&&T($,{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(E,"ActionsDropdown");import{ChevronDown as O,Info as Z}from"lucide-react";import K from"react-flagpack";import{useState as z}from"react";import{jsx as j,jsxs as L}from"react/jsx-runtime";var I=m(({children:e,content:n})=>L("div",{className:"relative inline-block group",children:[e,L("div",{className:"absolute bottom-full right-0 mb-2 px-3 py-2 bg-gray-900 text-white text-xs rounded-md opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 w-64 whitespace-normal break-words",children:[n,j("div",{className:"absolute top-full right-3 border-4 border-transparent border-t-gray-900"})]})]}),"BasicTooltip");import{Fragment as b,jsx as o,jsxs as r}from"react/jsx-runtime";var V={GB:"GB-UKM"},Y=m(({title:e,country:n,region:a,annualGrossSalary:l,onDelete:_,onExportPdf:d,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:d},{label:"Delete",onClick:_}];return r("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[r("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(K,{code:V[n.alpha_2_code]||n.alpha_2_code})}),r("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}),r("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[n.name," ",a?` (${a.name})`:""]}),r("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(E,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),q=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 J({minimumOnboardingDays:e,data:n,className:a}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:r(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:r("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&&r("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),r(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:n.steps.map(l=>r("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),r("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[n.helpText,n.zendeskArticleId&&o(f,{zendeskId:n.zendeskArticleId,children:"Learn more"})]})]})]})})}m(J,"OnboardingTimeline");function Q({className:e,countryBenefitsUrl:n,countryGuideUrl:a,country:l}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:r(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:r("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),o(A,{children:r("div",{className:"flex flex-col gap-1",children:[a&&o("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),n&&o("a",{href:n,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}m(Q,"HiringSection");function W({isMultipleCurrency:e,className:n}){return r("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",n),children:[o("span",{"aria-hidden":!0}),e?r(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):r(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}m(W,"EstimationHeaders");function S({label:e,amounts:n,className:a,children:l}){let[_,d]=z(!0);return r("div",{className:i("RemoteFlows__EstimationResults__Row",a),children:[r("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[r("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(O,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(n)?n.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):r(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:n})]})]}),_&&l&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:l})]})}m(S,"EstimationRow");function X({item:e,isMultipleCurrency:n,level:a=0}){let[l,_]=z(!1),d=e.children&&e.children.length>0,c=a>0,u=e.isCollapsible||d;return r("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[r("div",{className:i(n?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[r("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?r("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(O,{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(I,{content:r(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(Z,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),n?r(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(h,{items:e.children,isMultipleCurrency:n,level:a+1})})]})}m(X,"BreakdownListItem");function h({items:e,isMultipleCurrency:n,className:a,level:l}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",a),children:e.map((_,d)=>o(X,{item:_,isMultipleCurrency:n,level:l},d))})}m(h,"BreakdownList");var Re=m(({estimation:e,title:n,components:a,onDelete:l,onExportPdf:_,onEdit:d})=>{let c=a?.HiringSection||Q,u=a?.OnboardingTimeline||J,H=a?.Header||Y,v=a?.Footer,D=q(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,k=e.employer_currency_costs.monthly_management_fee,M=e.region.code!==e.country.code,G=t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code);return r(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(H,{title:n,annualGrossSalary:G,region:M?e.region:void 0,country:e.country,onDelete:l,onExportPdf:_,onEdit:d})}),r("div",{className:"RemoteFlows__Separator",children:[o(W,{isMultipleCurrency:p,className:"mb-3"}),o(S,{label:"Monthly total cost",amounts:p?[t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross monthly salary",regionalAmount:t(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Monthly fee",regionalAmount:t(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(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(S,{label:"Annual total cost",amounts:p?[t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.code)},{label:"Mandatory employer costs",regionalAmount:t(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Annual fee",regionalAmount:t(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(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:D})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),v&&o(v,{})]})},"EstimationResults");export{Re as a};
2
- //# sourceMappingURL=chunk-HYDNZQOV.js.map
1
+ import{a as R,b as x,c as N,d as A}from"./chunk-AYC6DTFV.js";import{a as C}from"./chunk-H5QXOIKS.js";import{b as B}from"./chunk-MP3VDCI7.js";import{a as w,b as f}from"./chunk-G5O2CM6V.js";import{a as i,b as t,e as F}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-P37U34EQ.js";import{MoreHorizontal as P}from"lucide-react";import{useState as U}from"react";import{Fragment as $,jsx as g,jsxs as T}from"react/jsx-runtime";function E({actions:e=[],className:n,label:a,"data-testid":l}){let[_,d]=U(!1);return T("div",{className:i("relative",n),children:[g(B,{"data-testid":l,variant:"ghost","aria-label":a,className:"h-8 w-8 p-0",onClick:()=>d(!_),children:g(P,{className:"h-4 w-4"})}),_&&T($,{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(E,"ActionsDropdown");import{ChevronDown as O,Info as Z}from"lucide-react";import K from"react-flagpack";import{useState as z}from"react";import{jsx as j,jsxs as L}from"react/jsx-runtime";var I=m(({children:e,content:n})=>L("div",{className:"relative inline-block group",children:[e,L("div",{className:"absolute bottom-full right-0 mb-2 px-3 py-2 bg-gray-900 text-white text-xs rounded-md opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 w-64 whitespace-normal break-words",children:[n,j("div",{className:"absolute top-full right-3 border-4 border-transparent border-t-gray-900"})]})]}),"BasicTooltip");import{Fragment as b,jsx as o,jsxs as r}from"react/jsx-runtime";var V={GB:"GB-UKM"},Y=m(({title:e,country:n,region:a,annualGrossSalary:l,onDelete:_,onExportPdf:d,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:d},{label:"Delete",onClick:_}];return r("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[r("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(K,{code:V[n.alpha_2_code]||n.alpha_2_code})}),r("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}),r("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[n.name," ",a?` (${a.name})`:""]}),r("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(E,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),q=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 J({minimumOnboardingDays:e,data:n,className:a}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:r(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:r("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&&r("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),r(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:n.steps.map(l=>r("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),r("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[n.helpText,n.zendeskArticleId&&o(f,{zendeskId:n.zendeskArticleId,children:"Learn more"})]})]})]})})}m(J,"OnboardingTimeline");function Q({className:e,countryBenefitsUrl:n,countryGuideUrl:a,country:l}){return o(R,{collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:r(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:r("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),o(A,{children:r("div",{className:"flex flex-col gap-1",children:[a&&o("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),n&&o("a",{href:n,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}m(Q,"HiringSection");function W({isMultipleCurrency:e,className:n}){return r("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",n),children:[o("span",{"aria-hidden":!0}),e?r(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):r(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}m(W,"EstimationHeaders");function S({label:e,amounts:n,className:a,children:l}){let[_,d]=z(!0);return r("div",{className:i("RemoteFlows__EstimationResults__Row",a),children:[r("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[r("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(O,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(n)?n.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):r(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:n})]})]}),_&&l&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:l})]})}m(S,"EstimationRow");function X({item:e,isMultipleCurrency:n,level:a=0}){let[l,_]=z(!1),d=e.children&&e.children.length>0,c=a>0,u=e.isCollapsible||d;return r("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[r("div",{className:i(n?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[r("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?r("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(O,{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(I,{content:r(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(Z,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),n?r(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(h,{items:e.children,isMultipleCurrency:n,level:a+1})})]})}m(X,"BreakdownListItem");function h({items:e,isMultipleCurrency:n,className:a,level:l}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",a),children:e.map((_,d)=>o(X,{item:_,isMultipleCurrency:n,level:l},d))})}m(h,"BreakdownList");var Re=m(({estimation:e,title:n,components:a,onDelete:l,onExportPdf:_,onEdit:d})=>{let c=a?.HiringSection||Q,u=a?.OnboardingTimeline||J,H=a?.Header||Y,v=a?.Footer,D=q(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,k=e.employer_currency_costs.monthly_management_fee,M=e.region.code!==e.country.code,G=t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code);return r(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(H,{title:n,annualGrossSalary:G,region:M?e.region:void 0,country:e.country,onDelete:l,onExportPdf:_,onEdit:d})}),r("div",{className:"RemoteFlows__Separator",children:[o(W,{isMultipleCurrency:p,className:"mb-3"}),o(S,{label:"Monthly total cost",amounts:p?[t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross monthly salary",regionalAmount:t(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Monthly fee",regionalAmount:t(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(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(S,{label:"Annual total cost",amounts:p?[t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.code)},{label:"Mandatory employer costs",regionalAmount:t(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.code),employerAmount:t(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:t(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Annual fee",regionalAmount:t(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(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:D})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),v&&o(v,{})]})},"EstimationResults");export{Re as a};
2
+ //# sourceMappingURL=chunk-GOTY4N6S.js.map