@remoteoss/remote-flows 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/{ZendeskTriggerButton-FSCvhzTG.d.ts → ZendeskTriggerButton-DIV8pCPo.d.ts} +2 -1
  2. package/dist/{chunk-KH5SAWNH.js → chunk-2FKEF3OG.js} +2 -2
  3. package/dist/{chunk-AU6AILO2.js → chunk-53KVZ4BP.js} +2 -2
  4. package/dist/{chunk-46JFDBPC.js → chunk-5MYWJJBQ.js} +2 -2
  5. package/dist/{chunk-22JG4IMF.js → chunk-5NPET4ZO.js} +2 -2
  6. package/dist/{chunk-I3PGODII.js → chunk-6KIQIVKA.js} +2 -2
  7. package/dist/{chunk-T5LZSTW3.js → chunk-6LJRRFK2.js} +2 -2
  8. package/dist/chunk-7AC3W7WD.js +2 -0
  9. package/dist/chunk-7AC3W7WD.js.map +1 -0
  10. package/dist/chunk-7VOQAVM4.js +2 -0
  11. package/dist/chunk-7VOQAVM4.js.map +1 -0
  12. package/dist/chunk-ANQ4HVVK.js +2 -0
  13. package/dist/chunk-ANQ4HVVK.js.map +1 -0
  14. package/dist/{chunk-P4ZSYIA4.js → chunk-AODV6HT2.js} +2 -2
  15. package/dist/{chunk-S2KE2JLJ.js → chunk-AUZWLETL.js} +2 -2
  16. package/dist/{chunk-BGXVK7HL.js → chunk-AWDGLK2T.js} +2 -2
  17. package/dist/{chunk-VUP76ZMQ.js → chunk-BOTWQMOJ.js} +2 -2
  18. package/dist/{chunk-PHBQMNG3.js → chunk-CVIWZYO3.js} +2 -2
  19. package/dist/chunk-DB7ITLRX.js +2 -0
  20. package/dist/chunk-DB7ITLRX.js.map +1 -0
  21. package/dist/{chunk-2M7EBC4K.js → chunk-DZ7FZ4L2.js} +2 -2
  22. package/dist/{chunk-W5BJQRNM.js → chunk-E6OBNWMU.js} +2 -2
  23. package/dist/chunk-EHAZWZ3O.js +2 -0
  24. package/dist/chunk-EHAZWZ3O.js.map +1 -0
  25. package/dist/{chunk-4JVXDB5G.js → chunk-FFMKAMWP.js} +2 -2
  26. package/dist/{chunk-I52UTPHD.js → chunk-GWLOE7WJ.js} +2 -2
  27. package/dist/{chunk-LHSNAVGR.js → chunk-HMNHKZGD.js} +2 -2
  28. package/dist/{chunk-M6G27EJN.js → chunk-IQKZWU7I.js} +2 -2
  29. package/dist/chunk-IWA5B4U6.js +2 -0
  30. package/dist/chunk-IWA5B4U6.js.map +1 -0
  31. package/dist/{chunk-RNJWBKLA.js → chunk-JO4722R7.js} +2 -2
  32. package/dist/chunk-LMYJ6V44.js +2 -0
  33. package/dist/chunk-LMYJ6V44.js.map +1 -0
  34. package/dist/{chunk-74DRB7Z5.js → chunk-MGVP76ZI.js} +2 -2
  35. package/dist/{chunk-VVF4IZES.js → chunk-MRPXDND2.js} +2 -2
  36. package/dist/chunk-NP4G3N5P.js +2 -0
  37. package/dist/{chunk-4IXRU67S.js → chunk-OU4Y73FX.js} +2 -2
  38. package/dist/{chunk-BLZW25OE.js → chunk-PYKEYPGA.js} +2 -2
  39. package/dist/{chunk-7KNNJBO6.js → chunk-QDYWPG2R.js} +2 -2
  40. package/dist/{chunk-OCNL6L4L.js → chunk-QPTO4XXU.js} +2 -2
  41. package/dist/{chunk-EJ4COVQQ.js → chunk-QTYDDIVO.js} +2 -2
  42. package/dist/chunk-R3DJNVHR.js +2 -0
  43. package/dist/chunk-R3DJNVHR.js.map +1 -0
  44. package/dist/chunk-R645TMO5.js +2 -0
  45. package/dist/{chunk-2TADRH4W.js.map → chunk-R645TMO5.js.map} +1 -1
  46. package/dist/{chunk-JHPCP2ZX.js → chunk-RAHCZTQ3.js} +2 -2
  47. package/dist/{chunk-CT2ROVBF.js → chunk-TM7Q7RHH.js} +2 -2
  48. package/dist/chunk-UFBTCHEI.js +2 -0
  49. package/dist/{chunk-IUZ7DEXC.js.map → chunk-UFBTCHEI.js.map} +1 -1
  50. package/dist/{chunk-RDGF4PBB.js → chunk-UQOWSJ2B.js} +2 -2
  51. package/dist/chunk-VDRNNOVA.js +2 -0
  52. package/dist/chunk-VDRNNOVA.js.map +1 -0
  53. package/dist/chunk-VM2DQCZO.js +2 -0
  54. package/dist/chunk-VM2DQCZO.js.map +1 -0
  55. package/dist/chunk-W55MUSAS.js +2 -0
  56. package/dist/{chunk-NVYMAOQ7.js.map → chunk-W55MUSAS.js.map} +1 -1
  57. package/dist/{chunk-NWEXPORY.js → chunk-WCIJHQMP.js} +2 -2
  58. package/dist/chunk-WLBRCGTG.js +2 -0
  59. package/dist/{chunk-QKLIYOMA.js.map → chunk-WLBRCGTG.js.map} +1 -1
  60. package/dist/chunk-XPKVRYIU.js +2 -0
  61. package/dist/chunk-XPKVRYIU.js.map +1 -0
  62. package/dist/{chunk-3VYNEJMC.js → chunk-Z42H2QEW.js} +2 -2
  63. package/dist/{chunk-HCZWP44I.js → chunk-ZWZJ4XOY.js} +2 -2
  64. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  65. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  66. package/dist/flows/ContractAmendment/index.js +1 -1
  67. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  68. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  69. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  70. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  71. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  72. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  73. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  74. package/dist/flows/ContractorOnboarding/index.js +1 -1
  75. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  76. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  77. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  78. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  79. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  80. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  81. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  82. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  83. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  84. package/dist/flows/CostCalculator/hooks.js +1 -1
  85. package/dist/flows/CostCalculator/index.js +1 -1
  86. package/dist/flows/CostCalculator/utils.js +1 -1
  87. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  88. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  89. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  90. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  91. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  92. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  93. package/dist/flows/Onboarding/index.js +1 -1
  94. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  95. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  96. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  97. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  98. package/dist/flows/Termination/TerminationFlow.js +1 -1
  99. package/dist/flows/Termination/TerminationForm.js +1 -1
  100. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.d.ts +10 -0
  101. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js +2 -0
  102. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js.map +1 -0
  103. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.d.ts +11 -0
  104. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js +2 -0
  105. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js.map +1 -0
  106. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.d.ts +18 -0
  107. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +2 -0
  108. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js.map +1 -0
  109. package/dist/flows/Termination/components/AcknowledgeInformation/constants.d.ts +12 -0
  110. package/dist/flows/Termination/components/AcknowledgeInformation/constants.js +2 -0
  111. package/dist/flows/Termination/components/AcknowledgeInformation/constants.js.map +1 -0
  112. package/dist/flows/Termination/components/AcknowledgeInformation/types.d.ts +11 -0
  113. package/dist/flows/Termination/components/AcknowledgeInformation/types.js +1 -0
  114. package/dist/flows/Termination/components/AcknowledgeInformation/types.js.map +1 -0
  115. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  116. package/dist/flows/Termination/hooks.js +1 -1
  117. package/dist/flows/Termination/index.d.ts +4 -0
  118. package/dist/flows/Termination/index.js +1 -1
  119. package/dist/flows/Termination/json-schemas/additionalInformation.d.ts +17 -0
  120. package/dist/flows/Termination/json-schemas/additionalInformation.js +1 -1
  121. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +19 -0
  122. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  123. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +1 -0
  124. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  125. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  126. package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +1 -0
  127. package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
  128. package/dist/flows/api.js +1 -1
  129. package/dist/index.css +1 -1
  130. package/dist/index.css.map +1 -1
  131. package/dist/index.d.ts +52 -1
  132. package/dist/index.js +1 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/internals.d.ts +1 -1
  135. package/dist/internals.js +1 -1
  136. package/package.json +1 -1
  137. package/dist/chunk-2TADRH4W.js +0 -2
  138. package/dist/chunk-32GSS4UM.js +0 -2
  139. package/dist/chunk-32GSS4UM.js.map +0 -1
  140. package/dist/chunk-4T6PRR6R.js +0 -2
  141. package/dist/chunk-4T6PRR6R.js.map +0 -1
  142. package/dist/chunk-GC23RRCI.js +0 -2
  143. package/dist/chunk-GC23RRCI.js.map +0 -1
  144. package/dist/chunk-HHWIJGDR.js +0 -2
  145. package/dist/chunk-HHWIJGDR.js.map +0 -1
  146. package/dist/chunk-IUZ7DEXC.js +0 -2
  147. package/dist/chunk-MP2T74PU.js +0 -2
  148. package/dist/chunk-MP2T74PU.js.map +0 -1
  149. package/dist/chunk-NVYMAOQ7.js +0 -2
  150. package/dist/chunk-Q3A4A2HL.js +0 -2
  151. package/dist/chunk-QEWB24WT.js +0 -2
  152. package/dist/chunk-QEWB24WT.js.map +0 -1
  153. package/dist/chunk-QKLIYOMA.js +0 -2
  154. package/dist/chunk-XSHHMBMT.js +0 -2
  155. package/dist/chunk-XSHHMBMT.js.map +0 -1
  156. /package/dist/{chunk-KH5SAWNH.js.map → chunk-2FKEF3OG.js.map} +0 -0
  157. /package/dist/{chunk-AU6AILO2.js.map → chunk-53KVZ4BP.js.map} +0 -0
  158. /package/dist/{chunk-46JFDBPC.js.map → chunk-5MYWJJBQ.js.map} +0 -0
  159. /package/dist/{chunk-22JG4IMF.js.map → chunk-5NPET4ZO.js.map} +0 -0
  160. /package/dist/{chunk-I3PGODII.js.map → chunk-6KIQIVKA.js.map} +0 -0
  161. /package/dist/{chunk-T5LZSTW3.js.map → chunk-6LJRRFK2.js.map} +0 -0
  162. /package/dist/{chunk-P4ZSYIA4.js.map → chunk-AODV6HT2.js.map} +0 -0
  163. /package/dist/{chunk-S2KE2JLJ.js.map → chunk-AUZWLETL.js.map} +0 -0
  164. /package/dist/{chunk-BGXVK7HL.js.map → chunk-AWDGLK2T.js.map} +0 -0
  165. /package/dist/{chunk-VUP76ZMQ.js.map → chunk-BOTWQMOJ.js.map} +0 -0
  166. /package/dist/{chunk-PHBQMNG3.js.map → chunk-CVIWZYO3.js.map} +0 -0
  167. /package/dist/{chunk-2M7EBC4K.js.map → chunk-DZ7FZ4L2.js.map} +0 -0
  168. /package/dist/{chunk-W5BJQRNM.js.map → chunk-E6OBNWMU.js.map} +0 -0
  169. /package/dist/{chunk-4JVXDB5G.js.map → chunk-FFMKAMWP.js.map} +0 -0
  170. /package/dist/{chunk-I52UTPHD.js.map → chunk-GWLOE7WJ.js.map} +0 -0
  171. /package/dist/{chunk-LHSNAVGR.js.map → chunk-HMNHKZGD.js.map} +0 -0
  172. /package/dist/{chunk-M6G27EJN.js.map → chunk-IQKZWU7I.js.map} +0 -0
  173. /package/dist/{chunk-RNJWBKLA.js.map → chunk-JO4722R7.js.map} +0 -0
  174. /package/dist/{chunk-74DRB7Z5.js.map → chunk-MGVP76ZI.js.map} +0 -0
  175. /package/dist/{chunk-VVF4IZES.js.map → chunk-MRPXDND2.js.map} +0 -0
  176. /package/dist/{chunk-Q3A4A2HL.js.map → chunk-NP4G3N5P.js.map} +0 -0
  177. /package/dist/{chunk-4IXRU67S.js.map → chunk-OU4Y73FX.js.map} +0 -0
  178. /package/dist/{chunk-BLZW25OE.js.map → chunk-PYKEYPGA.js.map} +0 -0
  179. /package/dist/{chunk-7KNNJBO6.js.map → chunk-QDYWPG2R.js.map} +0 -0
  180. /package/dist/{chunk-OCNL6L4L.js.map → chunk-QPTO4XXU.js.map} +0 -0
  181. /package/dist/{chunk-EJ4COVQQ.js.map → chunk-QTYDDIVO.js.map} +0 -0
  182. /package/dist/{chunk-JHPCP2ZX.js.map → chunk-RAHCZTQ3.js.map} +0 -0
  183. /package/dist/{chunk-CT2ROVBF.js.map → chunk-TM7Q7RHH.js.map} +0 -0
  184. /package/dist/{chunk-RDGF4PBB.js.map → chunk-UQOWSJ2B.js.map} +0 -0
  185. /package/dist/{chunk-NWEXPORY.js.map → chunk-WCIJHQMP.js.map} +0 -0
  186. /package/dist/{chunk-3VYNEJMC.js.map → chunk-Z42H2QEW.js.map} +0 -0
  187. /package/dist/{chunk-HCZWP44I.js.map → chunk-ZWZJ4XOY.js.map} +0 -0
