@remoteoss/remote-flows 1.40.0 → 1.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +2 -0
  2. package/dist/{WorkScheduleFieldDefault-6DC7RDII.js → WorkScheduleFieldDefault-D6TGVPHC.js} +2 -2
  3. package/dist/{chunk-32ERURM2.js → chunk-33VF3QHP.js} +2 -2
  4. package/dist/{chunk-UI4AZZD5.js → chunk-36IU27QH.js} +2 -2
  5. package/dist/chunk-3GCJILCE.js +2 -0
  6. package/dist/chunk-3GCJILCE.js.map +1 -0
  7. package/dist/{chunk-JFPOX7SW.js → chunk-4VEUIX5E.js} +2 -2
  8. package/dist/{chunk-G556HMVA.js → chunk-COAJUZSE.js} +2 -2
  9. package/dist/{chunk-XYCFKCVZ.js → chunk-IZIKQFAC.js} +2 -2
  10. package/dist/{chunk-Q2OGLLBA.js → chunk-PB6UQ4A4.js} +2 -2
  11. package/dist/{chunk-Q2OGLLBA.js.map → chunk-PB6UQ4A4.js.map} +1 -1
  12. package/dist/{chunk-HK4LGSS7.js → chunk-UQMZU7HM.js} +2 -2
  13. package/dist/{chunk-7BPB4PXN.js → chunk-WIFDQWVX.js} +2 -2
  14. package/dist/default-components.js +1 -1
  15. package/dist/flows/ContractAmendment/ContractAmendmentBack.d.ts +2 -2
  16. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +2 -2
  17. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +2 -3
  18. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +2 -2
  19. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.d.ts +2 -2
  20. package/dist/flows/ContractAmendment/index.d.ts +1 -2
  21. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +4 -5
  22. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  23. package/dist/flows/ContractorOnboarding/api.d.ts +40 -40
  24. package/dist/flows/ContractorOnboarding/api.js +1 -1
  25. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +3 -4
  26. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +3 -4
  27. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  28. package/dist/flows/ContractorOnboarding/components/ContractPreviewHeader.d.ts +2 -3
  29. package/dist/flows/ContractorOnboarding/components/ContractPreviewStatement.d.ts +2 -3
  30. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +3 -4
  31. package/dist/flows/ContractorOnboarding/components/ContractReviewButton.d.ts +2 -2
  32. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +4 -5
  33. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +3 -4
  34. package/dist/flows/ContractorOnboarding/components/OnboardingBack.d.ts +2 -2
  35. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +2 -2
  36. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.d.ts +2 -2
  37. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +3 -4
  38. package/dist/flows/ContractorOnboarding/components/SaveDraftButton.d.ts +2 -2
  39. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +3 -4
  40. package/dist/flows/ContractorOnboarding/components/StatementOfWorkDisclaimer.d.ts +2 -2
  41. package/dist/flows/ContractorOnboarding/components/StatementOfWorkDisclaimer.js +1 -1
  42. package/dist/flows/ContractorOnboarding/constants.js +1 -1
  43. package/dist/flows/ContractorOnboarding/context.d.ts +4 -5
  44. package/dist/flows/ContractorOnboarding/hooks.d.ts +2 -3
  45. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  46. package/dist/flows/ContractorOnboarding/index.d.ts +3 -4
  47. package/dist/flows/ContractorOnboarding/index.js +1 -1
  48. package/dist/flows/ContractorOnboarding/jsfModify.d.ts +2 -3
  49. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  50. package/dist/flows/ContractorOnboarding/types.d.ts +2 -3
  51. package/dist/flows/ContractorOnboarding/utils.d.ts +1 -2
  52. package/dist/flows/ContractorOnboarding/utils.js +1 -1
  53. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -2
  54. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +2 -3
  55. package/dist/flows/CostCalculator/CostCalculatorResetButton.d.ts +2 -2
  56. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.d.ts +2 -2
  57. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -3
  58. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -3
  59. package/dist/flows/CostCalculator/api.d.ts +5 -5
  60. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -3
  61. package/dist/flows/CostCalculator/context.d.ts +2 -2
  62. package/dist/flows/CostCalculator/hooks.d.ts +2 -2
  63. package/dist/flows/CostCalculator/index.d.ts +0 -1
  64. package/dist/flows/CostCalculator/index.js +1 -1
  65. package/dist/flows/CreateCompany/CreateCompany.d.ts +3 -4
  66. package/dist/flows/CreateCompany/api.d.ts +1 -1
  67. package/dist/flows/CreateCompany/components/AddressDetailsStep.d.ts +2 -3
  68. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.d.ts +2 -3
  69. package/dist/flows/CreateCompany/components/CreateCompanyForm.d.ts +2 -3
  70. package/dist/flows/CreateCompany/components/CreateCompanySubmit.d.ts +2 -2
  71. package/dist/flows/CreateCompany/context.d.ts +1 -2
  72. package/dist/flows/CreateCompany/hooks.d.ts +1 -2
  73. package/dist/flows/CreateCompany/index.d.ts +2 -3
  74. package/dist/flows/CreateCompany/types.d.ts +1 -2
  75. package/dist/flows/Onboarding/OnboardingFlow.d.ts +3 -4
  76. package/dist/flows/Onboarding/api.d.ts +16 -17
  77. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -3
  78. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +2 -3
  79. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +2 -3
  80. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +2 -3
  81. package/dist/flows/Onboarding/components/EmploymentAgreementInfoContent.d.ts +2 -2
  82. package/dist/flows/Onboarding/components/EngagementAgreementDetailsStep.d.ts +2 -3
  83. package/dist/flows/Onboarding/components/EquityPriceDetails.d.ts +2 -2
  84. package/dist/flows/Onboarding/components/OnboardingBack.d.ts +2 -2
  85. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +3 -4
  86. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +2 -2
  87. package/dist/flows/Onboarding/components/OnboardingSubmit.d.ts +2 -2
  88. package/dist/flows/Onboarding/components/PreOnboardingRequirements.d.ts +3 -3
  89. package/dist/flows/Onboarding/components/PreviewEmploymentAgreementStep.d.ts +2 -2
  90. package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -2
  91. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +2 -2
  92. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +2 -3
  93. package/dist/flows/Onboarding/context.d.ts +3 -4
  94. package/dist/flows/Onboarding/hooks.d.ts +1 -2
  95. package/dist/flows/Onboarding/index.d.ts +1 -2
  96. package/dist/flows/Onboarding/types.d.ts +2 -3
  97. package/dist/flows/Onboarding/utils.d.ts +2 -3
  98. package/dist/flows/PayrollAdminOnboarding/PayrollAdminOnboardingFlow.d.ts +3 -4
  99. package/dist/flows/PayrollAdminOnboarding/context.d.ts +1 -1
  100. package/dist/flows/PayrollAdminOnboarding/hooks.d.ts +1 -1
  101. package/dist/flows/PayrollAdminOnboarding/index.d.ts +2 -3
  102. package/dist/flows/PayrollAdminOnboarding/types.d.ts +1 -1
  103. package/dist/flows/PayrollEmployeeOnboarding/PayrollEmployeeOnboardingFlow.d.ts +3 -4
  104. package/dist/flows/PayrollEmployeeOnboarding/context.d.ts +1 -1
  105. package/dist/flows/PayrollEmployeeOnboarding/hooks.d.ts +1 -1
  106. package/dist/flows/PayrollEmployeeOnboarding/index.d.ts +2 -3
  107. package/dist/flows/PayrollEmployeeOnboarding/types.d.ts +1 -1
  108. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +2 -3
  109. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +2 -3
  110. package/dist/flows/Termination/PaidTimeOffForm.d.ts +2 -3
  111. package/dist/flows/Termination/TerminationBack.d.ts +2 -2
  112. package/dist/flows/Termination/TerminationDetailsForm.d.ts +2 -3
  113. package/dist/flows/Termination/TerminationFlow.d.ts +3 -4
  114. package/dist/flows/Termination/TerminationForm.d.ts +3 -4
  115. package/dist/flows/Termination/TerminationSubmit.d.ts +2 -2
  116. package/dist/flows/Termination/api.d.ts +4 -5
  117. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.d.ts +2 -2
  118. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.d.ts +2 -2
  119. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -7
  120. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +4 -5
  121. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +4 -5
  122. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.d.ts +2 -2
  123. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.d.ts +2 -2
  124. package/dist/flows/Termination/context.d.ts +1 -2
  125. package/dist/flows/Termination/hooks.d.ts +1 -2
  126. package/dist/flows/Termination/index.d.ts +5 -6
  127. package/dist/flows/Termination/json-schemas/schema.d.ts +2 -3
  128. package/dist/flows/Termination/types.d.ts +2 -3
  129. package/dist/flows/Termination/utils.d.ts +1 -2
  130. package/dist/index.d.ts +13 -13
  131. package/dist/index.js +2 -2
  132. package/dist/internals.d.ts +45 -45
  133. package/dist/{types-BDhuq1UF.d.ts → types-BcjbPv3W.d.ts} +8 -9
  134. package/dist/{types-Cjy498SD.d.ts → types-BydTmx76.d.ts} +2 -2
  135. package/dist/{types-5vsf9upM.d.ts → types-CBE9Gstk.d.ts} +8 -9
  136. package/dist/{types---jTQSYP.d.ts → types-CTjgSFHY.d.ts} +2 -2
  137. package/dist/{types-5jgrwYf3.d.ts → types-CgDgP-h7.d.ts} +5 -6
  138. package/dist/{types-STTuXABa.d.ts → types-DS-m0rPG.d.ts} +3 -4
  139. package/dist/{types-Buo22VR2.d.ts → types-De7SaR2_.d.ts} +2 -3
  140. package/package.json +20 -20
  141. package/dist/chunk-OQIJAVBT.js +0 -2
  142. package/dist/chunk-OQIJAVBT.js.map +0 -1
  143. /package/dist/{WorkScheduleFieldDefault-6DC7RDII.js.map → WorkScheduleFieldDefault-D6TGVPHC.js.map} +0 -0
  144. /package/dist/{chunk-32ERURM2.js.map → chunk-33VF3QHP.js.map} +0 -0
  145. /package/dist/{chunk-UI4AZZD5.js.map → chunk-36IU27QH.js.map} +0 -0
  146. /package/dist/{chunk-JFPOX7SW.js.map → chunk-4VEUIX5E.js.map} +0 -0
  147. /package/dist/{chunk-G556HMVA.js.map → chunk-COAJUZSE.js.map} +0 -0
  148. /package/dist/{chunk-XYCFKCVZ.js.map → chunk-IZIKQFAC.js.map} +0 -0
  149. /package/dist/{chunk-HK4LGSS7.js.map → chunk-UQMZU7HM.js.map} +0 -0
  150. /package/dist/{chunk-7BPB4PXN.js.map → chunk-WIFDQWVX.js.map} +0 -0
