@remoteoss/remote-flows 0.27.0 → 0.28.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 (175) hide show
  1. package/dist/{chunk-ZIPHLBX4.js → chunk-2FKEF3OG.js} +2 -2
  2. package/dist/{chunk-UTBVLDKY.js → chunk-2RZ65777.js} +2 -2
  3. package/dist/{chunk-N3EIN72T.js → chunk-53KVZ4BP.js} +2 -2
  4. package/dist/{chunk-PFT7KJ65.js → chunk-57XKXW6I.js} +2 -2
  5. package/dist/{chunk-XP7UEI56.js → chunk-5MYWJJBQ.js} +2 -2
  6. package/dist/{chunk-RINDVT6U.js → chunk-6IZ6XHVO.js} +2 -2
  7. package/dist/{chunk-4ZGIL6OE.js → chunk-6KIQIVKA.js} +2 -2
  8. package/dist/{chunk-WZAWPSKS.js → chunk-6LJRRFK2.js} +2 -2
  9. package/dist/{chunk-HFI2MD3H.js → chunk-7ELDXUJJ.js} +2 -2
  10. package/dist/{chunk-DZ67OJVF.js → chunk-7LZVUOMP.js} +2 -2
  11. package/dist/{chunk-SB3IYODL.js → chunk-AODV6HT2.js} +2 -2
  12. package/dist/{chunk-LRNSFLHR.js → chunk-AUZWLETL.js} +2 -2
  13. package/dist/{chunk-R64X3EJF.js → chunk-AWDGLK2T.js} +2 -2
  14. package/dist/{chunk-YXWBSRKS.js → chunk-C67CG4QZ.js} +2 -2
  15. package/dist/{chunk-UFBTCHEI.js → chunk-C6B3CVSL.js} +2 -2
  16. package/dist/chunk-DB7ITLRX.js +2 -0
  17. package/dist/chunk-DB7ITLRX.js.map +1 -0
  18. package/dist/{chunk-BMDZJNJV.js → chunk-FHHVVAXP.js} +2 -2
  19. package/dist/{chunk-AYLYOLVG.js → chunk-GWLOE7WJ.js} +2 -2
  20. package/dist/{chunk-BO6OKTIG.js → chunk-IEY4QYMK.js} +2 -2
  21. package/dist/{chunk-FEHSJUZJ.js → chunk-IQKZWU7I.js} +2 -2
  22. package/dist/{chunk-L3C4AHZJ.js → chunk-JHAFMU4Z.js} +2 -2
  23. package/dist/{chunk-QLNFHOLH.js → chunk-JO4722R7.js} +2 -2
  24. package/dist/{chunk-VLLLNIMN.js → chunk-MGVP76ZI.js} +2 -2
  25. package/dist/{chunk-7Y46DL2U.js → chunk-MRPXDND2.js} +2 -2
  26. package/dist/{chunk-LDJT7TII.js → chunk-OU4Y73FX.js} +2 -2
  27. package/dist/{chunk-SA74WAVS.js → chunk-PYKEYPGA.js} +2 -2
  28. package/dist/{chunk-TUFTB5UD.js → chunk-QDYWPG2R.js} +2 -2
  29. package/dist/chunk-QS5KOZM4.js +2 -0
  30. package/dist/{chunk-L6FZRTSN.js → chunk-QTYDDIVO.js} +2 -2
  31. package/dist/chunk-R3DJNVHR.js +2 -0
  32. package/dist/chunk-R3DJNVHR.js.map +1 -0
  33. package/dist/{chunk-E3JFQ7PH.js → chunk-SASLKPFS.js} +2 -2
  34. package/dist/{chunk-ZY5U2UNT.js → chunk-SSLB4VJH.js} +2 -2
  35. package/dist/{chunk-746ELT2W.js → chunk-TFKE327J.js} +2 -2
  36. package/dist/{chunk-NRW33IP5.js → chunk-TM7Q7RHH.js} +2 -2
  37. package/dist/{chunk-R3LY6TV5.js → chunk-UQOWSJ2B.js} +2 -2
  38. package/dist/chunk-VDRNNOVA.js +2 -0
  39. package/dist/chunk-VDRNNOVA.js.map +1 -0
  40. package/dist/{chunk-GD5556B2.js → chunk-VWCJQXCL.js} +2 -2
  41. package/dist/{chunk-A2SWQS2N.js → chunk-WCIJHQMP.js} +2 -2
  42. package/dist/chunk-WKANRAQC.js +2 -0
  43. package/dist/chunk-WKANRAQC.js.map +1 -0
  44. package/dist/chunk-XPKVRYIU.js +2 -0
  45. package/dist/chunk-XPKVRYIU.js.map +1 -0
  46. package/dist/{chunk-RAHCZTQ3.js → chunk-YTCUIISL.js} +2 -2
  47. package/dist/{chunk-WNTOQYRY.js → chunk-ZHMQDRBT.js} +2 -2
  48. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  49. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  50. package/dist/flows/ContractAmendment/index.js +1 -1
  51. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +2 -2
  52. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  53. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +1 -1
  54. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  55. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +2 -2
  56. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  57. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +2 -2
  58. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  59. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +2 -2
  60. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  61. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  62. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +2 -2
  63. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  64. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +1 -1
  65. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  66. package/dist/flows/ContractorOnboarding/context.d.ts +4 -4
  67. package/dist/flows/ContractorOnboarding/hooks.d.ts +2 -2
  68. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  69. package/dist/flows/ContractorOnboarding/index.d.ts +2 -2
  70. package/dist/flows/ContractorOnboarding/index.js +1 -1
  71. package/dist/flows/ContractorOnboarding/types.d.ts +2 -2
  72. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  73. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  74. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  75. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  76. package/dist/flows/CostCalculator/hooks.js +1 -1
  77. package/dist/flows/CostCalculator/index.js +1 -1
  78. package/dist/flows/CostCalculator/utils.js +1 -1
  79. package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
  80. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  81. package/dist/flows/Onboarding/api.d.ts +1 -1
  82. package/dist/flows/Onboarding/api.js +1 -1
  83. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  84. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
  85. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  86. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
  87. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  88. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
  89. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  90. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
  91. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  92. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  93. package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
  94. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
  95. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  96. package/dist/flows/Onboarding/context.d.ts +3 -3
  97. package/dist/flows/Onboarding/hooks.d.ts +1 -1
  98. package/dist/flows/Onboarding/hooks.js +1 -1
  99. package/dist/flows/Onboarding/index.d.ts +1 -1
  100. package/dist/flows/Onboarding/index.js +1 -1
  101. package/dist/flows/Onboarding/types.d.ts +1 -1
  102. package/dist/flows/Onboarding/utils.d.ts +1 -1
  103. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  104. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  105. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  106. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  107. package/dist/flows/Termination/TerminationFlow.js +1 -1
  108. package/dist/flows/Termination/TerminationForm.js +1 -1
  109. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +2 -2
  110. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +2 -2
  111. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +2 -2
  112. package/dist/flows/Termination/hooks.js +1 -1
  113. package/dist/flows/Termination/index.d.ts +2 -2
  114. package/dist/flows/Termination/index.js +1 -1
  115. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +2 -0
  116. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  117. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +1 -0
  118. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  119. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  120. package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +1 -0
  121. package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
  122. package/dist/flows/api.js +1 -1
  123. package/dist/index.d.ts +3 -3
  124. package/dist/index.js +1 -1
  125. package/dist/index.js.map +1 -1
  126. package/dist/{types-1tGveWWg.d.ts → types-B48IQTY-.d.ts} +2 -2
  127. package/dist/{types-DegHPy8Q.d.ts → types-C1II2Ikg.d.ts} +3 -3
  128. package/dist/{types-CwUhT-vz.d.ts → types-pdKQ7fMD.d.ts} +1 -1
  129. package/package.json +1 -1
  130. package/dist/chunk-4T6PRR6R.js +0 -2
  131. package/dist/chunk-4T6PRR6R.js.map +0 -1
  132. package/dist/chunk-GC23RRCI.js +0 -2
  133. package/dist/chunk-GC23RRCI.js.map +0 -1
  134. package/dist/chunk-KOIHMAAP.js +0 -2
  135. package/dist/chunk-LRGEEPGK.js +0 -2
  136. package/dist/chunk-LRGEEPGK.js.map +0 -1
  137. package/dist/chunk-OXCEJQFC.js +0 -2
  138. package/dist/chunk-OXCEJQFC.js.map +0 -1
  139. /package/dist/{chunk-ZIPHLBX4.js.map → chunk-2FKEF3OG.js.map} +0 -0
  140. /package/dist/{chunk-UTBVLDKY.js.map → chunk-2RZ65777.js.map} +0 -0
  141. /package/dist/{chunk-N3EIN72T.js.map → chunk-53KVZ4BP.js.map} +0 -0
  142. /package/dist/{chunk-PFT7KJ65.js.map → chunk-57XKXW6I.js.map} +0 -0
  143. /package/dist/{chunk-XP7UEI56.js.map → chunk-5MYWJJBQ.js.map} +0 -0
  144. /package/dist/{chunk-RINDVT6U.js.map → chunk-6IZ6XHVO.js.map} +0 -0
  145. /package/dist/{chunk-4ZGIL6OE.js.map → chunk-6KIQIVKA.js.map} +0 -0
  146. /package/dist/{chunk-WZAWPSKS.js.map → chunk-6LJRRFK2.js.map} +0 -0
  147. /package/dist/{chunk-HFI2MD3H.js.map → chunk-7ELDXUJJ.js.map} +0 -0
  148. /package/dist/{chunk-DZ67OJVF.js.map → chunk-7LZVUOMP.js.map} +0 -0
  149. /package/dist/{chunk-SB3IYODL.js.map → chunk-AODV6HT2.js.map} +0 -0
  150. /package/dist/{chunk-LRNSFLHR.js.map → chunk-AUZWLETL.js.map} +0 -0
  151. /package/dist/{chunk-R64X3EJF.js.map → chunk-AWDGLK2T.js.map} +0 -0
  152. /package/dist/{chunk-YXWBSRKS.js.map → chunk-C67CG4QZ.js.map} +0 -0
  153. /package/dist/{chunk-UFBTCHEI.js.map → chunk-C6B3CVSL.js.map} +0 -0
  154. /package/dist/{chunk-BMDZJNJV.js.map → chunk-FHHVVAXP.js.map} +0 -0
  155. /package/dist/{chunk-AYLYOLVG.js.map → chunk-GWLOE7WJ.js.map} +0 -0
  156. /package/dist/{chunk-BO6OKTIG.js.map → chunk-IEY4QYMK.js.map} +0 -0
  157. /package/dist/{chunk-FEHSJUZJ.js.map → chunk-IQKZWU7I.js.map} +0 -0
  158. /package/dist/{chunk-L3C4AHZJ.js.map → chunk-JHAFMU4Z.js.map} +0 -0
  159. /package/dist/{chunk-QLNFHOLH.js.map → chunk-JO4722R7.js.map} +0 -0
  160. /package/dist/{chunk-VLLLNIMN.js.map → chunk-MGVP76ZI.js.map} +0 -0
  161. /package/dist/{chunk-7Y46DL2U.js.map → chunk-MRPXDND2.js.map} +0 -0
  162. /package/dist/{chunk-LDJT7TII.js.map → chunk-OU4Y73FX.js.map} +0 -0
  163. /package/dist/{chunk-SA74WAVS.js.map → chunk-PYKEYPGA.js.map} +0 -0
  164. /package/dist/{chunk-TUFTB5UD.js.map → chunk-QDYWPG2R.js.map} +0 -0
  165. /package/dist/{chunk-KOIHMAAP.js.map → chunk-QS5KOZM4.js.map} +0 -0
  166. /package/dist/{chunk-L6FZRTSN.js.map → chunk-QTYDDIVO.js.map} +0 -0
  167. /package/dist/{chunk-E3JFQ7PH.js.map → chunk-SASLKPFS.js.map} +0 -0
  168. /package/dist/{chunk-ZY5U2UNT.js.map → chunk-SSLB4VJH.js.map} +0 -0
  169. /package/dist/{chunk-746ELT2W.js.map → chunk-TFKE327J.js.map} +0 -0
  170. /package/dist/{chunk-NRW33IP5.js.map → chunk-TM7Q7RHH.js.map} +0 -0
  171. /package/dist/{chunk-R3LY6TV5.js.map → chunk-UQOWSJ2B.js.map} +0 -0
  172. /package/dist/{chunk-GD5556B2.js.map → chunk-VWCJQXCL.js.map} +0 -0
  173. /package/dist/{chunk-A2SWQS2N.js.map → chunk-WCIJHQMP.js.map} +0 -0
  174. /package/dist/{chunk-RAHCZTQ3.js.map → chunk-YTCUIISL.js.map} +0 -0
  175. /package/dist/{chunk-WNTOQYRY.js.map → chunk-ZHMQDRBT.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-7Y46DL2U.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function f({onSubmit:n}){let{terminationBag:i}=m();return e(r,{onSubmit:o(async a=>{await n?.(i?.parseFormValues(a)),i?.next()},"handleSubmit")})}o(f,"PaidTimeOffForm");export{f as a};
2
- //# sourceMappingURL=chunk-ZIPHLBX4.js.map
1
+ import{a as r}from"./chunk-MRPXDND2.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function f({onSubmit:n}){let{terminationBag:i}=m();return e(r,{onSubmit:o(async a=>{await n?.(i?.parseFormValues(a)),i?.next()},"handleSubmit")})}o(f,"PaidTimeOffForm");export{f as a};
2
+ //# sourceMappingURL=chunk-2FKEF3OG.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-HFI2MD3H.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
2
- //# sourceMappingURL=chunk-UTBVLDKY.js.map
1
+ import{a as s}from"./chunk-7ELDXUJJ.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
2
+ //# sourceMappingURL=chunk-2RZ65777.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-7Y46DL2U.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as r}from"react/jsx-runtime";function p({onSubmit:e}){let{terminationBag:i}=m();return r(n,{onSubmit:o(async t=>{await e?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(p,"EmployeeCommunicationForm");export{p as a};
2
- //# sourceMappingURL=chunk-N3EIN72T.js.map
1
+ import{a as n}from"./chunk-MRPXDND2.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as r}from"react/jsx-runtime";function p({onSubmit:e}){let{terminationBag:i}=m();return r(n,{onSubmit:o(async t=>{await e?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(p,"EmployeeCommunicationForm");export{p as a};
2
+ //# sourceMappingURL=chunk-53KVZ4BP.js.map
@@ -1,2 +1,2 @@
1
- import{c as d,d as S}from"./chunk-WNTOQYRY.js";import{a as u}from"./chunk-HN5HLFTB.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-CFIJKJXD.js";import{f as y}from"./chunk-CNDSIADP.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var i=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,s)=>!e&&!r?.management_fee&&n?i(u,n,s):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:s,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(g=>{m(g);let a=i(u,g,n.managementFees);a&&c.setValue("management.management_fee",a)},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:"",hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(l=>l.value===e.currencySlug)?.label;if(a){m(a);let l=i(u,a,n.managementFees);c.setValue("management.management_fee",l)}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:s(t)})},"CostCalculatorFlow");export{W as a};
2
- //# sourceMappingURL=chunk-PFT7KJ65.js.map
1
+ import{c as d,d as S}from"./chunk-ZHMQDRBT.js";import{a as u}from"./chunk-HN5HLFTB.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-CFIJKJXD.js";import{f as y}from"./chunk-CNDSIADP.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var i=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,s)=>!e&&!r?.management_fee&&n?i(u,n,s):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:s,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(g=>{m(g);let a=i(u,g,n.managementFees);a&&c.setValue("management.management_fee",a)},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:"",hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(l=>l.value===e.currencySlug)?.label;if(a){m(a);let l=i(u,a,n.managementFees);c.setValue("management.management_fee",l)}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:s(t)})},"CostCalculatorFlow");export{W as a};
2
+ //# sourceMappingURL=chunk-57XKXW6I.js.map
@@ -1,2 +1,2 @@
1
- import{b as y}from"./chunk-PGWKJ6FK.js";import{b as c}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-QLNFHOLH.js";import{b as u}from"./chunk-2YTBWEC7.js";import{f,g as p}from"./chunk-CNDSIADP.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as S}from"react";import{jsx as b}from"react/jsx-runtime";import{createElement as V}from"react";function U({defaultValues:d,onSubmit:g,components:E}){let{formId:k,onboardingBag:o}=y(),w=c(o.handleValidation),r=f({resolver:w,defaultValues:d,shouldUnregister:!1,mode:"onBlur"});S(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),S(()=>{let t=r?.watch(e=>{Object.keys(e).some(i=>e[i]!==d[i])&&o?.checkFieldUpdates(e)});return()=>t?.unsubscribe()},[]);let h=m(async(t,e)=>{let s=e?.nativeEvent;if(s?.isDraftSubmission){let{onSuccess:i,onError:l}=s.draftCallbacks;try{if(!await r.trigger())return;let n=await o.onSubmit(t);if(n?.data)i?.();else if(n?.error){let B=o.stepState.currentStep.name,P=o.meta?.fields?.[B],O=u(n?.fieldErrors||[],P);l?.({error:n.error,rawError:n.rawError,fieldErrors:O})}}catch(a){l?.({error:a,rawError:a,fieldErrors:[]})}}else g(t)},"handleSubmit");return V(p,{...r,key:`form-${o.stepState.currentStep.name}`},b("form",{id:k,onSubmit:r.handleSubmit(h),className:"space-y-4 RemoteFlows__OnboardingForm",children:b(F,{components:E,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}m(U,"OnboardingForm");export{U as a};
2
- //# sourceMappingURL=chunk-XP7UEI56.js.map
1
+ import{b as y}from"./chunk-PGWKJ6FK.js";import{b as c}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-JO4722R7.js";import{b as u}from"./chunk-2YTBWEC7.js";import{f,g as p}from"./chunk-CNDSIADP.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as S}from"react";import{jsx as b}from"react/jsx-runtime";import{createElement as V}from"react";function U({defaultValues:d,onSubmit:g,components:E}){let{formId:k,onboardingBag:o}=y(),w=c(o.handleValidation),r=f({resolver:w,defaultValues:d,shouldUnregister:!1,mode:"onBlur"});S(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),S(()=>{let t=r?.watch(e=>{Object.keys(e).some(i=>e[i]!==d[i])&&o?.checkFieldUpdates(e)});return()=>t?.unsubscribe()},[]);let h=m(async(t,e)=>{let s=e?.nativeEvent;if(s?.isDraftSubmission){let{onSuccess:i,onError:l}=s.draftCallbacks;try{if(!await r.trigger())return;let n=await o.onSubmit(t);if(n?.data)i?.();else if(n?.error){let B=o.stepState.currentStep.name,P=o.meta?.fields?.[B],O=u(n?.fieldErrors||[],P);l?.({error:n.error,rawError:n.rawError,fieldErrors:O})}}catch(a){l?.({error:a,rawError:a,fieldErrors:[]})}}else g(t)},"handleSubmit");return V(p,{...r,key:`form-${o.stepState.currentStep.name}`},b("form",{id:k,onSubmit:r.handleSubmit(h),className:"space-y-4 RemoteFlows__OnboardingForm",children:b(F,{components:E,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}m(U,"OnboardingForm");export{U as a};
2
+ //# sourceMappingURL=chunk-5MYWJJBQ.js.map
@@ -1,2 +1,2 @@
1
- import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-LRGEEPGK.js";import{a as m}from"./chunk-2YTBWEC7.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
2
- //# sourceMappingURL=chunk-RINDVT6U.js.map
1
+ import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-WKANRAQC.js";import{a as m}from"./chunk-2YTBWEC7.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
2
+ //# sourceMappingURL=chunk-6IZ6XHVO.js.map
@@ -1,2 +1,2 @@
1
- import{b as u}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-QLNFHOLH.js";import{f as l,g as p}from"./chunk-CNDSIADP.js";import{c as f}from"./chunk-PAQW5BFW.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=u(y),e=l({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=f(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
- //# sourceMappingURL=chunk-4ZGIL6OE.js.map
1
+ import{b as u}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-JO4722R7.js";import{f as l,g as p}from"./chunk-CNDSIADP.js";import{c as f}from"./chunk-PAQW5BFW.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=u(y),e=l({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=f(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
+ //# sourceMappingURL=chunk-6KIQIVKA.js.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-7Y46DL2U.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function F({requesterName:n,onSubmit:s,onSuccess:m,onError:d}){let{terminationBag:e}=a(),l=i(async o=>{await s?.(e?.parseFormValues(o));let r=await e?.onSubmit(o);r?.error?d?.(r.error):r?.data&&await m?.(r.data)},"handleSubmit"),u=e?.fields.map(o=>o.name==="acknowledge_termination_procedure"?{...o,label:o.label.replace("{{requesterName}}",n)}:o);return p(t,{fields:u,onSubmit:l})}i(F,"AdditionalDetailsForm");export{F as a};
2
- //# sourceMappingURL=chunk-WZAWPSKS.js.map
1
+ import{a as t}from"./chunk-MRPXDND2.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function F({requesterName:n,onSubmit:s,onSuccess:m,onError:d}){let{terminationBag:e}=a(),l=i(async o=>{await s?.(e?.parseFormValues(o));let r=await e?.onSubmit(o);r?.error?d?.(r.error):r?.data&&await m?.(r.data)},"handleSubmit"),u=e?.fields.map(o=>o.name==="acknowledge_termination_procedure"?{...o,label:o.label.replace("{{requesterName}}",n)}:o);return p(t,{fields:u,onSubmit:l})}i(F,"AdditionalDetailsForm");export{F as a};
2
+ //# sourceMappingURL=chunk-6LJRRFK2.js.map
@@ -1,2 +1,2 @@
1
- import{m as K}from"./chunk-LRGEEPGK.js";import{a as w}from"./chunk-BV3PGYSH.js";import{b as J}from"./chunk-3ZWDIEEM.js";import{c as G}from"./chunk-CNDSIADP.js";import{a as t,b as d,c as Me}from"./chunk-P37U34EQ.js";var L=d((Et,U)=>{"use strict";function Pe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}t(Pe,"isObject");U.exports=Pe});var X=d(($t,V)=>{"use strict";var _e=typeof global=="object"&&global&&global.Object===Object&&global;V.exports=_e});var F=d((qt,z)=>{"use strict";var ke=X(),we=typeof self=="object"&&self&&self.Object===Object&&self,Le=ke||we||Function("return this")();z.exports=Le});var Y=d((It,Q)=>{"use strict";var Fe=F(),Ae=t(function(){return Fe.Date.now()},"now");Q.exports=Ae});var ee=d((Pt,Z)=>{"use strict";var We=/\s/;function De(e){for(var n=e.length;n--&&We.test(e.charAt(n)););return n}t(De,"trimmedEndIndex");Z.exports=De});var ne=d((kt,te)=>{"use strict";var Be=ee(),Ne=/^\s+/;function He(e){return e&&e.slice(0,Be(e)+1).replace(Ne,"")}t(He,"baseTrim");te.exports=He});var A=d((Lt,re)=>{"use strict";var Ge=F(),Je=Ge.Symbol;re.exports=Je});var ae=d((Ft,se)=>{"use strict";var oe=A(),ie=Object.prototype,Ke=ie.hasOwnProperty,Ue=ie.toString,O=oe?oe.toStringTag:void 0;function Ve(e){var n=Ke.call(e,O),r=e[O];try{e[O]=void 0;var o=!0}catch{}var s=Ue.call(e);return o&&(n?e[O]=r:delete e[O]),s}t(Ve,"getRawTag");se.exports=Ve});var ue=d((Wt,ce)=>{"use strict";var Xe=Object.prototype,ze=Xe.toString;function Qe(e){return ze.call(e)}t(Qe,"objectToString");ce.exports=Qe});var me=d((Bt,le)=>{"use strict";var fe=A(),Ye=ae(),Ze=ue(),et="[object Null]",tt="[object Undefined]",de=fe?fe.toStringTag:void 0;function nt(e){return e==null?e===void 0?tt:et:de&&de in Object(e)?Ye(e):Ze(e)}t(nt,"baseGetTag");le.exports=nt});var pe=d((Ht,ge)=>{"use strict";function rt(e){return e!=null&&typeof e=="object"}t(rt,"isObjectLike");ge.exports=rt});var ve=d((Jt,be)=>{"use strict";var ot=me(),it=pe(),st="[object Symbol]";function at(e){return typeof e=="symbol"||it(e)&&ot(e)==st}t(at,"isSymbol");be.exports=at});var Te=d((Ut,xe)=>{"use strict";var ct=ne(),ye=L(),ut=ve(),he=NaN,ft=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,lt=/^0o[0-7]+$/i,mt=parseInt;function gt(e){if(typeof e=="number")return e;if(ut(e))return he;if(ye(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ye(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ct(e);var r=dt.test(e);return r||lt.test(e)?mt(e.slice(2),r?2:8):ft.test(e)?he:+e}t(gt,"toNumber");xe.exports=gt});var je=d((Xt,Se)=>{"use strict";var pt=L(),W=Y(),Ce=Te(),bt="Expected a function",vt=Math.max,yt=Math.min;function ht(e,n,r){var o,s,p,l,a,c,m=0,E=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(bt);n=Ce(n)||0,pt(r)&&(E=!!r.leading,u="maxWait"in r,p=u?vt(Ce(r.maxWait)||0,n):p,h="trailing"in r?!!r.trailing:h);function x(i){var g=o,y=s;return o=s=void 0,m=i,l=e.apply(y,g),l}t(x,"invokeFunc");function R(i){return m=i,a=setTimeout(v,n),E?x(i):l}t(R,"leadingEdge");function C(i){var g=i-c,y=i-m,M=n-g;return u?yt(M,p-y):M}t(C,"remainingWait");function $(i){var g=i-c,y=i-m;return c===void 0||g>=n||g<0||u&&y>=p}t($,"shouldInvoke");function v(){var i=W();if($(i))return b(i);a=setTimeout(v,C(i))}t(v,"timerExpired");function b(i){return a=void 0,h&&o?x(i):(o=s=void 0,l)}t(b,"trailingEdge");function q(){a!==void 0&&clearTimeout(a),m=0,o=c=s=a=void 0}t(q,"cancel");function I(){return a===void 0?l:b(W())}t(I,"flush");function S(){var i=W(),g=$(i);if(o=arguments,s=this,c=i,g){if(a===void 0)return R(c);if(u)return clearTimeout(a),a=setTimeout(v,n),x(c)}return a===void 0&&(a=setTimeout(v,n)),l}return t(S,"debounced"),S.cancel=q,S.flush=I,S}t(ht,"debounce");Se.exports=ht});import{useState as Ct,useCallback as St,useEffect as Re,useRef as $e}from"react";var Ee=Me(je(),1);import{useCallback as xt,useEffect as Tt,useRef as Oe}from"react";function D(e,n){let r=Oe(e);Tt(()=>{r.current=e},[e]);let o=Oe((0,Ee.default)(s=>{r.current(s)},n)).current;return xt(s=>{o(s)},[o])}t(D,"useDebounce");import{Fragment as Ot,jsx as T,jsxs as qe}from"react/jsx-runtime";var jt=t(({description:e,showConversion:n,targetCurrency:r,className:o,onClick:s})=>{let{components:p}=J(),l=n?`Hide ${r} conversion`:`Show ${r} conversion`,a=p?.button;return qe("span",{className:o,children:[e," ",a?T(a,{className:`${o.replace("-description","-button")}`,"data-type":"inline",onClick:s,children:l}):T("button",{className:`${o.replace("-description","-button")}`,onClick:s,children:l})]})},"DescriptionWithConversion"),cn=t(({sourceCurrency:e,targetCurrency:n,mainFieldName:r,conversionFieldName:o,conversionProperties:s,classNamePrefix:p,description:l,conversionType:a="spread",...c})=>{let[m,E]=Ct(!1),{setValue:u,watch:h}=G(),x=h(r||c.name),R=$e(!0),C=$e(new Map),$=e&&n&&e!==n,{mutateAsync:v}=K({type:a}),b=`${c.name}_converted`;Re(()=>{u(b,r||c.name)},[u,r,c.name,b]),Re(()=>{if(R.current){R.current=!1;return}u(o,"")},[e,o,u]);let q=St(async(f,j,k,B)=>{if(!f)return;let N=`${j}_${k}_${f}`,H=C.current.get(N);if(H){u(B,H.targetAmount);return}try{let P=await v({source_currency:j,target_currency:k,amount:Number(f)});if(P.data?.data?.conversion_data?.target_amount){let _=P.data.data.conversion_data.target_amount;if(_){u(B,_?.toString()),C.current.set(N,{targetAmount:_.toString()});let Ie=`${k}_${j}_${_}`;C.current.set(Ie,{targetAmount:f.toString()})}}}catch(P){console.error("Error converting currency:",P)}},[v,u]),I=D(f=>q(f,e,n,o),500),S=D(f=>q(f,n,e,r||c.name),500),i=t(f=>{u(b,r||c.name),m&&I(f.target.value)},"handleMainFieldChange"),g=t(f=>{u(b,o),S(f.target.value)},"handleConversionFieldChange"),y=t(f=>{f.preventDefault(),E(j=>!j),!m&&x&&I(x)},"toggleConversion"),M=$?T(jt,{targetCurrency:n,description:l,showConversion:m,className:`${p}-description`,onClick:y}):l;return qe(Ot,{children:[T(w,{...c,name:r||c.name,additionalProps:{currency:e},description:M,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:i}),m&&T(w,{additionalProps:{currency:n},name:o,label:s?.label||"Conversion",description:s?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:g}),T("input",{type:"hidden",name:b,value:h(b)||r||c.name})]})},"CurrencyConversionField");export{cn as a};
2
- //# sourceMappingURL=chunk-HFI2MD3H.js.map
1
+ import{m as K}from"./chunk-WKANRAQC.js";import{a as w}from"./chunk-BV3PGYSH.js";import{b as J}from"./chunk-3ZWDIEEM.js";import{c as G}from"./chunk-CNDSIADP.js";import{a as t,b as d,c as Me}from"./chunk-P37U34EQ.js";var L=d((Et,U)=>{"use strict";function Pe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}t(Pe,"isObject");U.exports=Pe});var X=d(($t,V)=>{"use strict";var _e=typeof global=="object"&&global&&global.Object===Object&&global;V.exports=_e});var F=d((qt,z)=>{"use strict";var ke=X(),we=typeof self=="object"&&self&&self.Object===Object&&self,Le=ke||we||Function("return this")();z.exports=Le});var Y=d((It,Q)=>{"use strict";var Fe=F(),Ae=t(function(){return Fe.Date.now()},"now");Q.exports=Ae});var ee=d((Pt,Z)=>{"use strict";var We=/\s/;function De(e){for(var n=e.length;n--&&We.test(e.charAt(n)););return n}t(De,"trimmedEndIndex");Z.exports=De});var ne=d((kt,te)=>{"use strict";var Be=ee(),Ne=/^\s+/;function He(e){return e&&e.slice(0,Be(e)+1).replace(Ne,"")}t(He,"baseTrim");te.exports=He});var A=d((Lt,re)=>{"use strict";var Ge=F(),Je=Ge.Symbol;re.exports=Je});var ae=d((Ft,se)=>{"use strict";var oe=A(),ie=Object.prototype,Ke=ie.hasOwnProperty,Ue=ie.toString,O=oe?oe.toStringTag:void 0;function Ve(e){var n=Ke.call(e,O),r=e[O];try{e[O]=void 0;var o=!0}catch{}var s=Ue.call(e);return o&&(n?e[O]=r:delete e[O]),s}t(Ve,"getRawTag");se.exports=Ve});var ue=d((Wt,ce)=>{"use strict";var Xe=Object.prototype,ze=Xe.toString;function Qe(e){return ze.call(e)}t(Qe,"objectToString");ce.exports=Qe});var me=d((Bt,le)=>{"use strict";var fe=A(),Ye=ae(),Ze=ue(),et="[object Null]",tt="[object Undefined]",de=fe?fe.toStringTag:void 0;function nt(e){return e==null?e===void 0?tt:et:de&&de in Object(e)?Ye(e):Ze(e)}t(nt,"baseGetTag");le.exports=nt});var pe=d((Ht,ge)=>{"use strict";function rt(e){return e!=null&&typeof e=="object"}t(rt,"isObjectLike");ge.exports=rt});var ve=d((Jt,be)=>{"use strict";var ot=me(),it=pe(),st="[object Symbol]";function at(e){return typeof e=="symbol"||it(e)&&ot(e)==st}t(at,"isSymbol");be.exports=at});var Te=d((Ut,xe)=>{"use strict";var ct=ne(),ye=L(),ut=ve(),he=NaN,ft=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,lt=/^0o[0-7]+$/i,mt=parseInt;function gt(e){if(typeof e=="number")return e;if(ut(e))return he;if(ye(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ye(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ct(e);var r=dt.test(e);return r||lt.test(e)?mt(e.slice(2),r?2:8):ft.test(e)?he:+e}t(gt,"toNumber");xe.exports=gt});var je=d((Xt,Se)=>{"use strict";var pt=L(),W=Y(),Ce=Te(),bt="Expected a function",vt=Math.max,yt=Math.min;function ht(e,n,r){var o,s,p,l,a,c,m=0,E=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(bt);n=Ce(n)||0,pt(r)&&(E=!!r.leading,u="maxWait"in r,p=u?vt(Ce(r.maxWait)||0,n):p,h="trailing"in r?!!r.trailing:h);function x(i){var g=o,y=s;return o=s=void 0,m=i,l=e.apply(y,g),l}t(x,"invokeFunc");function R(i){return m=i,a=setTimeout(v,n),E?x(i):l}t(R,"leadingEdge");function C(i){var g=i-c,y=i-m,M=n-g;return u?yt(M,p-y):M}t(C,"remainingWait");function $(i){var g=i-c,y=i-m;return c===void 0||g>=n||g<0||u&&y>=p}t($,"shouldInvoke");function v(){var i=W();if($(i))return b(i);a=setTimeout(v,C(i))}t(v,"timerExpired");function b(i){return a=void 0,h&&o?x(i):(o=s=void 0,l)}t(b,"trailingEdge");function q(){a!==void 0&&clearTimeout(a),m=0,o=c=s=a=void 0}t(q,"cancel");function I(){return a===void 0?l:b(W())}t(I,"flush");function S(){var i=W(),g=$(i);if(o=arguments,s=this,c=i,g){if(a===void 0)return R(c);if(u)return clearTimeout(a),a=setTimeout(v,n),x(c)}return a===void 0&&(a=setTimeout(v,n)),l}return t(S,"debounced"),S.cancel=q,S.flush=I,S}t(ht,"debounce");Se.exports=ht});import{useState as Ct,useCallback as St,useEffect as Re,useRef as $e}from"react";var Ee=Me(je(),1);import{useCallback as xt,useEffect as Tt,useRef as Oe}from"react";function D(e,n){let r=Oe(e);Tt(()=>{r.current=e},[e]);let o=Oe((0,Ee.default)(s=>{r.current(s)},n)).current;return xt(s=>{o(s)},[o])}t(D,"useDebounce");import{Fragment as Ot,jsx as T,jsxs as qe}from"react/jsx-runtime";var jt=t(({description:e,showConversion:n,targetCurrency:r,className:o,onClick:s})=>{let{components:p}=J(),l=n?`Hide ${r} conversion`:`Show ${r} conversion`,a=p?.button;return qe("span",{className:o,children:[e," ",a?T(a,{className:`${o.replace("-description","-button")}`,"data-type":"inline",onClick:s,children:l}):T("button",{className:`${o.replace("-description","-button")}`,onClick:s,children:l})]})},"DescriptionWithConversion"),cn=t(({sourceCurrency:e,targetCurrency:n,mainFieldName:r,conversionFieldName:o,conversionProperties:s,classNamePrefix:p,description:l,conversionType:a="spread",...c})=>{let[m,E]=Ct(!1),{setValue:u,watch:h}=G(),x=h(r||c.name),R=$e(!0),C=$e(new Map),$=e&&n&&e!==n,{mutateAsync:v}=K({type:a}),b=`${c.name}_converted`;Re(()=>{u(b,r||c.name)},[u,r,c.name,b]),Re(()=>{if(R.current){R.current=!1;return}u(o,"")},[e,o,u]);let q=St(async(f,j,k,B)=>{if(!f)return;let N=`${j}_${k}_${f}`,H=C.current.get(N);if(H){u(B,H.targetAmount);return}try{let P=await v({source_currency:j,target_currency:k,amount:Number(f)});if(P.data?.data?.conversion_data?.target_amount){let _=P.data.data.conversion_data.target_amount;if(_){u(B,_?.toString()),C.current.set(N,{targetAmount:_.toString()});let Ie=`${k}_${j}_${_}`;C.current.set(Ie,{targetAmount:f.toString()})}}}catch(P){console.error("Error converting currency:",P)}},[v,u]),I=D(f=>q(f,e,n,o),500),S=D(f=>q(f,n,e,r||c.name),500),i=t(f=>{u(b,r||c.name),m&&I(f.target.value)},"handleMainFieldChange"),g=t(f=>{u(b,o),S(f.target.value)},"handleConversionFieldChange"),y=t(f=>{f.preventDefault(),E(j=>!j),!m&&x&&I(x)},"toggleConversion"),M=$?T(jt,{targetCurrency:n,description:l,showConversion:m,className:`${p}-description`,onClick:y}):l;return qe(Ot,{children:[T(w,{...c,name:r||c.name,additionalProps:{currency:e},description:M,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:i}),m&&T(w,{additionalProps:{currency:n},name:o,label:s?.label||"Conversion",description:s?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:g}),T("input",{type:"hidden",name:b,value:h(b)||r||c.name})]})},"CurrencyConversionField");export{cn as a};
2
+ //# sourceMappingURL=chunk-7ELDXUJJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-KOIHMAAP.js";import{a as n}from"./chunk-XFD3ULUF.js";import{b as i}from"./chunk-3O3Q24JL.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as r}from"./chunk-P37U34EQ.js";import{modify as c}from"@remoteoss/json-schema-form";import{useMutation as l,useQuery as p}from"@tanstack/react-query";import{createHeadlessForm as y}from"@remoteoss/json-schema-form";var V=r(()=>{let{client:o}=a();return l({mutationFn:r(e=>i({client:o,body:e}),"mutationFn")})},"useCreateTermination"),M=r(({formValues:o,jsfModify:e,step:m})=>p({queryKey:["rmt-flows-termination-schema",m],queryFn:r(()=>s[m]??n,"queryFn"),select:r(({data:f})=>{let t=f?.schema||{};if(e){let{schema:u}=c(t,e);t=u}return y(t||{},{initialValues:o||{}})},"select")}),"useTerminationSchema");export{V as a,M as b};
2
- //# sourceMappingURL=chunk-DZ67OJVF.js.map
1
+ import{a as s}from"./chunk-QS5KOZM4.js";import{a as n}from"./chunk-XFD3ULUF.js";import{b as i}from"./chunk-3O3Q24JL.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as r}from"./chunk-P37U34EQ.js";import{modify as c}from"@remoteoss/json-schema-form";import{useMutation as l,useQuery as p}from"@tanstack/react-query";import{createHeadlessForm as y}from"@remoteoss/json-schema-form";var V=r(()=>{let{client:o}=a();return l({mutationFn:r(e=>i({client:o,body:e}),"mutationFn")})},"useCreateTermination"),M=r(({formValues:o,jsfModify:e,step:m})=>p({queryKey:["rmt-flows-termination-schema",m],queryFn:r(()=>s[m]??n,"queryFn"),select:r(({data:f})=>{let t=f?.schema||{};if(e){let{schema:u}=c(t,e);t=u}return y(t||{},{initialValues:o||{}})},"select")}),"useTerminationSchema");export{V as a,M as b};
2
+ //# sourceMappingURL=chunk-7LZVUOMP.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-XP7UEI56.js";import{b as t}from"./chunk-PGWKJ6FK.js";import{b as e}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{onboardingBag:o}=t(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let p=e(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),f=o.stepState.values?.basic_information||o.initialValues.basic_information;return c(s,{defaultValues:f,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
- //# sourceMappingURL=chunk-SB3IYODL.js.map
1
+ import{a as s}from"./chunk-5MYWJJBQ.js";import{b as t}from"./chunk-PGWKJ6FK.js";import{b as e}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{onboardingBag:o}=t(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let p=e(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),f=o.stepState.values?.basic_information||o.initialValues.basic_information;return c(s,{defaultValues:f,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
+ //# sourceMappingURL=chunk-AODV6HT2.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-NRW33IP5.js";import{b as e}from"./chunk-TOA3JILU.js";import{b as t}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{contractorOnboardingBag:o}=e(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let f=t(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:f})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),c=o.stepState.values?.basic_information||o.initialValues.basic_information;return p(s,{defaultValues:c,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
- //# sourceMappingURL=chunk-LRNSFLHR.js.map
1
+ import{a as s}from"./chunk-TM7Q7RHH.js";import{b as e}from"./chunk-TOA3JILU.js";import{b as t}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{contractorOnboardingBag:o}=e(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let f=t(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:f})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),c=o.stepState.values?.basic_information||o.initialValues.basic_information;return p(s,{defaultValues:c,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
+ //# sourceMappingURL=chunk-AUZWLETL.js.map
@@ -1,2 +1,2 @@
1
- import{a as b}from"./chunk-NRW33IP5.js";import{b as P}from"./chunk-TOA3JILU.js";import{b as g}from"./chunk-2YTBWEC7.js";import{b as m}from"./chunk-WVDTHFGS.js";import{a}from"./chunk-P37U34EQ.js";import{useState as f,useMemo as S}from"react";import{Document as k,Page as C,pdfjs as x}from"react-pdf";import{jsx as r,jsxs as i}from"react/jsx-runtime";x.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${x.version}/build/pdf.worker.min.mjs`;function N({base64Data:c,fileName:l="document.pdf"}){let[n,t]=f(0),[s,u]=f(1),[p,o]=f(!0),[d,w]=f(""),v=S(()=>{if(!c)return"";let e=c.trim();return e.startsWith("data:application/pdf;base64,")||e.startsWith("data:")?e:`data:application/pdf;base64,${e}`},[c]),h=a(({numPages:e})=>{t(e),o(!1),w("")},"onDocumentLoadSuccess"),y=a(e=>{console.error("Error loading PDF:",e),w("Failed to load PDF document"),o(!1)},"onDocumentLoadError"),E=a(()=>{u(e=>Math.max(1,e-1))},"goToPrevPage"),D=a(()=>{u(e=>Math.min(n,e+1))},"goToNextPage");return v?i("div",{className:"w-full space-y-4",children:[i("div",{children:[i("div",{className:"flex justify-center items-center min-h-[600px] p-4 bg-gray-50",children:[p&&i("div",{className:"text-center",children:[r("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"}),r("p",{className:"text-gray-600",children:"Loading PDF..."})]}),d&&i("div",{className:"text-center space-y-4",children:[r("p",{className:"text-red-600",children:d}),r(m,{asChild:!0,children:r("a",{href:v,download:l,children:"Download PDF Instead"})})]}),!d&&r(k,{file:v,onLoadSuccess:h,onLoadError:y,loading:"",className:"flex flex-col items-center",children:r(C,{pageNumber:s,renderTextLayer:!0,renderAnnotationLayer:!0,className:"shadow-lg",width:Math.min(window.innerWidth-100,800)})})]}),n>0&&!d&&r("div",{className:"border-t bg-white px-4 py-3",children:i("div",{className:"flex items-center justify-between",children:[r(m,{onClick:E,disabled:s<=1,variant:"outline",size:"sm",children:"\u2190 Previous"}),i("div",{className:"text-sm text-gray-600",children:["Page ",s," of ",n]}),r(m,{onClick:D,disabled:s>=n,variant:"outline",size:"sm",children:"Next \u2192"})]})})]}),i("div",{className:"flex justify-between items-center text-sm",children:[r("p",{className:"text-gray-600",children:l}),r(m,{variant:"link",size:"link",asChild:!0,children:i("a",{href:v,download:l,className:"flex items-center gap-1",children:[r("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download PDF"]})})]})]}):r("div",{className:"w-full border rounded p-8 text-center bg-gray-50",children:r("p",{className:"text-gray-500",children:"No PDF data available"})})}a(N,"PDFPreview");import{jsx as F,jsxs as L}from"react/jsx-runtime";function I({onSubmit:c,onSuccess:l,onError:n}){let{contractorOnboardingBag:t}=P(),s=a(async p=>{try{await c?.(t.parseFormValues(p));let o=await t.onSubmit(p);if(o?.data){await l?.(o?.data),t?.next();return}if(o?.error){let d=g(o?.fieldErrors||[],t.meta?.fields?.contract_preview);n?.({error:o?.error,rawError:o?.rawError,fieldErrors:d})}}catch(o){n?.({error:o,rawError:o,fieldErrors:[]})}},"handleSubmit"),u=t.stepState.values?.contract_preview||t.initialValues.contract_preview;return L("div",{className:"space-y-4",children:[F(N,{base64Data:t.documentPreviewPdf?.contract_document.content}),F(b,{defaultValues:u,onSubmit:s})]})}a(I,"ContractPreviewStep");export{I as a};
2
- //# sourceMappingURL=chunk-R64X3EJF.js.map
1
+ import{a as b}from"./chunk-TM7Q7RHH.js";import{b as P}from"./chunk-TOA3JILU.js";import{b as g}from"./chunk-2YTBWEC7.js";import{b as m}from"./chunk-WVDTHFGS.js";import{a}from"./chunk-P37U34EQ.js";import{useState as f,useMemo as S}from"react";import{Document as k,Page as C,pdfjs as x}from"react-pdf";import{jsx as r,jsxs as i}from"react/jsx-runtime";x.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${x.version}/build/pdf.worker.min.mjs`;function N({base64Data:c,fileName:l="document.pdf"}){let[n,t]=f(0),[s,u]=f(1),[p,o]=f(!0),[d,w]=f(""),v=S(()=>{if(!c)return"";let e=c.trim();return e.startsWith("data:application/pdf;base64,")||e.startsWith("data:")?e:`data:application/pdf;base64,${e}`},[c]),h=a(({numPages:e})=>{t(e),o(!1),w("")},"onDocumentLoadSuccess"),y=a(e=>{console.error("Error loading PDF:",e),w("Failed to load PDF document"),o(!1)},"onDocumentLoadError"),E=a(()=>{u(e=>Math.max(1,e-1))},"goToPrevPage"),D=a(()=>{u(e=>Math.min(n,e+1))},"goToNextPage");return v?i("div",{className:"w-full space-y-4",children:[i("div",{children:[i("div",{className:"flex justify-center items-center min-h-[600px] p-4 bg-gray-50",children:[p&&i("div",{className:"text-center",children:[r("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"}),r("p",{className:"text-gray-600",children:"Loading PDF..."})]}),d&&i("div",{className:"text-center space-y-4",children:[r("p",{className:"text-red-600",children:d}),r(m,{asChild:!0,children:r("a",{href:v,download:l,children:"Download PDF Instead"})})]}),!d&&r(k,{file:v,onLoadSuccess:h,onLoadError:y,loading:"",className:"flex flex-col items-center",children:r(C,{pageNumber:s,renderTextLayer:!0,renderAnnotationLayer:!0,className:"shadow-lg",width:Math.min(window.innerWidth-100,800)})})]}),n>0&&!d&&r("div",{className:"border-t bg-white px-4 py-3",children:i("div",{className:"flex items-center justify-between",children:[r(m,{onClick:E,disabled:s<=1,variant:"outline",size:"sm",children:"\u2190 Previous"}),i("div",{className:"text-sm text-gray-600",children:["Page ",s," of ",n]}),r(m,{onClick:D,disabled:s>=n,variant:"outline",size:"sm",children:"Next \u2192"})]})})]}),i("div",{className:"flex justify-between items-center text-sm",children:[r("p",{className:"text-gray-600",children:l}),r(m,{variant:"link",size:"link",asChild:!0,children:i("a",{href:v,download:l,className:"flex items-center gap-1",children:[r("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download PDF"]})})]})]}):r("div",{className:"w-full border rounded p-8 text-center bg-gray-50",children:r("p",{className:"text-gray-500",children:"No PDF data available"})})}a(N,"PDFPreview");import{jsx as F,jsxs as L}from"react/jsx-runtime";function I({onSubmit:c,onSuccess:l,onError:n}){let{contractorOnboardingBag:t}=P(),s=a(async p=>{try{await c?.(t.parseFormValues(p));let o=await t.onSubmit(p);if(o?.data){await l?.(o?.data),t?.next();return}if(o?.error){let d=g(o?.fieldErrors||[],t.meta?.fields?.contract_preview);n?.({error:o?.error,rawError:o?.rawError,fieldErrors:d})}}catch(o){n?.({error:o,rawError:o,fieldErrors:[]})}},"handleSubmit"),u=t.stepState.values?.contract_preview||t.initialValues.contract_preview;return L("div",{className:"space-y-4",children:[F(N,{base64Data:t.documentPreviewPdf?.contract_document.content}),F(b,{defaultValues:u,onSubmit:s})]})}a(I,"ContractPreviewStep");export{I as a};
2
+ //# sourceMappingURL=chunk-AWDGLK2T.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-L6FZRTSN.js";import{a as i}from"./chunk-LDJT7TII.js";import{a as e}from"./chunk-LRNSFLHR.js";import{a as c}from"./chunk-FEHSJUZJ.js";import{a as d}from"./chunk-R64X3EJF.js";import{a as n}from"./chunk-5ZR7EFPY.js";import{a as f}from"./chunk-BMDZJNJV.js";import{a as m}from"./chunk-DPY77ASH.js";import{a as t}from"./chunk-TOA3JILU.js";import{a}from"./chunk-ZY5U2UNT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as u}from"react";import{jsx as v}from"react/jsx-runtime";var A=r(({render:g,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O,options:l})=>{let o=a({options:l,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O}),P=u();return v(t.Provider,{value:{contractorOnboardingBag:o,formId:P},children:g({contractorOnboardingBag:o,components:{BasicInformationStep:e,SelectCountryStep:i,BackButton:n,SubmitButton:m,PricingPlanStep:p,ContractDetailsStep:c,ContractPreviewStep:d,OnboardingInvite:f}})})},"ContractorOnboardingFlow");export{A as a};
2
- //# sourceMappingURL=chunk-YXWBSRKS.js.map
1
+ import{a as p}from"./chunk-QTYDDIVO.js";import{a as i}from"./chunk-OU4Y73FX.js";import{a as e}from"./chunk-AUZWLETL.js";import{a as c}from"./chunk-IQKZWU7I.js";import{a as d}from"./chunk-AWDGLK2T.js";import{a as n}from"./chunk-5ZR7EFPY.js";import{a as f}from"./chunk-FHHVVAXP.js";import{a as m}from"./chunk-DPY77ASH.js";import{a as t}from"./chunk-TOA3JILU.js";import{a}from"./chunk-SSLB4VJH.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as u}from"react";import{jsx as v}from"react/jsx-runtime";var A=r(({render:g,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O,options:l})=>{let o=a({options:l,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O}),P=u();return v(t.Provider,{value:{contractorOnboardingBag:o,formId:P},children:g({contractorOnboardingBag:o,components:{BasicInformationStep:e,SelectCountryStep:i,BackButton:n,SubmitButton:m,PricingPlanStep:p,ContractDetailsStep:c,ContractPreviewStep:d,OnboardingInvite:f}})})},"ContractorOnboardingFlow");export{A as a};
2
+ //# sourceMappingURL=chunk-C67CG4QZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-HFI2MD3H.js";import{a as m,b as y}from"./chunk-ANQ4HVVK.js";import{c}from"./chunk-CNDSIADP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(y,{className:"text-sm",zendeskId:m.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(l,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
2
- //# sourceMappingURL=chunk-UFBTCHEI.js.map
1
+ import{a as l}from"./chunk-7ELDXUJJ.js";import{a as m,b as y}from"./chunk-ANQ4HVVK.js";import{c}from"./chunk-CNDSIADP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(y,{className:"text-sm",zendeskId:m.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(l,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
2
+ //# sourceMappingURL=chunk-C6B3CVSL.js.map
@@ -0,0 +1,2 @@
1
+ import{a as A}from"./chunk-BV3PGYSH.js";import{a as ve,b as Ge,c as Je,d as qe,e as je,f as Ke,g as Ye,h as Ze,i as Xe,j as xe,k as et,l as be,m as Se,o as ke,q as tt,r as ot,s as rt}from"./chunk-D6X2WCEG.js";import{b as Qe}from"./chunk-HPHWQU34.js";import{b as ye}from"./chunk-ANQ4HVVK.js";import{a as Ce,b as I}from"./chunk-WVDTHFGS.js";import{b as S}from"./chunk-3ZWDIEEM.js";import{a as ne,b as ae,c as b,d as Ae,e as Oe,f as ze,g as Ue,h as k,i as w,j as N,k as R,l as P,m as D}from"./chunk-CNDSIADP.js";import{g as Ve}from"./chunk-PAQW5BFW.js";import{a as y,e as oe}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Do,useEffect as To,useRef as Lt}from"react";import{Fragment as Ot,jsx as O,jsxs as se}from"react/jsx-runtime";function le({name:e,defaultValue:t,description:o,label:n,onChange:a,multiple:c,options:d,component:F,...f}){let{components:u}=S(),{control:s}=b(),i=r((m,l,g)=>{let p=g.value?[...g.value]:[];l?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:s,name:e,defaultValue:t,render:({field:m,fieldState:l})=>{let g=F||u?.checkbox;if(g){let p={name:e,description:o,label:n,defaultValue:t,multiple:c,options:d,...f};return O(g,{field:{...m,onChange:r(h=>{if(c){let{checked:x,value:C}=h.target;i(C,x,m),a?.(x);return}m.onChange(h),a?.(h)},"onChange")},fieldState:l,fieldData:p})}return se(w,{"data-field":e,className:y(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(R,{children:se(Ot,{children:[d&&c?O(N,{children:n}):null,d&&c?d.map(p=>se("div",{className:"flex space-x-2",children:[O(ve,{id:p.value,onCheckedChange:h=>{i(p.value,h===!0,m),a?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):se("div",{className:"flex space-x-2",children:[O(ve,{id:e,onCheckedChange:p=>{m.onChange(p),a?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:n})]})]})}),o&&O(P,{children:o}),l.error&&O(D,{})]})}})}r(le,"CheckBoxField");import{CalendarIcon as Gt}from"lucide-react";import{PopoverClose as Jt}from"@radix-ui/react-popover";import{ChevronLeft as zt,ChevronRight as Vt}from"lucide-react";import{DayPicker as Ut}from"react-day-picker";import{jsx as Ne}from"react/jsx-runtime";function nt({className:e,classNames:t,showOutsideDays:o=!0,...n}){return Ne(Ut,{showOutsideDays:o,className:y("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:y(Ce({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(Ce({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:a,...c})=>Ne(zt,{className:y("size-4",a),...c}),"IconLeft"),IconRight:r(({className:a,...c})=>Ne(Vt,{className:y("size-4",a),...c}),"IconRight")},...n})}r(nt,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as ie}from"react/jsx-runtime";function me({...e}){return ie(z.Root,{"data-slot":"popover",...e})}r(me,"Popover");function de({...e}){return ie(z.Trigger,{"data-slot":"popover-trigger",...e})}r(de,"PopoverTrigger");function ce({className:e,align:t="center",sideOffset:o=4,...n}){return ie(z.Portal,{children:ie(z.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:y("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}r(ce,"PopoverContent");import{format as at,parse as qt}from"date-fns";import{Fragment as jt,jsx as M,jsxs as we}from"react/jsx-runtime";function st({description:e,label:t,name:o,minDate:n,onChange:a,component:c,...d}){let{components:F}=S(),{control:f}=b(),u;return d.meta?.mot&&typeof d.meta.mot=="number"?u=Ve(d.meta.mot):n&&(u=qt(n,"yyyy-MM-dd",new Date)),M(k,{control:f,name:o,render:({field:s,fieldState:i})=>{let m=c||F?.date;if(m){let l={description:e,label:t,name:o,onChange:a,...u&&{minDate:u.toISOString()},...d};return M(m,{field:{...s,onChange:r(g=>{s.onChange(g),a?.(g)},"onChange")},fieldState:i,fieldData:l})}return we(w,{"data-field":o,className:`flex flex-col RemoteFlows__DatePickerField__Item__${o}`,children:[M(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),we(me,{children:[M(de,{asChild:!0,children:M(R,{children:M("div",{children:we(I,{type:"button",variant:"outline",className:y("w-full pl-3 text-left font-normal",!s.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${o}`,children:[s.value&&M(jt,{children:at(s.value,"yyyy-MM-dd")}),M(Gt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),M(ce,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:M(nt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:s.value?new Date(s.value):void 0,onSelect:l=>{s.onChange(l?at(l,"yyyy-MM-dd"):null),a?.(l)},defaultMonth:u,components:{DayContent:r(l=>M(Jt,{children:l.date.getDate()}),"DayContent")},...u&&{disabled:r(l=>l<u,"disabled")}})})]}),e?M(P,{children:e}):null,i.error&&M(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(st,"DatePickerField");import{useState as Kt,useRef as Yt}from"react";import{Upload as Zt,X as Xt}from"lucide-react";import{jsx as V,jsxs as ue}from"react/jsx-runtime";var Qt=r(e=>e?e.split(",").map(t=>t.trim().toUpperCase()).join(", "):null,"getAcceptedFormats");function lt({onChange:e,className:t,multiple:o,accept:n}){let[a,c]=Kt([]),d=Yt(null),F=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),f=r(i=>{if(i.target.files&&i.target.files.length>0){let m=Array.from(i.target.files);c(m),e(i)}},"handleChange"),u=r(i=>{c(m=>m.filter(l=>l!==i))},"onRemoveFile"),s=Qt(n);return ue("div",{className:y("flex flex-col items-start gap-4",t),children:[V("input",{type:"file",ref:d,onChange:f,className:"hidden","aria-label":"File upload",multiple:o,accept:n}),ue(I,{type:"button",onClick:F,className:"gap-2",children:[V(Zt,{className:"h-4 w-4"}),"Choose File"]}),s&&ue("div",{className:"text-sm text-gray-600",children:["Accepted formats:"," ",V("span",{className:"font-medium",children:s})]}),a.length===0&&V("div",{className:"text-sm",children:o?V("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):V("span",{className:"font-medium",children:"No file selected."})}),a.length>0&&a.map((i,m)=>ue("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",V("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",V(I,{variant:"ghost",onClick:()=>u(i),children:V(Xt,{})})]},m))]})}r(lt,"FileUploader");import{jsx as U,jsxs as ro}from"react/jsx-runtime";var eo=r(e=>new Promise((t,o)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=a=>o(a)}),"toBase64"),to=r(async e=>await Promise.all(e.map(async o=>{let n=await eo(o);return{name:o.name,content:n.split(",")[1]}})),"convertFilesToBase64"),oo=r((e,t)=>{if(!t)return null;for(let o of e)if(o.size>t){let n=Math.round(t/1048576),a=Math.round(o.size/(1024*1024));return`File "${o.name}" exceeds maximum size of ${n}MB (file is ${a}MB)`}return null},"validateFileSize");function it({name:e,description:t,label:o,multiple:n,onChange:a,component:c,accept:d,maxSize:F,...f}){let{components:u}=S(),{control:s,setError:i,clearErrors:m}=b(),l=r(async(g,p)=>{let h=g.target.files?Array.from(g.target.files):[],x=oo(h,F);if(x){i(e,{message:x});return}m(e);let C=await to(h);p.onChange(C),a?.(C)},"handleOnChange");return U(k,{control:s,name:e,render:({field:g,fieldState:p})=>{let h=c||u?.file;if(h){let x={name:e,description:t,label:o,multiple:n,accept:d,maxFileSize:F,...f};return U(h,{field:{...g,value:null,onChange:r(async C=>l(C,g),"onChange")},fieldState:p,fieldData:x})}return ro(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[U(N,{className:"RemoteFlows__FileUpload__Label",children:o}),U(R,{children:U(lt,{onChange:x=>l(x,g),multiple:n,className:y("RemoteFlows__FileUpload__Input"),accept:d})}),t&&U("div",{className:"flex items-center justify-between",children:U(P,{className:"RemoteFlows__FileUpload__Description",children:t})}),p.error&&U(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(it,"FileUploadField");import{jsx as Re}from"react/jsx-runtime";function pe(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.number;return n?Re(k,{control:o,name:e.name,render:({field:a,fieldState:c})=>Re(n,{field:{...a,onChange:r(d=>{a.onChange(d),e.onChange?.(d)},"onChange")},fieldState:c,fieldData:e})}):Re(A,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(pe,"NumberField");import{Fragment as no}from"react";import{jsx as W,jsxs as Pe}from"react/jsx-runtime";function mt({name:e,defaultValue:t,description:o,label:n,options:a,onChange:c,component:d,...F}){let{components:f}=S(),{control:u}=b();return W(k,{control:u,name:e,defaultValue:t,render:({field:s,fieldState:i})=>{let m=d||f?.radio;if(m){let l={name:e,defaultValue:t,description:o,label:n,options:a,...F};return W(m,{field:{...s,onChange:r(g=>{s.onChange(g),c?.(g)},"onChange")},fieldState:i,fieldData:l})}return Pe(w,{className:y("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:n}),W(R,{children:W(Ge,{"aria-label":n||e,onValueChange:l=>{s.onChange(l),c?.(l)},value:s.value,className:"flex flex-col space-y-3",children:a?.map(l=>W(no,{children:Pe(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(R,{children:W(Je,{value:l.value,className:"RemoteFlows__RadioField__Input",disabled:l.disabled})}),Pe("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:l.label}),l.description&&W(P,{className:"mt-2",children:l.description})]})]})},l.value))})}),o&&W(P,{children:o}),i.error&&W(D,{})]})}})}r(mt,"RadioGroupField");import{jsx as E,jsxs as dt}from"react/jsx-runtime";function ct({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,component:d,...F}){let{control:f}=b(),{components:u}=S();return E(k,{defaultValue:n,control:f,name:t,render:({field:s,fieldState:i})=>{let m=d||u?.select;if(m){let l={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,...F};return E(m,{field:{...s,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;s.onChange(p),c?.(p)},"onChange")},fieldState:i,fieldData:l})}return dt(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[E(N,{className:"RemoteFlows__SelectField__Label",children:e}),E(R,{children:E("div",{className:"relative",children:dt(qe,{value:s.value||"",onValueChange:l=>{let g=F.jsonType==="number"?Number(l):l;s.onChange(g),c?.(g)},children:[E(Ye,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!i.error,"aria-label":e,children:E("span",{className:"absolute",children:E(Ke,{placeholder:e})})}),E(Ze,{className:"RemoteFlows__SelectField__Content",children:E(je,{className:"RemoteFlows__SelectField__Group",children:o.map(l=>E(Xe,{value:l.value,className:"RemoteFlows__SelectField__SelectItem",disabled:l.disabled,children:l.label},l.value))})})]})})}),a&&E(P,{children:a}),i.error&&E(D,{})]})}})}r(ct,"SelectField");import{useState as co}from"react";import{Fragment as ao,useState as so}from"react";import{Check as lo,ChevronDownIcon as io,X as mo}from"lucide-react";import{Command as K}from"cmdk";import{SearchIcon as sn}from"lucide-react";import{jsx as Y,jsxs as cn}from"react/jsx-runtime";function ut({className:e,...t}){return Y(K,{"data-slot":"command",className:y("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(ut,"Command");function pt({className:e,...t}){return Y(K.List,{"data-slot":"command-list",className:y("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(pt,"CommandList");function ft({...e}){return Y(K.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ft,"CommandEmpty");function Ft({className:e,...t}){return Y(K.Group,{"data-slot":"command-group",className:y("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(Ft,"CommandGroup");function gt({className:e,...t}){return Y(K.Separator,{"data-slot":"command-separator",className:y("bg-border -mx-1 h-px",e),...t})}r(gt,"CommandSeparator");function ht({className:e,...t}){return Y(K.Item,{"data-slot":"command-item",className:y("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(ht,"CommandItem");import{jsx as L,jsxs as Z}from"react/jsx-runtime";function fe({options:e,selected:t,onChange:o,placeholder:n,...a}){let[c,d]=so(!1),F=r(s=>{o(t.filter(i=>i.value!==s.value))},"handleUnselect"),f=e.some(s=>s.category),u=e.reduce((s,i)=>{let m=i.category||"Uncategorized";return s[m]||(s[m]=[]),s[m].push(i),s},{});return Z(me,{open:c,onOpenChange:d,...a,children:[L(de,{children:Z(I,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(s=>Z(Qe,{variant:"secondary",className:"mr-1 mb-1",children:[s.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${s.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:i=>{i.key==="Enter"&&F(s)},onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},onClick:()=>F(s),children:L(mo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},s.label)):L("span",{className:"text-foreground",children:n})}),L(io,{className:"size-4"})]})}),L(ce,{align:"start",className:"w-full p-0",children:L(ut,{children:Z(pt,{children:[L(ft,{children:"No item found."}),Object.entries(u).map(([s,i],m)=>Z(ao,{children:[m>0&&L(gt,{}),L(Ft,{heading:f?s:void 0,children:i.map(l=>{let g=t.some(p=>p.value===l.value);return Z(ht,{onSelect:()=>{o(g?t.filter(p=>p.value!==l.value):[...t,l])},children:[L(lo,{className:y("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),l.label]},l.label)})})]},s))]})})})]})}r(fe,"MultiSelect");import{jsx as G,jsxs as uo}from"react/jsx-runtime";function _t({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,$meta:d,component:F,...f}){let{control:u}=b(),{components:s}=S(),[i,m]=co([]);return G(k,{defaultValue:n,control:u,name:t,render:({field:l,fieldState:g})=>{let p=F||s?.countries;if(p){let C={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,$meta:d,...f};return G(p,{field:{...l,onChange:r(T=>{l.onChange(T),c?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(d?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(d?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...o.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],x=r(C=>{let T=C.map(({value:j})=>j);l.onChange(T),c?.(T),m(C)},"handleChange");return uo(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[G(N,{className:"RemoteFlows__CountryField__Label",children:e}),G(R,{children:G(fe,{options:h,selected:i,onChange:x,...f})}),a&&G(P,{children:a}),g.error&&G(D,{})]})}})}r(_t,"CountryField");import*as yt from"react";import{jsx as po}from"react/jsx-runtime";var De=yt.forwardRef(({className:e,...t},o)=>po("textarea",{className:y("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));De.displayName="Textarea";import{jsx as J,jsxs as Te}from"react/jsx-runtime";function vt({name:e,description:t,label:o,onChange:n,maxLength:a,component:c,...d}){let{components:F}=S(),{control:f}=b();return J(k,{control:f,name:e,render:({field:u,fieldState:s})=>{let i=c||F?.textarea;if(i){let l={name:e,description:t,label:o,maxLength:a,...d};return J(i,{field:{...u,onChange:r(g=>{u.onChange(g),n?.(g)},"onChange")},fieldState:s,fieldData:l})}let m=u.value?.length??0;return Te(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[J(N,{className:"RemoteFlows__TextArea__Label",children:o}),J(R,{children:J(De,{...u,value:u.value??"",onChange:l=>{u.onChange(l),n?.(l)},className:y(s.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:o})}),(t||a)&&Te("div",{className:"flex items-center justify-between",children:[t&&J(P,{className:"RemoteFlows__TextArea__Description",children:t}),a&&Te("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",a]})]}),s.error&&J(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(vt,"TextAreaField");import{jsx as $e}from"react/jsx-runtime";function Ct(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.email;return n?$e(k,{control:o,name:e.name,render:({field:a,fieldState:c})=>$e(n,{field:{...a,onChange:r(d=>{a.onChange(d),e.onChange?.(d)},"onChange")},fieldState:c,fieldData:e})}):$e(A,{...e,type:"email"})}r(Ct,"EmailField");import{jsx as xt}from"react/jsx-runtime";function bt(e){let{control:t}=b();return xt(k,{control:t,name:e.name,render:({field:o})=>xt("input",{...o,type:"hidden"})})}r(bt,"HiddenField");import vo,{useEffect as Co,useState as $t}from"react";var St=r((e,t,o)=>{if(e&&"reportValidity"in e){let n=ne(o,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},"r"),Ie=r((e,t)=>{for(let o in t.fields){let n=t.fields[o];n&&n.ref&&"reportValidity"in n.ref?St(n.ref,o,e):n&&n.refs&&n.refs.forEach(a=>St(a,o,e))}},"o"),Nt=r((e,t)=>{t.shouldUseNativeValidation&&Ie(e,t);let o={};for(let n in e){let a=ne(t.fields,n),c=Object.assign(e[n]||{},{ref:a&&a.ref});if(fo(t.names||Object.keys(e),n)){let d=Object.assign({},ne(o,n));ae(d,"root",c),ae(o,n,d)}else ae(o,n,c)}return o},"s"),fo=r((e,t)=>{let o=kt(t);return e.some(n=>kt(n).match(`^${o}\\.\\d+`))},"i");function kt(e){return e.replace(/\]|\[/g,"")}r(kt,"n");function wt(e,t,o){return t===void 0&&(t={}),o===void 0&&(o={}),function(n,a,c){try{return Promise.resolve(function(d,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[o.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:a}))).then(function(u){return c.shouldUseNativeValidation&&Ie({},c),{values:o.raw?Object.assign({},n):u,errors:{}}}))}catch(u){return F(u)}return f&&f.then?f.then(void 0,F):f}(0,function(d){if(!d.inner)throw d;return{values:{},errors:Nt((F=d,f=!c.shouldUseNativeValidation&&c.criteriaMode==="all",(F.inner||[]).reduce(function(u,s){if(u[s.path]||(u[s.path]={message:s.message,type:s.type}),f){var i=u[s.path].types,m=i&&i[s.type];u[s.path]=Ae(s.path,f,u,s.type,m?[].concat(m,s.message):s.message)}return u},{})),c)};var F,f}))}catch(d){return Promise.reject(d)}}}r(wt,"o");import*as $ from"yup";import Rt from"lodash.groupby";import X from"lodash.capitalize";var Pt=60,Fe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Fo(e){if(e<60)return`${e}m`;let t=Math.floor(e/Pt),o=e%Pt;return o>0?`${t}h${o}m`:`${t}h`}r(Fo,"convertBreakDurationToHours");function Dt(e){let t=e.reduce((o,n)=>n.hours+o,0);return Number(t.toFixed(2))}r(Dt,"calculateTotalWorkHours");function go(e,t){let o=t.map(({day:c})=>c.toLowerCase()),n=o.indexOf(e),a=null;for(;n<o.length&&!a;){let c=o[n],d=o[n+1],F=Fe.indexOf(c)+1;Fe[F]===d||(a=c),n+=1}return a}r(go,"findLastConsecutiveDay");function ho(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(ho,"shouldSummarizeSchedule");function _o(e){return Number.parseInt(e.break_duration_minutes)>0}r(_o,"shouldSummarizeBreaks");function Tt(e){let t=e.filter(ho),o=Rt(t,F=>`${F.start_time}|${F.end_time}`),n=e.filter(_o),a=Rt(n,"break_duration_minutes"),c=Object.keys(o).map(F=>{let f=o[F],u=f[0].day,[s,i]=F.split("|"),m=`from <span>${s.replace(":","h")}</span> to <span>${i.replace(":","h")}</span>`,l=go(u,f),p=(l?f.findIndex(h=>h.day===l):-1)===f.length-1;return f.length===1?`${X(u)}, ${m}`:!p||!l?f.reduce((h,x,C)=>{let T=X(x.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${X(u)}</span> to <span>${X(l)}</span>, ${m}`}),d=Object.keys(a).reverse().map((F,f)=>{let u=f===0,s=a[F],i=Fo(parseInt(F,10));if(Object.keys(a).length===1)return`With ${i} daily breaks`;if(s.length===1){let m=`${i} break on ${X(s[0].day)}.`;return u?`With ${m}`:m}return s.reduce((m,l,g)=>{let p=X(l.day);return g===0?`${m} ${p}`:g===s.length-1?`${m}, and ${p}.`:`${m}, ${p}`},u?`With ${i} break on`:`${i} break on`)});return{workHoursSummary:c,breakSummary:d}}r(Tt,"buildWorkScheduleSummary");function Me(e){let{checked:t,start_time:o,end_time:n,break_duration_minutes:a}=e;if(!t)return 0;let[c,d]=o.split(":").map(Number),[F,f]=n.split(":").map(Number),u=c*60+d,m=(F*60+f-u-Number.parseInt(a||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Me,"calculateHours");var yo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function ge(e){return yo[e]}r(ge,"getShortWeekday");import{jsx as v,jsxs as B}from"react/jsx-runtime";var xo=$.object({day:$.string().required(),checked:$.boolean().required(),start_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:$.number().default(0),break_duration_minutes:$.string().default("0")}),bo=$.object({schedule:$.array(xo)});function So({defaultSchedule:e,onSubmit:t}){let[o,n]=$t(!1),a=Fe.map(p=>{let h=e.find(x=>x.day.toLowerCase()===ge(p).toLowerCase()||x.day.toLowerCase()===p.toLowerCase());return h?{...h,day:ge(p),checked:!0}:{...e[0],checked:!1,day:ge(p)}}),c=ze({defaultValues:{schedule:a},resolver:wt(bo)}),{handleSubmit:d,watch:F,reset:f,control:u,formState:s}=c,{fields:i}=Oe({name:"schedule",control:u}),m=F("schedule");function l(p){let h=p.schedule.filter(({checked:x})=>x).map(x=>({...x,hours:Me(x)}));t(h),n(!1)}r(l,"handleSubmitWorkingHours");function g(){f(),n(!1)}return r(g,"handleCancel"),v("div",{className:"flex items-center justify-between",children:B(xe,{open:o,onOpenChange:n,children:[v(et,{asChild:!0,children:v(I,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),B(be,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[v(Se,{children:v(ke,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),v(Ue,{...c,children:B("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[B("div",{className:"rounded-lg",children:[v("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),B("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[v("div",{className:"col-span-2"}),v("div",{className:"col-span-3 text-center",children:"START"}),v("div",{className:"col-span-1 text-center"}),v("div",{className:"col-span-3 text-center",children:"END"}),v("div",{className:"col-span-2 text-center",children:"HOURS"})]}),v("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:i.map((p,h)=>{let x=m[h],C=Me(x);return B(vo.Fragment,{children:[B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[v("div",{className:"col-span-2 flex items-center gap-3",children:v(le,{label:p.day,name:`schedule.${h}.checked`})}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[v("div",{className:"col-span-2 text-gray-500",children:"Break"}),v("div",{className:"col-span-2",children:v(A,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-gray-500",children:"minutes"}),v("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(s.errors).length>0&&v("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),B("div",{className:"flex gap-4 pt-4",children:[v(I,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),v(I,{type:"button",className:"submit-button",onClick:d(l),children:"Save Schedule"})]})]})})]})]})})}r(So,"WorkScheduleSelectionForm");function It(e){let{components:t}=S(),{setValue:o,control:n,watch:a}=b(),c=a(e.name),[d,F]=$t(c),{workHoursSummary:f,breakSummary:u}=Tt(d),s=Dt(d);Co(()=>{o(e.name,d)},[d,e.name,o]);function i(l){F(l)}r(i,"onSubmit");let m=e.component||t?.["work-schedule"];return m?v(k,{control:n,name:e.name,render:({field:l,fieldState:g})=>v(m,{field:{...l,onChange:r(p=>{l.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:u,totalWorkHours:s}}})}):B("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[v("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),B("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:u.join()}),B("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",v("span",{children:s})," hours per week"]}),v(So,{defaultSchedule:d,onSubmit:i})]})]})}r(It,"WorkScheduleField");import{useState as ko}from"react";import{jsx as q,jsxs as No}from"react/jsx-runtime";function Mt({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,component:d,...F}){let{control:f}=b(),{components:u}=S(),[s,i]=ko();return q(k,{defaultValue:n,control:f,name:t,render:({field:m,fieldState:l})=>{let g=d||u?.["multi-select"];if(g){let h={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,...F};return q(g,{field:{...m,onChange:r(x=>{m.onChange(x),c?.(x)},"onChange")},fieldState:l,fieldData:h})}let p=s||o.filter(h=>m.value.includes(h.value));return No(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[q(N,{className:"RemoteFlows__SelectField__Label",children:e}),q(R,{children:q(fe,{options:o,selected:p,onChange:h=>{let x=h.map(({value:C})=>C);m.onChange(x),c?.(x),i(h)},...F})}),a&&q(P,{children:a}),l.error&&q(D,{})]})}})}r(Mt,"MultiSelectField");import{jsx as wo}from"react/jsx-runtime";var Et=r(e=>wo(pe,{maxLength:15,...e}),"MoneyField");var Ee={checkbox:le,text:A,email:Ct,money:Et,select:ct,"multi-select":Mt,radio:mt,number:pe,file:it,date:st,textarea:vt,countries:_t,hidden:bt,"work-schedule":It};import{AlertCircle as Ro}from"lucide-react";import{jsx as he,jsxs as Po}from"react/jsx-runtime";function Wt({title:e,description:t,severity:o}){let{components:n}=S();if(n?.statement){let a=n?.statement;return he(a,{data:{title:e,description:oe(t),severity:o}})}return Po(tt,{variant:"warning",children:[he(Ro,{className:"h-4 w-4"}),e&&he(ot,{children:e}),t&&he(rt,{dangerouslySetInnerHTML:{__html:oe(t)}})]})}r(Wt,"Statement");import{Fragment as Io,jsx as H,jsxs as Q}from"react/jsx-runtime";var $o=r(({isExpanded:e,onToggle:t,className:o,...n})=>H(I,{type:"button",className:y("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",o),variant:"default",onClick:t,...n,children:e?"Remove":"Define"}),"DefaultToggleButton");function Bt({label:e,name:t,fields:o,description:n,components:a,statement:c,isFlatFieldset:d,extra:F,variant:f="outset",features:u,meta:s}){let{helpCenter:i}=s||{},{watch:m,setValue:l,trigger:g,formState:p}=b(),{components:h}=S(),x=u?.toggle?.stateField,C=x?m(x):u?.toggle?.defaultExpanded??!0,T=o.map(({name:_})=>`${t}.${_}`),j=m(T),We=Lt(j),ee=Lt(null),Ht=r(()=>{x&&l(x,!C)},"toggleExpanded");To(()=>{let _=j,re=We.current,_e=p.isSubmitted||p.submitCount>0,He=!1;for(let te=0;te<_.length;te++)if(_[te]!==void 0&&re[te]!==_[te]){He=!0;break}return He&&_e&&(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{g()},50)),We.current=[..._],()=>{ee.current&&clearTimeout(ee.current)}},[j,g,p.isSubmitted,p.submitCount]);let At=h?.fieldsetToggle||$o,Le=`${t}-content`,Be=`${t}-header`;return Q("fieldset",{className:y("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[H("legend",{className:y("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),i?.callToAction&&i?.id&&f==="outset"&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:i.id,children:i.callToAction}),f==="inset"&&Q(Io,{children:[Q("div",{className:"RemoteFlows__FieldSetField__Header",id:Be,"data-state":C?"expanded":"collapsed","aria-expanded":C,children:[H("h3",{className:y("RemoteFlows__FieldSetField__Title"),children:e}),u?.toggle?.enabled&&H(At,{isExpanded:C,onToggle:Ht,"aria-expanded":C,"aria-controls":Le,"aria-label":`${C?"Hide":"Show"} ${e}`,className:y("RemoteFlows__FieldSetField__Toggle",u.toggle?.className),children:C?u.toggle.labels?.collapse??"Remove":u.toggle.labels?.expand??"Define"})]}),i?.callToAction&&i?.id&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:i.id,children:i.callToAction})]}),C&&Q("div",{id:Le,"aria-labelledby":Be,role:"region",children:[n?H("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:oe(n)}}):null,Q("div",{className:"grid gap-4",children:[o.map(_=>{if(_.calculateDynamicProperties&&(_={..._,..._.calculateDynamicProperties(j,_)||{}}),_.isVisible===!1||_.deprecated)return null;if(_.Component){let{Component:_e}=_;return H(_e,{..._},_.name)}if(_.type==="fieldset")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:a},`${d?_.name:`${t}.${_.name}`}`);if(_.type==="fieldset-flat")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:a,isFlatFieldset:!0},`${d?_.name:`${t}.${_.name}`}`);let re=Ee[_.type];return _.type==="select"&&_.multiple&&(re=Ee["multi-select"]),Q(Do,{children:[H(re,{..._,name:`${d?_.name:`${t}.${_.name}`}`,component:a?.[_.type]}),_.extra?_.extra:null]},`${d?_.name:`${t}.${_.name}`}`)}),F||null,c?H(Wt,{...c}):null]})]})]})}r(Bt,"FieldSetField");export{Ee as a,Wt as b,Bt as c};
2
+ //# sourceMappingURL=chunk-DB7ITLRX.js.map