@@ -25,7 +25,8 @@ interface ZendeskTriggerButtonProps {
25
25
  className?: string;
26
26
  onClick?: (zendeskId: number) => void;
27
27
  children?: React.ReactNode;
28
+ external?: boolean;
28
29
  }
29
- declare function ZendeskTriggerButton({ zendeskId, className, onClick, children, }: ZendeskTriggerButtonProps): react_jsx_runtime.JSX.Element;
30
+ declare function ZendeskTriggerButton({ zendeskId, className, onClick, children, external, }: ZendeskTriggerButtonProps): react_jsx_runtime.JSX.Element;
30
31
 
31
32
  export { ZendeskTriggerButton as Z, cn as c, transformYupErrorsIntoObject as t };
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-VVF4IZES.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-KH5SAWNH.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 n}from"./chunk-VVF4IZES.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-AU6AILO2.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{b as y}from"./chunk-PGWKJ6FK.js";import{b as c}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-RNJWBKLA.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-46JFDBPC.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{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as o}from"./chunk-MP2T74PU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as r}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{Info as p}from"lucide-react";import{Fragment as f,jsx as t,jsxs as e}from"react/jsx-runtime";function B({extraStatutoryPaymentsTotal:d,extraStatutoryPaymentsBreakdown:u,currency:s}){return e("div",{children:[e("div",{className:"flex justify-between items-center mb-2",children:[t("h3",{className:"font-medium text-primary-foreground-800",children:"Extra Statutory Payments"}),t("span",{className:"font-semibold text-lg",children:r(d,s)})]}),t(l,{className:"mb-3"}),t("div",{className:"space-y-3 pl-2",children:u.map((a,c)=>e("div",{className:"flex justify-between items-start text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{children:a.name}),a.description&&t(m,{content:e(f,{children:[t("span",{children:a.description})," ",a.zendesk_article_url&&t(o,{zendeskId:Number(a.zendesk_article_id),children:"Learn more"})]}),children:e(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[t(p,{className:"h-3 w-3 text-gray-400"}),t("span",{className:"sr-only",children:"Info"})]})})]}),t("span",{children:r(a.amount,s)})]},c))})]})}n(B,"CostCalculatorExtraStatutoryPaymentsBreakdown");export{B as a};
2
- //# sourceMappingURL=chunk-22JG4IMF.js.map
1
+ import{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{b as o}from"./chunk-ANQ4HVVK.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as r}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{Info as p}from"lucide-react";import{Fragment as f,jsx as t,jsxs as e}from"react/jsx-runtime";function B({extraStatutoryPaymentsTotal:d,extraStatutoryPaymentsBreakdown:u,currency:s}){return e("div",{children:[e("div",{className:"flex justify-between items-center mb-2",children:[t("h3",{className:"font-medium text-primary-foreground-800",children:"Extra Statutory Payments"}),t("span",{className:"font-semibold text-lg",children:r(d,s)})]}),t(l,{className:"mb-3"}),t("div",{className:"space-y-3 pl-2",children:u.map((a,c)=>e("div",{className:"flex justify-between items-start text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{children:a.name}),a.description&&t(m,{content:e(f,{children:[t("span",{children:a.description})," ",a.zendesk_article_url&&t(o,{zendeskId:Number(a.zendesk_article_id),children:"Learn more"})]}),children:e(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[t(p,{className:"h-3 w-3 text-gray-400"}),t("span",{className:"sr-only",children:"Info"})]})})]}),t("span",{children:r(a.amount,s)})]},c))})]})}n(B,"CostCalculatorExtraStatutoryPaymentsBreakdown");export{B as a};
2
+ //# sourceMappingURL=chunk-5NPET4ZO.js.map
@@ -1,2 +1,2 @@
1
- import{b as u}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-RNJWBKLA.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-I3PGODII.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-VVF4IZES.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-T5LZSTW3.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
@@ -0,0 +1,2 @@
1
+ import{a as P}from"./chunk-6IL4TB7S.js";import{a as v}from"./chunk-IWA5B4U6.js";import{a as $}from"./chunk-7VOQAVM4.js";import{a as N}from"./chunk-VM2DQCZO.js";import{a as C}from"./chunk-SLMJEZJ7.js";import{a as w}from"./chunk-BOTWQMOJ.js";import{a as x}from"./chunk-S4XU4SE7.js";import{a as k}from"./chunk-KDUM4EZJ.js";import{a as M}from"./chunk-2YTBWEC7.js";import{a as l,b as S}from"./chunk-ANQ4HVVK.js";import{a as V,b as h}from"./chunk-DZ7FZ4L2.js";import{a as j}from"./chunk-PJBAQZ6G.js";import{a as F}from"./chunk-Z5WMKCRJ.js";import{c as f}from"./chunk-PAQW5BFW.js";import{a as s}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as W}from"@remoteoss/json-schema-form";import G from"lodash.omitby";import X from"lodash.isnull";import{format as Y}from"date-fns";import{useMemo as I}from"react";import ee from"lodash.omit";import{jsx as b,jsxs as U}from"react/jsx-runtime";function y(t,e,_){return{"x-jsf-presentation":{inputType:"hidden",Component:n(()=>U("div",{className:s("RemoteFlows__InformationStatement",_?.className),children:[b("h3",{className:s("RemoteFlows__InformationStatement__Title"),children:t}),b("p",{className:s("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}n(y,"createInformationField");import{Fragment as oe,jsx as r,jsxs as ne}from"react/jsx-runtime";function ie(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}n(ie,"buildInitialValues");var be=n(({employmentId:t,options:e,initialValues:_})=>{let{fieldValues:T,setFieldValues:R,stepState:a,previousStep:D,nextStep:E}=j(x),{data:p}=k({employmentId:t}),c=ie({...a.values?.employee_communication,...a.values?.termination_details,...a.values?.paid_time_off,...a.values?.additional_information,..._}),u=I(()=>({...a.values?.[a.currentStep.name],...c,...T}),[a.values,a.currentStep.name,T,c]),O=I(()=>({fields:{risk_assesment_info:y("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:y("Proposed termination date",ne(oe,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",r(S,{external:!0,zendeskId:l.terminationNoticePeriods,className:s("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:Y(new Date,"yyyy-MM-dd")}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:n(()=>{let o=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return r(P,{employeeName:p?.basic_information?.name,proposedTerminationDate:u.proposed_termination_date,employmentId:t,employment:p,render:i=>o?r(o,{...i}):r(C,{...i})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:n(()=>{let o=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return r(v,{render:i=>o?r(o,{...i}):r($,{...i})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:n(()=>{let o={involuntaryOffboardingServiceChargeZendeskId:l.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:l.reconciliationInvoice},i=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return i?r(i,{...o}):r(N,{...o})},"Component")}}}}),[e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,p,u.proposed_termination_date,t]),{data:m,isLoading:A}=h({formValues:u,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...O?.fields}},step:a.currentStep.name}),d=W(w.data.schema),g=V(),{mutateAsync:z}=M(g);async function J(o){if(!t)throw new Error("Employment id is missing");if(m){let i=f(o,d.fields,{isPartialValidation:!0}),{customer_informed_employee:L}=i,Z=L==="yes"?{employee_awareness:{date:i.customer_informed_employee_date,note:i.customer_informed_employee_description}}:void 0,q=F(i,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),K=ee(q,"customer_informed_employee_date","customer_informed_employee_description"),Q=G({...K,...Z},X);return z({employment_id:t,termination_details:Q,type:"termination"})}}n(J,"onSubmit");function B(){D()}n(B,"back");function H(){E()}return n(H,"next"),{employmentId:t,stepState:a,fields:m?.fields||[],isLoading:A,isSubmitting:g.isPending,initialValues:c,handleValidation:n(o=>{if(m){let i=f(o,m?.fields);return m?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:n(o=>{if(d){let i=f(o,d?.fields,{isPartialValidation:!0});R(i)}},"checkFieldUpdates"),parseFormValues:n(o=>f(o,d.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:J,back:B,next:H}},"useTermination");export{be as a};
2
+ //# sourceMappingURL=chunk-7AC3W7WD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api';\nimport { AcknowledgeInformationContainer } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer';\nimport { AcknowledgeInformation } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation';\nimport { AcknowledgeInformationFees } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmploymentQuery({ employmentId });\n\n const initialValues = buildInitialValues({\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n });\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n external\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: format(new Date(), 'yyyy-MM-dd'),\n },\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <AcknowledgeInformationContainer\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <AcknowledgeInformation {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_fees_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const zendeskIds = {\n involuntaryOffboardingServiceChargeZendeskId:\n zendeskArticles.involuntaryOffboardingServiceCharge,\n reconciliationInvoiceZendeskId:\n zendeskArticles.reconciliationInvoice,\n };\n\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n if (CustomComponent) {\n return <CustomComponent {...zendeskIds} />;\n }\n\n return <AcknowledgeInformationFees {...zendeskIds} />;\n },\n },\n },\n },\n };\n }, [\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,\n employment,\n formValues.proposed_termination_date,\n employmentId,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (entireTerminationSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema?.fields,\n { isPartialValidation: true },\n );\n setFieldValues(parsedValues as TerminationFormValues);\n }\n },\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (values: TerminationFormValues) => {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n });\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n 'x-jsf-presentation': {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },\n };\n}\n"],"mappings":"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","names":["createHeadlessForm","omitBy","isNull","format","useMemo","omit","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmploymentQuery","initialValues","formValues","useMemo","customFields","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","format","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","AcknowledgeInformationContainer","AcknowledgeInformation","zendeskIds","AcknowledgeInformationFees","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next"]}
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-AFRA4BIW.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as n}from"react/jsx-runtime";var i=m(({cards:e})=>n("div",{className:"RemoteFlows__AcknowledgeInformation",children:[n(t,{className:"mb-6",children:[o("h2",{className:"RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium",children:e.remoteDoesNext.title}),o("p",{className:"RemoteFlows__AcknowledgeInformation__Description color-[#71717A] text-xs",children:e.remoteDoesNext.description})]}),n(t,{className:"mb-6",children:[o("h2",{className:"RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium",children:e.whatYouNeedToDo.title}),o("ul",{className:"RemoteFlows__AcknowledgeInformation__List list-disc pl-5 text-xs text-[#71717A]",children:e.whatYouNeedToDo.list.map(l=>o("li",{className:"RemoteFlows__AcknowledgeInformation__ListItem mb-2",children:l},l))})]})]}),"AcknowledgeInformation");export{i as a};
2
+ //# sourceMappingURL=chunk-7VOQAVM4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.tsx"],"sourcesContent":["import { Card } from '@/src/components/ui/card';\nimport { AcknowledgeInformationContainerRenderProps } from '@/src/flows/Termination/components/AcknowledgeInformation/types';\n\n/**\n * The acknowledge information component props\n */\nexport type AcknowledgeInformationProps =\n AcknowledgeInformationContainerRenderProps;\n\nexport const AcknowledgeInformation = ({\n cards,\n}: AcknowledgeInformationProps) => {\n return (\n <div className='RemoteFlows__AcknowledgeInformation'>\n <Card className='mb-6'>\n <h2 className='RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium'>\n {cards.remoteDoesNext.title}\n </h2>\n <p className='RemoteFlows__AcknowledgeInformation__Description color-[#71717A] text-xs'>\n {cards.remoteDoesNext.description}\n </p>\n </Card>\n\n <Card className='mb-6'>\n <h2 className='RemoteFlows__AcknowledgeInformation__Title color-[#000] font-medium'>\n {cards.whatYouNeedToDo.title}\n </h2>\n <ul className='RemoteFlows__AcknowledgeInformation__List list-disc pl-5 text-xs text-[#71717A]'>\n {cards.whatYouNeedToDo.list.map((item) => (\n <li\n key={item}\n className='RemoteFlows__AcknowledgeInformation__ListItem mb-2'\n >\n {item}\n </li>\n ))}\n </ul>\n </Card>\n </div>\n );\n};\n"],"mappings":"gFAcM,OACE,OAAAA,EADF,QAAAC,MAAA,oBALC,IAAMC,EAAyBC,EAAA,CAAC,CACrC,MAAAC,CACF,IAEIH,EAAC,OAAI,UAAU,sCACb,UAAAA,EAACI,EAAA,CAAK,UAAU,OACd,UAAAL,EAAC,MAAG,UAAU,sEACX,SAAAI,EAAM,eAAe,MACxB,EACAJ,EAAC,KAAE,UAAU,2EACV,SAAAI,EAAM,eAAe,YACxB,GACF,EAEAH,EAACI,EAAA,CAAK,UAAU,OACd,UAAAL,EAAC,MAAG,UAAU,sEACX,SAAAI,EAAM,gBAAgB,MACzB,EACAJ,EAAC,MAAG,UAAU,kFACX,SAAAI,EAAM,gBAAgB,KAAK,IAAKE,GAC/BN,EAAC,MAEC,UAAU,qDAET,SAAAM,GAHIA,CAIP,CACD,EACH,GACF,GACF,EA7BkC","names":["jsx","jsxs","AcknowledgeInformation","__name","cards","Card","item"]}
@@ -0,0 +1,2 @@
1
+ import{a as h,b as y,d as Z,e as v,f as x,g as R}from"./chunk-TWIUL2P3.js";import{g as b}from"./chunk-3O3Q24JL.js";import{b as k,d as C}from"./chunk-3ZWDIEEM.js";import{a as p,f as D}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";var z={disclaimerCostCalculator:4668194326797,employeeOnboardingTimeline:4411262104589,extraPayments:4466822781709,internationalPricing:4410698586893,remoteFxRate:33271144977421,terminationEmployeeCommunication:4411585179661,terminationNoticePeriods:5831900985613,involuntaryOffboardingServiceCharge:4406932229133,reconciliationInvoice:17604014808589},c=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL");import{useQuery as L}from"@tanstack/react-query";var T=e((r,i)=>{let{client:a}=C();return L({queryKey:["zendesk-article",r],queryFn:e(async()=>{let t=await b({client:a,path:{id:Number(r)}});if(t.error)throw new Error(t.error.message||"Failed to fetch article");return t},"queryFn"),select:e(t=>{let o=t.data?.data.help_center_article;return o&&{...o,body:D(o.body||"")}},"select"),retry:!1,...i})},"useZendeskArticle");import{jsx as n,jsxs as m}from"react/jsx-runtime";var _=e(({Trigger:r,zendeskId:i,open:a,onClose:t})=>{let{components:o}=k(),d=c(i),l=e(()=>{t?.()},"handleClose"),{data:s,isLoading:f,error:g}=T(i,{enabled:a}),w=o?.zendeskDrawer;return w?n(w,{open:a,onClose:l,data:s,isLoading:f,error:g,zendeskURL:d,Trigger:r}):m(h,{open:a,onOpenChange:F=>!F&&l(),direction:"right",children:[n(y,{asChild:!0,children:r}),n(Z,{className:"h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer",children:m("div",{className:"h-full flex flex-col",children:[m(v,{children:[n(x,{children:s?.title}),m(R,{children:["For more details see our"," ",n("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"help article"})," "]})]}),f&&n("div",{children:"Loading..."}),g&&n("div",{className:"text-sm p-4 text-red-500",children:"Error loading article"}),n("div",{className:"flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content",dangerouslySetInnerHTML:{__html:s?.body||""}})]})})]})},"ZendeskDrawer");import{useState as P}from"react";import{jsx as u}from"react/jsx-runtime";var N="RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block text-xs bg-transparent border-none cursor-pointer p-0";function j({zendeskId:r,className:i,onClick:a,children:t,external:o=!1}){let[d,l]=P(!1),s=e(()=>{o||l(!0),a?.(r)},"handleClick");return o?u("a",{href:c(r),target:"_blank",rel:"noopener noreferrer",onClick:s,className:p(N,i),children:t}):u(_,{zendeskId:r,open:d,onClose:()=>l(!1),Trigger:u("button",{onClick:s,className:p(N,i),children:t})})}e(j,"ZendeskTriggerButton");export{z as a,j as b};
2
+ //# sourceMappingURL=chunk-ANQ4HVVK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/shared/zendesk-drawer/utils.ts","../src/components/shared/zendesk-drawer/api.ts","../src/components/shared/zendesk-drawer/ZendeskDrawer.tsx","../src/components/shared/zendesk-drawer/ZendeskTriggerButton.tsx"],"sourcesContent":["export const zendeskArticles = {\n /**\n * Disclaimer for Cost Calculator\n * Access: Private (Need Remote account to access)\n * https://support.remote.com/hc/en-us/articles/4668194326797\n */\n disclaimerCostCalculator: 4668194326797,\n /**\n * Employee Onboarding Timeline\n * Access: Private (Need Remote account to access)\n * https://support.remote.com/hc/en-us/articles/4411262104589\n */\n employeeOnboardingTimeline: 4411262104589,\n /**\n * Extra Payments\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/4466822781709\n */\n extraPayments: 4466822781709,\n /**\n * International Pricing\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/4410698586893\n */\n internationalPricing: 4410698586893,\n /**\n * Remote FX Rate\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/33271144977421\n */\n remoteFxRate: 33271144977421,\n /**\n * Employee Communication for Terminations\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/4411585179661\n */\n terminationEmployeeCommunication: 4411585179661,\n /**\n * Notice Period for Terminations by Country\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/5831900985613\n */\n terminationNoticePeriods: 5831900985613,\n /**\n * Involuntary Offboarding Service Charge\n * Access: Private (Need Remote account to access)\n * https://support.remote.com/hc/en-us/articles/4406932229133\n */\n involuntaryOffboardingServiceCharge: 4406932229133,\n /**\n * Reconciliation Invoice\n * Access: Public (Everyone can access)\n * https://support.remote.com/hc/en-us/articles/17604014808589\n */\n reconciliationInvoice: 17604014808589,\n};\n\nexport const buildZendeskURL = (zendeskId: number) => {\n return `https://support.remote.com/hc/en-us/articles/${zendeskId}`;\n};\n","import { getShowHelpCenterArticle } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { sanitizeHtmlWithImageErrorHandling } from '@/src/lib/utils';\nimport { Client } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useZendeskArticle = (\n zendeskId: number | null,\n queryOptions?: { enabled?: boolean },\n) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['zendesk-article', zendeskId],\n queryFn: async () => {\n const response = await getShowHelpCenterArticle({\n client: client as Client,\n path: {\n id: Number(zendeskId),\n },\n });\n\n if (response.error) {\n throw new Error(response.error.message || 'Failed to fetch article');\n }\n\n return response;\n },\n select: (data) => {\n const article = data.data?.data.help_center_article;\n if (article) {\n return {\n ...article,\n body: sanitizeHtmlWithImageErrorHandling(article.body || ''),\n };\n }\n return article;\n },\n retry: false,\n ...queryOptions,\n });\n};\n","import { useZendeskArticle } from '@/src/components/shared/zendesk-drawer/api';\nimport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerDescription,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport { useFormFields } from '@/src/context';\nimport { buildZendeskURL } from '@/src/components/shared/zendesk-drawer/utils';\n\nexport type ZendeskDrawerProps = {\n Trigger: React.ReactElement;\n zendeskId: number;\n open: boolean;\n onClose: () => void;\n};\n\nexport const ZendeskDrawer = ({\n Trigger,\n zendeskId,\n open,\n onClose,\n}: ZendeskDrawerProps) => {\n const { components } = useFormFields();\n const zendeskURL = buildZendeskURL(zendeskId);\n\n const handleClose = () => {\n onClose?.();\n };\n\n const { data, isLoading, error } = useZendeskArticle(zendeskId, {\n enabled: open,\n });\n\n const CustomZendeskDrawer = components?.zendeskDrawer;\n\n if (CustomZendeskDrawer) {\n return (\n <CustomZendeskDrawer\n open={open}\n onClose={handleClose}\n data={data}\n isLoading={isLoading}\n error={error}\n zendeskURL={zendeskURL}\n Trigger={Trigger}\n />\n );\n }\n\n return (\n <Drawer\n open={open}\n onOpenChange={(open) => !open && handleClose()}\n direction='right'\n >\n <DrawerTrigger asChild>{Trigger}</DrawerTrigger>\n <DrawerContent className='h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer'>\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{data?.title}</DrawerTitle>\n <DrawerDescription>\n For more details see our{' '}\n <a href={zendeskURL} target='_blank' rel='noopener noreferrer'>\n help article\n </a>{' '}\n </DrawerDescription>\n </DrawerHeader>\n {isLoading && <div>Loading...</div>}\n {error && (\n <div className='text-sm p-4 text-red-500'>\n Error loading article\n </div>\n )}\n <div\n className='flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content'\n dangerouslySetInnerHTML={{\n __html: data?.body || '',\n }}\n ></div>\n </div>\n </DrawerContent>\n </Drawer>\n );\n};\n","import { cn } from '@/src/lib/utils';\nimport { ZendeskDrawer } from './ZendeskDrawer';\nimport { buildZendeskURL } from './utils';\nimport { useState } from 'react';\n\ninterface ZendeskTriggerButtonProps {\n zendeskId: number;\n className?: string;\n onClick?: (zendeskId: number) => void;\n children?: React.ReactNode;\n external?: boolean;\n}\n\nconst baseClassName =\n 'RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block text-xs bg-transparent border-none cursor-pointer p-0';\n\nexport function ZendeskTriggerButton({\n zendeskId,\n className,\n onClick,\n children,\n external = false,\n}: ZendeskTriggerButtonProps) {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleClick = () => {\n if (!external) {\n setIsOpen(true);\n }\n onClick?.(zendeskId);\n };\n\n if (external) {\n return (\n <a\n href={buildZendeskURL(zendeskId)}\n target='_blank'\n rel='noopener noreferrer'\n onClick={handleClick}\n className={cn(baseClassName, className)}\n >\n {children}\n </a>\n );\n }\n\n return (\n <ZendeskDrawer\n zendeskId={zendeskId}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n Trigger={\n <button onClick={handleClick} className={cn(baseClassName, className)}>\n {children}\n </button>\n }\n />\n );\n}\n"],"mappings":"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","names":["zendeskArticles","buildZendeskURL","__name","zendeskId","useQuery","useZendeskArticle","__name","zendeskId","queryOptions","client","useClient","useQuery","response","getShowHelpCenterArticle","data","article","sanitizeHtmlWithImageErrorHandling","jsx","jsxs","ZendeskDrawer","__name","Trigger","zendeskId","open","onClose","components","useFormFields","zendeskURL","buildZendeskURL","handleClose","data","isLoading","error","useZendeskArticle","CustomZendeskDrawer","Drawer","DrawerTrigger","DrawerContent","DrawerHeader","DrawerTitle","DrawerDescription","useState","jsx","baseClassName","ZendeskTriggerButton","zendeskId","className","onClick","children","external","isOpen","setIsOpen","useState","handleClick","__name","buildZendeskURL","cn","ZendeskDrawer"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-46JFDBPC.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-P4ZSYIA4.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-CT2ROVBF.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-S2KE2JLJ.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-CT2ROVBF.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-BGXVK7HL.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 t}from"./chunk-GC23RRCI.js";import{a}from"./chunk-XSHHMBMT.js";import{a as e}from"./chunk-N6G4VZXF.js";import{a as r}from"./chunk-4T6PRR6R.js";var i={data:{version:7,schema:{additionalProperties:!1,allOf:[...e.data.schema.allOf,...t.data.schema.allOf,...r.data.schema.allOf,...a.data.schema.allOf],properties:{...e.data.schema.properties,...t.data.schema.properties,...r.data.schema.properties,...a.data.schema.properties},required:[...e.data.schema.required,...t.data.schema.required,...r.data.schema.required,...a.data.schema.required],type:"object","x-jsf-order":[...e.data.schema["x-jsf-order"],...t.data.schema["x-jsf-order"],...r.data.schema["x-jsf-order"],...a.data.schema["x-jsf-order"]]}}};export{i as a};
2
- //# sourceMappingURL=chunk-VUP76ZMQ.js.map
1
+ import{a as t}from"./chunk-R3DJNVHR.js";import{a}from"./chunk-LMYJ6V44.js";import{a as e}from"./chunk-N6G4VZXF.js";import{a as r}from"./chunk-XPKVRYIU.js";var i={data:{version:7,schema:{additionalProperties:!1,allOf:[...e.data.schema.allOf,...t.data.schema.allOf,...r.data.schema.allOf,...a.data.schema.allOf],properties:{...e.data.schema.properties,...t.data.schema.properties,...r.data.schema.properties,...a.data.schema.properties},required:[...e.data.schema.required,...t.data.schema.required,...r.data.schema.required,...a.data.schema.required],type:"object","x-jsf-order":[...e.data.schema["x-jsf-order"],...t.data.schema["x-jsf-order"],...r.data.schema["x-jsf-order"],...a.data.schema["x-jsf-order"]]}}};export{i as a};
2
+ //# sourceMappingURL=chunk-BOTWQMOJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as o}from"./chunk-MP2T74PU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Info as u}from"lucide-react";import{Fragment as f,jsx as e,jsxs as t}from"react/jsx-runtime";function w({benefitsTotal:d,benefitsBreakdown:p,currency:n}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground-800",children:"Benefits"}),e("span",{className:"font-semibold text-lg",children:a(d,n)})]}),e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:p.map((s,c)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(f,{children:[e("span",{children:s.description})," ",s.zendesk_article_url&&e(o,{zendeskId:Number(s.zendesk_article_id),children:"Learn more"})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(u,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(s.amount,n)})]},c))})]})}r(w,"CostCalculatorBenefitsBreakdown");export{w as a};
2
- //# sourceMappingURL=chunk-PHBQMNG3.js.map
1
+ import{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{b as o}from"./chunk-ANQ4HVVK.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Info as u}from"lucide-react";import{Fragment as f,jsx as e,jsxs as t}from"react/jsx-runtime";function w({benefitsTotal:d,benefitsBreakdown:p,currency:n}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground-800",children:"Benefits"}),e("span",{className:"font-semibold text-lg",children:a(d,n)})]}),e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:p.map((s,c)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(f,{children:[e("span",{children:s.description})," ",s.zendesk_article_url&&e(o,{zendeskId:Number(s.zendesk_article_id),children:"Learn more"})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(u,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(s.amount,n)})]},c))})]})}r(w,"CostCalculatorBenefitsBreakdown");export{w as a};
2
+ //# sourceMappingURL=chunk-CVIWZYO3.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