package/README.md CHANGED
@@ -26,6 +26,8 @@ A React library that provides components for Remote's embedded solution, enablin
26
26
  - [Contributing](#contributing)
27
27
  - [Internals](#internals)
28
28
 
29
+ > **For maintainers and contributors:** See [ARCHITECTURE.md](ARCHITECTURE.md) for architectural patterns, design philosophy, and decision-making framework.
30
+
29
31
  ## Installation
30
32
 
31
33
  ```sh
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-OQIJAVBT.js";import"./chunk-MHIY35CK.js";import"./chunk-FQFLC6YA.js";import"./chunk-T5J2Z6ZR.js";import"./chunk-OV6PV4N5.js";import"./chunk-Y3CJRZLA.js";import"./chunk-G2LZFGZA.js";import"./chunk-H2O4CVKF.js";import"./chunk-P37U34EQ.js";export{a as WorkScheduleFieldDefault};
2
- //# sourceMappingURL=WorkScheduleFieldDefault-6DC7RDII.js.map
1
+ import{a}from"./chunk-3GCJILCE.js";import"./chunk-MHIY35CK.js";import"./chunk-FQFLC6YA.js";import"./chunk-T5J2Z6ZR.js";import"./chunk-OV6PV4N5.js";import"./chunk-Y3CJRZLA.js";import"./chunk-G2LZFGZA.js";import"./chunk-H2O4CVKF.js";import"./chunk-P37U34EQ.js";export{a as WorkScheduleFieldDefault};
2
+ //# sourceMappingURL=WorkScheduleFieldDefault-D6TGVPHC.js.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-7BPB4PXN.js";import{a as c}from"./chunk-Y34DKDJI.js";import{b as s}from"./chunk-Q3ALCPJN.js";import{c as l}from"./chunk-G556HMVA.js";import{x as n}from"./chunk-G2LZFGZA.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as m,jsxs as g}from"react/jsx-runtime";function x({onSubmit:p,onSuccess:u,onError:S}){let{contractorOnboardingBag:r}=s(),f=a(async(e,F)=>{try{let t=await r.parseFormValues(e);await p?.(t);let o=await r.onSubmit(e);if(o?.data){await u?.(o?.data),r?.next();return}}catch(t){let o=n(t,r.meta?.fields?.contract_details,F);S?.(o)}},"handleSubmit"),C=r.stepState.values?.contract_details||r.initialValues.contract_details,i=r.stepState.values?.pricing_plan?.subscription,b=l(i);return g("div",{className:"space-y-4",children:[m(c,{defaultValues:C,onSubmit:f}),b&&m(d,{subscription:i})]})}a(x,"ContractDetailsStep");export{x as a};
2
- //# sourceMappingURL=chunk-32ERURM2.js.map
1
+ import{a as d}from"./chunk-WIFDQWVX.js";import{a as c}from"./chunk-Y34DKDJI.js";import{b as s}from"./chunk-Q3ALCPJN.js";import{c as l}from"./chunk-COAJUZSE.js";import{x as n}from"./chunk-G2LZFGZA.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as m,jsxs as g}from"react/jsx-runtime";function x({onSubmit:p,onSuccess:u,onError:S}){let{contractorOnboardingBag:r}=s(),f=a(async(e,F)=>{try{let t=await r.parseFormValues(e);await p?.(t);let o=await r.onSubmit(e);if(o?.data){await u?.(o?.data),r?.next();return}}catch(t){let o=n(t,r.meta?.fields?.contract_details,F);S?.(o)}},"handleSubmit"),C=r.stepState.values?.contract_details||r.initialValues.contract_details,i=r.stepState.values?.pricing_plan?.subscription,b=l(i);return g("div",{className:"space-y-4",children:[m(c,{defaultValues:C,onSubmit:f}),b&&m(d,{subscription:i})]})}a(x,"ContractDetailsStep");export{x as a};
2
+ //# sourceMappingURL=chunk-33VF3QHP.js.map
@@ -1,2 +1,2 @@
1
- import{a as Yt,b as re,c as oe,d as ae,e as se,f as ce,g as le,i as ue,j as de,k as pe,l as me,m as fe,n as ye,o as _e,p as ge,q as be,r as Se,s as Ce,t as we,u as ve}from"./chunk-XYCFKCVZ.js";import{a as he,b as Pe,c as Ee}from"./chunk-HK4LGSS7.js";import{a as Zt,b as te,f as ee,g as ne,h as ie}from"./chunk-G556HMVA.js";import{a as $,b as at,c as m,d as zt,g as Xt}from"./chunk-Q2OGLLBA.js";import{a as Wt}from"./chunk-PJ6KPGIE.js";import{f as Kt,h as Gt,i as Ht}from"./chunk-UYGDMJF2.js";import{Q as Ut}from"./chunk-GZUP2IE6.js";import{a as Nt,b as w,d as Qt,h as _,i as k,u as V,v}from"./chunk-G2LZFGZA.js";import{a as $t}from"./chunk-JDIKYCN6.js";import{e as Jt}from"./chunk-H2O4CVKF.js";import{a as d}from"./chunk-P37U34EQ.js";import{useEffect as A,useMemo as a,useRef as Me,useState as R}from"react";import Ve from"lodash.omit";import{useQuery as Pn}from"@tanstack/react-query";var En=d(()=>{let{client:T}=Jt(),{data:q}=re(),u=oe(q)?q?.company?.id??"":"";return Pn({queryKey:["legal-entities",u],queryFn:d(()=>Ut({client:T,path:{company_id:u},query:{page_size:100}}),"queryFn"),select:d(z=>z.data?.data?.legal_entities,"select"),enabled:!!u})},"useLegalEntities"),Fe=d(()=>{let{data:T}=En();return T?.find(q=>q.is_default)},"useDefaultLegalEntity");var Fn={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},Mn={employment_basic_information:"basic_information"},ii=d(({countryCode:T,externalId:q,employmentId:u,skipSteps:z,options:f,initialValues:p})=>{let Oe=f?.excludeProducts||[],_t=Me(f?.onContractReviewed);A(()=>{_t.current=f?.onContractReviewed},[f?.onContractReviewed]);let[l,gt]=R(T||null),[r,De]=R(u),[g,bt]=R(void 0),X=Me({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[Y,Ie]=R(void 0),[St,Z]=R(!1),[Ct,ke]=R(!0),[st,wt]=R(null),{steps:Ae,stepsArray:Re}=a(()=>Zt({includeSelectCountry:!z?.includes("select_country"),includeEligibilityQuestionnaire:St,includeContractPreview:Ct}),[St,Ct,z]),{fieldValues:c,stepState:e,setFieldValues:vt,previousStep:qe,nextStep:Te,goToStep:L,setStepValues:ht}=$t(Ae);A(()=>{st&&(L(st),wt(null))},[st,L]);let{data:o,isLoading:Le,refetch:Pt}=Wt({employmentId:r,queryParams:{exclude_files:!0}}),je=Fe(),{status:O}=o||{},h=O&&ee.includes(O),xe=O&&!ne.includes(O),Be=a(()=>O&&["invited","initiated"].includes(O)?"invited":"not_invited",[O]),Et=Gt(),Ft=Ht(l,f),ct=de(),Mt=Yt(),{mutateAsync:Vt}=fe(ct,Mt,c),Ot=be(),Dt=Se(),{mutateAsyncOrThrow:Ne}=w(Ft),It=se(),kt=ue(),At=Ce(),{mutateAsyncOrThrow:Qe}=w(Et),{mutateAsyncOrThrow:Je}=w(ct),{mutateAsyncOrThrow:Ue}=w(It),{mutateAsyncOrThrow:Rt}=w(kt),{mutateAsyncOrThrow:Ke}=w(Ot),{mutateAsyncOrThrow:qt}=w(Dt),{mutateAsyncOrThrow:Ge}=w(At);u&&o?.country?.code&&!l&&gt(o.country.code);let{selectCountryForm:j,isLoading:He,countries:Tt}=we({jsfModify:f?.jsfModify?.select_country}),lt=a(()=>Tt?.find(t=>t.value===l),[Tt,l]),We=a(()=>lt?.label,[lt]),$e=e.currentStep.name==="pricing_plan"||!!u&&h,{form:P,isLoading:ze,contractorSubscriptions:tt,filteredContractorSubscriptions:x,refetch:ut,isEligibilityQuestionnaireBlocked:B}=me(r,lt,{jsonSchemaVersion:f?.jsonSchemaVersion,queryOptions:{enabled:$e},excludeProducts:Oe,jsfModify:f?.jsfModify?.pricing_plan}),D=a(()=>!!tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.submitted_at,[tt]);A(()=>{if(D){Z(!1);return}else Z(Y===m)},[D,Y]),A(()=>{let t=o?.contractor_type==="cor";ke(!t)},[o?.contractor_type]);let et=a(()=>tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.responses,[tt]),Xe=Fn[e.currentStep.name]||"contractor_basic_information",Ye=Mn[Xe],Ze=o?.[Ye]||{},tn=d(({form:t,options:i={},query:s={}})=>{let M=Object.keys(c).length>0?{...p,...e.values?.[e.currentStep.name],...c}:{...p,...Ze};return Kt({countryCode:l,form:t,fieldValues:M,query:s,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}}})},"useJSONSchema"),en=!!(l&&(e.currentStep.name==="basic_information"||u)),nn=!!(l==="GBR"&&u&&e.currentStep.name==="basic_information"),{data:N,isLoading:rn}=ye(u,{enabled:nn}),{data:nt,isLoading:on}=_e(r,{enabled:!!r});A(()=>{nt&&nt.length>0&&!g&&bt(nt[0].id)},[nt,g]);let{data:b,isLoading:an}=tn({form:"contractor_basic_information",options:{jsfModify:Pe(l,We,f),queryOptions:{enabled:en}}}),sn=a(()=>te(o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date),[o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date]),y=a(()=>{let t={standard:$,plus:at,cor:m};if(c.subscription)return c.subscription;let i=e.values?.pricing_plan?.subscription;if(i&&!B)return i;if(D&&!B)return m;if(B&&D)return $;if(x&&x.length>0)return t[o?.contractor_type]||$},[c,e.values,D,o?.contractor_type,B,x]);A(()=>{y&&y!==Y&&Ie(y)},[y,Y]);let cn=a(()=>({...et,...p,...e.values?.eligibility_questionnaire,...c}),[et,p,e.values?.eligibility_questionnaire,c]),ln=a(()=>y===m&&e.currentStep.name==="eligibility_questionnaire"||!!u&&h&&y===m,[y,e.currentStep.name,u,h]),{data:E,isLoading:un}=ge({options:{queryOptions:{enabled:ln},jsfModify:f?.jsfModify?.eligibility_questionnaire},fieldValues:cn}),dn=!!(l&&e.currentStep.name==="contract_details"||h),{data:S,isLoading:pn}=ve({countryCode:l,fieldValues:c,employmentId:r,options:{queryOptions:{enabled:dn},jsfModify:he(f?.jsfModify?.contract_details,sn,y,c,y===m)}}),mn=a(()=>e.currentStep.name==="contract_preview"||!!u&&h,[e.currentStep.name,u,h]),{data:F}=ae({fieldValues:c,options:{queryOptions:{enabled:mn},jsfModify:Ee(f,c)}}),{data:dt,isLoading:fn,refetch:yn}=ce({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),{hasCompanySignedContract:_n}=le({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),n=a(()=>({select_country:j?.fields||[],basic_information:b?.fields||[],pricing_plan:P?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:S?.fields||[],contract_preview:F?.fields||[],review:[]}),[j?.fields,b?.fields,P?.fields,S?.fields,F?.fields,E?.fields]),gn={select_country:null,basic_information:b?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:S?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},bn={select_country:j?.meta?.["x-jsf-presentation"],basic_information:b?.meta?.["x-jsf-presentation"],pricing_plan:P?.meta?.["x-jsf-presentation"],eligibility_questionnaire:E?.meta?.["x-jsf-presentation"],contract_details:S?.meta?.["x-jsf-presentation"],contract_preview:F?.meta?.["x-jsf-presentation"],review:null},{country:Sn,basic_information:it={},contract_details:Lt={}}=o||{},jt=Sn?.code,Q=a(()=>k(n.select_country,{country:l||jt||""}),[n.select_country,l,jt]),pt=a(()=>N?.content?Qt(N.content,N.name):null,[N?.content,N?.name]),J=a(()=>{let t={...p,...it,ir35:o?.contract_details?.ir_35,nationality_status:o?.contract_details?.nationality,...pt&&{ir35_sds_file:[pt]}};return k(n.basic_information,t)},[p,it,o?.contract_details?.ir_35,o?.contract_details?.nationality,pt,n.basic_information]),U=a(()=>{let i={...{service_duration:{provisional_start_date:it.provisional_start_date}},...p,...Lt};return k(n.contract_details,i)},[n.contract_details,Lt,p,it]),K=a(()=>{let t=dt?.contract_document?.signatories?.find(s=>s.type==="company"),i={...p,signature:t?.signature};return k(n.contract_preview,i)},[n.contract_preview,p,dt]),G=a(()=>{let i={...{subscription:y},...p};return k(n.pricing_plan,i)},[n.pricing_plan,p,y]),H=a(()=>{let t={...p,...et};return k(n.eligibility_questionnaire,t)},[n.eligibility_questionnaire,p,et]),Cn=a(()=>({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H}),[Q,J,U,K,G,H]),mt=!!(u&&h&&e.currentStep.name!=="review"),ft=He||an||Le||pn||ze||fn||rn||on||un,xt=a(()=>{let i=o?.contractor_type==="cor"||n.contract_preview.length>0;return!!(mt&&!ft&&g&&n.basic_information.length>0&&n.contract_details.length>0&&i)},[mt,ft,g,n.basic_information.length,n.contract_details.length,n.contract_preview.length,o?.contractor_type]);A(()=>{xt&&(X.current={select_country:V(Q,n.select_country,{skipMoneyConversion:!0}),basic_information:V(J,n.basic_information,{skipMoneyConversion:!0}),contract_details:V(U,n.contract_details,{skipMoneyConversion:!0}),contract_preview:V(K,n.contract_preview,{skipMoneyConversion:!0}),pricing_plan:V(G,n.pricing_plan,{skipMoneyConversion:!0}),eligibility_questionnaire:V(H,n.eligibility_questionnaire,{skipMoneyConversion:!0})},ht({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H,review:{}}),L("review"))},[xt,L,Q,J,U,ht,n.select_country,n.basic_information,n.contract_details,n.pricing_plan,G,n.contract_preview,K,n.eligibility_questionnaire,H]);let wn=d(t=>{L(t)},"goTo"),Bt=d(async t=>j&&e.currentStep.name==="select_country"?t:b&&e.currentStep.name==="basic_information"?await _(t,b?.fields,{isPartialValidation:!1}):S&&e.currentStep.name==="contract_details"?await _(t,S?.fields,{isPartialValidation:!1}):F&&e.currentStep.name==="contract_preview"?await _(t,F?.fields,{isPartialValidation:!1}):P&&e.currentStep.name==="pricing_plan"?await _(t,P?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await _(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues"),vn=d(t=>{if(!Nt(t))return null;let i=t.normalizedErrors.services_and_deliverables,s=Array.isArray(i)?i[0]:i;return s?.source===Xt?{error:s.error,source:s.source,skippable:s.skippable}:null},"extractAiValidationError");async function hn(t){let i=e.currentStep.name,s=await Bt(t);switch(i in X.current&&(X.current[i]=V(s,n[i])),e.currentStep.name){case"select_country":return gt(s.country),Promise.resolve({data:{countryCode:s.country}});case"basic_information":{let I=!r&&l,M=r&&l&&o?.country&&o?.country.code!==l;if(I||M){let yt={basic_information:Ve(s,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:l,external_id:q},ot=await Qe(yt),C=ot?.data?.employment?.id;if(!C)throw v("Employment ID not found");return await Vt({employmentId:C}),De(C),ot}else if(r){let rt=Ve(s,"nationality_status","ir35","ir35_sds_file");return await Vt({employmentId:r}),Ne({employmentId:r,basic_information:rt})}return}case"contract_details":{let{services_and_deliverables_ai_warning:I,services_and_deliverables_error_skippable:M,...rt}=s,yt=c.services_and_deliverables_error_skippable===!0,ot={contract_document:rt,skip_ai_checks:yt};try{let C=await Je({employmentId:r,payload:ot}),W=C?.data?.contract_document?.id;if(!W)throw v("Contract document ID not found");return bt(W),C}catch(C){let W=vn(C);throw W&&vt({...t,services_and_deliverables_ai_warning:ie(y===m),services_and_deliverables_error_skippable:W.skippable}),C}}case"contract_preview":{if(_n)return Promise.resolve({data:{contract_document:{id:g}}});let I=await Ue({employmentId:r,contractDocumentId:g,payload:{signature:s.signature}});return await yn(),I}case"pricing_plan":{if(t.subscription===zt)return Promise.resolve({data:{subscription:t.subscription}});if(x.length===0)throw v("No available subscriptions.");if(!t.subscription&&x.length>0)throw v("Please select a subscription plan.");if(B&&[m,at].includes(t.subscription))throw v(`This individual is not eligible for ${pe[t.subscription]}.`);if(D&&t.subscription!==m)try{await Ge({employmentId:r}),await ut()}catch(M){if(M?.response?.status!==404)throw M;await ut()}if(t.subscription==$)return Rt({employmentId:r,payload:{operation:"downgrade"}});if(t.subscription==at)return Rt({employmentId:r,payload:{operation:"upgrade"}});if(t.subscription==m)return D&&o?.contractor_type!=="cor"?qt({employmentId:r}):Promise.resolve({data:{subscription:t.subscription}});throw v("invalid selection")}case"eligibility_questionnaire":try{if((await Ke({employmentId:r,payload:s}))?.data?.is_blocking)throw Z(!1),wt("pricing_plan"),v("This individual is not eligible for Contractor of Record.");return await qt({employmentId:r})}finally{await ut()}default:throw v("Invalid step state")}}return d(hn,"onSubmit"),{isLoading:ft||mt,fieldValues:c,stepState:e,checkFieldUpdates:vt,markContractAsReviewed:d(()=>{_t.current?.()},"markContractAsReviewed"),back:qe,next:d(()=>{r&&Pt(),Te()},"handleNextStep"),goTo:wn,onSubmit:hn,fields:n[e.currentStep.name],meta:{fields:X.current,fieldsets:gn[e.currentStep.name],presentation:bn[e.currentStep.name]},parseFormValues:Bt,canSkipAiValidation:c.services_and_deliverables_error_skippable===!0,handleValidation:d(async t=>{if(e.currentStep.name==="select_country")return j.handleValidation(t);if(b&&e.currentStep.name==="basic_information"){let i=await _(t,b?.fields,{isPartialValidation:!1});return b?.handleValidation(i)}if(S&&e.currentStep.name==="contract_details"){let i=await _(t,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}if(F&&e.currentStep.name==="contract_preview"){let i=await _(t,F?.fields,{isPartialValidation:!0});return F?.handleValidation(i)}if(P&&e.currentStep.name==="pricing_plan"){let i=await _(t,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let i=await _(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(i)}return null},"handleValidation"),initialValues:Cn,employmentId:r,refetchEmployment:Pt,isSubmitting:Et.isPending||Ft.isPending||ct.isPending||It.isPending||kt.isPending||Mt.isPending||Ot.isPending||Dt.isPending||At.isPending,documentPreviewPdf:dt,canInvite:xe,isEmploymentReadOnly:h,invitedStatus:Be,employment:o,defaultLegalEntity:je,steps:Re}},"useContractorOnboarding");export{ii as a};
2
- //# sourceMappingURL=chunk-UI4AZZD5.js.map
1
+ import{a as Yt,b as re,c as oe,d as ae,e as se,f as ce,g as le,i as ue,j as de,k as pe,l as me,m as fe,n as ye,o as _e,p as ge,q as be,r as Se,s as Ce,t as we,u as ve}from"./chunk-IZIKQFAC.js";import{a as he,b as Pe,c as Ee}from"./chunk-UQMZU7HM.js";import{a as Zt,b as te,f as ee,g as ne,h as ie}from"./chunk-COAJUZSE.js";import{a as $,b as at,c as m,d as zt,g as Xt}from"./chunk-PB6UQ4A4.js";import{a as Wt}from"./chunk-PJ6KPGIE.js";import{f as Kt,h as Gt,i as Ht}from"./chunk-UYGDMJF2.js";import{Q as Ut}from"./chunk-GZUP2IE6.js";import{a as Nt,b as w,d as Qt,h as _,i as k,u as V,v}from"./chunk-G2LZFGZA.js";import{a as $t}from"./chunk-JDIKYCN6.js";import{e as Jt}from"./chunk-H2O4CVKF.js";import{a as d}from"./chunk-P37U34EQ.js";import{useEffect as A,useMemo as a,useRef as Me,useState as R}from"react";import Ve from"lodash.omit";import{useQuery as Pn}from"@tanstack/react-query";var En=d(()=>{let{client:T}=Jt(),{data:q}=re(),u=oe(q)?q?.company?.id??"":"";return Pn({queryKey:["legal-entities",u],queryFn:d(()=>Ut({client:T,path:{company_id:u},query:{page_size:100}}),"queryFn"),select:d(z=>z.data?.data?.legal_entities,"select"),enabled:!!u})},"useLegalEntities"),Fe=d(()=>{let{data:T}=En();return T?.find(q=>q.is_default)},"useDefaultLegalEntity");var Fn={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},Mn={employment_basic_information:"basic_information"},ii=d(({countryCode:T,externalId:q,employmentId:u,skipSteps:z,options:f,initialValues:p})=>{let Oe=f?.excludeProducts||[],_t=Me(f?.onContractReviewed);A(()=>{_t.current=f?.onContractReviewed},[f?.onContractReviewed]);let[l,gt]=R(T||null),[r,De]=R(u),[g,bt]=R(void 0),X=Me({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[Y,Ie]=R(void 0),[St,Z]=R(!1),[Ct,ke]=R(!0),[st,wt]=R(null),{steps:Ae,stepsArray:Re}=a(()=>Zt({includeSelectCountry:!z?.includes("select_country"),includeEligibilityQuestionnaire:St,includeContractPreview:Ct}),[St,Ct,z]),{fieldValues:c,stepState:e,setFieldValues:vt,previousStep:qe,nextStep:Te,goToStep:L,setStepValues:ht}=$t(Ae);A(()=>{st&&(L(st),wt(null))},[st,L]);let{data:o,isLoading:Le,refetch:Pt}=Wt({employmentId:r,queryParams:{exclude_files:!0}}),je=Fe(),{status:O}=o||{},h=O&&ee.includes(O),xe=O&&!ne.includes(O),Be=a(()=>O&&["invited","initiated"].includes(O)?"invited":"not_invited",[O]),Et=Gt(),Ft=Ht(l,f),ct=de(),Mt=Yt(),{mutateAsync:Vt}=fe(ct,Mt,c),Ot=be(),Dt=Se(),{mutateAsyncOrThrow:Ne}=w(Ft),It=se(),kt=ue(),At=Ce(),{mutateAsyncOrThrow:Qe}=w(Et),{mutateAsyncOrThrow:Je}=w(ct),{mutateAsyncOrThrow:Ue}=w(It),{mutateAsyncOrThrow:Rt}=w(kt),{mutateAsyncOrThrow:Ke}=w(Ot),{mutateAsyncOrThrow:qt}=w(Dt),{mutateAsyncOrThrow:Ge}=w(At);u&&o?.country?.code&&!l&&gt(o.country.code);let{selectCountryForm:j,isLoading:He,countries:Tt}=we({jsfModify:f?.jsfModify?.select_country}),lt=a(()=>Tt?.find(t=>t.value===l),[Tt,l]),We=a(()=>lt?.label,[lt]),$e=e.currentStep.name==="pricing_plan"||!!u&&h,{form:P,isLoading:ze,contractorSubscriptions:tt,filteredContractorSubscriptions:x,refetch:ut,isEligibilityQuestionnaireBlocked:B}=me(r,lt,{jsonSchemaVersion:f?.jsonSchemaVersion,queryOptions:{enabled:$e},excludeProducts:Oe,jsfModify:f?.jsfModify?.pricing_plan}),D=a(()=>!!tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.submitted_at,[tt]);A(()=>{if(D){Z(!1);return}else Z(Y===m)},[D,Y]),A(()=>{let t=o?.contractor_type==="cor";ke(!t)},[o?.contractor_type]);let et=a(()=>tt?.find(t=>t.product.identifier===m)?.eligibility_questionnaire?.responses,[tt]),Xe=Fn[e.currentStep.name]||"contractor_basic_information",Ye=Mn[Xe],Ze=o?.[Ye]||{},tn=d(({form:t,options:i={},query:s={}})=>{let M=Object.keys(c).length>0?{...p,...e.values?.[e.currentStep.name],...c}:{...p,...Ze};return Kt({countryCode:l,form:t,fieldValues:M,query:s,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}}})},"useJSONSchema"),en=!!(l&&(e.currentStep.name==="basic_information"||u)),nn=!!(l==="GBR"&&u&&e.currentStep.name==="basic_information"),{data:N,isLoading:rn}=ye(u,{enabled:nn}),{data:nt,isLoading:on}=_e(r,{enabled:!!r});A(()=>{nt&&nt.length>0&&!g&&bt(nt[0].id)},[nt,g]);let{data:b,isLoading:an}=tn({form:"contractor_basic_information",options:{jsfModify:Pe(l,We,f),queryOptions:{enabled:en}}}),sn=a(()=>te(o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date),[o?.basic_information?.provisional_start_date,c?.service_duration?.provisional_start_date]),y=a(()=>{let t={standard:$,plus:at,cor:m};if(c.subscription)return c.subscription;let i=e.values?.pricing_plan?.subscription;if(i&&!B)return i;if(D&&!B)return m;if(B&&D)return $;if(x&&x.length>0)return t[o?.contractor_type]||$},[c,e.values,D,o?.contractor_type,B,x]);A(()=>{y&&y!==Y&&Ie(y)},[y,Y]);let cn=a(()=>({...et,...p,...e.values?.eligibility_questionnaire,...c}),[et,p,e.values?.eligibility_questionnaire,c]),ln=a(()=>y===m&&e.currentStep.name==="eligibility_questionnaire"||!!u&&h&&y===m,[y,e.currentStep.name,u,h]),{data:E,isLoading:un}=ge({options:{queryOptions:{enabled:ln},jsfModify:f?.jsfModify?.eligibility_questionnaire},fieldValues:cn}),dn=!!(l&&e.currentStep.name==="contract_details"||h),{data:S,isLoading:pn}=ve({countryCode:l,fieldValues:c,employmentId:r,options:{queryOptions:{enabled:dn},jsfModify:he(f?.jsfModify?.contract_details,sn,y,c,y===m)}}),mn=a(()=>e.currentStep.name==="contract_preview"||!!u&&h,[e.currentStep.name,u,h]),{data:F}=ae({fieldValues:c,options:{queryOptions:{enabled:mn},jsfModify:Ee(f,c)}}),{data:dt,isLoading:fn,refetch:yn}=ce({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),{hasCompanySignedContract:_n}=le({employmentId:r,contractDocumentId:g,options:{queryOptions:{enabled:!!g}}}),n=a(()=>({select_country:j?.fields||[],basic_information:b?.fields||[],pricing_plan:P?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:S?.fields||[],contract_preview:F?.fields||[],review:[]}),[j?.fields,b?.fields,P?.fields,S?.fields,F?.fields,E?.fields]),gn={select_country:null,basic_information:b?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:S?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},bn={select_country:j?.meta?.["x-jsf-presentation"],basic_information:b?.meta?.["x-jsf-presentation"],pricing_plan:P?.meta?.["x-jsf-presentation"],eligibility_questionnaire:E?.meta?.["x-jsf-presentation"],contract_details:S?.meta?.["x-jsf-presentation"],contract_preview:F?.meta?.["x-jsf-presentation"],review:null},{country:Sn,basic_information:it={},contract_details:Lt={}}=o||{},jt=Sn?.code,Q=a(()=>k(n.select_country,{country:l||jt||""}),[n.select_country,l,jt]),pt=a(()=>N?.content?Qt(N.content,N.name):null,[N?.content,N?.name]),J=a(()=>{let t={...p,...it,ir35:o?.contract_details?.ir_35,nationality_status:o?.contract_details?.nationality,...pt&&{ir35_sds_file:[pt]}};return k(n.basic_information,t)},[p,it,o?.contract_details?.ir_35,o?.contract_details?.nationality,pt,n.basic_information]),U=a(()=>{let i={...{service_duration:{provisional_start_date:it.provisional_start_date}},...p,...Lt};return k(n.contract_details,i)},[n.contract_details,Lt,p,it]),K=a(()=>{let t=dt?.contract_document?.signatories?.find(s=>s.type==="company"),i={...p,signature:t?.signature};return k(n.contract_preview,i)},[n.contract_preview,p,dt]),G=a(()=>{let i={...{subscription:y},...p};return k(n.pricing_plan,i)},[n.pricing_plan,p,y]),H=a(()=>{let t={...p,...et};return k(n.eligibility_questionnaire,t)},[n.eligibility_questionnaire,p,et]),Cn=a(()=>({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H}),[Q,J,U,K,G,H]),mt=!!(u&&h&&e.currentStep.name!=="review"),ft=He||an||Le||pn||ze||fn||rn||on||un,xt=a(()=>{let i=o?.contractor_type==="cor"||n.contract_preview.length>0;return!!(mt&&!ft&&g&&n.basic_information.length>0&&n.contract_details.length>0&&i)},[mt,ft,g,n.basic_information.length,n.contract_details.length,n.contract_preview.length,o?.contractor_type]);A(()=>{xt&&(X.current={select_country:V(Q,n.select_country,{skipMoneyConversion:!0}),basic_information:V(J,n.basic_information,{skipMoneyConversion:!0}),contract_details:V(U,n.contract_details,{skipMoneyConversion:!0}),contract_preview:V(K,n.contract_preview,{skipMoneyConversion:!0}),pricing_plan:V(G,n.pricing_plan,{skipMoneyConversion:!0}),eligibility_questionnaire:V(H,n.eligibility_questionnaire,{skipMoneyConversion:!0})},ht({select_country:Q,basic_information:J,contract_details:U,contract_preview:K,pricing_plan:G,eligibility_questionnaire:H,review:{}}),L("review"))},[xt,L,Q,J,U,ht,n.select_country,n.basic_information,n.contract_details,n.pricing_plan,G,n.contract_preview,K,n.eligibility_questionnaire,H]);let wn=d(t=>{L(t)},"goTo"),Bt=d(async t=>j&&e.currentStep.name==="select_country"?t:b&&e.currentStep.name==="basic_information"?await _(t,b?.fields,{isPartialValidation:!1}):S&&e.currentStep.name==="contract_details"?await _(t,S?.fields,{isPartialValidation:!1}):F&&e.currentStep.name==="contract_preview"?await _(t,F?.fields,{isPartialValidation:!1}):P&&e.currentStep.name==="pricing_plan"?await _(t,P?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await _(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues"),vn=d(t=>{if(!Nt(t))return null;let i=t.normalizedErrors.services_and_deliverables,s=Array.isArray(i)?i[0]:i;return s?.source===Xt?{error:s.error,source:s.source,skippable:s.skippable}:null},"extractAiValidationError");async function hn(t){let i=e.currentStep.name,s=await Bt(t);switch(i in X.current&&(X.current[i]=V(s,n[i])),e.currentStep.name){case"select_country":return gt(s.country),Promise.resolve({data:{countryCode:s.country}});case"basic_information":{let I=!r&&l,M=r&&l&&o?.country&&o?.country.code!==l;if(I||M){let yt={basic_information:Ve(s,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:l,external_id:q},ot=await Qe(yt),C=ot?.data?.employment?.id;if(!C)throw v("Employment ID not found");return await Vt({employmentId:C}),De(C),ot}else if(r){let rt=Ve(s,"nationality_status","ir35","ir35_sds_file");return await Vt({employmentId:r}),Ne({employmentId:r,basic_information:rt})}return}case"contract_details":{let{services_and_deliverables_ai_warning:I,services_and_deliverables_error_skippable:M,...rt}=s,yt=c.services_and_deliverables_error_skippable===!0,ot={contract_document:rt,skip_ai_checks:yt};try{let C=await Je({employmentId:r,payload:ot}),W=C?.data?.contract_document?.id;if(!W)throw v("Contract document ID not found");return bt(W),C}catch(C){let W=vn(C);throw W&&vt({...t,services_and_deliverables_ai_warning:ie(y===m),services_and_deliverables_error_skippable:W.skippable}),C}}case"contract_preview":{if(_n)return Promise.resolve({data:{contract_document:{id:g}}});let I=await Ue({employmentId:r,contractDocumentId:g,payload:{signature:s.signature}});return await yn(),I}case"pricing_plan":{if(t.subscription===zt)return Promise.resolve({data:{subscription:t.subscription}});if(x.length===0)throw v("No available subscriptions.");if(!t.subscription&&x.length>0)throw v("Please select a subscription plan.");if(B&&[m,at].includes(t.subscription))throw v(`This individual is not eligible for ${pe[t.subscription]}.`);if(D&&t.subscription!==m)try{await Ge({employmentId:r}),await ut()}catch(M){if(M?.response?.status!==404)throw M;await ut()}if(t.subscription==$)return Rt({employmentId:r,payload:{operation:"downgrade"}});if(t.subscription==at)return Rt({employmentId:r,payload:{operation:"upgrade"}});if(t.subscription==m)return D&&o?.contractor_type!=="cor"?qt({employmentId:r}):Promise.resolve({data:{subscription:t.subscription}});throw v("invalid selection")}case"eligibility_questionnaire":try{if((await Ke({employmentId:r,payload:s}))?.data?.is_blocking)throw Z(!1),wt("pricing_plan"),v("This individual is not eligible for Contractor of Record.");return await qt({employmentId:r})}finally{await ut()}default:throw v("Invalid step state")}}return d(hn,"onSubmit"),{isLoading:ft||mt,fieldValues:c,stepState:e,checkFieldUpdates:vt,markContractAsReviewed:d(()=>{_t.current?.()},"markContractAsReviewed"),back:qe,next:d(()=>{r&&Pt(),Te()},"handleNextStep"),goTo:wn,onSubmit:hn,fields:n[e.currentStep.name],meta:{fields:X.current,fieldsets:gn[e.currentStep.name],presentation:bn[e.currentStep.name]},parseFormValues:Bt,canSkipAiValidation:c.services_and_deliverables_error_skippable===!0,handleValidation:d(async t=>{if(e.currentStep.name==="select_country")return j.handleValidation(t);if(b&&e.currentStep.name==="basic_information"){let i=await _(t,b?.fields,{isPartialValidation:!1});return b?.handleValidation(i)}if(S&&e.currentStep.name==="contract_details"){let i=await _(t,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}if(F&&e.currentStep.name==="contract_preview"){let i=await _(t,F?.fields,{isPartialValidation:!0});return F?.handleValidation(i)}if(P&&e.currentStep.name==="pricing_plan"){let i=await _(t,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let i=await _(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(i)}return null},"handleValidation"),initialValues:Cn,employmentId:r,refetchEmployment:Pt,isSubmitting:Et.isPending||Ft.isPending||ct.isPending||It.isPending||kt.isPending||Mt.isPending||Ot.isPending||Dt.isPending||At.isPending,documentPreviewPdf:dt,canInvite:xe,isEmploymentReadOnly:h,invitedStatus:Be,employment:o,defaultLegalEntity:je,steps:Re}},"useContractorOnboarding");export{ii as a};
2
+ //# sourceMappingURL=chunk-36IU27QH.js.map
@@ -0,0 +1,2 @@
1
+ import{a as T,b as E,c as j,d as $,f as O}from"./chunk-MHIY35CK.js";import{a as V,d as w,e as x,f as B}from"./chunk-FQFLC6YA.js";import{b as F}from"./chunk-T5J2Z6ZR.js";import{a as N}from"./chunk-OV6PV4N5.js";import{a as y,b as k,d as D,e as R,f as H,h as C}from"./chunk-Y3CJRZLA.js";import{a as s}from"./chunk-P37U34EQ.js";import*as l from"yup";var P=s((t,a,r)=>{if(t&&"reportValidity"in t){let o=y(r,a);t.setCustomValidity(o&&o.message||""),t.reportValidity()}},"r"),b=s((t,a)=>{for(let r in a.fields){let o=a.fields[r];o&&o.ref&&"reportValidity"in o.ref?P(o.ref,r,t):o&&o.refs&&o.refs.forEach(u=>P(u,r,t))}},"o"),q=s((t,a)=>{a.shouldUseNativeValidation&&b(t,a);let r={};for(let o in t){let u=y(a.fields,o),i=Object.assign(t[o]||{},{ref:u&&u.ref});if(A(a.names||Object.keys(t),o)){let n=Object.assign({},y(r,o));k(n,"root",i),k(r,o,n)}else k(r,o,i)}return r},"s"),A=s((t,a)=>{let r=M(a).replace(/[.*+?^${}()|\\]/g,"\\$&");return t.some(o=>M(o).match(`^${r}\\.\\d+`))},"i");function M(t){return t.replace(/[\[\]]/g,"")}s(M,"n");function L(t,a,r){return r===void 0&&(r={}),function(o,u,i){try{return Promise.resolve((function(n,_){try{var p=(a!=null&&a.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(t[r.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},a,{context:u}))).then(function(m){return i.shouldUseNativeValidation&&b({},i),{values:r.raw?Object.assign({},o):m,errors:{}}}))}catch(m){return _(m)}return p&&p.then?p.then(void 0,_):p})(0,function(n){if(!n.inner)throw n;return{values:{},errors:q((_=n,p=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(_.inner||[]).reduce(function(m,c){if(m[c.path]||(m[c.path]={message:c.message,type:c.type}),p){var S=m[c.path].types,g=S&&S[c.type];m[c.path]=D(c.path,p,m,c.type,g?[].concat(g,c.message):c.message)}return m},{})),i)};var _,p}))}catch(n){return Promise.reject(n)}}}s(L,"o");import{Fragment as Y,useState as z}from"react";import{jsx as e,jsxs as d}from"react/jsx-runtime";var K=l.object({day:l.string().required(),checked:l.boolean().required(),start_time:l.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:s(t=>t.required("Required"),"then"),otherwise:s(t=>t.optional().nullable(),"otherwise")}),end_time:l.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:s(t=>t.required("Required"),"then"),otherwise:s(t=>t.optional().nullable(),"otherwise")}),hours:l.number().default(0),break_duration_minutes:l.string().default("0")}),G=l.object({schedule:l.array(K)});function J({defaultSchedule:t,onSubmit:a}){let[r,o]=z(!1),u=V.map(f=>{let h=t.find(v=>v.day.toLowerCase()===x(f).toLowerCase()||v.day.toLowerCase()===f.toLowerCase());return h?{...h,day:x(f),checked:!0}:{...t[0],checked:!1,day:x(f)}}),i=H({defaultValues:{schedule:u},resolver:L(G)}),{handleSubmit:n,watch:_,reset:p,control:m,formState:c}=i,{fields:S}=R({name:"schedule",control:m}),g=_("schedule");function I(f){let h=f.schedule.filter(({checked:v})=>v).map(v=>({...v,hours:w(v)}));a(h),o(!1)}s(I,"handleSubmitWorkingHours");function U(){p(),o(!1)}return s(U,"handleCancel"),e("div",{className:"flex items-center justify-between",children:d(T,{open:r,onOpenChange:o,children:[e(E,{asChild:!0,children:e(F,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),d(j,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[e($,{children:e(O,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),e(C,{...i,children:d("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[d("div",{className:"rounded-lg",children:[e("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."}),d("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[e("div",{className:"col-span-2"}),e("div",{className:"col-span-3 text-center",children:"START"}),e("div",{className:"col-span-1 text-center"}),e("div",{className:"col-span-3 text-center",children:"END"}),e("div",{className:"col-span-2 text-center",children:"HOURS"})]}),e("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:S.map((f,h)=>{let v=g[h],W=w(v);return d(Y,{children:[d("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[e("div",{className:"col-span-2 flex items-center gap-3",children:e(B,{label:f.day,name:`schedule.${h}.checked`})}),e("div",{className:"col-span-3",children:e(N,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),e("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),e("div",{className:"col-span-3",children:e(N,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),e("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(W)?"-":`${W} hours`})]}),d("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[e("div",{className:"col-span-2 text-gray-500",children:"Break"}),e("div",{className:"col-span-2",children:e(N,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),e("div",{className:"col-span-2 text-gray-500",children:"minutes"}),e("div",{className:"col-span-4"})]})]},f.id)})})]}),Object.keys(c.errors).length>0&&e("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),d("div",{className:"flex gap-4 pt-4",children:[e(F,{type:"button",className:"reset-button",variant:"outline",onClick:U,children:"Cancel"}),e(F,{type:"button",className:"submit-button",onClick:n(I),children:"Save Schedule"})]})]})})]})]})})}s(J,"WorkScheduleSelectionForm");var he=s(({fieldData:t})=>{let{defaultFormattedValue:a,currentSchedule:r,onSubmit:o}=t,{workHoursSummary:u,breakSummary:i,totalWorkHours:n}=a;return d("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[e("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),d("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[e("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:u.join(", ")}}),e("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),d("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",e("span",{children:n})," hours per week"]}),e(J,{defaultSchedule:r,onSubmit:o})]})]})},"WorkScheduleFieldDefault");export{he as a};
2
+ //# sourceMappingURL=chunk-3GCJILCE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/form/fields/default/WorkScheduleFieldDefault.tsx","../node_modules/@hookform/resolvers/src/validateFieldsNatively.ts","../node_modules/@hookform/resolvers/src/toNestErrors.ts","../node_modules/@hookform/resolvers/yup/src/yup.ts"],"sourcesContent":["import { useFieldArray, useForm } from 'react-hook-form';\nimport * as yup from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport { Fragment, useState } from 'react';\nimport { Form } from '@/src/components/ui/form';\nimport {\n calculateHours,\n DailySchedule,\n DAYS_OF_THE_WEEK,\n getShortWeekday,\n} from '@/src/components/form/fields/workScheduleUtils';\nimport { CheckBoxField } from '@/src/components/form/fields/CheckBoxField';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { Button } from '@/src/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '@/src/components/ui/dialog';\nimport { WorkScheduleComponentProps } from '@/src/types/fields';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype WorkScheduleFormData = {\n schedule: DailySchedule[];\n};\n\ntype WorkScheduleSelectionProps = {\n defaultSchedule: DailySchedule[];\n onSubmit: (data: WorkScheduleFormData['schedule']) => void;\n};\n\nconst fieldSchema = yup.object({\n day: yup.string().required(),\n checked: yup.boolean().required(),\n start_time: yup\n .string()\n .matches(/^([01]\\d|2[0-3]):([0-5]\\d)$/, 'Invalid time format (HH:mm)')\n .when('checked', {\n is: true,\n then: (schema) => schema.required('Required'),\n otherwise: (schema) => schema.optional().nullable(),\n }),\n end_time: yup\n .string()\n .matches(/^([01]\\d|2[0-3]):([0-5]\\d)$/, 'Invalid time format (HH:mm)')\n .when('checked', {\n is: true,\n then: (schema) => schema.required('Required'),\n otherwise: (schema) => schema.optional().nullable(),\n }),\n hours: yup.number().default(0),\n break_duration_minutes: yup.string().default('0'),\n});\n\nconst formSchema = yup.object({\n schedule: yup.array(fieldSchema),\n});\n\nfunction WorkScheduleSelectionForm({\n defaultSchedule,\n onSubmit,\n}: WorkScheduleSelectionProps) {\n const [openDialog, setOpenDialog] = useState(false);\n\n const transformedSchedule = DAYS_OF_THE_WEEK.map((day) => {\n const existingSchedule = defaultSchedule.find(\n (schedule) =>\n schedule.day.toLowerCase() === getShortWeekday(day).toLowerCase() ||\n schedule.day.toLowerCase() === day.toLowerCase(),\n );\n\n if (existingSchedule) {\n return {\n ...existingSchedule,\n day: getShortWeekday(day),\n checked: true,\n };\n }\n\n return {\n // We just need to override the day and checked. The rest of the fields are the same for every day.\n ...defaultSchedule[0],\n checked: false,\n day: getShortWeekday(day),\n };\n });\n\n const form = useForm<WorkScheduleFormData>({\n defaultValues: {\n schedule: transformedSchedule,\n },\n resolver: yupResolver(formSchema) as $TSFixMe,\n });\n\n const { handleSubmit, watch, reset, control, formState } = form;\n\n const { fields } = useFieldArray({\n name: 'schedule',\n control,\n });\n\n const watchedSchedule = watch('schedule');\n\n function handleSubmitWorkingHours(data: WorkScheduleFormData) {\n // We can only send the days that are checked.\n const schedule = data.schedule\n .filter(({ checked }) => checked)\n .map((day) => ({\n ...day,\n hours: calculateHours(day),\n }));\n\n onSubmit(schedule);\n setOpenDialog(false);\n }\n\n function handleCancel() {\n reset();\n setOpenDialog(false);\n }\n\n return (\n <div className='flex items-center justify-between'>\n <Dialog open={openDialog} onOpenChange={setOpenDialog}>\n <DialogTrigger asChild>\n <Button\n variant={'link'}\n className='flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger'\n >\n Edit Schedule\n </Button>\n </DialogTrigger>\n <DialogContent className='max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content'>\n <DialogHeader>\n <DialogTitle className='RemoteFlows__WorkScheduleSelectionForm__Title'>\n Edit employee working hours\n </DialogTitle>\n </DialogHeader>\n\n <Form {...form}>\n <form className='space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form'>\n <div className='rounded-lg'>\n <p className='text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description'>\n The times displayed are in the employee's time zone in the\n 24-hour format.\n </p>\n\n <div className='grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header'>\n <div className='col-span-2'></div>\n <div className='col-span-3 text-center'>START</div>\n <div className='col-span-1 text-center'></div>\n <div className='col-span-3 text-center'>END</div>\n <div className='col-span-2 text-center'>HOURS</div>\n {/* <div className=\"col-span-2 text-center\">ACTIONS</div> */}\n </div>\n\n <div className='RemoteFlows__WorkScheduleSelectionForm__Rows'>\n {fields.map((field, index) => {\n const currentDay = watchedSchedule[index];\n const calculatedHours = calculateHours(currentDay);\n\n return (\n <Fragment key={field.id}>\n <div className='grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours'>\n <div className='col-span-2 flex items-center gap-3'>\n <CheckBoxField\n label={field.day}\n name={`schedule.${index}.checked`}\n />\n </div>\n <div className='col-span-3'>\n <TextField\n name={`schedule.${index}.start_time`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-1 text-center text-gray-500'>\n to\n </div>\n <div className='col-span-3'>\n <TextField\n name={`schedule.${index}.end_time`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-2 text-center text-gray-600'>\n {isNaN(calculatedHours)\n ? '-'\n : `${calculatedHours} hours`}\n </div>\n </div>\n\n <div className='grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break'>\n <div className='col-span-2 text-gray-500'>Break</div>\n <div className='col-span-2'>\n <TextField\n name={`schedule.${index}.break_duration_minutes`}\n includeErrorMessage={false}\n />\n </div>\n <div className='col-span-2 text-gray-500'>\n minutes\n </div>\n <div className='col-span-4'></div>\n </div>\n </Fragment>\n );\n })}\n </div>\n </div>\n\n {Object.keys(formState.errors).length > 0 && (\n <p className='text-destructive text-sm mb-0'>\n Invalid time format (HH:mm)\n </p>\n )}\n\n <div className='flex gap-4 pt-4'>\n <Button\n type='button'\n className='reset-button'\n variant='outline'\n onClick={handleCancel}\n >\n Cancel\n </Button>\n <Button\n type='button'\n className='submit-button'\n onClick={handleSubmit(handleSubmitWorkingHours)}\n >\n Save Schedule\n </Button>\n </div>\n </form>\n </Form>\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n\nexport const WorkScheduleFieldDefault = ({\n fieldData,\n}: WorkScheduleComponentProps) => {\n const { defaultFormattedValue, currentSchedule, onSubmit } = fieldData;\n const { workHoursSummary, breakSummary, totalWorkHours } =\n defaultFormattedValue;\n return (\n <div className={`flex flex-col gap-3 RemoteFlows__WorkScheduleField`}>\n <p className={`text-sm RemoteFlows__WorkScheduleField__Title`}>\n Work hours\n </p>\n <div className='flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary'>\n <p\n className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours'\n dangerouslySetInnerHTML={{\n __html: workHoursSummary.join(', '),\n }}\n />\n\n <p className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break'>\n {breakSummary.join()}\n </p>\n <p className='text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total'>\n Total of <span>{totalWorkHours}</span> hours per week\n </p>\n <WorkScheduleSelectionForm\n defaultSchedule={currentSchedule}\n onSubmit={onSubmit}\n />\n </div>\n </div>\n );\n};\n","import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = <TFieldValues extends FieldValues>(\n errors: FieldErrors,\n options: ResolverOptions<TFieldValues>,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field && field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = <TFieldValues extends FieldValues>(\n errors: FieldErrors,\n options: ResolverOptions<TFieldValues>,\n): FieldErrors<TFieldValues> => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors<TFieldValues>;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => {\n const path = escapeForRegex(name);\n return names.some((n) => escapeBrackets(n).match(`^${path}\\\\.\\\\d+`));\n};\n\n// Removes brackets to match react-hook-form's `set` method behavior.\nfunction escapeBrackets(input: string): string {\n return input.replace(/[\\[\\]]/g, '');\n}\n\n// Removes brackets then escapes regex metacharacters so a field name can be\n// safely embedded in a regex pattern without causing a SyntaxError.\nfunction escapeForRegex(input: string): string {\n return escapeBrackets(input).replace(/[.*+?^${}()|\\\\]/g, '\\\\$&');\n}\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nfunction parseErrorSchema(\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) {\n return (error.inner || []).reduce<Record<string, FieldError>>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n}\n\nexport function yupResolver<Input extends FieldValues, Context, Output>(\n schema:\n | Yup.ObjectSchema<Input, any, Output, any>\n | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<Input, any, Output, any>>>,\n schemaOptions?: Parameters<(typeof schema)['validate']>[1],\n resolverOptions?: {\n mode?: 'async' | 'sync';\n raw?: false;\n },\n): Resolver<Input, Context, Yup.InferType<typeof schema>>;\n\nexport function yupResolver<Input extends FieldValues, Context, Output>(\n schema:\n | Yup.ObjectSchema<Input, any, Output, any>\n | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<Input, any, Output, any>>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] | undefined,\n resolverOptions: {\n mode?: 'async' | 'sync';\n raw: true;\n },\n): Resolver<Input, Context, Input>;\n\n/**\n * Creates a resolver for react-hook-form using Yup schema validation\n * @param {Yup.ObjectSchema<TFieldValues> | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<TFieldValues>>>} schema - Yup validation schema\n * @param {Parameters<(typeof schema)['validate']>[1]} schemaOptions - Options to pass to Yup's validate/validateSync\n * @param {Object} resolverOptions - Additional resolver configuration\n * @param {('async' | 'sync')} [resolverOptions.mode] - Validation mode\n * @param {boolean} [resolverOptions.raw] - If true, returns raw values instead of validated results\n * @returns {Resolver<Yup.InferType<typeof schema> | Input>} A resolver function compatible with react-hook-form\n * @example\n * const schema = Yup.object({\n * name: Yup.string().required(),\n * age: Yup.number().required(),\n * });\n *\n * useForm({\n * resolver: yupResolver(schema)\n * });\n */\nexport function yupResolver<Input extends FieldValues, Context, Output>(\n schema:\n | Yup.ObjectSchema<Input, any, Output, any>\n | ReturnType<typeof Yup.lazy<Yup.ObjectSchema<Input, any, Output, any>>>,\n schemaOptions?: Parameters<(typeof schema)['validate']>[1],\n resolverOptions: {\n mode?: 'async' | 'sync';\n raw?: boolean;\n } = {},\n): Resolver<Input, Context, Yup.InferType<typeof schema> | Input> {\n return async (values: Input, context, options) => {\n try {\n if (schemaOptions?.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? Object.assign({}, values) : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n"],"mappings":"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","names":["yup","setCustomValidity","ref","fieldPath","errors","error","get","message","reportValidity","validateFieldsNatively","options","fields","field","refs","forEach","toNestErrors","shouldUseNativeValidation","fieldErrors","path","Object","assign","isNameInFieldArray","names","keys","fieldArrayErrors","set","name","escapeBrackets","replace","some","n","match","input","yupResolver","schema","schemaOptions","resolverOptions","values","context","options","Promise","resolve","process","env","NODE_ENV","console","warn","mode","Object","assign","abortEarly","then","result","shouldUseNativeValidation","validateFieldsNatively","raw","errors","e","r","u","_catch","inner","toNestErrors","error","validateAllFieldCriteria","criteriaMode","reduce","previous","path","message","type","types","messages","appendErrors","concat","reject","Fragment","useState","jsx","jsxs","fieldSchema","__name","schema","formSchema","WorkScheduleSelectionForm","defaultSchedule","onSubmit","openDialog","setOpenDialog","useState","transformedSchedule","DAYS_OF_THE_WEEK","day","existingSchedule","schedule","getShortWeekday","form","useForm","o","handleSubmit","watch","reset","control","formState","fields","useFieldArray","watchedSchedule","handleSubmitWorkingHours","data","checked","calculateHours","handleCancel","Dialog","DialogTrigger","Button","DialogContent","DialogHeader","DialogTitle","Form","field","index","currentDay","calculatedHours","Fragment","CheckBoxField","TextField","WorkScheduleFieldDefault","fieldData","defaultFormattedValue","currentSchedule","workHoursSummary","breakSummary","totalWorkHours"]}
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-KVUKJU5U.js";import{a as i}from"./chunk-6P536SW2.js";import{a as u}from"./chunk-34U3WJ75.js";import{a as d}from"./chunk-SVVZOMLQ.js";import{a as S}from"./chunk-QIAK5VU7.js";import{a as e}from"./chunk-CW7CHRMN.js";import{a as s}from"./chunk-DNAPYU5I.js";import{a as p}from"./chunk-DB4JHJ3Z.js";import{a as c}from"./chunk-W7MCRAQ4.js";import{a as m}from"./chunk-V62JQXIC.js";import{a as f}from"./chunk-32ERURM2.js";import{a as n}from"./chunk-Q3ALCPJN.js";import{a}from"./chunk-UI4AZZD5.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as I,useRef as F,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var J=t(({render:g,employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O,options:w})=>{let P=I(),o=F(void 0),R=y(()=>({setValue:o}),[]),r=a({options:{...w,onContractReviewed:t(()=>{o.current&&o.current("review_completed",!0)},"onContractReviewed")},employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O});return D(n.Provider,{value:{contractorOnboardingBag:r,formId:P,formRef:R},children:g({contractorOnboardingBag:r,components:{BasicInformationStep:m,SelectCountryStep:i,BackButton:e,SubmitButton:p,PricingPlanStep:c,EligibilityQuestionnaireStep:S,ContractDetailsStep:f,ContractPreviewStep:u,OnboardingInvite:s,ContractReviewButton:d,SaveDraftButton:l}})})},"ContractorOnboardingFlow");export{J as a};
2
- //# sourceMappingURL=chunk-JFPOX7SW.js.map
1
+ import{a as l}from"./chunk-KVUKJU5U.js";import{a as i}from"./chunk-6P536SW2.js";import{a as u}from"./chunk-34U3WJ75.js";import{a as d}from"./chunk-SVVZOMLQ.js";import{a as S}from"./chunk-QIAK5VU7.js";import{a as e}from"./chunk-CW7CHRMN.js";import{a as s}from"./chunk-DNAPYU5I.js";import{a as p}from"./chunk-DB4JHJ3Z.js";import{a as c}from"./chunk-W7MCRAQ4.js";import{a as m}from"./chunk-V62JQXIC.js";import{a as f}from"./chunk-33VF3QHP.js";import{a as n}from"./chunk-Q3ALCPJN.js";import{a}from"./chunk-36IU27QH.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as I,useRef as F,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var J=t(({render:g,employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O,options:w})=>{let P=I(),o=F(void 0),R=y(()=>({setValue:o}),[]),r=a({options:{...w,onContractReviewed:t(()=>{o.current&&o.current("review_completed",!0)},"onContractReviewed")},employmentId:C,externalId:b,countryCode:v,skipSteps:B,initialValues:O});return D(n.Provider,{value:{contractorOnboardingBag:r,formId:P,formRef:R},children:g({contractorOnboardingBag:r,components:{BasicInformationStep:m,SelectCountryStep:i,BackButton:e,SubmitButton:p,PricingPlanStep:c,EligibilityQuestionnaireStep:S,ContractDetailsStep:f,ContractPreviewStep:u,OnboardingInvite:s,ContractReviewButton:d,SaveDraftButton:l}})})},"ContractorOnboardingFlow");export{J as a};
2
+ //# sourceMappingURL=chunk-4VEUIX5E.js.map
@@ -1,2 +1,2 @@
1
- import{a,b as s,e as l,h as c,i as d}from"./chunk-Q2OGLLBA.js";import{a as i}from"./chunk-P37U34EQ.js";function _(e={}){let o=[{name:"select_country",label:"Select Country",visible:!!e?.includeSelectCountry},{name:"basic_information",label:"Basic Information",visible:!0},{name:"pricing_plan",label:"Pricing Plan",visible:!0},{name:"eligibility_questionnaire",label:"Eligibility Questionnaire",visible:!!e?.includeEligibilityQuestionnaire},{name:"contract_details",label:"Contract Details",visible:!0},{name:"contract_preview",label:"Contract Preview",visible:!!e?.includeContractPreview},{name:"review",label:"Review",visible:!0}].map((n,r)=>({name:n.name,index:r,label:n.label,visible:n.visible}));return{steps:o.reduce((n,r)=>(n[r.name]={index:r.index,name:r.name,visible:r.visible},n),{}),stepsArray:o}}i(_,"buildSteps");var E=i((e,t)=>{if(e&&t&&e!==t)return`When the contractor will start providing service to your company. ${`This date does not match the date you provided in the Basic Information step - ${e} - and will override it only when both parties have signed the contract.`}`},"calculateProvisionalStartDateDescription"),v=i(e=>e===a||e===s,"isCMOrCMPlus"),p=["SAU","KWT","OMN","QAT","BHR"],g=i(e=>p.includes(e),"isNationalityCountryCode"),y=i((e,t)=>!t||t.length===0?!0:!t.some(o=>l[o]===e),"shouldIncludeProduct"),S=["initiated","invited","created_awaiting_reserve","created_reserve_paid"],f=["initiated","created_awaiting_reserve","invited"];function R(e){return e?d:c}i(R,"transformAiErrorResponse");export{_ as a,E as b,v as c,g as d,y as e,S as f,f as g,R as h};
2
- //# sourceMappingURL=chunk-G556HMVA.js.map
1
+ import{a,b as s,e as l,h as c,i as d}from"./chunk-PB6UQ4A4.js";import{a as i}from"./chunk-P37U34EQ.js";function _(e={}){let o=[{name:"select_country",label:"Select Country",visible:!!e?.includeSelectCountry},{name:"basic_information",label:"Basic Information",visible:!0},{name:"pricing_plan",label:"Pricing Plan",visible:!0},{name:"eligibility_questionnaire",label:"Eligibility Questionnaire",visible:!!e?.includeEligibilityQuestionnaire},{name:"contract_details",label:"Contract Details",visible:!0},{name:"contract_preview",label:"Contract Preview",visible:!!e?.includeContractPreview},{name:"review",label:"Review",visible:!0}].map((n,r)=>({name:n.name,index:r,label:n.label,visible:n.visible}));return{steps:o.reduce((n,r)=>(n[r.name]={index:r.index,name:r.name,visible:r.visible},n),{}),stepsArray:o}}i(_,"buildSteps");var E=i((e,t)=>{if(e&&t&&e!==t)return`When the contractor will start providing service to your company. ${`This date does not match the date you provided in the Basic Information step - ${e} - and will override it only when both parties have signed the contract.`}`},"calculateProvisionalStartDateDescription"),v=i(e=>e===a||e===s,"isCMOrCMPlus"),p=["SAU","KWT","OMN","QAT","BHR"],g=i(e=>p.includes(e),"isNationalityCountryCode"),y=i((e,t)=>!t||t.length===0?!0:!t.some(o=>l[o]===e),"shouldIncludeProduct"),S=["initiated","invited","created_awaiting_reserve","created_reserve_paid"],f=["initiated","created_awaiting_reserve","invited"];function R(e){return e?d:c}i(R,"transformAiErrorResponse");export{_ as a,E as b,v as c,g as d,y as e,S as f,f as g,R as h};
2
+ //# sourceMappingURL=chunk-COAJUZSE.js.map
@@ -1,2 +1,2 @@
1
- import{a as X}from"./chunk-AP56UUME.js";import{a as z}from"./chunk-IJCTN52C.js";import{e as P}from"./chunk-G556HMVA.js";import{a as O,b as Z,c as I,d as _,f as h,m as ee}from"./chunk-Q2OGLLBA.js";import{a as H}from"./chunk-WVJDCDGZ.js";import{a as Y}from"./chunk-54Z4QJ3Q.js";import{a as b}from"./chunk-LKVQ32ZK.js";import{$ as G,E as v,K as A,S as j,V as J,X as K,_ as N,aa as k,ba as $,f as D,fa as B,ga as W,h as V,r as w,t as Q,u as L,v as U}from"./chunk-GZUP2IE6.js";import{b as E,g as q,t as x}from"./chunk-G2LZFGZA.js";import{e as a}from"./chunk-H2O4CVKF.js";import{a as n}from"./chunk-P37U34EQ.js";import{useMemo as se}from"react";import{useMutation as g,useQuery as m}from"@tanstack/react-query";import{useMutation as fe,useQuery as te}from"@tanstack/react-query";var De=n(()=>{let{client:e}=a();return fe({mutationFn:n(t=>K({client:e,body:t,headers:{Authorization:""}}),"mutationFn")})},"useUploadFile"),ne=n(e=>{let{client:t}=a();return te({queryKey:["download-file",e],queryFn:n(async()=>{let o=await v({client:t,path:{id:e}});if(o.error)throw o.error;return o.data},"queryFn"),select:n(({data:o})=>o?.file,"select"),enabled:!!e})},"useDownloadFile"),oe=n((e,t,o)=>{let{client:r}=a();return te({queryKey:["employment-files",e],queryFn:n(async()=>{let i=await J({client:r,path:{employment_id:e},query:t});if(i.error)throw i.error;return i.data},"queryFn"),...o})},"useEmploymentFiles");import{useQuery as be}from"@tanstack/react-query";import{useQuery as Ce}from"@tanstack/react-query";var re=n(()=>{let{client:e}=a();return Ce({queryKey:["identity"],queryFn:n(()=>G({client:e,headers:{Authorization:""}}),"queryFn"),select:n(t=>t.data?.data,"select")})},"useIdentity");function ge(e){return e!=null&&"company"in e}n(ge,"hasCompany");var ie=n((e={enabled:!0})=>{let{data:t}=re(),o=ge(t)?t?.company?.id??"":"",{client:r}=a();return be({queryKey:["pricing-plans",o],queryFn:n(()=>D({client:r,path:{company_id:o}}),"queryFn"),select:n(i=>i.data?.data?.pricing_plans,"select"),enabled:!!e?.enabled&&!!o})},"useCompanyPricingPlans");var Fe=n(({employmentId:e,options:t})=>{let{client:o}=a();return m({queryKey:["contractor-currencies",e],queryFn:n(async()=>U({client:o,path:{employment_id:e},query:{restrict_to_guaranteed_pay_out_currencies:!1}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:n(({data:r})=>r?.data,"select")})},"useContractorCurrencies"),gt=n(({fieldValues:e,options:t})=>m({queryKey:["contract-document-signature",e.review_completed,t?.jsfModify],queryFn:n(async()=>b(z,e,{jsfModify:t?.jsfModify}),"queryFn"),enabled:t?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),Ft=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,contractDocumentId:o,payload:r})=>N({client:e,body:r,path:{employment_id:t,contract_document_id:o}}),"mutationFn")})},"useSignContractDocument"),Se=n(({employmentId:e,contractDocumentId:t,options:o})=>{let{client:r}=a();return m({queryKey:["contract-document",e,t],queryFn:n(async()=>Q({client:r,path:{employment_id:e,id:t}}),"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:i})=>({...i?.data,contract_document:{...i?.data?.contract_document,content:x(i?.data?.contract_document?.content)}}),"select")})},"useGetShowContractDocument"),St=n(({employmentId:e,contractDocumentId:t,options:o})=>{let{data:r}=Se({employmentId:e,contractDocumentId:t,options:{queryOptions:{enabled:o?.queryOptions?.enabled}}});return{hasCompanySignedContract:r?.contract_document?.signatories?.some(s=>s.type==="company"&&s.status==="signed")}},"useHasCompanySignedContract"),_e=n(({employmentId:e,options:t})=>{let{client:o}=a();return m({queryKey:["contractor-subscriptions",e],queryFn:n(async()=>w({client:o,path:{employment_id:e}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:n(({data:r})=>r?.data,"select")})},"useGetContractorSubscriptions"),_t=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,payload:o})=>$({client:e,body:o,path:{employment_id:t}}),"mutationFn")})},"usePostManageContractorSubscriptions"),ht=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,payload:o})=>j({client:e,body:o,path:{employment_id:t}}),"mutationFn")})},"useCreateContractorContractDocument"),he=n(({countryCode:e,employmentId:t,fieldValues:o,options:r})=>{let{client:i}=a();return m({queryKey:["contractor-onboarding-details-schema",e,t],retry:!1,queryFn:n(async()=>V({client:i,path:{country_code:e},query:{json_schema_version:1,employment_id:t}}),"queryFn"),enabled:r?.queryOptions?.enabled,select:n(({data:s})=>{let c=s?.data?.schema||{};return b(c,o,r)},"select")})},"useContractorOnboardingDetailsSchema"),Ee={[O]:"Contractor Management",[Z]:"Contractor Management Plus",[I]:"Contractor of Record"},qe=n(e=>{let{data:t,isLoading:o}=ie({enabled:e?.enabled}),r=t?.find(s=>s.product.name==="EOR Monthly");return{eorSubscription:r?{product:{identifier:_,short_name:"EOR"},currency:r.price.currency,price:{amount:q(r.price.amount)},features:["Contract between Remote and employee","Remote manages onboarding, payroll, and compliance","Manages taxes, benefits, and time-off tracking","Handles contracts, transfers, and terminations"],description:"Enables hiring in countries without a local entity",label:"Employer of Record",value:_}:null,isLoading:o}},"useEorSubscription"),Oe=n((e,t,o)=>(t&&P(_,o)&&e.push({label:t.label,value:t.value,description:t.description,meta:{features:t.features,price:{amount:t.price.amount,currencyCode:t.currency?.code??""}},disabled:!1}),e),"addEorToFieldOptions"),Et=n((e,t,o)=>{let{data:r,isLoading:i,refetch:s}=_e({employmentId:e,options:{queryOptions:o?.queryOptions}}),c=se(()=>r?.filter(u=>P(u.product.identifier??"",o?.excludeProducts))??[],[r,o?.excludeProducts]),F=r?r?.length<3:!1,d=r?.find(u=>u.product.identifier===I)?.eligibility_questionnaire?.is_blocking,f=(F||d)&&t?.eor_onboarding&&!o?.excludeProducts?.includes("eor"),{eorSubscription:R,isLoading:ae}=qe({enabled:f}),ce=c.length>0||f&&R!==null,M=b(X.data.schema,{},{...o,jsfModify:{...o?.jsfModify,required:ce?o?.jsfModify?.required:u=>u.filter(C=>C!=="subscription")}}),T=M.fields.find(u=>u.name==="subscription");if(T){let u=c.map(S=>{let l=S.product,le=S.price.amount,ue=S.currency.code,de=Ee[l.identifier]??"",me=l.identifier??"",pe=l.description??"";l.description||console.error(`[Data Integrity] Missing description for product: ${l.identifier}`,{product:l});let ye={features:l.features??ee[l.identifier]??[],price:{amount:q(le),currencyCode:ue}};return{label:de,value:me,description:pe,meta:ye,disabled:d&&l.identifier!==O}});u.sort((S,l)=>S.label.localeCompare(l.label));let C=[];f&&(Oe(C,R,o?.excludeProducts),C.length>0&&(C[0].meta={...C[0].meta,groupSeparator:{show:!0}})),T.options=[...u,...C]}return{isLoading:i||ae,form:M,contractorSubscriptions:r,filteredContractorSubscriptions:c,refetch:s,isEligibilityQuestionnaireBlocked:d}},"useContractorSubscriptionSchemaField"),qt=n((e,t,o)=>{let{mutateAsyncOrThrow:r}=E(t),{mutateAsyncOrThrow:i}=E(e);return{mutateAsync:n(async({employmentId:s})=>{let{nationality_status:c,ir35:p,ir35_sds_file:F}=o,y={contract_document:{ir_35:p}},d={contract_document:{nationality:c}};return p?(await i({employmentId:s,payload:y}),F?r({employment_id:s,file:F,sub_type:h}):Promise.resolve()):c?i({employmentId:s,payload:d}):Promise.resolve()},"mutateAsync")}},"useUpdateUKandSaudiFields"),Ot=n((e,t)=>{let{data:o,isLoading:r}=oe(e,{sub_type:h},{...t,select:n(({data:c})=>c?.files?.filter(p=>p.sub_type===h),"select")}),i=o?.[0]?.id,s=ne(i);return{...s,isLoading:r||s.isLoading}},"useGetIR35File"),It=n((e,t)=>{let{client:o}=a();return m({queryKey:["contract-documents",e],queryFn:n(async()=>L({client:o,path:{employment_id:e}}),"queryFn"),enabled:t?.enabled,select:n(({data:r})=>r?.data?.contract_documents,"select")})},"useGetContractDocuments"),Pt=n(({options:e,fieldValues:t})=>{let{client:o}=a();return m({queryKey:["eligibility-questionnaire"],queryFn:n(async()=>{let r=await k({client:o,query:{type:"contractor_of_record",json_schema_version:1}});if(r.error)throw new Error("Failed to fetch eligibility questionnaire");return r.data.data},"queryFn"),select:n(r=>{let i=r?.schema||{};return b(i,t,{jsfModify:e?.jsfModify})},"select"),enabled:e?.queryOptions?.enabled})},"useGetEligibilityQuestionnaire"),Rt=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,payload:o})=>A({client:e,body:{employment_slug:t,responses:o,type:"contractor_of_record"},query:{json_schema_version:1}}),"mutationFn")})},"usePostCreateEligibilityQuestionnaire"),Mt=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t})=>W({client:e,path:{employment_id:t}}),"mutationFn")})},"usePostManageContractorCorSubscription"),Tt=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t})=>B({client:e,path:{employment_id:t}}),"mutationFn")})},"useDeleteContractorCorSubscription"),xt=n(e=>{let{client:t}=a(),{data:o,isLoading:r}=m({...Y(t,"contractor-onboarding-countries"),select:n(s=>s.data?.data?.map(c=>({label:c.name,value:c.code,eor_onboarding:c.eor_onboarding,contractor_products_available:c.contractor_products_available}))||[],"select"),enabled:e?.queryOptions?.enabled}),i=b(H.data.schema,{},e);if(o){let s=i.fields.find(c=>c.name==="country");s&&(s.options=o)}return{isLoading:r,selectCountryForm:i,countries:o}},"useCountriesSchemaField"),Dt=n(({countryCode:e,employmentId:t,fieldValues:o,options:r})=>{let i=he({countryCode:e,employmentId:t,fieldValues:o,options:r}),{data:s,isLoading:c}=Fe({employmentId:t,options:{queryOptions:{enabled:r?.queryOptions?.enabled}}}),p=se(()=>!i.data||!s?i.data:{...i.data,fields:i.data.fields.map(y=>y.name!=="payment_terms"?y:{...y,fields:y.fields?.map(d=>d.name!=="compensation_currency_code"?d:{...d,options:s.map(f=>({label:f.code,value:f.code,meta:{source:f.source}}))})})},[i.data,s]);return{...i,data:p,isLoading:i.isLoading||c}},"useContractorOnboardingDetailsSchemaWithCurrencies");export{De as a,re as b,ge as c,gt as d,Ft as e,Se as f,St as g,_e as h,_t as i,ht as j,Ee as k,Et as l,qt as m,Ot as n,It as o,Pt as p,Rt as q,Mt as r,Tt as s,xt as t,Dt as u};
2
- //# sourceMappingURL=chunk-XYCFKCVZ.js.map
1
+ import{a as X}from"./chunk-AP56UUME.js";import{a as z}from"./chunk-IJCTN52C.js";import{e as P}from"./chunk-COAJUZSE.js";import{a as O,b as Z,c as I,d as _,f as h,m as ee}from"./chunk-PB6UQ4A4.js";import{a as H}from"./chunk-WVJDCDGZ.js";import{a as Y}from"./chunk-54Z4QJ3Q.js";import{a as b}from"./chunk-LKVQ32ZK.js";import{$ as G,E as v,K as A,S as j,V as J,X as K,_ as N,aa as k,ba as $,f as D,fa as B,ga as W,h as V,r as w,t as Q,u as L,v as U}from"./chunk-GZUP2IE6.js";import{b as E,g as q,t as x}from"./chunk-G2LZFGZA.js";import{e as a}from"./chunk-H2O4CVKF.js";import{a as n}from"./chunk-P37U34EQ.js";import{useMemo as se}from"react";import{useMutation as g,useQuery as m}from"@tanstack/react-query";import{useMutation as fe,useQuery as te}from"@tanstack/react-query";var De=n(()=>{let{client:e}=a();return fe({mutationFn:n(t=>K({client:e,body:t,headers:{Authorization:""}}),"mutationFn")})},"useUploadFile"),ne=n(e=>{let{client:t}=a();return te({queryKey:["download-file",e],queryFn:n(async()=>{let o=await v({client:t,path:{id:e}});if(o.error)throw o.error;return o.data},"queryFn"),select:n(({data:o})=>o?.file,"select"),enabled:!!e})},"useDownloadFile"),oe=n((e,t,o)=>{let{client:r}=a();return te({queryKey:["employment-files",e],queryFn:n(async()=>{let i=await J({client:r,path:{employment_id:e},query:t});if(i.error)throw i.error;return i.data},"queryFn"),...o})},"useEmploymentFiles");import{useQuery as be}from"@tanstack/react-query";import{useQuery as Ce}from"@tanstack/react-query";var re=n(()=>{let{client:e}=a();return Ce({queryKey:["identity"],queryFn:n(()=>G({client:e,headers:{Authorization:""}}),"queryFn"),select:n(t=>t.data?.data,"select")})},"useIdentity");function ge(e){return e!=null&&"company"in e}n(ge,"hasCompany");var ie=n((e={enabled:!0})=>{let{data:t}=re(),o=ge(t)?t?.company?.id??"":"",{client:r}=a();return be({queryKey:["pricing-plans",o],queryFn:n(()=>D({client:r,path:{company_id:o}}),"queryFn"),select:n(i=>i.data?.data?.pricing_plans,"select"),enabled:!!e?.enabled&&!!o})},"useCompanyPricingPlans");var Fe=n(({employmentId:e,options:t})=>{let{client:o}=a();return m({queryKey:["contractor-currencies",e],queryFn:n(async()=>U({client:o,path:{employment_id:e},query:{restrict_to_guaranteed_pay_out_currencies:!1}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:n(({data:r})=>r?.data,"select")})},"useContractorCurrencies"),gt=n(({fieldValues:e,options:t})=>m({queryKey:["contract-document-signature",e.review_completed,t?.jsfModify],queryFn:n(async()=>b(z,e,{jsfModify:t?.jsfModify}),"queryFn"),enabled:t?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),Ft=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,contractDocumentId:o,payload:r})=>N({client:e,body:r,path:{employment_id:t,contract_document_id:o}}),"mutationFn")})},"useSignContractDocument"),Se=n(({employmentId:e,contractDocumentId:t,options:o})=>{let{client:r}=a();return m({queryKey:["contract-document",e,t],queryFn:n(async()=>Q({client:r,path:{employment_id:e,id:t}}),"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:i})=>({...i?.data,contract_document:{...i?.data?.contract_document,content:x(i?.data?.contract_document?.content)}}),"select")})},"useGetShowContractDocument"),St=n(({employmentId:e,contractDocumentId:t,options:o})=>{let{data:r}=Se({employmentId:e,contractDocumentId:t,options:{queryOptions:{enabled:o?.queryOptions?.enabled}}});return{hasCompanySignedContract:r?.contract_document?.signatories?.some(s=>s.type==="company"&&s.status==="signed")}},"useHasCompanySignedContract"),_e=n(({employmentId:e,options:t})=>{let{client:o}=a();return m({queryKey:["contractor-subscriptions",e],queryFn:n(async()=>w({client:o,path:{employment_id:e}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:n(({data:r})=>r?.data,"select")})},"useGetContractorSubscriptions"),_t=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,payload:o})=>$({client:e,body:o,path:{employment_id:t}}),"mutationFn")})},"usePostManageContractorSubscriptions"),ht=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,payload:o})=>j({client:e,body:o,path:{employment_id:t}}),"mutationFn")})},"useCreateContractorContractDocument"),he=n(({countryCode:e,employmentId:t,fieldValues:o,options:r})=>{let{client:i}=a();return m({queryKey:["contractor-onboarding-details-schema",e,t],retry:!1,queryFn:n(async()=>V({client:i,path:{country_code:e},query:{json_schema_version:1,employment_id:t}}),"queryFn"),enabled:r?.queryOptions?.enabled,select:n(({data:s})=>{let c=s?.data?.schema||{};return b(c,o,r)},"select")})},"useContractorOnboardingDetailsSchema"),Ee={[O]:"Contractor Management",[Z]:"Contractor Management Plus",[I]:"Contractor of Record"},qe=n(e=>{let{data:t,isLoading:o}=ie({enabled:e?.enabled}),r=t?.find(s=>s.product.name==="EOR Monthly");return{eorSubscription:r?{product:{identifier:_,short_name:"EOR"},currency:r.price.currency,price:{amount:q(r.price.amount)},features:["Contract between Remote and employee","Remote manages onboarding, payroll, and compliance","Manages taxes, benefits, and time-off tracking","Handles contracts, transfers, and terminations"],description:"Enables hiring in countries without a local entity",label:"Employer of Record",value:_}:null,isLoading:o}},"useEorSubscription"),Oe=n((e,t,o)=>(t&&P(_,o)&&e.push({label:t.label,value:t.value,description:t.description,meta:{features:t.features,price:{amount:t.price.amount,currencyCode:t.currency?.code??""}},disabled:!1}),e),"addEorToFieldOptions"),Et=n((e,t,o)=>{let{data:r,isLoading:i,refetch:s}=_e({employmentId:e,options:{queryOptions:o?.queryOptions}}),c=se(()=>r?.filter(u=>P(u.product.identifier??"",o?.excludeProducts))??[],[r,o?.excludeProducts]),F=r?r?.length<3:!1,d=r?.find(u=>u.product.identifier===I)?.eligibility_questionnaire?.is_blocking,f=(F||d)&&t?.eor_onboarding&&!o?.excludeProducts?.includes("eor"),{eorSubscription:R,isLoading:ae}=qe({enabled:f}),ce=c.length>0||f&&R!==null,M=b(X.data.schema,{},{...o,jsfModify:{...o?.jsfModify,required:ce?o?.jsfModify?.required:u=>u.filter(C=>C!=="subscription")}}),T=M.fields.find(u=>u.name==="subscription");if(T){let u=c.map(S=>{let l=S.product,le=S.price.amount,ue=S.currency.code,de=Ee[l.identifier]??"",me=l.identifier??"",pe=l.description??"";l.description||console.error(`[Data Integrity] Missing description for product: ${l.identifier}`,{product:l});let ye={features:l.features??ee[l.identifier]??[],price:{amount:q(le),currencyCode:ue}};return{label:de,value:me,description:pe,meta:ye,disabled:d&&l.identifier!==O}});u.sort((S,l)=>S.label.localeCompare(l.label));let C=[];f&&(Oe(C,R,o?.excludeProducts),C.length>0&&(C[0].meta={...C[0].meta,groupSeparator:{show:!0}})),T.options=[...u,...C]}return{isLoading:i||ae,form:M,contractorSubscriptions:r,filteredContractorSubscriptions:c,refetch:s,isEligibilityQuestionnaireBlocked:d}},"useContractorSubscriptionSchemaField"),qt=n((e,t,o)=>{let{mutateAsyncOrThrow:r}=E(t),{mutateAsyncOrThrow:i}=E(e);return{mutateAsync:n(async({employmentId:s})=>{let{nationality_status:c,ir35:p,ir35_sds_file:F}=o,y={contract_document:{ir_35:p}},d={contract_document:{nationality:c}};return p?(await i({employmentId:s,payload:y}),F?r({employment_id:s,file:F,sub_type:h}):Promise.resolve()):c?i({employmentId:s,payload:d}):Promise.resolve()},"mutateAsync")}},"useUpdateUKandSaudiFields"),Ot=n((e,t)=>{let{data:o,isLoading:r}=oe(e,{sub_type:h},{...t,select:n(({data:c})=>c?.files?.filter(p=>p.sub_type===h),"select")}),i=o?.[0]?.id,s=ne(i);return{...s,isLoading:r||s.isLoading}},"useGetIR35File"),It=n((e,t)=>{let{client:o}=a();return m({queryKey:["contract-documents",e],queryFn:n(async()=>L({client:o,path:{employment_id:e}}),"queryFn"),enabled:t?.enabled,select:n(({data:r})=>r?.data?.contract_documents,"select")})},"useGetContractDocuments"),Pt=n(({options:e,fieldValues:t})=>{let{client:o}=a();return m({queryKey:["eligibility-questionnaire"],queryFn:n(async()=>{let r=await k({client:o,query:{type:"contractor_of_record",json_schema_version:1}});if(r.error)throw new Error("Failed to fetch eligibility questionnaire");return r.data.data},"queryFn"),select:n(r=>{let i=r?.schema||{};return b(i,t,{jsfModify:e?.jsfModify})},"select"),enabled:e?.queryOptions?.enabled})},"useGetEligibilityQuestionnaire"),Rt=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t,payload:o})=>A({client:e,body:{employment_slug:t,responses:o,type:"contractor_of_record"},query:{json_schema_version:1}}),"mutationFn")})},"usePostCreateEligibilityQuestionnaire"),Mt=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t})=>W({client:e,path:{employment_id:t}}),"mutationFn")})},"usePostManageContractorCorSubscription"),Tt=n(()=>{let{client:e}=a();return g({mutationFn:n(async({employmentId:t})=>B({client:e,path:{employment_id:t}}),"mutationFn")})},"useDeleteContractorCorSubscription"),xt=n(e=>{let{client:t}=a(),{data:o,isLoading:r}=m({...Y(t,"contractor-onboarding-countries"),select:n(s=>s.data?.data?.map(c=>({label:c.name,value:c.code,eor_onboarding:c.eor_onboarding,contractor_products_available:c.contractor_products_available}))||[],"select"),enabled:e?.queryOptions?.enabled}),i=b(H.data.schema,{},e);if(o){let s=i.fields.find(c=>c.name==="country");s&&(s.options=o)}return{isLoading:r,selectCountryForm:i,countries:o}},"useCountriesSchemaField"),Dt=n(({countryCode:e,employmentId:t,fieldValues:o,options:r})=>{let i=he({countryCode:e,employmentId:t,fieldValues:o,options:r}),{data:s,isLoading:c}=Fe({employmentId:t,options:{queryOptions:{enabled:r?.queryOptions?.enabled}}}),p=se(()=>!i.data||!s?i.data:{...i.data,fields:i.data.fields.map(y=>y.name!=="payment_terms"?y:{...y,fields:y.fields?.map(d=>d.name!=="compensation_currency_code"?d:{...d,options:s.map(f=>({label:f.code,value:f.code,meta:{source:f.source}}))})})},[i.data,s]);return{...i,data:p,isLoading:i.isLoading||c}},"useContractorOnboardingDetailsSchemaWithCurrencies");export{De as a,re as b,ge as c,gt as d,Ft as e,Se as f,St as g,_e as h,_t as i,ht as j,Ee as k,Et as l,qt as m,Ot as n,It as o,Pt as p,Rt as q,Mt as r,Tt as s,xt as t,Dt as u};
2
+ //# sourceMappingURL=chunk-IZIKQFAC.js.map
@@ -1,2 +1,2 @@
1
- var t="urn:remotecom:resource:product:contractor:standard:monthly",e="urn:remotecom:resource:product:contractor:plus:monthly",o="urn:remotecom:resource:product:contractor:aor:monthly",n="urn:remotecom:resource:product:eor:monthly",c={cm:t,"cm+":e,cor:o,eor:n},i="ir_35",s="REMOTE_AI",d="You cannot control how a contractor completes the Services and Deliverables. This means, for example, that you can't specify their working hours or use of subcontractors. Please make sure this field includes only project names, descriptions, and deliverables. We do not allow hyperlinks.",l="The content You have entered may not be consistent with the Contractor of Record terms. You are responsible before proceeding for ensuring that the language entered herein accurately reflects those terms and your relationship with Subcontractors.",r=[{title:"You add a new contractor and their details in Remote.",id:"add-contractor-details"},{title:"Contractor accepts invite to join Remote.",id:"contractor-accepts-invite"},{title:"Ask your contractor to sign their agreement with your company.",id:"ask-contractor-to-sign-agreement"},{title:"Once the agreement is signed, the contractor can begin work.",id:"agreement-signed-begin-work"},{title:"The contractor will submit invoices on a date specified by you.",id:"contractor-submits-invoices"},{title:"You will pay the contractor according to the agreed-upon terms.",id:"pay-contractor"}],a=[{title:"You add a new contractor and their details in Remote, and reconfirm our Terms of Service.",description:"Review all details carefully, as we'll use this information to draft the contract.",id:"add-contractor-details-and-reconfirm-terms"},{title:"You pay the reserve amount required to add the contractor.",id:"pay-reserve-amount"},{title:"The contractor is invited to the platform.",id:"contractor-invited-to-platform"},{title:"The contractor completes onboarding on Remote.",id:"contractor-completes-onboarding"},{title:"The contractor signs the services agreement with Remote.",id:"contractor-signs-services-agreement"},{title:"Contractor begins working.",id:"contractor-begins-working"},{title:"Contractor submits an invoice to Remote.",id:"contractor-submits-invoice"},{title:"You review and approve the invoice.",id:"review-and-approve-invoice"},{title:"A COR contractor payment invoice is generated, which you pay.",id:"cor-contractor-payment-invoice-generated"},{title:"Remote receives payment and pays contractor.",id:"remote-receives-payment-and-pays-contractor"},{title:"Contractor receives payment.",id:"contractor-receives-payment"}],m={[t]:r,[e]:r,[o]:a},p={[t]:{title:"Contractor Management",subtitle:"Engage and pay contractors compliantly",listItems:["Ideal for businesses wanting a straightforward solution to manage and pay contractors directly.","Helps with everything from contractor onboarding, invoicing, payments, and compliance.","Full control remains with you."],contractPillText:"Contract between you and contractor"},[e]:{title:"Contractor Management Plus",subtitle:"Engage and pay contractors with indemnity coverage",listItems:["Great for businesses concerned about contractor classification risks.","Helps with everything from contractor onboarding, invoicing, payments, and compliance.","Offers a warranty on Remote's localized, compliant contracts.","Control remains with you"],contractPillText:"Contract between you and contractor"},[o]:{title:"Contractor of Record",subtitle:"Remote reduces liability by directly engaging the contractor",listItems:["Ideal for businesses who want admin relief and have low risk tolerance.","No need to be experts in local labor laws; Remote manages its compliance with contractors.","Indemnity protection, Remote backs its compliance in administering and paying contractors"],contractPillText:"Contract between Remote and contractor"},[n]:{title:"Employer of Record",subtitle:"Remote engages the employee on your behalf",listItems:["Remote manages onboarding, payroll, and compliance","Manages taxes, benefits, and time-off tracking","Handles contracts, transfers, and terminations"],contractPillText:"Contract between Remote and employee"}},u={[t]:["Contract between you and contractor","Localized contract templates","AI-powered features to reduce misclassification risks","Experts on hand to identify misclassification risks","Only pay for active contractors","Work with contractors in 200+ countries and jurisdictions"],[e]:["Contract between you and contractor","Access to all Contractor Management features","$100K indemnity coverage for penalties","4X monetary coverage than our competitors\xA0 in case of penalties"],[o]:["Contract between Remote and the contractor","Our most comprehensive option for compliance and flexibility","Locally compliant agreements","Localized contract templates","Indemnity coverage for losses related to Remote\u2019s administration and contractor payments"]};export{t as a,e as b,o as c,n as d,c as e,i as f,s as g,d as h,l as i,a as j,m as k,p as l,u as m};
2
- //# sourceMappingURL=chunk-Q2OGLLBA.js.map
1
+ var t="urn:remotecom:resource:product:contractor:standard:monthly",e="urn:remotecom:resource:product:contractor:plus:monthly",o="urn:remotecom:resource:product:contractor:aor:monthly",n="urn:remotecom:resource:product:eor:monthly",c={cm:t,"cm+":e,cor:o,eor:n},i="ir_35",s="REMOTE_AI",d="You cannot control how a contractor completes the Services and Deliverables. This means, for example, that you can't specify their working hours or use of subcontractors. Please make sure this field includes only project names, descriptions, and deliverables. We do not allow hyperlinks.",l="The content You have entered may not be consistent with the Contractor of Record terms. You are responsible before proceeding for ensuring that the language entered herein accurately reflects those terms and your relationship with Subcontractors.",r=[{title:"You add a new contractor and their details in Remote.",id:"add-contractor-details"},{title:"Contractor accepts invite to join Remote.",id:"contractor-accepts-invite"},{title:"Ask your contractor to sign their agreement with your company.",id:"ask-contractor-to-sign-agreement"},{title:"Once the agreement is signed, the contractor can begin work.",id:"agreement-signed-begin-work"},{title:"The contractor will submit invoices on a date specified by you.",id:"contractor-submits-invoices"},{title:"You will pay the contractor according to the agreed-upon terms.",id:"pay-contractor"}],a=[{title:"You add a new contractor and their details in Remote, and reconfirm our Terms of Service.",description:"Review all details carefully, as we'll use this information to draft the contract.",id:"add-contractor-details-and-reconfirm-terms"},{title:"You pay the reserve amount required to add the contractor.",id:"pay-reserve-amount"},{title:"The contractor is invited to the platform.",id:"contractor-invited-to-platform"},{title:"The contractor completes onboarding on Remote.",id:"contractor-completes-onboarding"},{title:"The contractor signs the services agreement with Remote.",id:"contractor-signs-services-agreement"},{title:"Contractor begins working.",id:"contractor-begins-working"},{title:"Contractor submits an invoice to Remote.",id:"contractor-submits-invoice"},{title:"You review and approve the invoice.",id:"review-and-approve-invoice"},{title:"A COR contractor payment invoice is generated, which you pay.",id:"cor-contractor-payment-invoice-generated"},{title:"Remote receives payment and pays contractor.",id:"remote-receives-payment-and-pays-contractor"},{title:"Contractor receives payment.",id:"contractor-receives-payment"}],m={[t]:r,[e]:r,[o]:a},p={[t]:{title:"Contractor Management",subtitle:"Engage and pay contractors compliantly",listItems:["Ideal for businesses wanting a straightforward solution to manage and pay contractors directly.","Helps with everything from contractor onboarding, invoicing, payments, and compliance.","Full control remains with you."],contractPillText:"Contract between you and contractor"},[e]:{title:"Contractor Management Plus",subtitle:"Engage and pay contractors with indemnity coverage",listItems:["Great for businesses concerned about contractor classification risks.","Helps with everything from contractor onboarding, invoicing, payments, and compliance.","Offers a warranty on Remote's localized, compliant contracts.","Control remains with you."],contractPillText:"Contract between you and contractor"},[o]:{title:"Contractor of Record",subtitle:"Remote reduces liability by directly engaging the contractor",listItems:["Ideal for businesses who want admin relief and have low risk tolerance.","No need to be experts in local labor laws; Remote manages its compliance with contractors.","Indemnity protection, Remote backs its compliance in administering and paying contractors."],contractPillText:"Contract between Remote and contractor"},[n]:{title:"Employer of Record",subtitle:"Remote engages the employee on your behalf",listItems:["Remote manages onboarding, payroll, and compliance.","Manages taxes, benefits, and time-off tracking.","Handles contracts, transfers, and terminations."],contractPillText:"Contract between Remote and employee"}},u={[t]:["Contract between you and contractor","Localized contract templates","AI-powered features to reduce misclassification risks","Experts on hand to identify misclassification risks","Only pay for active contractors","Work with contractors in 200+ countries and jurisdictions"],[e]:["Contract between you and contractor","Access to all Contractor Management features","$100K indemnity coverage for penalties","4X monetary coverage than our competitors\xA0 in case of penalties"],[o]:["Contract between Remote and the contractor","Our most comprehensive option for compliance and flexibility","Locally compliant agreements","Localized contract templates","Indemnity coverage for losses related to Remote\u2019s administration and contractor payments"]};export{t as a,e as b,o as c,n as d,c as e,i as f,s as g,d as h,l as i,a as j,m as k,p as l,u as m};
2
+ //# sourceMappingURL=chunk-PB6UQ4A4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/ContractorOnboarding/constants.ts"],"sourcesContent":["export const contractorStandardProductIdentifier =\n 'urn:remotecom:resource:product:contractor:standard:monthly';\nexport const contractorPlusProductIdentifier =\n 'urn:remotecom:resource:product:contractor:plus:monthly';\nexport const corProductIdentifier =\n 'urn:remotecom:resource:product:contractor:aor:monthly';\nexport const eorProductIdentifier =\n 'urn:remotecom:resource:product:eor:monthly';\n\nexport type ProductType = 'cm' | 'cm+' | 'cor' | 'eor';\n\nexport const PRODUCT_IDENTIFIER_MAP: Record<ProductType, string> = {\n cm: contractorStandardProductIdentifier,\n 'cm+': contractorPlusProductIdentifier,\n cor: corProductIdentifier,\n eor: eorProductIdentifier,\n};\n\nexport const IR35_FILE_SUBTYPE = 'ir_35';\n\nexport const REMOTE_AI_ERROR_SOURCE = 'REMOTE_AI';\n\nexport const REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE =\n \"You cannot control how a contractor completes the Services and Deliverables. This means, for example, that you can't specify their working hours or use of subcontractors. Please make sure this field includes only project names, descriptions, and deliverables. We do not allow hyperlinks.\";\n\nexport const REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE =\n 'The content You have entered may not be consistent with the Contractor of Record terms. You are responsible before proceeding for ensuring that the language entered herein accurately reflects those terms and your relationship with Subcontractors.';\n\nconst standardOnboardingWorkflow = [\n {\n title: 'You add a new contractor and their details in Remote.',\n id: 'add-contractor-details',\n },\n {\n title: 'Contractor accepts invite to join Remote.',\n id: 'contractor-accepts-invite',\n },\n {\n title: 'Ask your contractor to sign their agreement with your company.',\n id: 'ask-contractor-to-sign-agreement',\n },\n {\n title: 'Once the agreement is signed, the contractor can begin work.',\n id: 'agreement-signed-begin-work',\n },\n {\n title: 'The contractor will submit invoices on a date specified by you.',\n id: 'contractor-submits-invoices',\n },\n {\n title: 'You will pay the contractor according to the agreed-upon terms.',\n id: 'pay-contractor',\n },\n];\n\nexport const corOnboardingWorkflow = [\n {\n title:\n 'You add a new contractor and their details in Remote, and reconfirm our Terms of Service.',\n description:\n \"Review all details carefully, as we'll use this information to draft the contract.\",\n id: 'add-contractor-details-and-reconfirm-terms',\n },\n {\n title: 'You pay the reserve amount required to add the contractor.',\n id: 'pay-reserve-amount',\n },\n {\n title: 'The contractor is invited to the platform.',\n id: 'contractor-invited-to-platform',\n },\n {\n title: 'The contractor completes onboarding on Remote.',\n id: 'contractor-completes-onboarding',\n },\n {\n title: 'The contractor signs the services agreement with Remote.',\n id: 'contractor-signs-services-agreement',\n },\n {\n title: 'Contractor begins working.',\n id: 'contractor-begins-working',\n },\n {\n title: 'Contractor submits an invoice to Remote.',\n id: 'contractor-submits-invoice',\n },\n {\n title: 'You review and approve the invoice.',\n id: 'review-and-approve-invoice',\n },\n {\n title: 'A COR contractor payment invoice is generated, which you pay.',\n id: 'cor-contractor-payment-invoice-generated',\n },\n {\n title: 'Remote receives payment and pays contractor.',\n id: 'remote-receives-payment-and-pays-contractor',\n },\n {\n title: 'Contractor receives payment.',\n id: 'contractor-receives-payment',\n },\n];\n\n/**\n * Onboarding workflows for each pricing plan\n */\nexport const onboardingWorkflows: Record<\n string,\n { title: string; id: string; description?: string }[]\n> = {\n [contractorStandardProductIdentifier]: standardOnboardingWorkflow,\n // we assign the same workflow as its the same for standard and plus\n [contractorPlusProductIdentifier]: standardOnboardingWorkflow,\n [corProductIdentifier]: corOnboardingWorkflow,\n};\n\nexport const pricingPlanDetails = {\n [contractorStandardProductIdentifier]: {\n title: 'Contractor Management',\n subtitle: 'Engage and pay contractors compliantly',\n listItems: [\n 'Ideal for businesses wanting a straightforward solution to manage and pay contractors directly.',\n 'Helps with everything from contractor onboarding, invoicing, payments, and compliance.',\n 'Full control remains with you.',\n ],\n contractPillText: 'Contract between you and contractor',\n },\n [contractorPlusProductIdentifier]: {\n title: 'Contractor Management Plus',\n subtitle: 'Engage and pay contractors with indemnity coverage',\n listItems: [\n 'Great for businesses concerned about contractor classification risks.',\n 'Helps with everything from contractor onboarding, invoicing, payments, and compliance.',\n \"Offers a warranty on Remote's localized, compliant contracts.\",\n 'Control remains with you',\n ],\n contractPillText: 'Contract between you and contractor',\n },\n [corProductIdentifier]: {\n title: 'Contractor of Record',\n subtitle: 'Remote reduces liability by directly engaging the contractor',\n listItems: [\n 'Ideal for businesses who want admin relief and have low risk tolerance.',\n 'No need to be experts in local labor laws; Remote manages its compliance with contractors.',\n 'Indemnity protection, Remote backs its compliance in administering and paying contractors',\n ],\n contractPillText: 'Contract between Remote and contractor',\n },\n [eorProductIdentifier]: {\n title: 'Employer of Record',\n subtitle: 'Remote engages the employee on your behalf',\n listItems: [\n 'Remote manages onboarding, payroll, and compliance',\n 'Manages taxes, benefits, and time-off tracking',\n 'Handles contracts, transfers, and terminations',\n ],\n contractPillText: 'Contract between Remote and employee',\n },\n};\n\nexport const FEATURES_BY_IDENTIFIER: Record<string, string[]> = {\n [contractorStandardProductIdentifier]: [\n 'Contract between you and contractor',\n 'Localized contract templates',\n 'AI-powered features to reduce misclassification risks',\n 'Experts on hand to identify misclassification risks',\n 'Only pay for active contractors',\n 'Work with contractors in 200+ countries and jurisdictions',\n ],\n [contractorPlusProductIdentifier]: [\n 'Contract between you and contractor',\n 'Access to all Contractor Management features',\n '$100K indemnity coverage for penalties',\n '4X monetary coverage than our competitors  in case of penalties',\n ],\n [corProductIdentifier]: [\n 'Contract between Remote and the contractor',\n 'Our most comprehensive option for compliance and flexibility',\n 'Locally compliant agreements',\n 'Localized contract templates',\n 'Indemnity coverage for losses related to Remote’s administration and contractor payments',\n ],\n};\n"],"mappings":"AAAO,IAAMA,EACX,6DACWC,EACX,yDACWC,EACX,wDACWC,EACX,6CAIWC,EAAsD,CACjE,GAAIJ,EACJ,MAAOC,EACP,IAAKC,EACL,IAAKC,CACP,EAEaE,EAAoB,QAEpBC,EAAyB,YAEzBC,EACX,kSAEWC,EACX,yPAEIC,EAA6B,CACjC,CACE,MAAO,wDACP,GAAI,wBACN,EACA,CACE,MAAO,4CACP,GAAI,2BACN,EACA,CACE,MAAO,iEACP,GAAI,kCACN,EACA,CACE,MAAO,+DACP,GAAI,6BACN,EACA,CACE,MAAO,kEACP,GAAI,6BACN,EACA,CACE,MAAO,kEACP,GAAI,gBACN,CACF,EAEaC,EAAwB,CACnC,CACE,MACE,4FACF,YACE,qFACF,GAAI,4CACN,EACA,CACE,MAAO,6DACP,GAAI,oBACN,EACA,CACE,MAAO,6CACP,GAAI,gCACN,EACA,CACE,MAAO,iDACP,GAAI,iCACN,EACA,CACE,MAAO,2DACP,GAAI,qCACN,EACA,CACE,MAAO,6BACP,GAAI,2BACN,EACA,CACE,MAAO,2CACP,GAAI,4BACN,EACA,CACE,MAAO,sCACP,GAAI,4BACN,EACA,CACE,MAAO,gEACP,GAAI,0CACN,EACA,CACE,MAAO,+CACP,GAAI,6CACN,EACA,CACE,MAAO,+BACP,GAAI,6BACN,CACF,EAKaC,EAGT,CACF,CAACX,CAAmC,EAAGS,EAEvC,CAACR,CAA+B,EAAGQ,EACnC,CAACP,CAAoB,EAAGQ,CAC1B,EAEaE,EAAqB,CAChC,CAACZ,CAAmC,EAAG,CACrC,MAAO,wBACP,SAAU,yCACV,UAAW,CACT,kGACA,yFACA,gCACF,EACA,iBAAkB,qCACpB,EACA,CAACC,CAA+B,EAAG,CACjC,MAAO,6BACP,SAAU,qDACV,UAAW,CACT,wEACA,yFACA,gEACA,0BACF,EACA,iBAAkB,qCACpB,EACA,CAACC,CAAoB,EAAG,CACtB,MAAO,uBACP,SAAU,+DACV,UAAW,CACT,0EACA,6FACA,2FACF,EACA,iBAAkB,wCACpB,EACA,CAACC,CAAoB,EAAG,CACtB,MAAO,qBACP,SAAU,6CACV,UAAW,CACT,qDACA,iDACA,gDACF,EACA,iBAAkB,sCACpB,CACF,EAEaU,EAAmD,CAC9D,CAACb,CAAmC,EAAG,CACrC,sCACA,+BACA,wDACA,sDACA,kCACA,2DACF,EACA,CAACC,CAA+B,EAAG,CACjC,sCACA,+CACA,yCACA,oEACF,EACA,CAACC,CAAoB,EAAG,CACtB,6CACA,+DACA,+BACA,+BACA,+FACF,CACF","names":["contractorStandardProductIdentifier","contractorPlusProductIdentifier","corProductIdentifier","eorProductIdentifier","PRODUCT_IDENTIFIER_MAP","IR35_FILE_SUBTYPE","REMOTE_AI_ERROR_SOURCE","REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE","REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE","standardOnboardingWorkflow","corOnboardingWorkflow","onboardingWorkflows","pricingPlanDetails","FEATURES_BY_IDENTIFIER"]}
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/constants.ts"],"sourcesContent":["export const contractorStandardProductIdentifier =\n 'urn:remotecom:resource:product:contractor:standard:monthly';\nexport const contractorPlusProductIdentifier =\n 'urn:remotecom:resource:product:contractor:plus:monthly';\nexport const corProductIdentifier =\n 'urn:remotecom:resource:product:contractor:aor:monthly';\nexport const eorProductIdentifier =\n 'urn:remotecom:resource:product:eor:monthly';\n\nexport type ProductType = 'cm' | 'cm+' | 'cor' | 'eor';\n\nexport const PRODUCT_IDENTIFIER_MAP: Record<ProductType, string> = {\n cm: contractorStandardProductIdentifier,\n 'cm+': contractorPlusProductIdentifier,\n cor: corProductIdentifier,\n eor: eorProductIdentifier,\n};\n\nexport const IR35_FILE_SUBTYPE = 'ir_35';\n\nexport const REMOTE_AI_ERROR_SOURCE = 'REMOTE_AI';\n\nexport const REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE =\n \"You cannot control how a contractor completes the Services and Deliverables. This means, for example, that you can't specify their working hours or use of subcontractors. Please make sure this field includes only project names, descriptions, and deliverables. We do not allow hyperlinks.\";\n\nexport const REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE =\n 'The content You have entered may not be consistent with the Contractor of Record terms. You are responsible before proceeding for ensuring that the language entered herein accurately reflects those terms and your relationship with Subcontractors.';\n\nconst standardOnboardingWorkflow = [\n {\n title: 'You add a new contractor and their details in Remote.',\n id: 'add-contractor-details',\n },\n {\n title: 'Contractor accepts invite to join Remote.',\n id: 'contractor-accepts-invite',\n },\n {\n title: 'Ask your contractor to sign their agreement with your company.',\n id: 'ask-contractor-to-sign-agreement',\n },\n {\n title: 'Once the agreement is signed, the contractor can begin work.',\n id: 'agreement-signed-begin-work',\n },\n {\n title: 'The contractor will submit invoices on a date specified by you.',\n id: 'contractor-submits-invoices',\n },\n {\n title: 'You will pay the contractor according to the agreed-upon terms.',\n id: 'pay-contractor',\n },\n];\n\nexport const corOnboardingWorkflow = [\n {\n title:\n 'You add a new contractor and their details in Remote, and reconfirm our Terms of Service.',\n description:\n \"Review all details carefully, as we'll use this information to draft the contract.\",\n id: 'add-contractor-details-and-reconfirm-terms',\n },\n {\n title: 'You pay the reserve amount required to add the contractor.',\n id: 'pay-reserve-amount',\n },\n {\n title: 'The contractor is invited to the platform.',\n id: 'contractor-invited-to-platform',\n },\n {\n title: 'The contractor completes onboarding on Remote.',\n id: 'contractor-completes-onboarding',\n },\n {\n title: 'The contractor signs the services agreement with Remote.',\n id: 'contractor-signs-services-agreement',\n },\n {\n title: 'Contractor begins working.',\n id: 'contractor-begins-working',\n },\n {\n title: 'Contractor submits an invoice to Remote.',\n id: 'contractor-submits-invoice',\n },\n {\n title: 'You review and approve the invoice.',\n id: 'review-and-approve-invoice',\n },\n {\n title: 'A COR contractor payment invoice is generated, which you pay.',\n id: 'cor-contractor-payment-invoice-generated',\n },\n {\n title: 'Remote receives payment and pays contractor.',\n id: 'remote-receives-payment-and-pays-contractor',\n },\n {\n title: 'Contractor receives payment.',\n id: 'contractor-receives-payment',\n },\n];\n\n/**\n * Onboarding workflows for each pricing plan\n */\nexport const onboardingWorkflows: Record<\n string,\n { title: string; id: string; description?: string }[]\n> = {\n [contractorStandardProductIdentifier]: standardOnboardingWorkflow,\n // we assign the same workflow as its the same for standard and plus\n [contractorPlusProductIdentifier]: standardOnboardingWorkflow,\n [corProductIdentifier]: corOnboardingWorkflow,\n};\n\nexport const pricingPlanDetails = {\n [contractorStandardProductIdentifier]: {\n title: 'Contractor Management',\n subtitle: 'Engage and pay contractors compliantly',\n listItems: [\n 'Ideal for businesses wanting a straightforward solution to manage and pay contractors directly.',\n 'Helps with everything from contractor onboarding, invoicing, payments, and compliance.',\n 'Full control remains with you.',\n ],\n contractPillText: 'Contract between you and contractor',\n },\n [contractorPlusProductIdentifier]: {\n title: 'Contractor Management Plus',\n subtitle: 'Engage and pay contractors with indemnity coverage',\n listItems: [\n 'Great for businesses concerned about contractor classification risks.',\n 'Helps with everything from contractor onboarding, invoicing, payments, and compliance.',\n \"Offers a warranty on Remote's localized, compliant contracts.\",\n 'Control remains with you.',\n ],\n contractPillText: 'Contract between you and contractor',\n },\n [corProductIdentifier]: {\n title: 'Contractor of Record',\n subtitle: 'Remote reduces liability by directly engaging the contractor',\n listItems: [\n 'Ideal for businesses who want admin relief and have low risk tolerance.',\n 'No need to be experts in local labor laws; Remote manages its compliance with contractors.',\n 'Indemnity protection, Remote backs its compliance in administering and paying contractors.',\n ],\n contractPillText: 'Contract between Remote and contractor',\n },\n [eorProductIdentifier]: {\n title: 'Employer of Record',\n subtitle: 'Remote engages the employee on your behalf',\n listItems: [\n 'Remote manages onboarding, payroll, and compliance.',\n 'Manages taxes, benefits, and time-off tracking.',\n 'Handles contracts, transfers, and terminations.',\n ],\n contractPillText: 'Contract between Remote and employee',\n },\n};\n\nexport const FEATURES_BY_IDENTIFIER: Record<string, string[]> = {\n [contractorStandardProductIdentifier]: [\n 'Contract between you and contractor',\n 'Localized contract templates',\n 'AI-powered features to reduce misclassification risks',\n 'Experts on hand to identify misclassification risks',\n 'Only pay for active contractors',\n 'Work with contractors in 200+ countries and jurisdictions',\n ],\n [contractorPlusProductIdentifier]: [\n 'Contract between you and contractor',\n 'Access to all Contractor Management features',\n '$100K indemnity coverage for penalties',\n '4X monetary coverage than our competitors  in case of penalties',\n ],\n [corProductIdentifier]: [\n 'Contract between Remote and the contractor',\n 'Our most comprehensive option for compliance and flexibility',\n 'Locally compliant agreements',\n 'Localized contract templates',\n 'Indemnity coverage for losses related to Remote’s administration and contractor payments',\n ],\n};\n"],"mappings":"AAAO,IAAMA,EACX,6DACWC,EACX,yDACWC,EACX,wDACWC,EACX,6CAIWC,EAAsD,CACjE,GAAIJ,EACJ,MAAOC,EACP,IAAKC,EACL,IAAKC,CACP,EAEaE,EAAoB,QAEpBC,EAAyB,YAEzBC,EACX,kSAEWC,EACX,yPAEIC,EAA6B,CACjC,CACE,MAAO,wDACP,GAAI,wBACN,EACA,CACE,MAAO,4CACP,GAAI,2BACN,EACA,CACE,MAAO,iEACP,GAAI,kCACN,EACA,CACE,MAAO,+DACP,GAAI,6BACN,EACA,CACE,MAAO,kEACP,GAAI,6BACN,EACA,CACE,MAAO,kEACP,GAAI,gBACN,CACF,EAEaC,EAAwB,CACnC,CACE,MACE,4FACF,YACE,qFACF,GAAI,4CACN,EACA,CACE,MAAO,6DACP,GAAI,oBACN,EACA,CACE,MAAO,6CACP,GAAI,gCACN,EACA,CACE,MAAO,iDACP,GAAI,iCACN,EACA,CACE,MAAO,2DACP,GAAI,qCACN,EACA,CACE,MAAO,6BACP,GAAI,2BACN,EACA,CACE,MAAO,2CACP,GAAI,4BACN,EACA,CACE,MAAO,sCACP,GAAI,4BACN,EACA,CACE,MAAO,gEACP,GAAI,0CACN,EACA,CACE,MAAO,+CACP,GAAI,6CACN,EACA,CACE,MAAO,+BACP,GAAI,6BACN,CACF,EAKaC,EAGT,CACF,CAACX,CAAmC,EAAGS,EAEvC,CAACR,CAA+B,EAAGQ,EACnC,CAACP,CAAoB,EAAGQ,CAC1B,EAEaE,EAAqB,CAChC,CAACZ,CAAmC,EAAG,CACrC,MAAO,wBACP,SAAU,yCACV,UAAW,CACT,kGACA,yFACA,gCACF,EACA,iBAAkB,qCACpB,EACA,CAACC,CAA+B,EAAG,CACjC,MAAO,6BACP,SAAU,qDACV,UAAW,CACT,wEACA,yFACA,gEACA,2BACF,EACA,iBAAkB,qCACpB,EACA,CAACC,CAAoB,EAAG,CACtB,MAAO,uBACP,SAAU,+DACV,UAAW,CACT,0EACA,6FACA,4FACF,EACA,iBAAkB,wCACpB,EACA,CAACC,CAAoB,EAAG,CACtB,MAAO,qBACP,SAAU,6CACV,UAAW,CACT,sDACA,kDACA,iDACF,EACA,iBAAkB,sCACpB,CACF,EAEaU,EAAmD,CAC9D,CAACb,CAAmC,EAAG,CACrC,sCACA,+BACA,wDACA,sDACA,kCACA,2DACF,EACA,CAACC,CAA+B,EAAG,CACjC,sCACA,+CACA,yCACA,oEACF,EACA,CAACC,CAAoB,EAAG,CACtB,6CACA,+DACA,+BACA,+BACA,+FACF,CACF","names":["contractorStandardProductIdentifier","contractorPlusProductIdentifier","corProductIdentifier","eorProductIdentifier","PRODUCT_IDENTIFIER_MAP","IR35_FILE_SUBTYPE","REMOTE_AI_ERROR_SOURCE","REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE","REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE","standardOnboardingWorkflow","corOnboardingWorkflow","onboardingWorkflows","pricingPlanDetails","FEATURES_BY_IDENTIFIER"]}
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-3UDRMQNE.js";import{a as E}from"./chunk-Y3YYLANJ.js";import{b as p}from"./chunk-6PWZ4TBI.js";import{a as g}from"./chunk-VDRNNOVA.js";import{a as y}from"./chunk-NW3D7CPK.js";import{d as w}from"./chunk-G556HMVA.js";import{a as b,h as S,i as C}from"./chunk-Q2OGLLBA.js";import{a as f,c as v}from"./chunk-2Q462FT7.js";import{a as t}from"./chunk-P37U34EQ.js";import{addYears as I,format as u}from"date-fns";import{Fragment as D,jsx as _,jsxs as F}from"react/jsx-runtime";var x=t(n=>n===b,"isStandardPricingPlan"),M=t((n,i)=>{let e=i&&i<u(new Date,"yyyy-MM-dd");if(!n&&e)return p({severity:"warning",description:"Backdating the service start date is not supported in the selected Contractor Management plan."})},"showBackDateWarning");function R(n,i,e){e({...i,services_and_deliverables_ai_warning:"",services_and_deliverables_error_skippable:!1})}t(R,"onServicesAndDeliverablesChange");var $=t((n,i,e,r,a)=>{let d=x(e),c=r?.service_duration?.provisional_start_date,l=M(d,c),o=p({severity:"warning",title:"Possible misclassification risk",description:a?C:S});return{...n,create:{...n?.create,services_and_deliverables_ai_warning:{type:"string","x-jsf-presentation":{inputType:"hidden"}},services_and_deliverables_error_skippable:{type:"boolean","x-jsf-presentation":{inputType:"hidden"}}},fields:{...n?.fields,"service_duration.provisional_start_date":{description:i,"x-jsf-presentation":{minDate:d?void 0:u(new Date,"yyyy-MM-dd"),...l}},"service_duration.expiration_date":{"x-jsf-presentation":{calculateDynamicProperties:t(s=>{let m=a&&s.service_duration?.provisional_start_date?I(y(s.service_duration.provisional_start_date),1):void 0;return{maxDate:m?u(m,"yyyy-MM-dd"):void 0}},"calculateDynamicProperties")}},services_and_deliverables:{onChange:R,"x-jsf-presentation":{calculateDynamicProperties:t(s=>({statement:s.services_and_deliverables_ai_warning?o.statement:void 0}),"calculateDynamicProperties")}}}}},"buildContractDetailsJsfModify"),z=t((n,i,e)=>{let r=n==="SAU",a=n==="GBR",d=w(n);if(!r&&!a&&!d)return e?.jsfModify?.basic_information;if(a)return{...e?.jsfModify?.basic_information,create:{...e?.jsfModify?.basic_information?.create,ir35:{title:"IR35 Status",description:t(()=>F(D,{children:["What's your contractor's employment status?"," ",_(v,{zendeskId:f.ir35Status,children:"Learn more about IR35"})]}),"description"),oneOf:[{const:"inside",title:"Inside IR35 (deemed employee)"},{const:"outside",title:"Outside IR35"},{const:"exempt",title:"Exempt from IR35"}],"x-jsf-presentation":{inputType:"select"}},ir35_sds_file:{title:"Upload SDS",description:"Status determination statement",type:"string","x-jsf-presentation":{inputType:"file",accept:g.document,multiple:!1,maxSize:20971520,calculateDynamicProperties:t(o=>{let s=o.ir35;return{isVisible:s==="inside"||s==="outside"}},"calculateDynamicProperties")}}},allOf:[{if:{properties:{ir35:{enum:["inside","outside"]}}},then:{required:["ir35_sds_file"]},else:{properties:{ir35_sds_file:!1}}}],required:["ir35"],orderRoot:t(o=>[...o,"ir35","ir35_sds_file"],"orderRoot")};let c=r?"Is your contractor a Saudi Arabia national, or a non-Saudi national contracting via a local business entity or under a Special Privilege Iqama visa?":`Is the contractor a ${i??"selected country"} national, or a non-${i??"selected country"} national contracting through their local business entity?`,l=r?"Please be aware that contracting with non-Saudi Arabia nationals that are not operating as a company or under a Special Privilege Iqama visa can lead to fines for operating without proper work authorization. If you are concerned, please speak with the Contractor and/or local Saudi Arabia counsel to ensure compliance.":`Be aware that the Contractor must be a ${i??"selected country"} national, or a non-${i??"selected country"} national operating through their company to comply with the legal requirements for performing services and deliverables as a contractor in ${i??"selected country"}. If you are concerned, speak with the Contractor and/or local counsel to ensure compliance.`;return{...e?.jsfModify?.basic_information,create:{...e?.jsfModify?.basic_information?.create,nationality_status:{title:c,description:"",type:"string",oneOf:[{const:"national",description:"",title:"Yes"},{const:"non_national",description:l,title:"No"}],"x-jsf-presentation":{inputType:"radio"}}},required:["nationality_status"],orderRoot:t(o=>[...o,"nationality_status"],"orderRoot")}},"buildBasicInformationJsfModify"),G=t((n,i)=>{let e=n?.jsfModify?.contract_preview?.fields;return{fields:{contract_preview_header:{...e?.contract_preview_header,"x-jsf-presentation":{Component:t(r=>{let a=e?.contract_preview_header?.["x-jsf-presentation"]?.Component||h;return _(a,{...r})},"Component")}},contract_preview_statement:{...e?.contract_preview_statement,"x-jsf-presentation":{Component:t(r=>{let a=e?.contract_preview_statement?.["x-jsf-presentation"]?.Component||E;return _(a,{reviewCompleted:!!i?.review_completed,...r})},"Component")}},signature:{...e?.signature,"x-jsf-presentation":{calculateDynamicProperties:t(r=>({isVisible:!!r.review_completed}),"calculateDynamicProperties"),...e?.signature?.["x-jsf-presentation"]}}}}},"buildContractPreviewJsfModify");export{$ as a,z as b,G as c};
2
- //# sourceMappingURL=chunk-HK4LGSS7.js.map
1
+ import{a as h}from"./chunk-3UDRMQNE.js";import{a as E}from"./chunk-Y3YYLANJ.js";import{b as p}from"./chunk-6PWZ4TBI.js";import{a as g}from"./chunk-VDRNNOVA.js";import{a as y}from"./chunk-NW3D7CPK.js";import{d as w}from"./chunk-COAJUZSE.js";import{a as b,h as S,i as C}from"./chunk-PB6UQ4A4.js";import{a as f,c as v}from"./chunk-2Q462FT7.js";import{a as t}from"./chunk-P37U34EQ.js";import{addYears as I,format as u}from"date-fns";import{Fragment as D,jsx as _,jsxs as F}from"react/jsx-runtime";var x=t(n=>n===b,"isStandardPricingPlan"),M=t((n,i)=>{let e=i&&i<u(new Date,"yyyy-MM-dd");if(!n&&e)return p({severity:"warning",description:"Backdating the service start date is not supported in the selected Contractor Management plan."})},"showBackDateWarning");function R(n,i,e){e({...i,services_and_deliverables_ai_warning:"",services_and_deliverables_error_skippable:!1})}t(R,"onServicesAndDeliverablesChange");var $=t((n,i,e,r,a)=>{let d=x(e),c=r?.service_duration?.provisional_start_date,l=M(d,c),o=p({severity:"warning",title:"Possible misclassification risk",description:a?C:S});return{...n,create:{...n?.create,services_and_deliverables_ai_warning:{type:"string","x-jsf-presentation":{inputType:"hidden"}},services_and_deliverables_error_skippable:{type:"boolean","x-jsf-presentation":{inputType:"hidden"}}},fields:{...n?.fields,"service_duration.provisional_start_date":{description:i,"x-jsf-presentation":{minDate:d?void 0:u(new Date,"yyyy-MM-dd"),...l}},"service_duration.expiration_date":{"x-jsf-presentation":{calculateDynamicProperties:t(s=>{let m=a&&s.service_duration?.provisional_start_date?I(y(s.service_duration.provisional_start_date),1):void 0;return{maxDate:m?u(m,"yyyy-MM-dd"):void 0}},"calculateDynamicProperties")}},services_and_deliverables:{onChange:R,"x-jsf-presentation":{calculateDynamicProperties:t(s=>({statement:s.services_and_deliverables_ai_warning?o.statement:void 0}),"calculateDynamicProperties")}}}}},"buildContractDetailsJsfModify"),z=t((n,i,e)=>{let r=n==="SAU",a=n==="GBR",d=w(n);if(!r&&!a&&!d)return e?.jsfModify?.basic_information;if(a)return{...e?.jsfModify?.basic_information,create:{...e?.jsfModify?.basic_information?.create,ir35:{title:"IR35 Status",description:t(()=>F(D,{children:["What's your contractor's employment status?"," ",_(v,{zendeskId:f.ir35Status,children:"Learn more about IR35"})]}),"description"),oneOf:[{const:"inside",title:"Inside IR35 (deemed employee)"},{const:"outside",title:"Outside IR35"},{const:"exempt",title:"Exempt from IR35"}],"x-jsf-presentation":{inputType:"select"}},ir35_sds_file:{title:"Upload SDS",description:"Status determination statement",type:"string","x-jsf-presentation":{inputType:"file",accept:g.document,multiple:!1,maxSize:20971520,calculateDynamicProperties:t(o=>{let s=o.ir35;return{isVisible:s==="inside"||s==="outside"}},"calculateDynamicProperties")}}},allOf:[{if:{properties:{ir35:{enum:["inside","outside"]}}},then:{required:["ir35_sds_file"]},else:{properties:{ir35_sds_file:!1}}}],required:["ir35"],orderRoot:t(o=>[...o,"ir35","ir35_sds_file"],"orderRoot")};let c=r?"Is your contractor a Saudi Arabia national, or a non-Saudi national contracting via a local business entity or under a Special Privilege Iqama visa?":`Is the contractor a ${i??"selected country"} national, or a non-${i??"selected country"} national contracting through their local business entity?`,l=r?"Please be aware that contracting with non-Saudi Arabia nationals that are not operating as a company or under a Special Privilege Iqama visa can lead to fines for operating without proper work authorization. If you are concerned, please speak with the Contractor and/or local Saudi Arabia counsel to ensure compliance.":`Be aware that the Contractor must be a ${i??"selected country"} national, or a non-${i??"selected country"} national operating through their company to comply with the legal requirements for performing services and deliverables as a contractor in ${i??"selected country"}. If you are concerned, speak with the Contractor and/or local counsel to ensure compliance.`;return{...e?.jsfModify?.basic_information,create:{...e?.jsfModify?.basic_information?.create,nationality_status:{title:c,description:"",type:"string",oneOf:[{const:"national",description:"",title:"Yes"},{const:"non_national",description:l,title:"No"}],"x-jsf-presentation":{inputType:"radio"}}},required:["nationality_status"],orderRoot:t(o=>[...o,"nationality_status"],"orderRoot")}},"buildBasicInformationJsfModify"),G=t((n,i)=>{let e=n?.jsfModify?.contract_preview?.fields;return{fields:{contract_preview_header:{...e?.contract_preview_header,"x-jsf-presentation":{Component:t(r=>{let a=e?.contract_preview_header?.["x-jsf-presentation"]?.Component||h;return _(a,{...r})},"Component")}},contract_preview_statement:{...e?.contract_preview_statement,"x-jsf-presentation":{Component:t(r=>{let a=e?.contract_preview_statement?.["x-jsf-presentation"]?.Component||E;return _(a,{reviewCompleted:!!i?.review_completed,...r})},"Component")}},signature:{...e?.signature,"x-jsf-presentation":{calculateDynamicProperties:t(r=>({isVisible:!!r.review_completed}),"calculateDynamicProperties"),...e?.signature?.["x-jsf-presentation"]}}}}},"buildContractPreviewJsfModify");export{$ as a,z as b,G as c};
2
+ //# sourceMappingURL=chunk-UQMZU7HM.js.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as r}from"./chunk-Q2OGLLBA.js";import{a as t}from"./chunk-OXTA4W4J.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";var n={[o]:" Remote provides its Contractor Services Agreement (CSA) \u201Cas is\u201D; it does not constitute legal advice or create an attorney-client relationship with Remote. Remote is not liable for the content You enter herein and You are encouraged to seek independent legal advice tailored to the specific relationship between You and Your Contractor. By use of the CSA, You release Remote from liability for any claim for damages or losses which may arise related to Your use thereof.",[r]:"Remote provides its Contractor Services Agreement (CSA) \u201Cas is\u201D; it does not constitute legal advice or create an attorney-client relationship with Remote. Remote is not liable for the content You enter herein and You are encouraged to seek independent legal advice tailored to the specific relationship between You and Your Contractor."},d=e(({subscription:i})=>a(t,{title:"Contractor Services Agreement",description:n[i],severity:"info"}),"StatementOfWorkDisclaimer");export{d as a};
2
- //# sourceMappingURL=chunk-7BPB4PXN.js.map
1
+ import{a as o,b as r}from"./chunk-PB6UQ4A4.js";import{a as t}from"./chunk-OXTA4W4J.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";var n={[o]:" Remote provides its Contractor Services Agreement (CSA) \u201Cas is\u201D; it does not constitute legal advice or create an attorney-client relationship with Remote. Remote is not liable for the content You enter herein and You are encouraged to seek independent legal advice tailored to the specific relationship between You and Your Contractor. By use of the CSA, You release Remote from liability for any claim for damages or losses which may arise related to Your use thereof.",[r]:"Remote provides its Contractor Services Agreement (CSA) \u201Cas is\u201D; it does not constitute legal advice or create an attorney-client relationship with Remote. Remote is not liable for the content You enter herein and You are encouraged to seek independent legal advice tailored to the specific relationship between You and Your Contractor."},d=e(({subscription:i})=>a(t,{title:"Contractor Services Agreement",description:n[i],severity:"info"}),"StatementOfWorkDisclaimer");export{d as a};
2
+ //# sourceMappingURL=chunk-WIFDQWVX.js.map
@@ -1,2 +1,2 @@
1
- import{a as b}from"./chunk-F35ALUPA.js";import{a as k}from"./chunk-IHGCXP2X.js";import{a as w}from"./chunk-GSB44SSJ.js";import{a as x}from"./chunk-343R3QEG.js";import{a as u}from"./chunk-Q6PTVBDS.js";import{a as p}from"./chunk-KAX6IHET.js";import{a as D}from"./chunk-V3J5DAMB.js";import{a as F}from"./chunk-WYUPZMPN.js";import{a as n}from"./chunk-YS6VDGFW.js";import{a as s}from"./chunk-KY4PEPYW.js";import{a as c}from"./chunk-OQIJAVBT.js";import{a as t}from"./chunk-ITDU6XPR.js";import{a as o}from"./chunk-ZYIEPPSE.js";import{a as r}from"./chunk-UOYIAURS.js";import"./chunk-DJIQISA2.js";import{a as l}from"./chunk-2BCZXNBX.js";import{a as m}from"./chunk-HSVLNS27.js";import"./chunk-3B6BHFDV.js";import{a as i}from"./chunk-ECGNGVSC.js";import{a as f}from"./chunk-7D4XFAQR.js";import{a}from"./chunk-MF3W2PJ7.js";import{a as e}from"./chunk-MEPIOKJQ.js";import"./chunk-JXZX66MM.js";import"./chunk-S3EXF5DV.js";import"./chunk-QJJZTAG2.js";import"./chunk-LJUWER2H.js";import"./chunk-MHIY35CK.js";import"./chunk-3UBFABDS.js";import"./chunk-ZOTY3CAM.js";import"./chunk-R4TM2Y3K.js";import"./chunk-BUOHZMK6.js";import{a as d}from"./chunk-RR57VT45.js";import"./chunk-FQFLC6YA.js";import"./chunk-LLHJODMO.js";import"./chunk-T5J2Z6ZR.js";import"./chunk-OV6PV4N5.js";import"./chunk-2Q462FT7.js";import"./chunk-Y3CJRZLA.js";import"./chunk-GZUP2IE6.js";import"./chunk-G2LZFGZA.js";import"./chunk-H2O4CVKF.js";import"./chunk-P37U34EQ.js";var q={button:b,checkbox:s,countries:r,date:m,drawer:D,email:f,fieldsetToggle:d,file:e,"multi-select":u,number:i,radio:a,select:o,statement:l,textarea:t,text:p,zendeskDrawer:F,table:n,"work-schedule":c,pdfViewer:k,tel:w,time:x};export{q as defaultComponents};
1
+ import{a as b}from"./chunk-F35ALUPA.js";import{a as k}from"./chunk-IHGCXP2X.js";import{a as w}from"./chunk-GSB44SSJ.js";import{a as x}from"./chunk-343R3QEG.js";import{a as u}from"./chunk-Q6PTVBDS.js";import{a as p}from"./chunk-KAX6IHET.js";import{a as D}from"./chunk-V3J5DAMB.js";import{a as F}from"./chunk-WYUPZMPN.js";import{a as n}from"./chunk-YS6VDGFW.js";import{a as s}from"./chunk-KY4PEPYW.js";import{a as c}from"./chunk-3GCJILCE.js";import{a as t}from"./chunk-ITDU6XPR.js";import{a as o}from"./chunk-ZYIEPPSE.js";import{a as r}from"./chunk-UOYIAURS.js";import"./chunk-DJIQISA2.js";import{a as l}from"./chunk-2BCZXNBX.js";import{a as m}from"./chunk-HSVLNS27.js";import"./chunk-3B6BHFDV.js";import{a as i}from"./chunk-ECGNGVSC.js";import{a as f}from"./chunk-7D4XFAQR.js";import{a}from"./chunk-MF3W2PJ7.js";import{a as e}from"./chunk-MEPIOKJQ.js";import"./chunk-JXZX66MM.js";import"./chunk-S3EXF5DV.js";import"./chunk-QJJZTAG2.js";import"./chunk-LJUWER2H.js";import"./chunk-MHIY35CK.js";import"./chunk-3UBFABDS.js";import"./chunk-ZOTY3CAM.js";import"./chunk-R4TM2Y3K.js";import"./chunk-BUOHZMK6.js";import{a as d}from"./chunk-RR57VT45.js";import"./chunk-FQFLC6YA.js";import"./chunk-LLHJODMO.js";import"./chunk-T5J2Z6ZR.js";import"./chunk-OV6PV4N5.js";import"./chunk-2Q462FT7.js";import"./chunk-Y3CJRZLA.js";import"./chunk-GZUP2IE6.js";import"./chunk-G2LZFGZA.js";import"./chunk-H2O4CVKF.js";import"./chunk-P37U34EQ.js";var q={button:b,checkbox:s,countries:r,date:m,drawer:D,email:f,fieldsetToggle:d,file:e,"multi-select":u,number:i,radio:a,select:o,statement:l,textarea:t,text:p,zendeskDrawer:F,table:n,"work-schedule":c,pdfViewer:k,tel:w,time:x};export{q as defaultComponents};
2
2
  //# sourceMappingURL=default-components.js.map
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
  import { PropsWithChildren, ButtonHTMLAttributes } from 'react';
3
3
 
4
- declare function ContractAmendmentBack({ children, ...props }: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & Record<string, unknown>): react_jsx_runtime.JSX.Element;
4
+ declare function ContractAmendmentBack({ children, ...props }: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & Record<string, unknown>): React.JSX.Element;
5
5
 
6
6
  export { ContractAmendmentBack };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
  import { P as PostV1ContractAmendmentsError, b as ContractAmendmentResponse } from '../../types.gen-CTQ9C-mR.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
@@ -25,6 +25,6 @@ type ContractAmendmentConfirmationFormProps = {
25
25
  */
26
26
  onSuccess?: (data: ContractAmendmentResponse) => void | Promise<void>;
27
27
  };
28
- declare function ContractAmendmentConfirmationForm({ onSubmit, onError, onSuccess, }: ContractAmendmentConfirmationFormProps): react_jsx_runtime.JSX.Element | null;
28
+ declare function ContractAmendmentConfirmationForm({ onSubmit, onError, onSuccess, }: ContractAmendmentConfirmationFormProps): React.JSX.Element | null;
29
29
 
30
30
  export { ContractAmendmentConfirmationForm };
@@ -1,5 +1,5 @@
1
1
  import { ContractAmendmentConfirmationForm } from './ContractAmendmentConfirmationForm.js';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React$1 from 'react';
3
3
  import { ContractAmendmentBack } from './ContractAmendmentBack.js';
4
4
  import { ContractAmendmentForm } from './ContractAmendmentForm.js';
5
5
  import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
@@ -7,7 +7,6 @@ import { useContractAmendment } from './hooks.js';
7
7
  import { ContractAmendmentParams } from './types.js';
8
8
  import '../../types.gen-CTQ9C-mR.js';
9
9
  import 'react-hook-form';
10
- import 'react';
11
10
  import '../../mutations-DZjKx4tI.js';
12
11
  import '../../remoteFlows-C4Vv3_7t.js';
13
12
  import 'yup';
@@ -42,6 +41,6 @@ type ContractAmendmentRenderProps = {
42
41
  type ContractAmendmentFlowProps = ContractAmendmentParams & {
43
42
  render: ({ contractAmendmentBag, components, }: ContractAmendmentRenderProps) => React.ReactNode;
44
43
  };
45
- declare function ContractAmendmentFlow({ employmentId, countryCode, options, render, }: ContractAmendmentFlowProps): react_jsx_runtime.JSX.Element;
44
+ declare function ContractAmendmentFlow({ employmentId, countryCode, options, render, }: ContractAmendmentFlowProps): React$1.JSX.Element;
46
45
 
47
46
  export { ContractAmendmentFlow, type ContractAmendmentRenderProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
  import { c as PostV1ContractAmendmentsAutomatableError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-CTQ9C-mR.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
@@ -28,6 +28,6 @@ type ContractAmendmentFormProps = {
28
28
  */
29
29
  onSuccess?: (data: ContractAmendmentAutomatableResponse) => void | Promise<void>;
30
30
  };
31
- declare function ContractAmendmentForm({ onSubmit, onError, onSuccess, }: ContractAmendmentFormProps): react_jsx_runtime.JSX.Element;
31
+ declare function ContractAmendmentForm({ onSubmit, onError, onSuccess, }: ContractAmendmentFormProps): React.JSX.Element;
32
32
 
33
33
  export { ContractAmendmentForm };
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
  import { PropsWithChildren, ButtonHTMLAttributes } from 'react';
3
3
 
4
- declare function ContractAmendmentSubmit({ children, ...props }: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & Record<string, unknown>): react_jsx_runtime.JSX.Element;
4
+ declare function ContractAmendmentSubmit({ children, ...props }: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & Record<string, unknown>): React.JSX.Element;
5
5
 
6
6
  export { ContractAmendmentSubmit };
@@ -3,11 +3,10 @@ export { ContractAmendmentFlow, ContractAmendmentRenderProps } from './ContractA
3
3
  export { ContractAmendmentForm } from './ContractAmendmentForm.js';
4
4
  export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
5
5
  export { useContractAmendment } from './hooks.js';
6
- import 'react/jsx-runtime';
6
+ import 'react';
7
7
  import '../../types.gen-CTQ9C-mR.js';
8
8
  import 'react-hook-form';
9
9
  import './ContractAmendmentBack.js';
10
- import 'react';
11
10
  import './types.js';
12
11
  import '../types.js';
13
12
  import '../../remoteFlows-C4Vv3_7t.js';
@@ -1,9 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ContractorOnboardingFlowProps } from '../../types-BDhuq1UF.js';
1
+ import * as React from 'react';
2
+ import { C as ContractorOnboardingFlowProps } from '../../types-BcjbPv3W.js';
3
3
  import './constants.js';
4
4
  import '../../types.gen-CTQ9C-mR.js';
5
5
  import './components/OnboardingBack.js';
6
- import 'react';
7
6
  import './components/OnboardingSubmit.js';
8
7
  import '../../remoteFlows-C4Vv3_7t.js';
9
8
  import 'yup';
@@ -13,7 +12,7 @@ import '@tanstack/query-core';
13
12
  import '../useStepState.js';
14
13
  import '@remoteoss/remote-json-schema-form-kit';
15
14
  import './utils.js';
16
- import '../../types-5vsf9upM.js';
15
+ import '../../types-CBE9Gstk.js';
17
16
  import '../Onboarding/components/OnboardingBack.js';
18
17
  import '../Onboarding/components/OnboardingInvite.js';
19
18
  import '../Onboarding/components/OnboardingSubmit.js';
@@ -26,6 +25,6 @@ import './components/OnboardingInvite.js';
26
25
  import './components/ContractReviewButton.js';
27
26
  import './components/SaveDraftButton.js';
28
27
 
29
- declare const ContractorOnboardingFlow: ({ render, employmentId, externalId, countryCode, skipSteps, initialValues, options, }: ContractorOnboardingFlowProps) => react_jsx_runtime.JSX.Element;
28
+ declare const ContractorOnboardingFlow: ({ render, employmentId, externalId, countryCode, skipSteps, initialValues, options, }: ContractorOnboardingFlowProps) => React.JSX.Element;
30
29
 
31
30
  export { ContractorOnboardingFlow };
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-JFPOX7SW.js";import"../../chunk-KVUKJU5U.js";import"../../chunk-6P536SW2.js";import"../../chunk-34U3WJ75.js";import"../../chunk-SVVZOMLQ.js";import"../../chunk-QIAK5VU7.js";import"../../chunk-CW7CHRMN.js";import"../../chunk-DNAPYU5I.js";import"../../chunk-DB4JHJ3Z.js";import"../../chunk-W7MCRAQ4.js";import"../../chunk-V62JQXIC.js";import"../../chunk-32ERURM2.js";import"../../chunk-7BPB4PXN.js";import"../../chunk-Y34DKDJI.js";import"../../chunk-OL5C4QEH.js";import"../../chunk-J2ARI3NQ.js";import"../../chunk-Q3ALCPJN.js";import"../../chunk-UI4AZZD5.js";import"../../chunk-XYCFKCVZ.js";import"../../chunk-AP56UUME.js";import"../../chunk-IJCTN52C.js";import"../../chunk-HK4LGSS7.js";import"../../chunk-3UDRMQNE.js";import"../../chunk-Y3YYLANJ.js";import"../../chunk-6PWZ4TBI.js";import"../../chunk-VDRNNOVA.js";import"../../chunk-NW3D7CPK.js";import"../../chunk-G556HMVA.js";import"../../chunk-Q2OGLLBA.js";import"../../chunk-KFYWUBRS.js";import"../../chunk-PJ6KPGIE.js";import"../../chunk-UYGDMJF2.js";import"../../chunk-TJLXZ2ZK.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-54Z4QJ3Q.js";import"../../chunk-W5MWHAAI.js";import"../../chunk-3YTML5RG.js";import"../../chunk-OXTA4W4J.js";import"../../chunk-LKVQ32ZK.js";import"../../chunk-BUOHZMK6.js";import"../../chunk-RR57VT45.js";import"../../chunk-FQFLC6YA.js";import"../../chunk-LLHJODMO.js";import"../../chunk-T5J2Z6ZR.js";import"../../chunk-OV6PV4N5.js";import"../../chunk-2Q462FT7.js";import"../../chunk-Y3CJRZLA.js";import"../../chunk-GZUP2IE6.js";import"../../chunk-G2LZFGZA.js";import"../../chunk-JDIKYCN6.js";import"../../chunk-626FTNKA.js";import"../../chunk-H2O4CVKF.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
1
+ import{a}from"../../chunk-4VEUIX5E.js";import"../../chunk-KVUKJU5U.js";import"../../chunk-6P536SW2.js";import"../../chunk-34U3WJ75.js";import"../../chunk-SVVZOMLQ.js";import"../../chunk-QIAK5VU7.js";import"../../chunk-CW7CHRMN.js";import"../../chunk-DNAPYU5I.js";import"../../chunk-DB4JHJ3Z.js";import"../../chunk-W7MCRAQ4.js";import"../../chunk-V62JQXIC.js";import"../../chunk-33VF3QHP.js";import"../../chunk-WIFDQWVX.js";import"../../chunk-Y34DKDJI.js";import"../../chunk-OL5C4QEH.js";import"../../chunk-J2ARI3NQ.js";import"../../chunk-Q3ALCPJN.js";import"../../chunk-36IU27QH.js";import"../../chunk-IZIKQFAC.js";import"../../chunk-AP56UUME.js";import"../../chunk-IJCTN52C.js";import"../../chunk-UQMZU7HM.js";import"../../chunk-3UDRMQNE.js";import"../../chunk-Y3YYLANJ.js";import"../../chunk-6PWZ4TBI.js";import"../../chunk-VDRNNOVA.js";import"../../chunk-NW3D7CPK.js";import"../../chunk-COAJUZSE.js";import"../../chunk-PB6UQ4A4.js";import"../../chunk-KFYWUBRS.js";import"../../chunk-PJ6KPGIE.js";import"../../chunk-UYGDMJF2.js";import"../../chunk-TJLXZ2ZK.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-54Z4QJ3Q.js";import"../../chunk-W5MWHAAI.js";import"../../chunk-3YTML5RG.js";import"../../chunk-OXTA4W4J.js";import"../../chunk-LKVQ32ZK.js";import"../../chunk-BUOHZMK6.js";import"../../chunk-RR57VT45.js";import"../../chunk-FQFLC6YA.js";import"../../chunk-LLHJODMO.js";import"../../chunk-T5J2Z6ZR.js";import"../../chunk-OV6PV4N5.js";import"../../chunk-2Q462FT7.js";import"../../chunk-Y3CJRZLA.js";import"../../chunk-GZUP2IE6.js";import"../../chunk-G2LZFGZA.js";import"../../chunk-JDIKYCN6.js";import"../../chunk-626FTNKA.js";import"../../chunk-H2O4CVKF.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
2
2
  //# sourceMappingURL=ContractorOnboarding.js.map