@remoteoss/remote-flows 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2CDCTUVY.js +2 -0
- package/dist/{chunk-3O3Q24JL.js.map → chunk-2CDCTUVY.js.map} +1 -1
- package/dist/{chunk-UPXJJBXZ.js → chunk-2N5A6EGD.js} +2 -2
- package/dist/chunk-3UDG4IJO.js +2 -0
- package/dist/chunk-3UDG4IJO.js.map +1 -0
- package/dist/{chunk-FHQWEM5E.js → chunk-4CIYPTKM.js} +2 -2
- package/dist/{chunk-25U3HC77.js → chunk-56LJAMZC.js} +2 -2
- package/dist/{chunk-EKKRQI6B.js → chunk-5NARH23N.js} +2 -2
- package/dist/{chunk-LAYZ6XET.js → chunk-5ORIDYIK.js} +2 -2
- package/dist/{chunk-7JPHJ7SQ.js → chunk-664GOQG3.js} +2 -2
- package/dist/{chunk-IJQDK7KG.js → chunk-67V3DFV4.js} +2 -2
- package/dist/{chunk-43IIMISK.js → chunk-6GQZCUUR.js} +2 -2
- package/dist/{chunk-T2UJOEUA.js → chunk-6GUXV7XA.js} +2 -2
- package/dist/{chunk-MAVVGCUM.js → chunk-7JUP5JEY.js} +2 -2
- package/dist/{chunk-CHAHQRMM.js → chunk-7OL54VKA.js} +2 -2
- package/dist/chunk-7RFJWDXS.js +2 -0
- package/dist/chunk-7RFJWDXS.js.map +1 -0
- package/dist/{chunk-M22INAKM.js → chunk-7TX2YY4K.js} +2 -2
- package/dist/chunk-A6GJNXUZ.js +2 -0
- package/dist/chunk-A6GJNXUZ.js.map +1 -0
- package/dist/chunk-AP56UUME.js +2 -0
- package/dist/chunk-AP56UUME.js.map +1 -0
- package/dist/{chunk-6IL4TB7S.js → chunk-BB3WWKGA.js} +2 -2
- package/dist/{chunk-2FZWM6RV.js → chunk-BKWNJMNJ.js} +2 -2
- package/dist/{chunk-RC3XP5WU.js → chunk-CHDWFMD3.js} +2 -2
- package/dist/{chunk-CCL5LNHC.js → chunk-D64MAPTD.js} +2 -2
- package/dist/{chunk-LWZIOOPO.js → chunk-D7WCSZGW.js} +2 -2
- package/dist/{chunk-FTCLM4RE.js → chunk-DTZ23AE6.js} +2 -2
- package/dist/{chunk-LA6ZJLTB.js → chunk-DXTLNOCG.js} +2 -2
- package/dist/{chunk-5KHLOGTR.js → chunk-DYXTJBSK.js} +2 -2
- package/dist/{chunk-QM7J43SC.js → chunk-EL5QIDYZ.js} +2 -2
- package/dist/{chunk-ZQ6MG635.js → chunk-EVSDVI2G.js} +2 -2
- package/dist/{chunk-3WE5QB4I.js → chunk-FDBUFHR3.js} +2 -2
- package/dist/{chunk-OIN3HGOQ.js → chunk-GTWY3JK3.js} +2 -2
- package/dist/{chunk-P5WUODPR.js → chunk-HBRO74FQ.js} +2 -2
- package/dist/chunk-HJYHCWGX.js +2 -0
- package/dist/chunk-HJYHCWGX.js.map +1 -0
- package/dist/{chunk-ID3ZF7QT.js → chunk-HMUIT2NU.js} +2 -2
- package/dist/{chunk-QFK2SD24.js → chunk-HTJZUAVS.js} +2 -2
- package/dist/chunk-HX34JCPL.js +2 -0
- package/dist/chunk-HX34JCPL.js.map +1 -0
- package/dist/{chunk-ANGJCT4I.js → chunk-HYOJP6J5.js} +2 -2
- package/dist/{chunk-CEJ24TSW.js → chunk-JK5K2S7N.js} +2 -2
- package/dist/{chunk-5ZR7EFPY.js → chunk-K2L2NSOM.js} +2 -2
- package/dist/{chunk-I5XGKYJR.js → chunk-KFJJXMAH.js} +2 -2
- package/dist/{chunk-S3KOROEZ.js → chunk-KVAGMBSU.js} +2 -2
- package/dist/{chunk-UXVCNSHK.js → chunk-LJYCBMDS.js} +2 -2
- package/dist/{chunk-6VRUYYUV.js → chunk-LLM6MDNY.js} +2 -2
- package/dist/{chunk-DPY77ASH.js → chunk-OHAAAVNB.js} +2 -2
- package/dist/{chunk-ZJ7524CZ.js → chunk-OIIALEVF.js} +2 -2
- package/dist/chunk-OKM7DRCF.js +2 -0
- package/dist/{chunk-BSUVUGJG.js → chunk-PEHALKVU.js} +2 -2
- package/dist/{chunk-GWJZTMF4.js → chunk-PEOWIEYM.js} +2 -2
- package/dist/{chunk-PXX2JSFI.js → chunk-PFKNQGOD.js} +2 -2
- package/dist/{chunk-6IKJCDQU.js → chunk-QAOGIYQL.js} +2 -2
- package/dist/chunk-QGWCUGLN.js +2 -0
- package/dist/chunk-QGWCUGLN.js.map +1 -0
- package/dist/{chunk-I4XJ764Y.js → chunk-QIVDIOJG.js} +2 -2
- package/dist/chunk-QRD43QJA.js +2 -0
- package/dist/chunk-QRD43QJA.js.map +1 -0
- package/dist/{chunk-CYPGWEOO.js → chunk-RCWBOOZF.js} +2 -2
- package/dist/{chunk-SRYUZSIK.js → chunk-RGGU6BNB.js} +2 -2
- package/dist/{chunk-BV3PGYSH.js → chunk-RYXRWMF4.js} +2 -2
- package/dist/{chunk-K2I7ZL3Z.js → chunk-SOYN4LOZ.js} +2 -2
- package/dist/{chunk-3PTV5YSQ.js → chunk-TW7Z6G37.js} +2 -2
- package/dist/{chunk-WHVPDECD.js → chunk-U24UNO6X.js} +2 -2
- package/dist/{chunk-CDRDLO4A.js → chunk-UOOM7V2D.js} +2 -2
- package/dist/{chunk-GEHM46QD.js → chunk-WMICWLC3.js} +2 -2
- package/dist/{chunk-QU4ZTSMT.js → chunk-WNGPZXEX.js} +2 -2
- package/dist/chunk-XFJPUKYR.js +2 -0
- package/dist/chunk-XFJPUKYR.js.map +1 -0
- package/dist/{chunk-NW5EBNKN.js → chunk-XLAKJHGV.js} +2 -2
- package/dist/{chunk-2RBD2MJR.js → chunk-YBB6BOW7.js} +2 -2
- package/dist/{chunk-PJY4TN7I.js → chunk-YP2JBYAK.js} +2 -2
- package/dist/{chunk-MB6ZGX2O.js → chunk-YP7Q47E2.js} +2 -2
- package/dist/{chunk-OW5QGJD4.js → chunk-Z47JQN3R.js} +2 -2
- package/dist/{chunk-5Y2RV54X.js → chunk-ZF4BLPXL.js} +2 -2
- package/dist/{chunk-UYHBV7QJ.js → chunk-ZF6MZYBK.js} +2 -2
- package/dist/chunk-ZOTFS35J.js +2 -0
- package/dist/{chunk-U6RM2N4A.js.map → chunk-ZOTFS35J.js.map} +1 -1
- package/dist/{chunk-E5VV7WAZ.js → chunk-ZZWX3C6V.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +3 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +40 -3
- package/dist/flows/ContractorOnboarding/api.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/constants.d.ts +5 -0
- package/dist/flows/ContractorOnboarding/constants.js +2 -0
- package/dist/flows/ContractorOnboarding/constants.js.map +1 -0
- package/dist/flows/ContractorOnboarding/context.d.ts +6 -6
- package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/json-schemas/selectContractorSubscriptionStep.d.ts +23 -0
- package/dist/flows/ContractorOnboarding/json-schemas/selectContractorSubscriptionStep.js +2 -0
- package/dist/flows/ContractorOnboarding/json-schemas/selectContractorSubscriptionStep.js.map +1 -0
- package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/utils.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/api.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +3 -3
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +3 -3
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +7 -17
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
- package/dist/flows/Onboarding/components/SaveDraftButton.js +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +4 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +4 -4
- package/dist/flows/Onboarding/utils.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationBack.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TerminationSubmit.js +1 -1
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +5 -5
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +5 -5
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +5 -5
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/context.d.ts +7 -4
- package/dist/flows/Termination/hooks.d.ts +4 -4
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +6 -6
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +4 -4
- package/dist/flows/api.d.ts +4 -4
- package/dist/flows/api.js +1 -1
- package/dist/index.d.ts +15 -9
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.js +1 -1
- package/dist/{mutations-B3zY0Z8j.d.ts → mutations-BdkQ8BEQ.d.ts} +1 -1
- package/dist/{remoteFlows-C6LQCoUj.d.ts → remoteFlows-nNmmcD-T.d.ts} +3 -1
- package/dist/{types-D0Gtn_LU.d.ts → types-5wwUT05a.d.ts} +8 -2
- package/dist/{types-C_aEj_4p.d.ts → types-BOXcQDia.d.ts} +3 -3
- package/dist/{types-CXFW77uu.d.ts → types-CNHUaKN_.d.ts} +18 -3
- package/dist/{types-DRI6kPSl.d.ts → types-omiJJgNz.d.ts} +5 -5
- package/dist/{types.gen-B1wPsyg7.d.ts → types.gen-BS9UfhS-.d.ts} +47 -1
- package/package.json +1 -1
- package/dist/chunk-3O3Q24JL.js +0 -2
- package/dist/chunk-3ZWDIEEM.js +0 -2
- package/dist/chunk-3ZWDIEEM.js.map +0 -1
- package/dist/chunk-AWJUS6JD.js +0 -2
- package/dist/chunk-AWJUS6JD.js.map +0 -1
- package/dist/chunk-BDPCUDJB.js +0 -2
- package/dist/chunk-BDPCUDJB.js.map +0 -1
- package/dist/chunk-KDUM4EZJ.js +0 -2
- package/dist/chunk-KDUM4EZJ.js.map +0 -1
- package/dist/chunk-NZHJMUIX.js +0 -2
- package/dist/chunk-NZHJMUIX.js.map +0 -1
- package/dist/chunk-TKAZTT3M.js +0 -2
- package/dist/chunk-TKAZTT3M.js.map +0 -1
- package/dist/chunk-U6RM2N4A.js +0 -2
- package/dist/chunk-XOA7GG4P.js +0 -2
- package/dist/chunk-ZPBKMAKR.js +0 -2
- package/dist/chunk-ZPBKMAKR.js.map +0 -1
- /package/dist/{chunk-UPXJJBXZ.js.map → chunk-2N5A6EGD.js.map} +0 -0
- /package/dist/{chunk-FHQWEM5E.js.map → chunk-4CIYPTKM.js.map} +0 -0
- /package/dist/{chunk-25U3HC77.js.map → chunk-56LJAMZC.js.map} +0 -0
- /package/dist/{chunk-EKKRQI6B.js.map → chunk-5NARH23N.js.map} +0 -0
- /package/dist/{chunk-LAYZ6XET.js.map → chunk-5ORIDYIK.js.map} +0 -0
- /package/dist/{chunk-7JPHJ7SQ.js.map → chunk-664GOQG3.js.map} +0 -0
- /package/dist/{chunk-IJQDK7KG.js.map → chunk-67V3DFV4.js.map} +0 -0
- /package/dist/{chunk-43IIMISK.js.map → chunk-6GQZCUUR.js.map} +0 -0
- /package/dist/{chunk-T2UJOEUA.js.map → chunk-6GUXV7XA.js.map} +0 -0
- /package/dist/{chunk-MAVVGCUM.js.map → chunk-7JUP5JEY.js.map} +0 -0
- /package/dist/{chunk-CHAHQRMM.js.map → chunk-7OL54VKA.js.map} +0 -0
- /package/dist/{chunk-M22INAKM.js.map → chunk-7TX2YY4K.js.map} +0 -0
- /package/dist/{chunk-6IL4TB7S.js.map → chunk-BB3WWKGA.js.map} +0 -0
- /package/dist/{chunk-2FZWM6RV.js.map → chunk-BKWNJMNJ.js.map} +0 -0
- /package/dist/{chunk-RC3XP5WU.js.map → chunk-CHDWFMD3.js.map} +0 -0
- /package/dist/{chunk-CCL5LNHC.js.map → chunk-D64MAPTD.js.map} +0 -0
- /package/dist/{chunk-LWZIOOPO.js.map → chunk-D7WCSZGW.js.map} +0 -0
- /package/dist/{chunk-FTCLM4RE.js.map → chunk-DTZ23AE6.js.map} +0 -0
- /package/dist/{chunk-LA6ZJLTB.js.map → chunk-DXTLNOCG.js.map} +0 -0
- /package/dist/{chunk-5KHLOGTR.js.map → chunk-DYXTJBSK.js.map} +0 -0
- /package/dist/{chunk-QM7J43SC.js.map → chunk-EL5QIDYZ.js.map} +0 -0
- /package/dist/{chunk-ZQ6MG635.js.map → chunk-EVSDVI2G.js.map} +0 -0
- /package/dist/{chunk-3WE5QB4I.js.map → chunk-FDBUFHR3.js.map} +0 -0
- /package/dist/{chunk-OIN3HGOQ.js.map → chunk-GTWY3JK3.js.map} +0 -0
- /package/dist/{chunk-P5WUODPR.js.map → chunk-HBRO74FQ.js.map} +0 -0
- /package/dist/{chunk-ID3ZF7QT.js.map → chunk-HMUIT2NU.js.map} +0 -0
- /package/dist/{chunk-QFK2SD24.js.map → chunk-HTJZUAVS.js.map} +0 -0
- /package/dist/{chunk-ANGJCT4I.js.map → chunk-HYOJP6J5.js.map} +0 -0
- /package/dist/{chunk-CEJ24TSW.js.map → chunk-JK5K2S7N.js.map} +0 -0
- /package/dist/{chunk-5ZR7EFPY.js.map → chunk-K2L2NSOM.js.map} +0 -0
- /package/dist/{chunk-I5XGKYJR.js.map → chunk-KFJJXMAH.js.map} +0 -0
- /package/dist/{chunk-S3KOROEZ.js.map → chunk-KVAGMBSU.js.map} +0 -0
- /package/dist/{chunk-UXVCNSHK.js.map → chunk-LJYCBMDS.js.map} +0 -0
- /package/dist/{chunk-6VRUYYUV.js.map → chunk-LLM6MDNY.js.map} +0 -0
- /package/dist/{chunk-DPY77ASH.js.map → chunk-OHAAAVNB.js.map} +0 -0
- /package/dist/{chunk-ZJ7524CZ.js.map → chunk-OIIALEVF.js.map} +0 -0
- /package/dist/{chunk-XOA7GG4P.js.map → chunk-OKM7DRCF.js.map} +0 -0
- /package/dist/{chunk-BSUVUGJG.js.map → chunk-PEHALKVU.js.map} +0 -0
- /package/dist/{chunk-GWJZTMF4.js.map → chunk-PEOWIEYM.js.map} +0 -0
- /package/dist/{chunk-PXX2JSFI.js.map → chunk-PFKNQGOD.js.map} +0 -0
- /package/dist/{chunk-6IKJCDQU.js.map → chunk-QAOGIYQL.js.map} +0 -0
- /package/dist/{chunk-I4XJ764Y.js.map → chunk-QIVDIOJG.js.map} +0 -0
- /package/dist/{chunk-CYPGWEOO.js.map → chunk-RCWBOOZF.js.map} +0 -0
- /package/dist/{chunk-SRYUZSIK.js.map → chunk-RGGU6BNB.js.map} +0 -0
- /package/dist/{chunk-BV3PGYSH.js.map → chunk-RYXRWMF4.js.map} +0 -0
- /package/dist/{chunk-K2I7ZL3Z.js.map → chunk-SOYN4LOZ.js.map} +0 -0
- /package/dist/{chunk-3PTV5YSQ.js.map → chunk-TW7Z6G37.js.map} +0 -0
- /package/dist/{chunk-WHVPDECD.js.map → chunk-U24UNO6X.js.map} +0 -0
- /package/dist/{chunk-CDRDLO4A.js.map → chunk-UOOM7V2D.js.map} +0 -0
- /package/dist/{chunk-GEHM46QD.js.map → chunk-WMICWLC3.js.map} +0 -0
- /package/dist/{chunk-QU4ZTSMT.js.map → chunk-WNGPZXEX.js.map} +0 -0
- /package/dist/{chunk-NW5EBNKN.js.map → chunk-XLAKJHGV.js.map} +0 -0
- /package/dist/{chunk-2RBD2MJR.js.map → chunk-YBB6BOW7.js.map} +0 -0
- /package/dist/{chunk-PJY4TN7I.js.map → chunk-YP2JBYAK.js.map} +0 -0
- /package/dist/{chunk-MB6ZGX2O.js.map → chunk-YP7Q47E2.js.map} +0 -0
- /package/dist/{chunk-OW5QGJD4.js.map → chunk-Z47JQN3R.js.map} +0 -0
- /package/dist/{chunk-5Y2RV54X.js.map → chunk-ZF4BLPXL.js.map} +0 -0
- /package/dist/{chunk-UYHBV7QJ.js.map → chunk-ZF6MZYBK.js.map} +0 -0
- /package/dist/{chunk-E5VV7WAZ.js.map → chunk-ZZWX3C6V.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format, isFuture, parseISO, subDays } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n EmployeeCommunicationFormValues,\n PaidTimeOffFormValues,\n TerminationDetailsFormValues,\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { terminationDetailsSchema } from '@/src/flows/Termination/json-schemas/terminationDetails';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api';\nimport { AcknowledgeInformationContainer } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer';\nimport { AcknowledgeInformation } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation';\nimport { AcknowledgeInformationFees } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n hasFutureStartDate: boolean,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n ...(hasFutureStartDate\n ? { termination_reason: 'cancellation_before_start_date' }\n : {}),\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmploymentQuery({ employmentId });\n\n const hasFutureStartDate = Boolean(\n employment?.provisional_start_date &&\n isFuture(parseISO(employment.provisional_start_date)),\n );\n\n const initialValues = buildInitialValues(\n {\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n },\n hasFutureStartDate,\n );\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n const originalTerminationReasonOptions =\n terminationDetailsSchema.data.schema.properties.termination_reason.oneOf;\n\n const terminationReasonOptions = hasFutureStartDate\n ? originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const === 'cancellation_before_start_date',\n )\n : originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const !== 'cancellation_before_start_date',\n );\n\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n termination_reason: {\n ...(options?.jsfModify?.fields?.termination_reason as $TSFixMe),\n oneOf: terminationReasonOptions,\n },\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n external\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: format(new Date(), 'yyyy-MM-dd'),\n ...(formValues.termination_reason ===\n 'cancellation_before_start_date' &&\n employment?.provisional_start_date\n ? {\n maxDate: format(\n subDays(parseISO(employment.provisional_start_date), 1),\n 'yyyy-MM-dd',\n ),\n }\n : {}),\n },\n ...(formValues.termination_reason === 'cancellation_before_start_date'\n ? {\n 'x-jsf-errorMessage': {\n maximum:\n \"The proposed termination date must be before the employee's start date.\",\n },\n }\n : {}),\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <AcknowledgeInformationContainer\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <AcknowledgeInformation {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_fees_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const zendeskIds = {\n involuntaryOffboardingServiceChargeZendeskId:\n zendeskArticles.involuntaryOffboardingServiceCharge,\n reconciliationInvoiceZendeskId:\n zendeskArticles.reconciliationInvoice,\n };\n\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n if (CustomComponent) {\n return <CustomComponent {...zendeskIds} />;\n }\n\n return <AcknowledgeInformationFees {...zendeskIds} />;\n },\n },\n },\n },\n };\n }, [\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.termination_reason,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,\n employment,\n formValues.proposed_termination_date,\n formValues.termination_reason,\n hasFutureStartDate,\n employmentId,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Employment data passed useful to be used between components\n */\n employment: employment,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (\n values: TerminationFormValues,\n includeAllFields: boolean = false,\n ):\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues\n | TerminationFormValues => {\n if (includeAllFields) {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n }) as TerminationFormValues;\n }\n\n if (terminationHeadlessForm) {\n return parseJSFToValidate(values, terminationHeadlessForm?.fields, {\n isPartialValidation: true,\n }) as\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues;\n }\n return {} as $TSFixMe;\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n 'x-jsf-presentation': {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },\n };\n}\n"],"mappings":"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","names":["createHeadlessForm","omitBy","isNull","format","isFuture","parseISO","subDays","useMemo","omit","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","hasFutureStartDate","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmploymentQuery","isFuture","parseISO","initialValues","formValues","useMemo","customFields","originalTerminationReasonOptions","terminationDetailsSchema","terminationReasonOptions","option","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","format","subDays","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","AcknowledgeInformationContainer","AcknowledgeInformation","zendeskIds","AcknowledgeInformationFees","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next","includeAllFields"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as D}from"./chunk-SGE4DLC3.js";import{a as S,b as E,d as L,e as _,f as F}from"./chunk-TWIUL2P3.js";import{b as k}from"./chunk-WVDTHFGS.js";import{b as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as D}from"./chunk-SGE4DLC3.js";import{a as S,b as E,d as L,e as _,f as F}from"./chunk-TWIUL2P3.js";import{b as k}from"./chunk-WVDTHFGS.js";import{b as w}from"./chunk-XFJPUKYR.js";import{a as l}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{jsx as y,jsxs as B}from"react/jsx-runtime";var A=p(({open:e,onOpenChange:a,title:t,trigger:n,children:m,className:d="",direction:i="right"})=>{let{components:f}=w(),r=f?.drawer;return r?y(r,{open:e,onOpenChange:a,title:t,trigger:n,children:m}):B(S,{open:e,onOpenChange:a,direction:i,children:[y(E,{asChild:!0,children:n}),y(L,{className:l(d,"RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4"),children:B("div",{className:"h-full flex flex-col",children:[y(_,{children:y(F,{children:t})}),y("div",{className:"flex-1 overflow-y-auto",children:m})]})})]})},"Drawer");import*as T from"react";import{jsx as b}from"react/jsx-runtime";var g=T.forwardRef(({className:e,...a},t)=>b("div",{className:"relative w-full overflow-auto",children:b("table",{ref:t,className:l("w-full caption-bottom text-sm",e),...a})}));g.displayName="Table";var x=T.forwardRef(({className:e,...a},t)=>b("thead",{ref:t,className:l("[&_tr]:border-b",e),...a}));x.displayName="TableHeader";var h=T.forwardRef(({className:e,...a},t)=>b("tbody",{ref:t,className:l("[&_tr:last-child]:border-0",e),...a}));h.displayName="TableBody";var K=T.forwardRef(({className:e,...a},t)=>b("tfoot",{ref:t,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));K.displayName="TableFooter";var R=T.forwardRef(({className:e,...a},t)=>b("tr",{ref:t,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));R.displayName="TableRow";var v=T.forwardRef(({className:e,...a},t)=>b("th",{ref:t,className:l("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));v.displayName="TableHead";var C=T.forwardRef(({className:e,...a},t)=>b("td",{ref:t,className:l("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));C.displayName="TableCell";var Y=T.forwardRef(({className:e,...a},t)=>b("caption",{ref:t,className:l("mt-4 text-sm text-muted-foreground",e),...a}));Y.displayName="TableCaption";import q from"react";import{jsx as c,jsxs as I}from"react/jsx-runtime";var H=q.forwardRef(({data:e=[],columns:a,className:t=""},n)=>{let{components:m}=w(),d=m?.table;return d?c(d,{data:e,columns:a,className:t}):I(g,{ref:n,className:l("RemoteFlows__Table",t),children:[c(x,{children:c(R,{children:a.map(i=>c(v,{className:l("RemoteFlows__TableHead",i.className),children:i.label},String(i.id)))})}),c(h,{children:e?.map((i,f)=>c(R,{children:a.map(r=>c(C,{className:l("RemoteFlows__TableCell",r.className,r.cellClassName),children:r.render?r.render(i[r.id],i,f):i[r.id]},String(r.id)))},z(i,f)))})]})});H.displayName="Table";function z(e,a){return String(e.id??a)}p(z,"getRowKey");import{Fragment as M,jsx as o,jsxs as s}from"react/jsx-runtime";var J="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",V="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",u=p(({children:e,withBorder:a=!1,className:t=""})=>o("div",{className:l(J,a&&V,t),children:e}),"SummaryRow"),W=p(({usedDays:e,bookedDays:a,approvedDaysBeforeTermination:t,approvedDaysAfterTermination:n,remainingDays:m,proposedTerminationDate:d,isUnlimitedPto:i,currentEntitlementDays:f})=>{let r=new Date(d).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return s("div",{children:[s(u,{withBorder:!0,children:[o("label",{children:"Number of days entitled to per year"}),o("p",{"data-testid":"entitled-days",className:"font-bold",children:i?"Unlimited":f})]}),s(u,{children:[o("label",{children:"Total days booked"}),o("p",{"data-testid":"booked-days",className:"font-bold",children:a})]}),s(u,{children:[o("label",{children:"Number of days already used"}),o("p",{"data-testid":"used-days",className:"font-bold",children:e})]}),s(u,{children:[s("label",{children:["Approved for use before ",r]}),o("p",{"data-testid":"approved-days-before-termination",className:"font-bold",children:t})]}),s(u,{withBorder:!0,children:[s("label",{children:["Approved for use after ",r]}),o("p",{"data-testid":"approved-days-after-termination",className:"font-bold",children:n})]}),s(u,{children:[o("label",{children:"Total days remaining unused"}),o("p",{"data-testid":"remaining-days",className:"font-bold",children:m})]}),o(u,{className:"mb-2 py-0",children:s("p",{className:"text-xs text-[#222E39]",children:["Unused days expire on ",r]})})]})},"SummaryTimeOff"),X=[{id:"formattedDate",label:"Dates",className:"w-[250px]",cellClassName:"font-medium"},{id:"duration",label:"Duration",render:p(e=>D({number:e,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0}),"render")},{id:"status",label:"Status"}],Z=p(({employeeName:e,timeoffQuery:a,entitledDays:t,countryName:n,currentEntitlementDays:m,formattedProposedTerminationDate:d,onOpenChange:i,open:f})=>{let{data:r,isLoading:N}=a;return o(A,{open:f,onOpenChange:i,title:`${e} paid time off breakdown`,trigger:o(k,{variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"}),className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:!N&&o(M,{children:Array.isArray(r?.timeoffs)&&r?.timeoffs?.length>0?s(M,{children:[o("p",{className:"text-[#09090B] font-medium mb-4",children:"This list is for your information only."}),s("p",{className:"text-xs text-[#09090B] mb-1 flex items-center justify-between gap-2",children:[s("span",{children:["Annual entitlement for ",n]}),o("span",{className:"font-bold",children:t})]}),s("p",{className:"text-xs text-[#09090B] mb-6 flex items-center justify-between gap-2",children:[s("span",{children:["Entitlement up to ",d]}),o("span",{className:"font-bold",children:m})]}),o("div",{className:"mb-2",children:o(H,{data:r?.timeoffs,columns:X})}),s("p",{className:"text-xs",children:["Total of"," ",D({number:r?.bookedDays,singular:"day",plural:"days",followCopyGuidelines:!1,showNumber:!0})," ","booked"]})]}):s(M,{children:[o("p",{className:"font-medium mb-1 text-[#09090B]",children:"No recorded time off"}),s("p",{className:"text-sm text-[#09090B]",children:["According to our records, ",e," has not taken any time off this year."]})]})})})},"DrawerTimeOff"),Ne=p(({employeeName:e,proposedTerminationDate:a,summaryData:t,formattedProposedTerminationDate:n,timeoffQuery:m,employment:d,onOpenChange:i,open:f})=>{let{entitledDays:r,bookedDays:N,usedDays:O,approvedDaysBeforeTermination:U,approvedDaysAfterTermination:$,remainingDays:Q,currentEntitlementDays:P,isUnlimitedPto:G}=t.data;return s("div",{className:"RemoteFlows__PaidTimeOff__Container py-3",children:[o("h3",{className:"RemoteFlows__PaidTimeOff__Title mb-2",children:"Paid time off"}),s("p",{className:"RemoteFlows__PaidTimeOff__Description text-sm mb-2",children:["The proposed termination date for ",e," is"," ",n,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),s("div",{className:"mb-2",children:[!t?.isLoading&&!t?.isError&&t?.data&&o(W,{usedDays:O,bookedDays:N,currentEntitlementDays:P,approvedDaysBeforeTermination:U,approvedDaysAfterTermination:$,remainingDays:Q,proposedTerminationDate:a,isUnlimitedPto:G}),o(Z,{employeeName:e,timeoffQuery:m,entitledDays:r,currentEntitlementDays:P,countryName:d?.country?.name??"Unknown",onOpenChange:i,formattedProposedTerminationDate:n,open:f})]})]})},"PaidTimeOff");export{Ne as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HMUIT2NU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-GTWY3JK3.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-DYXTJBSK.js";import{a as f}from"./chunk-ZF6MZYBK.js";import{a as n}from"./chunk-PEOWIEYM.js";import{a as p}from"./chunk-KVAGMBSU.js";import{a as s}from"./chunk-YP7Q47E2.js";import{a as m}from"./chunk-EVSDVI2G.js";import{a}from"./chunk-5ORIDYIK.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-LJYCBMDS.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HTJZUAVS.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as j}from"./chunk-AP56UUME.js";import{a as x}from"./chunk-R2MHAPWD.js";import{c as P}from"./chunk-3UDG4IJO.js";import{B as F,G as q,H as _,e as S,k as g,l as h}from"./chunk-2CDCTUVY.js";import{b as D}from"./chunk-Z5WMKCRJ.js";import{d as s}from"./chunk-XFJPUKYR.js";import{a as C}from"./chunk-PAQW5BFW.js";import{b as O}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as f,modify as M}from"@remoteoss/json-schema-form";import{useMutation as b,useQuery as y}from"@tanstack/react-query";var H=e(({fieldValues:n,options:o})=>y({queryKey:["contract-document-signature"],queryFn:e(async()=>f(x,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),z=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>q({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),A=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return y({queryKey:["contract-document",n,o],queryFn:e(async()=>h({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:u})=>u?.data,"select")})},"useGetShowContractDocument"),V=e(({employmentId:n,options:o})=>{let{client:t}=s();return y({queryKey:["contractor-subscriptions",n],queryFn:e(async()=>g({client:t,path:{employment_id:n}}),"queryFn"),enabled:o?.queryOptions?.enabled,select:e(({data:r})=>r?.data,"select")})},"useGetContractorSubscriptions"),E=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,payload:t})=>_({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"usePostManageContractorSubscriptions"),N=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,payload:t})=>F({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),U=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:u}=s();return y({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>S({client:u,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:m})=>{let i=m?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=M(i,t.jsfModify);i=c}let a=D(i.properties||{},"money").reduce((c,p)=>(c[p]=C(o[p]),c),{}),d={...o,...a};return{meta:{"x-jsf-fieldsets":i["x-jsf-fieldsets"]},...f(i,{initialValues:d})}},"select")})},"useContractorOnboardingDetailsSchema"),W=e((n,o)=>{let{data:t,isLoading:r}=V({employmentId:n,options:{queryOptions:o?.queryOptions}}),{schema:u}=M(j.data.schema,o?.jsfModify||{}),m=f(u);if(t){let i=m.fields.find(l=>l.name==="subscription");if(i){let l=t.filter(a=>a.product.identifier!==P).map(a=>{let d="";a.price.amount&&(d=O(a.price.amount,a.currency.symbol));let c=`${a.product.name} - ${d}`,p=a.product.identifier;return{label:c,value:p}});i.options=l}}return{isLoading:r,form:m}},"useContractorSubscriptionSchemaField");export{H as a,z as b,A as c,V as d,E as e,N as f,U as g,W as h};
|
|
2
|
+
//# sourceMappingURL=chunk-HX34JCPL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/ContractorOnboarding/api.ts"],"sourcesContent":["import {\n CreateContractDocument,\n getShowContractDocument,\n getShowContractorContractDetailsCountry,\n getIndexSubscription,\n ManageContractorPlusSubscriptionOperationsParams,\n postCreateContractDocument,\n postManageContractorPlusSubscriptionSubscription,\n postSignContractDocument,\n SignContractDocument,\n} from '@/src/client';\nimport { convertToCents } from '@/src/components/form/utils';\nimport { useClient } from '@/src/context';\nimport { signatureSchema } from '@/src/flows/ContractorOnboarding/json-schemas/signature';\nimport { selectContractorSubscriptionStepSchema } from '@/src/flows/ContractorOnboarding/json-schemas/selectContractorSubscriptionStep';\nimport { FlowOptions } from '@/src/flows/types';\nimport { findFieldsByType } from '@/src/flows/utils';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { JSFFieldset } from '@/src/types/remoteFlows';\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { FieldValues } from 'react-hook-form';\nimport { corProductIdentifier } from '@/src/flows/ContractorOnboarding/constants';\n\n/**\n * Get the contract document signature schema\n * @param fieldValues - The field values\n * @param options - The options\n * @returns The contract document signature schema\n */\nexport const useGetContractDocumentSignatureSchema = ({\n fieldValues,\n options,\n}: {\n fieldValues: FieldValues;\n options?: { queryOptions?: { enabled?: boolean } };\n}) => {\n return useQuery({\n queryKey: ['contract-document-signature'],\n queryFn: async () => {\n return createHeadlessForm(signatureSchema, {\n initialValues: fieldValues,\n });\n },\n enabled: options?.queryOptions?.enabled,\n });\n};\n\n/**\n * Signs the contract document\n * @param employmentId - The employment ID\n * @param contractDocumentId - The contract document ID\n * @param payload - The payload\n * @returns The signed contract document\n */\nexport const useSignContractDocument = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: async ({\n employmentId,\n contractDocumentId,\n payload,\n }: {\n employmentId: string;\n contractDocumentId: string;\n payload: SignContractDocument;\n }) => {\n return postSignContractDocument({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n contract_document_id: contractDocumentId,\n },\n });\n },\n });\n};\n\n/**\n * Get the contract document for a given employment and contract document ID\n * @param employmentId - The employment ID\n * @param contractDocumentId - The contract document ID\n * @returns The contract document\n */\nexport const useGetShowContractDocument = ({\n employmentId,\n contractDocumentId,\n options,\n}: {\n employmentId: string;\n contractDocumentId: string;\n options?: { queryOptions?: { enabled?: boolean } };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['contract-document', employmentId, contractDocumentId],\n queryFn: async () => {\n return getShowContractDocument({\n client: client as Client,\n path: { employment_id: employmentId, id: contractDocumentId },\n });\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n return data?.data;\n },\n });\n};\n\n/**\n * Get the contractor subscriptions for the given employment id\n * @param employmentId - The employment ID\n * @returns The contractor subscriptions available\n */\nexport const useGetContractorSubscriptions = ({\n employmentId,\n options,\n}: {\n employmentId: string;\n options?: { queryOptions?: { enabled?: boolean } };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['contractor-subscriptions', employmentId],\n queryFn: async () => {\n return getIndexSubscription({\n client: client as Client,\n path: { employment_id: employmentId },\n });\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n return data?.data;\n },\n });\n};\n\n/**\n * Upgrade or downgrade contractor subscription\n */\nexport const usePostManageContractorSubscriptions = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: async ({\n employmentId,\n payload,\n }: {\n employmentId: string;\n payload: ManageContractorPlusSubscriptionOperationsParams;\n }) => {\n return postManageContractorPlusSubscriptionSubscription({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n });\n },\n });\n};\n\n/**\n * Saves the contractor details data\n * @param employmentId - The employment ID\n * @param payload - The payload\n * @returns The contractor contract document\n */\nexport const useCreateContractorContractDocument = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: async ({\n employmentId,\n payload,\n }: {\n employmentId: string;\n payload: CreateContractDocument;\n }) => {\n return postCreateContractDocument({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n });\n },\n });\n};\n\n/**\n * Get the contractor onboarding details schema for a given country\n * @param countryCode - The country code\n * @param fieldValues - The field values\n * @param options - The options\n * @returns The contractor onboarding details schema\n */\nexport const useContractorOnboardingDetailsSchema = ({\n countryCode,\n fieldValues,\n options,\n}: {\n countryCode: string;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n}) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.contractor_contract_details_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.contractor_contract_details_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['contractor-onboarding-details-schema', countryCode],\n retry: false,\n queryFn: async () => {\n return getShowContractorContractDetailsCountry({\n client: client as Client,\n path: { country_code: countryCode },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n let jsfSchema = data?.data?.schema || {};\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n\n // Contract details contains x-jsf-logic that need to be calculated every time a form value changes\n // In particular there are calculations involving the annual_gross_salary field. However this field value doesn't get\n // here in cents. So we need to convert the money fields to cents, so that the calculations are correct.\n const moneyFields = findFieldsByType(jsfSchema.properties || {}, 'money');\n const moneyFieldsData = moneyFields.reduce<Record<string, number | null>>(\n (acc, field) => {\n acc[field] = convertToCents(fieldValues[field]);\n return acc;\n },\n {},\n );\n\n const initialValues = {\n ...fieldValues,\n ...moneyFieldsData,\n };\n\n return {\n meta: {\n 'x-jsf-fieldsets': jsfSchema['x-jsf-fieldsets'] as JSFFieldset,\n },\n ...createHeadlessForm(jsfSchema, {\n initialValues,\n }),\n };\n },\n });\n};\n\nexport const useContractorSubscriptionSchemaField = (\n employmentId: string,\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } },\n) => {\n const { data: contractorSubscriptions, isLoading: isLoading } =\n useGetContractorSubscriptions({\n employmentId: employmentId,\n options: {\n queryOptions: options?.queryOptions,\n },\n });\n\n const { schema: selectContractorSubscriptionSchema } = modify(\n selectContractorSubscriptionStepSchema.data.schema,\n options?.jsfModify || {},\n );\n\n const form = createHeadlessForm(selectContractorSubscriptionSchema);\n\n if (contractorSubscriptions) {\n const field = form.fields.find((field) => field.name === 'subscription');\n if (field) {\n const options = contractorSubscriptions\n .filter((opts) => opts.product.identifier !== corProductIdentifier)\n .map((opts) => {\n let formattedPrice = '';\n if (opts.price.amount) {\n formattedPrice = formatCurrency(\n opts.price.amount,\n opts.currency.symbol,\n );\n }\n const label = `${opts.product.name} - ${formattedPrice}`;\n const value = opts.product.identifier;\n return { label, value };\n });\n field.options = options;\n }\n }\n\n return {\n isLoading,\n form,\n };\n};\n"],"mappings":"2YAoBA,OAAS,sBAAAA,EAAoB,UAAAC,MAAc,8BAC3C,OAAS,eAAAC,EAAa,YAAAC,MAAgB,wBAU/B,IAAMC,EAAwCC,EAAA,CAAC,CACpD,YAAAC,EACA,QAAAC,CACF,IAISC,EAAS,CACd,SAAU,CAAC,6BAA6B,EACxC,QAASH,EAAA,SACAI,EAAmBC,EAAiB,CACzC,cAAeJ,CACjB,CAAC,EAHM,WAKT,QAASC,GAAS,cAAc,OAClC,CAAC,EAfkD,yCAyBxCI,EAA0BN,EAAA,IAAM,CAC3C,GAAM,CAAE,OAAAO,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAY,CACjB,WAAYT,EAAA,MAAO,CACjB,aAAAU,EACA,mBAAAC,EACA,QAAAC,CACF,IAKSC,EAAyB,CAC9B,OAAQN,EACR,KAAMK,EACN,KAAM,CACJ,cAAeF,EACf,qBAAsBC,CACxB,CACF,CAAC,EAhBS,aAkBd,CAAC,CACH,EAtBuC,2BA8B1BG,EAA6Bd,EAAA,CAAC,CACzC,aAAAU,EACA,mBAAAC,EACA,QAAAT,CACF,IAIM,CACJ,GAAM,CAAE,OAAAK,CAAO,EAAIC,EAAU,EAC7B,OAAOL,EAAS,CACd,SAAU,CAAC,oBAAqBO,EAAcC,CAAkB,EAChE,QAASX,EAAA,SACAe,EAAwB,CAC7B,OAAQR,EACR,KAAM,CAAE,cAAeG,EAAc,GAAIC,CAAmB,CAC9D,CAAC,EAJM,WAMT,QAAST,GAAS,cAAc,QAChC,OAAQF,EAAA,CAAC,CAAE,KAAAgB,CAAK,IACPA,GAAM,KADP,SAGV,CAAC,CACH,EAvB0C,8BA8B7BC,EAAgCjB,EAAA,CAAC,CAC5C,aAAAU,EACA,QAAAR,CACF,IAGM,CACJ,GAAM,CAAE,OAAAK,CAAO,EAAIC,EAAU,EAC7B,OAAOL,EAAS,CACd,SAAU,CAAC,2BAA4BO,CAAY,EACnD,QAASV,EAAA,SACAkB,EAAqB,CAC1B,OAAQX,EACR,KAAM,CAAE,cAAeG,CAAa,CACtC,CAAC,EAJM,WAMT,QAASR,GAAS,cAAc,QAChC,OAAQF,EAAA,CAAC,CAAE,KAAAgB,CAAK,IACPA,GAAM,KADP,SAGV,CAAC,CACH,EArB6C,iCA0BhCG,EAAuCnB,EAAA,IAAM,CACxD,GAAM,CAAE,OAAAO,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAY,CACjB,WAAYT,EAAA,MAAO,CACjB,aAAAU,EACA,QAAAE,CACF,IAISQ,EAAiD,CACtD,OAAQb,EACR,KAAMK,EACN,KAAM,CACJ,cAAeF,CACjB,CACF,CAAC,EAbS,aAed,CAAC,CACH,EAnBoD,wCA2BvCW,EAAsCrB,EAAA,IAAM,CACvD,GAAM,CAAE,OAAAO,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAY,CACjB,WAAYT,EAAA,MAAO,CACjB,aAAAU,EACA,QAAAE,CACF,IAISU,EAA2B,CAChC,OAAQf,EACR,KAAMK,EACN,KAAM,CACJ,cAAeF,CACjB,CACF,CAAC,EAbS,aAed,CAAC,CACH,EAnBmD,uCA4BtCa,EAAuCvB,EAAA,CAAC,CACnD,YAAAwB,EACA,YAAAvB,EACA,QAAAC,CACF,IAKM,CACJ,IAAMuB,EAAuBvB,GAAS,mBAClC,wCACA,CACE,oBACEA,EAAQ,kBAAkB,uCAC9B,EACA,CAAC,EACC,CAAE,OAAAK,CAAO,EAAIC,EAAU,EAC7B,OAAOL,EAAS,CACd,SAAU,CAAC,uCAAwCqB,CAAW,EAC9D,MAAO,GACP,QAASxB,EAAA,SACA0B,EAAwC,CAC7C,OAAQnB,EACR,KAAM,CAAE,aAAciB,CAAY,EAClC,MAAO,CACL,GAAGC,CACL,CACF,CAAC,EAPM,WAST,QAASvB,GAAS,cAAc,QAChC,OAAQF,EAAA,CAAC,CAAE,KAAAgB,CAAK,IAAM,CACpB,IAAIW,EAAYX,GAAM,MAAM,QAAU,CAAC,EACvC,GAAId,GAAWA,EAAQ,UAAW,CAChC,GAAM,CAAE,OAAA0B,CAAO,EAAIC,EAAOF,EAAWzB,EAAQ,SAAS,EACtDyB,EAAYC,CACd,CAMA,IAAME,EADcC,EAAiBJ,EAAU,YAAc,CAAC,EAAG,OAAO,EACpC,OAClC,CAACK,EAAKC,KACJD,EAAIC,CAAK,EAAIC,EAAejC,EAAYgC,CAAK,CAAC,EACvCD,GAET,CAAC,CACH,EAEMG,EAAgB,CACpB,GAAGlC,EACH,GAAG6B,CACL,EAEA,MAAO,CACL,KAAM,CACJ,kBAAmBH,EAAU,iBAAiB,CAChD,EACA,GAAGvB,EAAmBuB,EAAW,CAC/B,cAAAQ,CACF,CAAC,CACH,CACF,EAhCQ,SAiCV,CAAC,CACH,EAjEoD,wCAmEvCC,EAAuCpC,EAAA,CAClDU,EACAR,IACG,CACH,GAAM,CAAE,KAAMmC,EAAyB,UAAWC,CAAU,EAC1DrB,EAA8B,CAC5B,aAAcP,EACd,QAAS,CACP,aAAcR,GAAS,YACzB,CACF,CAAC,EAEG,CAAE,OAAQqC,CAAmC,EAAIV,EACrDW,EAAuC,KAAK,OAC5CtC,GAAS,WAAa,CAAC,CACzB,EAEMuC,EAAOrC,EAAmBmC,CAAkC,EAElE,GAAIF,EAAyB,CAC3B,IAAMJ,EAAQQ,EAAK,OAAO,KAAMR,GAAUA,EAAM,OAAS,cAAc,EACvE,GAAIA,EAAO,CACT,IAAM/B,EAAUmC,EACb,OAAQK,GAASA,EAAK,QAAQ,aAAeC,CAAoB,EACjE,IAAKD,GAAS,CACb,IAAIE,EAAiB,GACjBF,EAAK,MAAM,SACbE,EAAiBC,EACfH,EAAK,MAAM,OACXA,EAAK,SAAS,MAChB,GAEF,IAAMI,EAAQ,GAAGJ,EAAK,QAAQ,IAAI,MAAME,CAAc,GAChDG,EAAQL,EAAK,QAAQ,WAC3B,MAAO,CAAE,MAAAI,EAAO,MAAAC,CAAM,CACxB,CAAC,EACHd,EAAM,QAAU/B,CAClB,CACF,CAEA,MAAO,CACL,UAAAoC,EACA,KAAAG,CACF,CACF,EA5CoD","names":["createHeadlessForm","modify","useMutation","useQuery","useGetContractDocumentSignatureSchema","__name","fieldValues","options","useQuery","createHeadlessForm","signatureSchema","useSignContractDocument","client","useClient","useMutation","employmentId","contractDocumentId","payload","postSignContractDocument","useGetShowContractDocument","getShowContractDocument","data","useGetContractorSubscriptions","getIndexSubscription","usePostManageContractorSubscriptions","postManageContractorPlusSubscriptionSubscription","useCreateContractorContractDocument","postCreateContractDocument","useContractorOnboardingDetailsSchema","countryCode","jsonSchemaQueryParam","getShowContractorContractDetailsCountry","jsfSchema","schema","modify","moneyFieldsData","findFieldsByType","acc","field","convertToCents","initialValues","useContractorSubscriptionSchemaField","contractorSubscriptions","isLoading","selectContractorSubscriptionSchema","selectContractorSubscriptionStepSchema","form","opts","corProductIdentifier","formattedPrice","formatCurrency","label","value"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as l}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as l}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-XFJPUKYR.js";import{a as c}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function R({children:e,...t}){let{form:r,formId:n,costCalculatorBag:s}=l(),{components:f}=i(),m=f?.button;return m?a(m,{...t,type:"reset",form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e}):a(C,{...t,type:"reset",className:c("RemoteFlows__CostCalculatorForm__ResetButton",t.className),form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e})}u(R,"CostCalculatorResetButton");export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HYOJP6J5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-7TX2YY4K.js";import{b as e}from"./chunk-TOA3JILU.js";import{b as t}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{contractorOnboardingBag:o}=e(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let f=t(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:f})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),c=o.stepState.values?.basic_information||o.initialValues.basic_information;return p(s,{defaultValues:c,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JK5K2S7N.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-TOA3JILU.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-TOA3JILU.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-XFJPUKYR.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({children:o,onClick:a,...n}){let{contractorOnboardingBag:{back:m,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||m(),a?.(p)},"onBackHandler"),e=d?.button;return e?c(e,{...n,onClick:r,children:o}):c(u,{...n,onClick:r,children:o})}t(C,"OnboardingBack");export{C as a};
|
|
2
|
+
//# sourceMappingURL=chunk-K2L2NSOM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-LLM6MDNY.js";import{a}from"./chunk-6GQZCUUR.js";import{a as r}from"./chunk-HBRO74FQ.js";import{a as t}from"./chunk-HJYHCWGX.js";import{a as f}from"./chunk-D7WCSZGW.js";import{a as e}from"./chunk-ZF4BLPXL.js";import{a as p}from"./chunk-EL5QIDYZ.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as F}from"react/jsx-runtime";var k=i(({employmentId:l,render:T,options:d,initialValues:s})=>{let u=c(),o=t({employmentId:l,options:d,initialValues:s});return F(m.Provider,{value:{formId:u,terminationBag:o},children:T({terminationBag:o,components:{SubmitButton:r,Back:n,EmployeeComunicationStep:e,TerminationDetailsStep:a,PaidTimeOffStep:p,AdditionalDetailsStep:f}})})},"TerminationFlow");export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KFJJXMAH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-XLAKJHGV.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{b as t}from"./chunk-2YTBWEC7.js";import{d as s}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=s(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=t(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KVAGMBSU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Le}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as Le}from"./chunk-PEHALKVU.js";import{a as ke}from"./chunk-VAIBLWOY.js";import{a as Ce,b as Oe,c as Pe,d as Me,e as Te}from"./chunk-EHS4ERDW.js";import{a as ue,b as ye,c as pe,f as _e,g as Se,h as be,i as ge,j as Fe,k as Ee,m as he}from"./chunk-7RFJWDXS.js";import{a as R}from"./chunk-2YTBWEC7.js";import{a as Ve}from"./chunk-PJBAQZ6G.js";import{c as h,d as L,f as W}from"./chunk-PAQW5BFW.js";import{g as V}from"./chunk-43WMZDDH.js";import{a as l}from"./chunk-P37U34EQ.js";import{useEffect as st,useMemo as d,useRef as at,useState as we}from"react";import rt from"lodash.mergewith";import{jsx as Be}from"react/jsx-runtime";var ct={employment_basic_information:"basic_information",contract_details:"contract_details"},lt={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},mt=l(({isLoadingBasicInformationForm:f,isLoadingContractDetailsForm:J,isLoadingEmployment:D,isLoadingBenefitsOffersSchema:I,isLoadingBenefitOffers:i,isLoadingCompany:N,isLoadingCountries:C,employmentStatus:s,employmentId:_,currentStepName:a,basicInformationFields:A,contractDetailsFields:r})=>{let O=f||J||D||I||i||N||C,c=s&&Pe.includes(s),k=s&&!Me.includes(s),w=!!(_&&c&&a!=="review"),B=O||w,j=!!(w&&!O&&A.length>0&&r.length>0);return{isLoading:B,isNavigatingToReview:j,isEmploymentReadOnly:c,canInvite:k}},"getLoadingStates"),ht=l(({employmentId:f,companyId:J,countryCode:D,type:I,options:i,skipSteps:N,externalId:C,initialValues:s})=>{let _=at({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[a,A]=we(f),[r,O]=we(D||null),{data:c,isLoading:k,refetch:w}=ue(a);f&&c?.country?.code&&!r&&O(c.country.code);let{data:B,isLoading:j}=pe(a),{data:q,isLoading:G,refetch:je}=ye(J),qe=N?.includes("select_country")?Oe:Ce,{fieldValues:S,stepState:n,setFieldValues:ve,previousStep:Re,nextStep:Je,goToStep:U,setStepValues:$}=Ve(qe),{selectCountryForm:v,isLoading:z}=Ee({jsfModify:i?.jsfModify?.select_country,queryOptions:{enabled:n.currentStep.name==="select_country"}}),K=be(i),Y=ge(i),Q=Fe(i),De=he(),{mutateAsync:Ie}=R(K),{mutateAsync:X}=R(Y),{mutateAsync:Ne}=R(Q),Ae=lt[n.currentStep.name]||"employment_basic_information",Ue=ct[Ae],xe=c?.[Ue]||{},Z=l(({form:e,options:o={},query:m={}})=>{let H=Object.keys(S).length>0?{...s,...n.values?.[n.currentStep.name],...S}:{...s,...xe};return _e({countryCode:r,form:e,fieldValues:H,query:m,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0},jsonSchemaVersion:o.jsonSchemaVersion}})},"useJSONSchema"),He=!!(r&&(n.currentStep.name==="basic_information"||f)),We=!!(r&&(n.currentStep.name==="contract_details"||f)),{data:u,isLoading:ee}=Z({form:"employment_basic_information",options:{jsfModify:i?.jsfModify?.basic_information,jsonSchemaVersion:i?.jsonSchemaVersion,queryOptions:{enabled:He}}}),b=i?.jsfModify?.contract_details?.fields?.annual_gross_salary,x=b&&typeof b=="object"&&"presentation"in b?b.presentation:void 0,te=i?.jsfModify?.contract_details?.fields?.equity_compensation,Ge=d(()=>({fields:{annual_gross_salary:{...b,presentation:{annual_gross_salary_conversion_properties:{label:x?.annual_gross_salary_conversion_properties?.label,description:x?.annual_gross_salary_conversion_properties?.description},desiredCurrency:q?.desired_currency,Component:l(e=>Be(Le,{desiredCurrency:q?.desired_currency||"",...e}),"Component")}},equity_compensation:{...te,presentation:{calculateDynamicProperties:l((e,o)=>{let m=e.equity_compensation?.offer_equity_compensation,M=o?.meta?.cost;return{extra:Be(ke,{offerEquity:m,equityCost:M})}},"calculateDynamicProperties")}}}}),[b,x,q?.desired_currency,te]),$e=Te(r,i?.jsonSchemaVersion),{data:y,isLoading:ne}=Z({form:"contract_details",query:{employment_id:a},options:{jsfModify:{...i?.jsfModify?.contract_details,fields:{...i?.jsfModify?.contract_details?.fields,...Ge.fields}},queryOptions:{enabled:We},jsonSchemaVersion:$e}}),{data:P,isLoading:oe}=Se(a,S,i),ie=d(()=>{if(n.currentStep.name==="benefits"){let e={...n.values?.[n.currentStep.name],...S};return rt({},B,e)}return{}},[n.currentStep.name,B,n.values,S]),t=d(()=>({select_country:v?.fields||[],basic_information:u?.fields||[],contract_details:y?.fields||[],benefits:P?.fields||[],review:[]}),[v?.fields,u?.fields,y?.fields,P?.fields]),ze={select_country:null,basic_information:u?.meta["x-jsf-fieldsets"],contract_details:y?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:Ke,basic_information:se={},contract_details:ae={},status:re}=c||{},ce=Ke?.code,le=n.currentStep.name,g=d(()=>L(t.select_country,{country:r||ce||""}),[t.select_country,r,ce]),F=d(()=>{let e={...s,...se};return L(t.basic_information,e)},[t.basic_information,se,s]),p=d(()=>{let e={...s,...ae};return L(t.contract_details,e)},[t.contract_details,ae,s]),E=d(()=>{let e={...s,...ie};return L(t.benefits,e)},[t.benefits,ie,s]),Ye=d(()=>c?{select_country:g,basic_information:W(t.basic_information,F),contract_details:c?.contract_details!==null?W(t.contract_details,p):p,benefits:E}:{select_country:g,basic_information:F,contract_details:p,benefits:E},[g,F,p,E,c,t]),{isLoading:Qe,isNavigatingToReview:me,isEmploymentReadOnly:Xe,canInvite:Ze}=d(()=>mt({isLoadingBasicInformationForm:ee,isLoadingContractDetailsForm:ne,isLoadingEmployment:k,isLoadingBenefitsOffersSchema:oe,isLoadingBenefitOffers:j,isLoadingCompany:G,isLoadingCountries:z,employmentId:f,employmentStatus:re,basicInformationFields:t.basic_information,contractDetailsFields:t.contract_details,currentStepName:le}),[ee,ne,k,oe,j,G,z,f,re,t.basic_information,t.contract_details,le]);st(()=>{me&&(_.current={select_country:V(g,t.select_country),basic_information:V(F,t.basic_information),contract_details:V(p,t.contract_details),benefits:V(E,t.benefits)},$({select_country:g,basic_information:F,contract_details:p,benefits:E,review:{}}),U("review"))},[F,E,p,U,me,g,$,t.basic_information,t.benefits,t.contract_details,t.select_country]);let de=l(e=>v&&n.currentStep.name==="select_country"?e:u&&n.currentStep.name==="basic_information"?h(e,u?.fields,{isPartialValidation:!1}):y&&n.currentStep.name==="contract_details"?h(e,y?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function et(e){let o=n.currentStep.name;o in _.current&&(_.current[o]=V(e,t[o]));let m=de(e);switch(je(),n.currentStep.name){case"select_country":return O(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let M=!a&&r,H=a&&r&&c?.country&&c?.country.code!==r;if(M||H){let it={basic_information:m,type:I,country_code:r,external_id:C};try{let T=await Ie(it),fe=T.data?.data?.employment?.id;return A(fe),await De.mutateAsync({employmentId:fe,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1}),T}catch(T){throw console.error("Error creating onboarding:",T),T}}else if(a)return X({employmentId:a,basic_information:m,pricing_plan_details:{frequency:"monthly"},external_id:C});return}case"contract_details":return X({employmentId:a,external_id:C,...{contract_details:m,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Ne({employmentId:a,...e})}}l(et,"onSubmit");function tt(){Re()}l(tt,"back");function nt(){Je()}l(nt,"next");function ot(e){U(e)}return l(ot,"goTo"),{employmentId:a,creditRiskStatus:q?.default_legal_entity_credit_risk_status,fieldValues:S,stepState:n,fields:t[n.currentStep.name],isLoading:Qe,isSubmitting:K.isPending||Y.isPending||Q.isPending,initialValues:Ye,handleValidation:l(e=>{if(n.currentStep.name==="select_country")return v.handleValidation(e);if(n.currentStep.name==="benefits"&&P){let o=h(e,P?.fields,{isPartialValidation:!1});return P?.handleValidation(o)}if(u&&n.currentStep.name==="basic_information"){let o=h(e,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}if(y&&n.currentStep.name==="contract_details"){let o=h(e,y?.fields,{isPartialValidation:!1});return y?.handleValidation(o)}return null},"handleValidation"),checkFieldUpdates:ve,parseFormValues:de,onSubmit:et,back:tt,next:nt,goTo:ot,meta:{fields:_.current,fieldsets:ze[n.currentStep.name]},refetchEmployment:w,employment:c,isEmploymentReadOnly:Xe,canInvite:Ze}},"useOnboarding");export{ht as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LJYCBMDS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-MRYRNB7Y.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-MRYRNB7Y.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as e}from"./chunk-XFJPUKYR.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function f({children:n,...t}){let{terminationBag:{back:i}}=c(),{components:B}=e(),r=B?.button;return r?s(r,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n}):s(m,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n})}u(f,"TerminationBack");export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LLM6MDNY.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e}from"./chunk-TOA3JILU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as e}from"./chunk-TOA3JILU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as m}from"./chunk-XFJPUKYR.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({children:t,...o}){let{formId:n}=e(),{components:f}=m(),r=f?.button;return r?s(r,{...o,form:n,children:t}):s(i,{...o,form:n,children:t})}u(p,"OnboardingSubmit");export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OHAAAVNB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-ZSCKSEAA.js";import{a as l}from"./chunk-ZE3YT3Q6.js";import{b as i}from"./chunk-UOOM7V2D.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as d,jsx as e,jsxs as s}from"react/jsx-runtime";function B({contributionsTotal:u,currency:n,contributionsBreakdown:r}){return s("div",{children:[s("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:a(u,n)})]}),r?s(d,{children:[e(p,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:r.map((t,c)=>s("div",{className:"flex justify-between items-start text-sm",children:[s("div",{className:"flex items-start gap-2",children:[e("span",{children:t.name}),t.description&&e(l,{content:s(d,{children:[e("span",{children:t.description})," ",t.zendesk_article_url&&e(i,{zendeskId:Number(t.zendesk_article_id),children:"Learn more"})]}),children:s(m,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(f,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(t.amount,n)})]},c))})]}):null]})}o(B,"CostCalculatorContributionsBreakdown");export{B as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OIIALEVF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-RR55GUDT.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OKM7DRCF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-FDBUFHR3.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PEHALKVU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-XLAKJHGV.js";import{b as t}from"./chunk-PGWKJ6FK.js";import{b as e}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{onboardingBag:o}=t(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let p=e(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),f=o.stepState.values?.basic_information||o.initialValues.basic_information;return c(s,{defaultValues:f,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PEOWIEYM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,b as x,c as N,d as A}from"./chunk-DTHBG6BD.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as C}from"./chunk-AFRA4BIW.js";import{a as w,b as f}from"./chunk-CDRDLO4A.js";import{b as B}from"./chunk-WVDTHFGS.js";import{a as i,b as n,e as F}from"./chunk-43WMZDDH.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:l,"data-testid":a}){let[_,m]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":a,variant:"ghost","aria-label":l,className:"h-8 w-8 p-0",onClick:()=>m(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${a}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),m(!1)},disabled:c.disabled,children:c.label},u))})]})]})}d(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=d(({title:e,country:r,region:l,annualGrossSalary:a,onDelete:_,onExportPdf:m,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:m},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",l?` (${l.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",a]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=d(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",l),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(a=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:a.title})," ","- ",a.description]},a.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(f,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}d(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:l,country:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",a.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[l&&o("a",{href:l,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d(J,"EstimationHeaders");function I({label:e,amounts:r,className:l,children:a}){let[_,m]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",l),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>m(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&a&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:a})]})}d(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:l=0}){let[a,_]=O(!1),m=e.children&&e.children.length>0,c=l>0,u=e.isCollapsible||m;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!a),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${a?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),m&&a&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:l+1})})]})}d(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:l,level:a}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",l),children:e.map((_,m)=>o(Q,{item:_,isMultipleCurrency:r,level:a},m))})}d(k,"BreakdownList");var pe=d(({estimation:e,title:r,components:l,onDelete:a,onExportPdf:_,onEdit:m})=>{let c=l?.HiringSection||q,u=l?.OnboardingTimeline||Y,z=l?.Header||K,h=l?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:a,onExportPdf:_,onEdit:m})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as x,c as N,d as A}from"./chunk-DTHBG6BD.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as C}from"./chunk-AFRA4BIW.js";import{a as w,b as f}from"./chunk-UOOM7V2D.js";import{b as B}from"./chunk-WVDTHFGS.js";import{a as i,b as n,e as F}from"./chunk-43WMZDDH.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:l,"data-testid":a}){let[_,m]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":a,variant:"ghost","aria-label":l,className:"h-8 w-8 p-0",onClick:()=>m(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${a}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),m(!1)},disabled:c.disabled,children:c.label},u))})]})]})}d(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=d(({title:e,country:r,region:l,annualGrossSalary:a,onDelete:_,onExportPdf:m,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:m},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",l?` (${l.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",a]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=d(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",l),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(a=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:a.title})," ","- ",a.description]},a.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(f,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}d(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:l,country:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",a.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[l&&o("a",{href:l,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d(J,"EstimationHeaders");function I({label:e,amounts:r,className:l,children:a}){let[_,m]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",l),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>m(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&a&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:a})]})}d(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:l=0}){let[a,_]=O(!1),m=e.children&&e.children.length>0,c=l>0,u=e.isCollapsible||m;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!a),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${a?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),m&&a&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:l+1})})]})}d(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:l,level:a}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",l),children:e.map((_,m)=>o(Q,{item:_,isMultipleCurrency:r,level:a},m))})}d(k,"BreakdownList");var pe=d(({estimation:e,title:r,components:l,onDelete:a,onExportPdf:_,onEdit:m})=>{let c=l?.HiringSection||q,u=l?.OnboardingTimeline||Y,z=l?.Header||K,h=l?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:a,onExportPdf:_,onEdit:m})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PFKNQGOD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-D64MAPTD.js";import{b as p}from"./chunk-2YTBWEC7.js";import{g as C}from"./chunk-CNDSIADP.js";import{g as E}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=f(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=p(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QAOGIYQL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as A}from"./chunk-RYXRWMF4.js";import{a as ve,b as Ge,c as Je,d as qe,e as je,f as Ke,g as Ye,h as Ze,i as Xe,j as xe,k as et,l as be,m as Se,o as ke,q as tt,r as ot,s as rt}from"./chunk-D6X2WCEG.js";import{b as Qe}from"./chunk-HPHWQU34.js";import{b as ye}from"./chunk-UOOM7V2D.js";import{a as Ce,b as I}from"./chunk-WVDTHFGS.js";import{b as S}from"./chunk-XFJPUKYR.js";import{a as ne,b as ae,c as b,d as Ae,e as Oe,f as ze,g as Ue,h as k,i as w,j as N,k as R,l as P,m as D}from"./chunk-CNDSIADP.js";import{g as Ve}from"./chunk-PAQW5BFW.js";import{a as y,e as oe}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Do,useEffect as To,useRef as Lt}from"react";import{Fragment as Ot,jsx as O,jsxs as se}from"react/jsx-runtime";function ie({name:e,defaultValue:t,description:o,label:n,onChange:s,multiple:m,options:d,component:f,...g}){let{components:p}=S(),{control:i}=b(),u=r((a,l,F)=>{let c=F.value?[...F.value]:[];l?c.includes(a)||F.onChange([...c,a]):F.onChange(c.filter(h=>h!==a))},"handleCheckboxChange");return O(k,{control:i,name:e,defaultValue:t,render:({field:a,fieldState:l})=>{let F=f||p?.checkbox;if(F){let c={name:e,description:o,label:n,defaultValue:t,multiple:m,options:d,...g};return O(F,{field:{...a,onChange:r(h=>{if(m){let{checked:x,value:C}=h.target;u(C,x,a),s?.(x);return}a.onChange(h),s?.(h)},"onChange")},fieldState:l,fieldData:c})}return se(w,{"data-field":e,className:y(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(R,{children:se(Ot,{children:[d&&m?O(N,{children:n}):null,d&&m?d.map(c=>se("div",{className:"flex space-x-2",children:[O(ve,{id:c.value,onCheckedChange:h=>{u(c.value,h===!0,a),s?.(h,c.value)},checked:a.value?.includes(c.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:c.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:c.label})]},c.value)):se("div",{className:"flex space-x-2",children:[O(ve,{id:e,onCheckedChange:c=>{a.onChange(c),s?.(c)},checked:a.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:n})]})]})}),o&&O(P,{children:o}),l.error&&O(D,{})]})}})}r(ie,"CheckBoxField");import{CalendarIcon as Gt}from"lucide-react";import{PopoverClose as Jt}from"@radix-ui/react-popover";import{ChevronLeft as zt,ChevronRight as Vt}from"lucide-react";import{DayPicker as Ut}from"react-day-picker";import{jsx as Ne}from"react/jsx-runtime";function nt({className:e,classNames:t,showOutsideDays:o=!0,...n}){return Ne(Ut,{showOutsideDays:o,className:y("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:y(Ce({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(Ce({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:s,...m})=>Ne(zt,{className:y("size-4",s),...m}),"IconLeft"),IconRight:r(({className:s,...m})=>Ne(Vt,{className:y("size-4",s),...m}),"IconRight")},...n})}r(nt,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function me({...e}){return le(z.Root,{"data-slot":"popover",...e})}r(me,"Popover");function ce({...e}){return le(z.Trigger,{"data-slot":"popover-trigger",...e})}r(ce,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:o=4,...n}){return le(z.Portal,{children:le(z.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:y("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}r(de,"PopoverContent");import{format as at}from"date-fns";import{Fragment as qt,jsx as M,jsxs as we}from"react/jsx-runtime";function st({description:e,label:t,name:o,minDate:n,maxDate:s,onChange:m,component:d,...f}){let{components:g}=S(),{control:p}=b(),i;f.meta?.mot&&typeof f.meta.mot=="number"?i=Ve(f.meta.mot):n&&(i=new Date(`${n}T00:00:00`));let u;return s&&(u=new Date(`${s}T23:59:59`)),M(k,{control:p,name:o,render:({field:a,fieldState:l})=>{let F=d||g?.date;if(F){let c={description:e,label:t,name:o,onChange:m,...i&&{minDate:i.toISOString()},...u&&{maxDate:u.toISOString()},...f};return M(F,{field:{...a,onChange:r(h=>{a.onChange(h),m?.(h)},"onChange")},fieldState:l,fieldData:c})}return we(w,{"data-field":o,className:`flex flex-col RemoteFlows__DatePickerField__Item__${o}`,children:[M(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),we(me,{children:[M(ce,{asChild:!0,children:M(R,{children:M("div",{children:we(I,{type:"button",variant:"outline",className:y("w-full pl-3 text-left font-normal",!a.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${o}`,children:[a.value&&M(qt,{children:at(a.value,"yyyy-MM-dd")}),M(Gt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),M(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:M(nt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:a.value?new Date(a.value):void 0,onSelect:c=>{a.onChange(c?at(c,"yyyy-MM-dd"):null),m?.(c)},defaultMonth:i,components:{DayContent:r(c=>M(Jt,{children:c.date.getDate()}),"DayContent")},disabled:c=>!!(i&&c<i||u&&c>u)})})]}),e?M(P,{children:e}):null,l.error&&M(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(st,"DatePickerField");import{useState as jt,useRef as Kt,useEffect as Yt}from"react";import{Upload as Zt,X as Xt}from"lucide-react";import{jsx as V,jsxs as ue}from"react/jsx-runtime";var Qt=r(e=>e?e.split(",").map(t=>t.trim().toUpperCase()).join(", "):null,"getAcceptedFormats");function it({onChange:e,className:t,multiple:o,accept:n,files:s}){let[m,d]=jt(s||[]),f=Kt(null);Yt(()=>{s&&s.length>0&&d(s)},[s]);let g=r(a=>{a.preventDefault(),f.current?.click()},"handleClick"),p=r(a=>{if(a.target.files&&a.target.files.length>0){let l=Array.from(a.target.files);d(l),e(a)}},"handleChange"),i=r(a=>{d(l=>l.filter(F=>F!==a))},"onRemoveFile"),u=Qt(n);return ue("div",{className:y("flex flex-col items-start gap-4",t),children:[V("input",{type:"file",ref:f,onChange:p,className:"hidden","aria-label":"File upload",multiple:o,accept:n}),ue(I,{type:"button",onClick:g,className:"gap-2",children:[V(Zt,{className:"h-4 w-4"}),"Choose File"]}),u&&ue("div",{className:"text-sm text-gray-600",children:["Accepted formats:"," ",V("span",{className:"font-medium",children:u})]}),m.length===0&&V("div",{className:"text-sm",children:o?V("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):V("span",{className:"font-medium",children:"No file selected."})}),m.length>0&&m.map((a,l)=>ue("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",V("span",{className:"font-medium",children:a.name})," (",Math.round(a.size/1024)," KB)",V(I,{variant:"ghost",onClick:()=>i(a),children:V(Xt,{})})]},l))]})}r(it,"FileUploader");import{jsx as U,jsxs as ro}from"react/jsx-runtime";var eo=r(e=>new Promise((t,o)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=s=>o(s)}),"toBase64"),to=r(async e=>await Promise.all(e.map(async o=>{let n=await eo(o);return{name:o.name,content:n.split(",")[1],size:o.size,type:o.type}})),"convertFilesToBase64"),oo=r((e,t)=>{if(!t)return null;for(let o of e)if(o.size>t){let n=Math.round(t/1048576),s=Math.round(o.size/(1024*1024));return`File "${o.name}" exceeds maximum size of ${n}MB (file is ${s}MB)`}return null},"validateFileSize");function lt({name:e,description:t,label:o,multiple:n,onChange:s,component:m,accept:d,maxSize:f,...g}){let{components:p}=S(),{control:i,setError:u,clearErrors:a}=b(),l=r(async(F,c)=>{let h=F.target.files?Array.from(F.target.files):[],x=oo(h,f);if(x){u(e,{message:x});return}a(e);let C=await to(h);c.onChange(C),s?.(C)},"handleOnChange");return U(k,{control:i,name:e,render:({field:F,fieldState:c})=>{let h=m||p?.file;if(h){let x={name:e,description:t,label:o,multiple:n,accept:d,maxFileSize:f,...g};return U(h,{field:{...F,value:F.value,onChange:r(async C=>l(C,F),"onChange")},fieldState:c,fieldData:x})}return ro(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[U(N,{className:"RemoteFlows__FileUpload__Label",children:o}),U(R,{children:U(it,{onChange:x=>l(x,F),multiple:n,className:y("RemoteFlows__FileUpload__Input"),accept:d,files:F.value})}),t&&U("div",{className:"flex items-center justify-between",children:U(P,{className:"RemoteFlows__FileUpload__Description",children:t})}),c.error&&U(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(lt,"FileUploadField");import{jsx as Re}from"react/jsx-runtime";function pe(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.number;return n?Re(k,{control:o,name:e.name,render:({field:s,fieldState:m})=>Re(n,{field:{...s,onChange:r(d=>{s.onChange(d),e.onChange?.(d)},"onChange")},fieldState:m,fieldData:e})}):Re(A,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(pe,"NumberField");import{Fragment as no}from"react";import{jsx as W,jsxs as Pe}from"react/jsx-runtime";function mt({name:e,defaultValue:t,description:o,label:n,options:s,onChange:m,component:d,...f}){let{components:g}=S(),{control:p}=b();return W(k,{control:p,name:e,defaultValue:t,render:({field:i,fieldState:u})=>{let a=d||g?.radio;if(a){let l={name:e,defaultValue:t,description:o,label:n,options:s,...f};return W(a,{field:{...i,onChange:r(F=>{i.onChange(F),m?.(F)},"onChange")},fieldState:u,fieldData:l})}return Pe(w,{className:y("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:n}),W(R,{children:W(Ge,{"aria-label":n||e,onValueChange:l=>{i.onChange(l),m?.(l)},value:i.value,className:"flex flex-col space-y-3",children:s?.map(l=>W(no,{children:Pe(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(R,{children:W(Je,{value:l.value,className:"RemoteFlows__RadioField__Input",disabled:l.disabled})}),Pe("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:l.label}),l.description&&W(P,{className:"mt-2",children:l.description})]})]})},l.value))})}),o&&W(P,{children:o}),u.error&&W(D,{})]})}})}r(mt,"RadioGroupField");import{jsx as E,jsxs as ct}from"react/jsx-runtime";function dt({label:e,name:t,options:o,defaultValue:n,description:s,onChange:m,component:d,...f}){let{control:g}=b(),{components:p}=S();return E(k,{defaultValue:n,control:g,name:t,render:({field:i,fieldState:u})=>{let a=d||p?.select;if(a){let l={label:e,name:t,options:o,defaultValue:n,description:s,onChange:m,...f};return E(a,{field:{...i,onChange:r(F=>{let c=f.jsonType==="number"?Number(F):F;i.onChange(c),m?.(c)},"onChange")},fieldState:u,fieldData:l})}return ct(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[E(N,{className:"RemoteFlows__SelectField__Label",children:e}),E(R,{children:E("div",{className:"relative",children:ct(qe,{value:i.value||"",onValueChange:l=>{let F=f.jsonType==="number"?Number(l):l;i.onChange(F),m?.(F)},children:[E(Ye,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:E("span",{className:"absolute",children:E(Ke,{placeholder:e})})}),E(Ze,{className:"RemoteFlows__SelectField__Content",children:E(je,{className:"RemoteFlows__SelectField__Group",children:o.map(l=>E(Xe,{value:l.value,className:"RemoteFlows__SelectField__SelectItem",disabled:l.disabled,children:l.label},l.value))})})]})})}),s&&E(P,{children:s}),u.error&&E(D,{})]})}})}r(dt,"SelectField");import{useState as co}from"react";import{Fragment as ao,useState as so}from"react";import{Check as io,ChevronDownIcon as lo,X as mo}from"lucide-react";import{Command as K}from"cmdk";import{SearchIcon as sn}from"lucide-react";import{jsx as Y,jsxs as dn}from"react/jsx-runtime";function ut({className:e,...t}){return Y(K,{"data-slot":"command",className:y("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(ut,"Command");function pt({className:e,...t}){return Y(K.List,{"data-slot":"command-list",className:y("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(pt,"CommandList");function ft({...e}){return Y(K.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ft,"CommandEmpty");function Ft({className:e,...t}){return Y(K.Group,{"data-slot":"command-group",className:y("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(Ft,"CommandGroup");function gt({className:e,...t}){return Y(K.Separator,{"data-slot":"command-separator",className:y("bg-border -mx-1 h-px",e),...t})}r(gt,"CommandSeparator");function ht({className:e,...t}){return Y(K.Item,{"data-slot":"command-item",className:y("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(ht,"CommandItem");import{jsx as L,jsxs as Z}from"react/jsx-runtime";function fe({options:e,selected:t,onChange:o,placeholder:n,...s}){let[m,d]=so(!1),f=r(i=>{o(t.filter(u=>u.value!==i.value))},"handleUnselect"),g=e.some(i=>i.category),p=e.reduce((i,u)=>{let a=u.category||"Uncategorized";return i[a]||(i[a]=[]),i[a].push(u),i},{});return Z(me,{open:m,onOpenChange:d,...s,children:[L(ce,{children:Z(I,{variant:"outline",role:"combobox","aria-expanded":m,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(i=>Z(Qe,{variant:"secondary",className:"mr-1 mb-1",children:[i.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${i.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:u=>{u.key==="Enter"&&f(i)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>f(i),children:L(mo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},i.label)):L("span",{className:"text-foreground",children:n})}),L(lo,{className:"size-4"})]})}),L(de,{align:"start",className:"w-full p-0",children:L(ut,{children:Z(pt,{children:[L(ft,{children:"No item found."}),Object.entries(p).map(([i,u],a)=>Z(ao,{children:[a>0&&L(gt,{}),L(Ft,{heading:g?i:void 0,children:u.map(l=>{let F=t.some(c=>c.value===l.value);return Z(ht,{onSelect:()=>{o(F?t.filter(c=>c.value!==l.value):[...t,l])},children:[L(io,{className:y("mr-2 h-4 w-4",F?"opacity-100":"opacity-0")}),l.label]},l.label)})})]},i))]})})})]})}r(fe,"MultiSelect");import{jsx as G,jsxs as uo}from"react/jsx-runtime";function _t({label:e,name:t,options:o,defaultValue:n,description:s,onChange:m,$meta:d,component:f,...g}){let{control:p}=b(),{components:i}=S(),[u,a]=co([]);return G(k,{defaultValue:n,control:p,name:t,render:({field:l,fieldState:F})=>{let c=f||i?.countries;if(c){let C={label:e,name:t,options:o,defaultValue:n,description:s,onChange:m,$meta:d,...g};return G(c,{field:{...l,onChange:r(T=>{l.onChange(T),m?.(T)},"onChange")},fieldState:F,fieldData:C})}let h=[...Object.entries(d?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(d?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...o.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],x=r(C=>{let T=C.map(({value:j})=>j);l.onChange(T),m?.(T),a(C)},"handleChange");return uo(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[G(N,{className:"RemoteFlows__CountryField__Label",children:e}),G(R,{children:G(fe,{options:h,selected:u,onChange:x,...g})}),s&&G(P,{children:s}),F.error&&G(D,{})]})}})}r(_t,"CountryField");import*as yt from"react";import{jsx as po}from"react/jsx-runtime";var De=yt.forwardRef(({className:e,...t},o)=>po("textarea",{className:y("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));De.displayName="Textarea";import{jsx as J,jsxs as Te}from"react/jsx-runtime";function vt({name:e,description:t,label:o,onChange:n,maxLength:s,component:m,...d}){let{components:f}=S(),{control:g}=b();return J(k,{control:g,name:e,render:({field:p,fieldState:i})=>{let u=m||f?.textarea;if(u){let l={name:e,description:t,label:o,maxLength:s,...d};return J(u,{field:{...p,onChange:r(F=>{p.onChange(F),n?.(F)},"onChange")},fieldState:i,fieldData:l})}let a=p.value?.length??0;return Te(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[J(N,{className:"RemoteFlows__TextArea__Label",children:o}),J(R,{children:J(De,{...p,value:p.value??"",onChange:l=>{p.onChange(l),n?.(l)},className:y(i.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:o})}),(t||s)&&Te("div",{className:"flex items-center justify-between",children:[t&&J(P,{className:"RemoteFlows__TextArea__Description",children:t}),s&&Te("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[a,"/",s]})]}),i.error&&J(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(vt,"TextAreaField");import{jsx as $e}from"react/jsx-runtime";function Ct(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.email;return n?$e(k,{control:o,name:e.name,render:({field:s,fieldState:m})=>$e(n,{field:{...s,onChange:r(d=>{s.onChange(d),e.onChange?.(d)},"onChange")},fieldState:m,fieldData:e})}):$e(A,{...e,type:"email"})}r(Ct,"EmailField");import{jsx as xt}from"react/jsx-runtime";function bt(e){let{control:t}=b();return xt(k,{control:t,name:e.name,render:({field:o})=>xt("input",{...o,type:"hidden"})})}r(bt,"HiddenField");import vo,{useEffect as Co,useState as $t}from"react";var St=r((e,t,o)=>{if(e&&"reportValidity"in e){let n=ne(o,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},"r"),Ie=r((e,t)=>{for(let o in t.fields){let n=t.fields[o];n&&n.ref&&"reportValidity"in n.ref?St(n.ref,o,e):n&&n.refs&&n.refs.forEach(s=>St(s,o,e))}},"o"),Nt=r((e,t)=>{t.shouldUseNativeValidation&&Ie(e,t);let o={};for(let n in e){let s=ne(t.fields,n),m=Object.assign(e[n]||{},{ref:s&&s.ref});if(fo(t.names||Object.keys(e),n)){let d=Object.assign({},ne(o,n));ae(d,"root",m),ae(o,n,d)}else ae(o,n,m)}return o},"s"),fo=r((e,t)=>{let o=kt(t);return e.some(n=>kt(n).match(`^${o}\\.\\d+`))},"i");function kt(e){return e.replace(/\]|\[/g,"")}r(kt,"n");function wt(e,t,o){return t===void 0&&(t={}),o===void 0&&(o={}),function(n,s,m){try{return Promise.resolve(function(d,f){try{var g=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[o.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:s}))).then(function(p){return m.shouldUseNativeValidation&&Ie({},m),{values:o.raw?Object.assign({},n):p,errors:{}}}))}catch(p){return f(p)}return g&&g.then?g.then(void 0,f):g}(0,function(d){if(!d.inner)throw d;return{values:{},errors:Nt((f=d,g=!m.shouldUseNativeValidation&&m.criteriaMode==="all",(f.inner||[]).reduce(function(p,i){if(p[i.path]||(p[i.path]={message:i.message,type:i.type}),g){var u=p[i.path].types,a=u&&u[i.type];p[i.path]=Ae(i.path,g,p,i.type,a?[].concat(a,i.message):i.message)}return p},{})),m)};var f,g}))}catch(d){return Promise.reject(d)}}}r(wt,"o");import*as $ from"yup";import Rt from"lodash.groupby";import X from"lodash.capitalize";var Pt=60,Fe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Fo(e){if(e<60)return`${e}m`;let t=Math.floor(e/Pt),o=e%Pt;return o>0?`${t}h${o}m`:`${t}h`}r(Fo,"convertBreakDurationToHours");function Dt(e){let t=e.reduce((o,n)=>n.hours+o,0);return Number(t.toFixed(2))}r(Dt,"calculateTotalWorkHours");function go(e,t){let o=t.map(({day:m})=>m.toLowerCase()),n=o.indexOf(e),s=null;for(;n<o.length&&!s;){let m=o[n],d=o[n+1],f=Fe.indexOf(m)+1;Fe[f]===d||(s=m),n+=1}return s}r(go,"findLastConsecutiveDay");function ho(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(ho,"shouldSummarizeSchedule");function _o(e){return Number.parseInt(e.break_duration_minutes)>0}r(_o,"shouldSummarizeBreaks");function Tt(e){let t=e.filter(ho),o=Rt(t,f=>`${f.start_time}|${f.end_time}`),n=e.filter(_o),s=Rt(n,"break_duration_minutes"),m=Object.keys(o).map(f=>{let g=o[f],p=g[0].day,[i,u]=f.split("|"),a=`from <span>${i.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,l=go(p,g),c=(l?g.findIndex(h=>h.day===l):-1)===g.length-1;return g.length===1?`${X(p)}, ${a}`:!c||!l?g.reduce((h,x,C)=>{let T=X(x.day);return C===g.length-1?`${h}and ${T}, ${a}`:`${h}<span>${T}</span>, `},""):`<span>${X(p)}</span> to <span>${X(l)}</span>, ${a}`}),d=Object.keys(s).reverse().map((f,g)=>{let p=g===0,i=s[f],u=Fo(parseInt(f,10));if(Object.keys(s).length===1)return`With ${u} daily breaks`;if(i.length===1){let a=`${u} break on ${X(i[0].day)}.`;return p?`With ${a}`:a}return i.reduce((a,l,F)=>{let c=X(l.day);return F===0?`${a} ${c}`:F===i.length-1?`${a}, and ${c}.`:`${a}, ${c}`},p?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:m,breakSummary:d}}r(Tt,"buildWorkScheduleSummary");function Me(e){let{checked:t,start_time:o,end_time:n,break_duration_minutes:s}=e;if(!t)return 0;let[m,d]=o.split(":").map(Number),[f,g]=n.split(":").map(Number),p=m*60+d,a=(f*60+g-p-Number.parseInt(s||"0"))/60;return a===Math.floor(a)?a:Number(a.toFixed(2))}r(Me,"calculateHours");var yo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function ge(e){return yo[e]}r(ge,"getShortWeekday");import{jsx as v,jsxs as B}from"react/jsx-runtime";var xo=$.object({day:$.string().required(),checked:$.boolean().required(),start_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:$.number().default(0),break_duration_minutes:$.string().default("0")}),bo=$.object({schedule:$.array(xo)});function So({defaultSchedule:e,onSubmit:t}){let[o,n]=$t(!1),s=Fe.map(c=>{let h=e.find(x=>x.day.toLowerCase()===ge(c).toLowerCase()||x.day.toLowerCase()===c.toLowerCase());return h?{...h,day:ge(c),checked:!0}:{...e[0],checked:!1,day:ge(c)}}),m=ze({defaultValues:{schedule:s},resolver:wt(bo)}),{handleSubmit:d,watch:f,reset:g,control:p,formState:i}=m,{fields:u}=Oe({name:"schedule",control:p}),a=f("schedule");function l(c){let h=c.schedule.filter(({checked:x})=>x).map(x=>({...x,hours:Me(x)}));t(h),n(!1)}r(l,"handleSubmitWorkingHours");function F(){g(),n(!1)}return r(F,"handleCancel"),v("div",{className:"flex items-center justify-between",children:B(xe,{open:o,onOpenChange:n,children:[v(et,{asChild:!0,children:v(I,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),B(be,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[v(Se,{children:v(ke,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),v(Ue,{...m,children:B("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[B("div",{className:"rounded-lg",children:[v("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),B("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[v("div",{className:"col-span-2"}),v("div",{className:"col-span-3 text-center",children:"START"}),v("div",{className:"col-span-1 text-center"}),v("div",{className:"col-span-3 text-center",children:"END"}),v("div",{className:"col-span-2 text-center",children:"HOURS"})]}),v("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((c,h)=>{let x=a[h],C=Me(x);return B(vo.Fragment,{children:[B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[v("div",{className:"col-span-2 flex items-center gap-3",children:v(ie,{label:c.day,name:`schedule.${h}.checked`})}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[v("div",{className:"col-span-2 text-gray-500",children:"Break"}),v("div",{className:"col-span-2",children:v(A,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-gray-500",children:"minutes"}),v("div",{className:"col-span-4"})]})]},c.id)})})]}),Object.keys(i.errors).length>0&&v("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),B("div",{className:"flex gap-4 pt-4",children:[v(I,{type:"button",className:"reset-button",variant:"outline",onClick:F,children:"Cancel"}),v(I,{type:"button",className:"submit-button",onClick:d(l),children:"Save Schedule"})]})]})})]})]})})}r(So,"WorkScheduleSelectionForm");function It(e){let{components:t}=S(),{setValue:o,control:n,watch:s}=b(),m=s(e.name),[d,f]=$t(m),{workHoursSummary:g,breakSummary:p}=Tt(d),i=Dt(d);Co(()=>{o(e.name,d)},[d,e.name,o]);function u(l){f(l)}r(u,"onSubmit");let a=e.component||t?.["work-schedule"];return a?v(k,{control:n,name:e.name,render:({field:l,fieldState:F})=>v(a,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:F,fieldData:{...e,defaultFormattedValue:{workHoursSummary:g,breakSummary:p,totalWorkHours:i}}})}):B("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[v("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),B("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:g.join(", ")}}),v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:p.join()}),B("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",v("span",{children:i})," hours per week"]}),v(So,{defaultSchedule:d,onSubmit:u})]})]})}r(It,"WorkScheduleField");import{useState as ko}from"react";import{jsx as q,jsxs as No}from"react/jsx-runtime";function Mt({label:e,name:t,options:o,defaultValue:n,description:s,onChange:m,component:d,...f}){let{control:g}=b(),{components:p}=S(),[i,u]=ko();return q(k,{defaultValue:n,control:g,name:t,render:({field:a,fieldState:l})=>{let F=d||p?.["multi-select"];if(F){let h={label:e,name:t,options:o,defaultValue:n,description:s,onChange:m,...f};return q(F,{field:{...a,onChange:r(x=>{a.onChange(x),m?.(x)},"onChange")},fieldState:l,fieldData:h})}let c=i||o.filter(h=>a.value.includes(h.value));return No(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[q(N,{className:"RemoteFlows__SelectField__Label",children:e}),q(R,{children:q(fe,{options:o,selected:c,onChange:h=>{let x=h.map(({value:C})=>C);a.onChange(x),m?.(x),u(h)},...f})}),s&&q(P,{children:s}),l.error&&q(D,{})]})}})}r(Mt,"MultiSelectField");import{jsx as wo}from"react/jsx-runtime";var Et=r(e=>wo(pe,{maxLength:15,...e}),"MoneyField");var Ee={checkbox:ie,text:A,email:Ct,money:Et,select:dt,"multi-select":Mt,radio:mt,number:pe,file:lt,date:st,textarea:vt,countries:_t,hidden:bt,"work-schedule":It};import{AlertCircle as Ro}from"lucide-react";import{jsx as he,jsxs as Po}from"react/jsx-runtime";function Wt({title:e,description:t,severity:o}){let{components:n}=S();if(n?.statement){let s=n?.statement;return he(s,{data:{title:e,description:oe(t),severity:o}})}return Po(tt,{variant:"warning",children:[he(Ro,{className:"h-4 w-4"}),e&&he(ot,{children:e}),t&&he(rt,{dangerouslySetInnerHTML:{__html:oe(t)}})]})}r(Wt,"Statement");import{Fragment as Io,jsx as H,jsxs as Q}from"react/jsx-runtime";var $o=r(({isExpanded:e,onToggle:t,className:o,...n})=>H(I,{type:"button",className:y("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",o),variant:"default",onClick:t,...n,children:e?"Remove":"Define"}),"DefaultToggleButton");function Bt({label:e,name:t,fields:o,description:n,components:s,statement:m,isFlatFieldset:d,extra:f,variant:g="outset",features:p,meta:i}){let{helpCenter:u}=i||{},{watch:a,setValue:l,trigger:F,formState:c}=b(),{components:h}=S(),x=p?.toggle?.stateField,C=x?a(x):p?.toggle?.defaultExpanded??!0,T=o.map(({name:_})=>`${t}.${_}`),j=a(T),We=Lt(j),ee=Lt(null),Ht=r(()=>{x&&l(x,!C)},"toggleExpanded");To(()=>{let _=j,re=We.current,_e=c.isSubmitted||c.submitCount>0,He=!1;for(let te=0;te<_.length;te++)if(_[te]!==void 0&&re[te]!==_[te]){He=!0;break}return He&&_e&&(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{F()},50)),We.current=[..._],()=>{ee.current&&clearTimeout(ee.current)}},[j,F,c.isSubmitted,c.submitCount]);let At=h?.fieldsetToggle||$o,Le=`${t}-content`,Be=`${t}-header`;return Q("fieldset",{className:y("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[H("legend",{className:y("text-sm font-semibold px-2",g==="inset"&&"hidden"),children:e}),u?.callToAction&&u?.id&&g==="outset"&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:u.id,children:u.callToAction}),g==="inset"&&Q(Io,{children:[Q("div",{className:"RemoteFlows__FieldSetField__Header",id:Be,"data-state":C?"expanded":"collapsed","aria-expanded":C,children:[H("h3",{className:y("RemoteFlows__FieldSetField__Title"),children:e}),p?.toggle?.enabled&&H(At,{isExpanded:C,onToggle:Ht,"aria-expanded":C,"aria-controls":Le,"aria-label":`${C?"Hide":"Show"} ${e}`,className:y("RemoteFlows__FieldSetField__Toggle",p.toggle?.className),children:C?p.toggle.labels?.collapse??"Remove":p.toggle.labels?.expand??"Define"})]}),u?.callToAction&&u?.id&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:u.id,children:u.callToAction})]}),C&&Q("div",{id:Le,"aria-labelledby":Be,role:"region",children:[n?H("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:oe(n)}}):null,Q("div",{className:"grid gap-4",children:[o.map(_=>{if(_.calculateDynamicProperties&&(_={..._,..._.calculateDynamicProperties(j,_)||{}}),_.isVisible===!1||_.deprecated)return null;if(_.Component){let{Component:_e}=_;return H(_e,{..._},_.name)}if(_.type==="fieldset")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:s},`${d?_.name:`${t}.${_.name}`}`);if(_.type==="fieldset-flat")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:s,isFlatFieldset:!0},`${d?_.name:`${t}.${_.name}`}`);let re=Ee[_.type];return _.type==="select"&&_.multiple&&(re=Ee["multi-select"]),Q(Do,{children:[H(re,{..._,name:`${d?_.name:`${t}.${_.name}`}`,component:s?.[_.type]}),_.extra?_.extra:null]},`${d?_.name:`${t}.${_.name}`}`)}),f||null,m?H(Wt,{...m}):null]})]})]})}r(Bt,"FieldSetField");export{Ee as a,Wt as b,Bt as c};
|
|
2
|
+
//# sourceMappingURL=chunk-QGWCUGLN.js.map
|