@remoteoss/remote-flows 0.27.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ZIPHLBX4.js → chunk-2FKEF3OG.js} +2 -2
- package/dist/{chunk-UTBVLDKY.js → chunk-2RZ65777.js} +2 -2
- package/dist/{chunk-N3EIN72T.js → chunk-53KVZ4BP.js} +2 -2
- package/dist/{chunk-PFT7KJ65.js → chunk-57XKXW6I.js} +2 -2
- package/dist/{chunk-XP7UEI56.js → chunk-5MYWJJBQ.js} +2 -2
- package/dist/{chunk-RINDVT6U.js → chunk-6IZ6XHVO.js} +2 -2
- package/dist/{chunk-4ZGIL6OE.js → chunk-6KIQIVKA.js} +2 -2
- package/dist/{chunk-WZAWPSKS.js → chunk-6LJRRFK2.js} +2 -2
- package/dist/{chunk-HFI2MD3H.js → chunk-7ELDXUJJ.js} +2 -2
- package/dist/{chunk-DZ67OJVF.js → chunk-7LZVUOMP.js} +2 -2
- package/dist/{chunk-SB3IYODL.js → chunk-AODV6HT2.js} +2 -2
- package/dist/{chunk-LRNSFLHR.js → chunk-AUZWLETL.js} +2 -2
- package/dist/{chunk-R64X3EJF.js → chunk-AWDGLK2T.js} +2 -2
- package/dist/{chunk-YXWBSRKS.js → chunk-C67CG4QZ.js} +2 -2
- package/dist/{chunk-UFBTCHEI.js → chunk-C6B3CVSL.js} +2 -2
- package/dist/chunk-DB7ITLRX.js +2 -0
- package/dist/chunk-DB7ITLRX.js.map +1 -0
- package/dist/{chunk-BMDZJNJV.js → chunk-FHHVVAXP.js} +2 -2
- package/dist/{chunk-AYLYOLVG.js → chunk-GWLOE7WJ.js} +2 -2
- package/dist/{chunk-BO6OKTIG.js → chunk-IEY4QYMK.js} +2 -2
- package/dist/{chunk-FEHSJUZJ.js → chunk-IQKZWU7I.js} +2 -2
- package/dist/{chunk-L3C4AHZJ.js → chunk-JHAFMU4Z.js} +2 -2
- package/dist/{chunk-QLNFHOLH.js → chunk-JO4722R7.js} +2 -2
- package/dist/{chunk-VLLLNIMN.js → chunk-MGVP76ZI.js} +2 -2
- package/dist/{chunk-7Y46DL2U.js → chunk-MRPXDND2.js} +2 -2
- package/dist/{chunk-LDJT7TII.js → chunk-OU4Y73FX.js} +2 -2
- package/dist/{chunk-SA74WAVS.js → chunk-PYKEYPGA.js} +2 -2
- package/dist/{chunk-TUFTB5UD.js → chunk-QDYWPG2R.js} +2 -2
- package/dist/chunk-QS5KOZM4.js +2 -0
- package/dist/{chunk-L6FZRTSN.js → chunk-QTYDDIVO.js} +2 -2
- package/dist/chunk-R3DJNVHR.js +2 -0
- package/dist/chunk-R3DJNVHR.js.map +1 -0
- package/dist/{chunk-E3JFQ7PH.js → chunk-SASLKPFS.js} +2 -2
- package/dist/{chunk-ZY5U2UNT.js → chunk-SSLB4VJH.js} +2 -2
- package/dist/{chunk-746ELT2W.js → chunk-TFKE327J.js} +2 -2
- package/dist/{chunk-NRW33IP5.js → chunk-TM7Q7RHH.js} +2 -2
- package/dist/{chunk-R3LY6TV5.js → chunk-UQOWSJ2B.js} +2 -2
- package/dist/chunk-VDRNNOVA.js +2 -0
- package/dist/chunk-VDRNNOVA.js.map +1 -0
- package/dist/{chunk-GD5556B2.js → chunk-VWCJQXCL.js} +2 -2
- package/dist/{chunk-A2SWQS2N.js → chunk-WCIJHQMP.js} +2 -2
- package/dist/chunk-WKANRAQC.js +2 -0
- package/dist/chunk-WKANRAQC.js.map +1 -0
- package/dist/chunk-XPKVRYIU.js +2 -0
- package/dist/chunk-XPKVRYIU.js.map +1 -0
- package/dist/{chunk-RAHCZTQ3.js → chunk-YTCUIISL.js} +2 -2
- package/dist/{chunk-WNTOQYRY.js → chunk-ZHMQDRBT.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/hooks.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +2 -2
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +1 -1
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +3 -3
- package/dist/flows/Onboarding/hooks.d.ts +1 -1
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +1 -1
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +1 -1
- package/dist/flows/Onboarding/utils.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +2 -2
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +2 -2
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +2 -2
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +2 -2
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +2 -0
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +1 -0
- package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +1 -0
- package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
- package/dist/flows/api.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{types-1tGveWWg.d.ts → types-B48IQTY-.d.ts} +2 -2
- package/dist/{types-DegHPy8Q.d.ts → types-C1II2Ikg.d.ts} +3 -3
- package/dist/{types-CwUhT-vz.d.ts → types-pdKQ7fMD.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-4T6PRR6R.js +0 -2
- package/dist/chunk-4T6PRR6R.js.map +0 -1
- package/dist/chunk-GC23RRCI.js +0 -2
- package/dist/chunk-GC23RRCI.js.map +0 -1
- package/dist/chunk-KOIHMAAP.js +0 -2
- package/dist/chunk-LRGEEPGK.js +0 -2
- package/dist/chunk-LRGEEPGK.js.map +0 -1
- package/dist/chunk-OXCEJQFC.js +0 -2
- package/dist/chunk-OXCEJQFC.js.map +0 -1
- /package/dist/{chunk-ZIPHLBX4.js.map → chunk-2FKEF3OG.js.map} +0 -0
- /package/dist/{chunk-UTBVLDKY.js.map → chunk-2RZ65777.js.map} +0 -0
- /package/dist/{chunk-N3EIN72T.js.map → chunk-53KVZ4BP.js.map} +0 -0
- /package/dist/{chunk-PFT7KJ65.js.map → chunk-57XKXW6I.js.map} +0 -0
- /package/dist/{chunk-XP7UEI56.js.map → chunk-5MYWJJBQ.js.map} +0 -0
- /package/dist/{chunk-RINDVT6U.js.map → chunk-6IZ6XHVO.js.map} +0 -0
- /package/dist/{chunk-4ZGIL6OE.js.map → chunk-6KIQIVKA.js.map} +0 -0
- /package/dist/{chunk-WZAWPSKS.js.map → chunk-6LJRRFK2.js.map} +0 -0
- /package/dist/{chunk-HFI2MD3H.js.map → chunk-7ELDXUJJ.js.map} +0 -0
- /package/dist/{chunk-DZ67OJVF.js.map → chunk-7LZVUOMP.js.map} +0 -0
- /package/dist/{chunk-SB3IYODL.js.map → chunk-AODV6HT2.js.map} +0 -0
- /package/dist/{chunk-LRNSFLHR.js.map → chunk-AUZWLETL.js.map} +0 -0
- /package/dist/{chunk-R64X3EJF.js.map → chunk-AWDGLK2T.js.map} +0 -0
- /package/dist/{chunk-YXWBSRKS.js.map → chunk-C67CG4QZ.js.map} +0 -0
- /package/dist/{chunk-UFBTCHEI.js.map → chunk-C6B3CVSL.js.map} +0 -0
- /package/dist/{chunk-BMDZJNJV.js.map → chunk-FHHVVAXP.js.map} +0 -0
- /package/dist/{chunk-AYLYOLVG.js.map → chunk-GWLOE7WJ.js.map} +0 -0
- /package/dist/{chunk-BO6OKTIG.js.map → chunk-IEY4QYMK.js.map} +0 -0
- /package/dist/{chunk-FEHSJUZJ.js.map → chunk-IQKZWU7I.js.map} +0 -0
- /package/dist/{chunk-L3C4AHZJ.js.map → chunk-JHAFMU4Z.js.map} +0 -0
- /package/dist/{chunk-QLNFHOLH.js.map → chunk-JO4722R7.js.map} +0 -0
- /package/dist/{chunk-VLLLNIMN.js.map → chunk-MGVP76ZI.js.map} +0 -0
- /package/dist/{chunk-7Y46DL2U.js.map → chunk-MRPXDND2.js.map} +0 -0
- /package/dist/{chunk-LDJT7TII.js.map → chunk-OU4Y73FX.js.map} +0 -0
- /package/dist/{chunk-SA74WAVS.js.map → chunk-PYKEYPGA.js.map} +0 -0
- /package/dist/{chunk-TUFTB5UD.js.map → chunk-QDYWPG2R.js.map} +0 -0
- /package/dist/{chunk-KOIHMAAP.js.map → chunk-QS5KOZM4.js.map} +0 -0
- /package/dist/{chunk-L6FZRTSN.js.map → chunk-QTYDDIVO.js.map} +0 -0
- /package/dist/{chunk-E3JFQ7PH.js.map → chunk-SASLKPFS.js.map} +0 -0
- /package/dist/{chunk-ZY5U2UNT.js.map → chunk-SSLB4VJH.js.map} +0 -0
- /package/dist/{chunk-746ELT2W.js.map → chunk-TFKE327J.js.map} +0 -0
- /package/dist/{chunk-NRW33IP5.js.map → chunk-TM7Q7RHH.js.map} +0 -0
- /package/dist/{chunk-R3LY6TV5.js.map → chunk-UQOWSJ2B.js.map} +0 -0
- /package/dist/{chunk-GD5556B2.js.map → chunk-VWCJQXCL.js.map} +0 -0
- /package/dist/{chunk-A2SWQS2N.js.map → chunk-WCIJHQMP.js.map} +0 -0
- /package/dist/{chunk-RAHCZTQ3.js.map → chunk-YTCUIISL.js.map} +0 -0
- /package/dist/{chunk-WNTOQYRY.js.map → chunk-ZHMQDRBT.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-XPKVRYIU.js";import"../../../chunk-VDRNNOVA.js";import"../../../chunk-P37U34EQ.js";export{a as paidTimeOffSchema};
|
|
2
2
|
//# sourceMappingURL=paidTimeOff.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-QS5KOZM4.js";import"../../../chunk-N6G4VZXF.js";import"../../../chunk-XPKVRYIU.js";import"../../../chunk-R3DJNVHR.js";import"../../../chunk-VDRNNOVA.js";import"../../../chunk-LMYJ6V44.js";import"../../../chunk-P37U34EQ.js";export{a as schema};
|
|
2
2
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-R3DJNVHR.js";import"../../../chunk-VDRNNOVA.js";import"../../../chunk-P37U34EQ.js";export{a as terminationDetailsSchema};
|
|
2
2
|
//# sourceMappingURL=terminationDetails.js.map
|
package/dist/flows/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-7LZVUOMP.js";import"../chunk-QS5KOZM4.js";import"../chunk-N6G4VZXF.js";import"../chunk-XPKVRYIU.js";import"../chunk-R3DJNVHR.js";import"../chunk-VDRNNOVA.js";import"../chunk-LMYJ6V44.js";import"../chunk-XFD3ULUF.js";import"../chunk-3O3Q24JL.js";import"../chunk-3ZWDIEEM.js";import"../chunk-P37U34EQ.js";export{a as useCreateTermination,b as useTerminationSchema};
|
|
2
2
|
//# sourceMappingURL=api.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -25,10 +25,10 @@ export { AcknowledgeInformationFeesProps } from './flows/Termination/components/
|
|
|
25
25
|
export { AcknowledgeInformationProps } from './flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js';
|
|
26
26
|
export { OnboardingFlow } from './flows/Onboarding/OnboardingFlow.js';
|
|
27
27
|
export { OnboardingInviteProps } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
28
|
-
export { B as BasicInformationFormPayload, c as BenefitsFormPayload, C as ContractDetailsFormPayload, e as CreditRiskState, d as CreditRiskStatus, E as Employment, f as OnboardingRenderProps, a as SelectCountryFormPayload, b as SelectCountrySuccess } from './types-
|
|
28
|
+
export { B as BasicInformationFormPayload, c as BenefitsFormPayload, C as ContractDetailsFormPayload, e as CreditRiskState, d as CreditRiskStatus, E as Employment, f as OnboardingRenderProps, a as SelectCountryFormPayload, b as SelectCountrySuccess } from './types-B48IQTY-.js';
|
|
29
29
|
export { ContractorOnboardingFlow } from './flows/ContractorOnboarding/ContractorOnboarding.js';
|
|
30
|
-
export { e as ContractPreviewFormPayload, f as ContractPreviewResponse, C as ContractorOnboardingContractDetailsFormPayload, d as ContractorOnboardingContractDetailsResponse, a as ContractorOnboardingFlowProps, b as ContractorOnboardingRenderProps, P as PricingPlanFormPayload, c as PricingPlanResponse } from './types-
|
|
31
|
-
export { B as BookedTimeoffBeforeDateResponse, c as PaidTimeoffBreakdownResponse, S as SummaryTimeOffDataResponse, e as useBookedTimeoffBeforeAndAfterTerminationQuery, u as useEmploymentQuery, d as usePaidTimeoffBreakdownQuery, f as useSummaryTimeOffDataQuery, g as useTimeOffLeavePoliciesSummaryQuery, b as useTimeOffQuery } from './types-
|
|
30
|
+
export { e as ContractPreviewFormPayload, f as ContractPreviewResponse, C as ContractorOnboardingContractDetailsFormPayload, d as ContractorOnboardingContractDetailsResponse, a as ContractorOnboardingFlowProps, b as ContractorOnboardingRenderProps, P as PricingPlanFormPayload, c as PricingPlanResponse } from './types-C1II2Ikg.js';
|
|
31
|
+
export { B as BookedTimeoffBeforeDateResponse, c as PaidTimeoffBreakdownResponse, S as SummaryTimeOffDataResponse, e as useBookedTimeoffBeforeAndAfterTerminationQuery, u as useEmploymentQuery, d as usePaidTimeoffBreakdownQuery, f as useSummaryTimeOffDataQuery, g as useTimeOffLeavePoliciesSummaryQuery, b as useTimeOffQuery } from './types-pdKQ7fMD.js';
|
|
32
32
|
export { Z as ZendeskTriggerButton, t as transformYupErrorsIntoObject } from './ZendeskTriggerButton-DIV8pCPo.js';
|
|
33
33
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
34
34
|
import { PropsWithChildren } from 'react';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-GULCZWSK.js";import{a as wt}from"./chunk-VWCJQXCL.js";import"./chunk-QDYWPG2R.js";import"./chunk-WCIJHQMP.js";import"./chunk-ZQ6MG635.js";import"./chunk-6IZ6XHVO.js";import"./chunk-OIN3HGOQ.js";import"./chunk-Z7WBY27D.js";import"./chunk-5KHLOGTR.js";import"./chunk-AODV6HT2.js";import"./chunk-GWLOE7WJ.js";import"./chunk-5MYWJJBQ.js";import"./chunk-PGWKJ6FK.js";import"./chunk-JHAFMU4Z.js";import"./chunk-VAIBLWOY.js";import"./chunk-2RZ65777.js";import"./chunk-FZ7FWFJX.js";import{a as ft}from"./chunk-WLBRCGTG.js";import{a as mt}from"./chunk-QIQTM4HB.js";import{a as ht}from"./chunk-IEY4QYMK.js";import"./chunk-6VRUYYUV.js";import"./chunk-UQOWSJ2B.js";import"./chunk-P5WUODPR.js";import"./chunk-TFKE327J.js";import"./chunk-6IL4TB7S.js";import"./chunk-IWA5B4U6.js";import"./chunk-7VOQAVM4.js";import"./chunk-VM2DQCZO.js";import"./chunk-EHAZWZ3O.js";import"./chunk-SLMJEZJ7.js";import"./chunk-SASLKPFS.js";import"./chunk-S4XU4SE7.js";import"./chunk-Z3BMF4BO.js";import{a as O}from"./chunk-YTCUIISL.js";import"./chunk-R645TMO5.js";import"./chunk-BCXRPHWY.js";import"./chunk-MQWVZSGH.js";import{a as D}from"./chunk-W55MUSAS.js";import{a as I}from"./chunk-H425RKFI.js";import"./chunk-DTHBG6BD.js";import"./chunk-CVIWZYO3.js";import"./chunk-E6OBNWMU.js";import"./chunk-5NPET4ZO.js";import"./chunk-ZSCKSEAA.js";import"./chunk-ZE3YT3Q6.js";import"./chunk-6LJRRFK2.js";import"./chunk-53KVZ4BP.js";import"./chunk-2FKEF3OG.js";import"./chunk-MRPXDND2.js";import"./chunk-MRYRNB7Y.js";import{a as R}from"./chunk-57XKXW6I.js";import{b as L,d as P}from"./chunk-ZHMQDRBT.js";import"./chunk-C6B3CVSL.js";import"./chunk-7ELDXUJJ.js";import"./chunk-VFRHMNLJ.js";import{a as W}from"./chunk-PYKEYPGA.js";import{a as E}from"./chunk-ANGJCT4I.js";import{a as _}from"./chunk-UPXJJBXZ.js";import{d as A,e as z}from"./chunk-RC3XP5WU.js";import"./chunk-HN5HLFTB.js";import"./chunk-KSHK3ZPX.js";import"./chunk-DKFUZO5P.js";import{a as bt}from"./chunk-C67CG4QZ.js";import"./chunk-QTYDDIVO.js";import"./chunk-OU4Y73FX.js";import"./chunk-AUZWLETL.js";import"./chunk-IQKZWU7I.js";import"./chunk-AWDGLK2T.js";import"./chunk-TM7Q7RHH.js";import"./chunk-5ZR7EFPY.js";import"./chunk-FHHVVAXP.js";import"./chunk-DPY77ASH.js";import"./chunk-TOA3JILU.js";import"./chunk-SSLB4VJH.js";import"./chunk-FB2QGVI2.js";import"./chunk-WKANRAQC.js";import"./chunk-WVJDCDGZ.js";import"./chunk-BDPCUDJB.js";import"./chunk-R2MHAPWD.js";import"./chunk-U6RM2N4A.js";import{a as j}from"./chunk-Q4BKFSTW.js";import{a as S}from"./chunk-DYB3RWP7.js";import"./chunk-A7ZJQCNU.js";import{a as ut}from"./chunk-MGVP76ZI.js";import{a as nt}from"./chunk-6KIQIVKA.js";import"./chunk-CFIJKJXD.js";import"./chunk-JO4722R7.js";import"./chunk-DB7ITLRX.js";import"./chunk-BV3PGYSH.js";import{a as it}from"./chunk-OW5QGJD4.js";import{a as vt}from"./chunk-CYPGWEOO.js";import{a as ct,b as st,c as lt,d as dt,e as pt,f as gt}from"./chunk-KDUM4EZJ.js";import"./chunk-SGE4DLC3.js";import"./chunk-2YTBWEC7.js";import"./chunk-JTOLQCOG.js";import"./chunk-JBUNDNKJ.js";import"./chunk-7R347KBY.js";import"./chunk-AFRA4BIW.js";import"./chunk-3A47R5RQ.js";import"./chunk-D6X2WCEG.js";import"./chunk-HPHWQU34.js";import{a as F,b as T}from"./chunk-ANQ4HVVK.js";import"./chunk-PD24XKD6.js";import"./chunk-TWIUL2P3.js";import"./chunk-ZX5OIIJX.js";import"./chunk-7LZVUOMP.js";import"./chunk-QS5KOZM4.js";import"./chunk-N6G4VZXF.js";import"./chunk-XPKVRYIU.js";import"./chunk-R3DJNVHR.js";import"./chunk-VDRNNOVA.js";import"./chunk-LMYJ6V44.js";import"./chunk-XFD3ULUF.js";import{a as v}from"./chunk-3O3Q24JL.js";import"./chunk-PJBAQZ6G.js";import"./chunk-Z5WMKCRJ.js";import"./chunk-EKKRQI6B.js";import"./chunk-WVDTHFGS.js";import{a as u,c as h}from"./chunk-3ZWDIEEM.js";import{a as ot}from"./chunk-LWGVLLBH.js";import"./chunk-CNDSIADP.js";import{b as C}from"./chunk-PAQW5BFW.js";import"./chunk-MQ6F5LE4.js";import"./chunk-TVZAFTPT.js";import{c as B,d as m}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{QueryClient as $,QueryClientProvider as J}from"@tanstack/react-query";function d(t){let a=document.documentElement;Object.keys(t).forEach(e=>{let o=t[e];o&&a.style.setProperty(e,o)})}r(d,"setCssProperties");function N(t){let a={};return Object.keys(t).forEach(e=>{a[`--${e}`]=t[e]}),a}r(N,"mapThemeColors");function q(t){return{"--spacing":t}}r(q,"mapThemeSpacing");function K(t){return{"--radius":t}}r(K,"mapThemeBorderRadius");function U(t){return{"--fontSizeBase":t.fontSizeBase}}r(U,"mapThemeFont");function f(t){t?.colors&&d(N(t.colors)),t?.spacing&&d(q(t.spacing)),t?.borderRadius&&d(K(t.borderRadius)),t?.font&&d(U(t.font))}r(f,"applyTheme");import{createContext as V,useEffect as M,useMemo as Y}from"react";import{jsx as Q}from"react/jsx-runtime";var H=V({theme:{}});function w(t){M(()=>{t.theme&&Object.keys(t.theme).length>0&&f(t.theme)},[t.theme]);let a=Y(()=>({theme:t.theme}),[t.theme]);return Q(H.Provider,{value:a,children:t.children})}r(w,"ThemeProvider");var b={local:"http://localhost:4000/api/eor",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as X}from"@hey-api/client-fetch";import{useQuery as Z}from"@tanstack/react-query";import{useRef as x}from"react";function G(t){try{return new URL(t),!0}catch{return!1}}r(G,"isValidUrl");var y=r(({auth:t,options:a,authId:e="default"})=>{let o=x(null),{refetch:c}=Z({queryKey:["auth",e],queryFn:t,enabled:!1}),s=a?.environment?b[a?.environment]:"https://gateway.remote.com",l=v.getConfig(),g="0.28.1";a?.environment&&a?.environment!=="production"&&m(g);let p=!!a?.proxy&&G(a.proxy.url);return a?.proxy&&!p&&console.error("Invalid proxy URL provided. Using default base URL."),x(X({...l,headers:{...l.headers,...p?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":g},baseUrl:p?a.proxy?.url:s,auth:r(async()=>{function k(n){return!n||Date.now()+6e4>n}if(r(k,"hasTokenExpired"),!o.current||k(o.current.expiresAt)){let{data:n}=await c();n&&(o.current={accessToken:n.accessToken,expiresAt:Date.now()+n.expiresIn*1e3})}return o.current?.accessToken},"auth")}))},"useAuth");import{jsx as i}from"react/jsx-runtime";var tt=new $;function at({children:t,auth:a,authId:e,proxy:o,environment:c}){let s=y({auth:a,authId:e,options:{proxy:o,environment:c}});return i(h.Provider,{value:{client:s.current},children:t})}r(at,"RemoteFlowContextWrapper");function rt({children:t,components:a}){return i(u.Provider,{value:a?{components:a}:{components:{}},children:t})}r(rt,"FormFieldsProvider");function et({auth:t,authId:a,children:e,components:o,theme:c,proxy:s,environment:l}){return i(J,{client:tt,children:i(rt,{components:o,children:i(at,{auth:t,authId:a,proxy:s,environment:l,children:i(w,{theme:c,children:e})})})})}r(et,"RemoteFlows");export{ot as ContractAmendmentConfirmationForm,ut as ContractAmendmentFlow,nt as ContractAmendmentForm,it as ContractAmendmentSubmit,bt as ContractorOnboardingFlow,j as CostCalculatorDisclaimer,R as CostCalculatorFlow,W as CostCalculatorForm,E as CostCalculatorResetButton,O as CostCalculatorResults,_ as CostCalculatorSubmitButton,D as EstimationResults,wt as OnboardingFlow,et as RemoteFlows,I as SummaryResults,ft as TerminationDialogInfoContent,ht as TerminationFlow,mt as TerminationReasonsDetailContent,T as ZendeskTriggerButton,L as buildCostCalculatorEstimationPayload,C as convertFromCents,S as disclaimerData,B as transformYupErrorsIntoObject,dt as useBookedTimeoffBeforeAndAfterTerminationQuery,vt as useContractAmendment,P as useCostCalculator,z as useCostCalculatorEstimationCsv,A as useCostCalculatorEstimationPdf,ct as useEmploymentQuery,lt as usePaidTimeoffBreakdownQuery,pt as useSummaryTimeOffDataQuery,gt as useTimeOffLeavePoliciesSummaryQuery,st as useTimeOffQuery,F as zendeskArticles};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"k1HAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,CARSC,EAAAL,EAAA,oBAUT,SAASM,EAAeC,EAAqC,CAC3D,IAAMC,EAAyB,CAAC,EAChC,cAAO,KAAKD,CAAM,EAAE,QAASE,GAAQ,CACnCD,EAAO,KAAKC,CAAG,EAA0B,EACvCF,EAAOE,CAAwB,CACnC,CAAC,EACMD,CACT,CAPSH,EAAAC,EAAA,kBAST,SAASI,EAAgBC,EAAkC,CACzD,MAAO,CACL,YAAaA,CACf,CACF,CAJSN,EAAAK,EAAA,mBAMT,SAASE,EAAqBC,EAAsC,CAClE,MAAO,CACL,WAAYA,CACd,CACF,CAJSR,EAAAO,EAAA,wBAMT,SAASE,EAAaC,EAA+B,CACnD,MAAO,CACL,iBAAkBA,EAAK,YACzB,CACF,CAJSV,EAAAS,EAAA,gBAMF,SAASE,EAAWC,EAAoC,CACzDA,GAAO,QACTjB,EAAiBM,EAAeW,EAAM,MAAM,CAAC,EAG3CA,GAAO,SACTjB,EAAiBU,EAAgBO,EAAM,OAAO,CAAC,EAG7CA,GAAO,cACTjB,EAAiBY,EAAqBK,EAAM,YAAY,CAAC,EAGvDA,GAAO,MACTjB,EAAiBc,EAAaG,EAAM,IAAI,CAAC,CAE7C,CAhBgBZ,EAAAW,EAAA,c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,EAAAC,GAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
1
|
+
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"82HAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,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AAc,CAAK,EAAI,MAAMZ,EAAQ,EAC3BY,IACFd,EAAQ,QAAU,CAChB,YAAac,EAAK,YAClB,UAAW,KAAK,IAAI,EAAIA,EAAK,UAAY,GAC3C,EAEJ,CACA,OAAOd,EAAQ,SAAS,WAC1B,EAdM,OAeR,CAAC,CACH,CACF,EA9DuB,WJQnB,cAAAe,MAAA,oBA1BJ,IAAMC,GAAc,IAAIC,EAUxB,SAASC,GAAyB,CAChC,SAAAC,EACA,KAAAC,EACA,OAAAC,EACA,MAAAC,EACA,YAAAC,CACF,EAAkC,CAChC,IAAMC,EAAkBC,EAAQ,CAC9B,KAAAL,EACA,OAAAC,EACA,QAAS,CACP,MAAAC,EACA,YAAAC,CACF,CACF,CAAC,EACD,OACER,EAACW,EAAkB,SAAlB,CAA2B,MAAO,CAAE,OAAQF,EAAgB,OAAQ,EAClE,SAAAL,EACH,CAEJ,CApBSQ,EAAAT,GAAA,4BAsBF,SAASU,GAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEd,EAACe,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAV,EACH,CAEJ,CAbgBQ,EAAAC,GAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
@@ -104,13 +104,13 @@ declare const useOnboarding: ({ employmentId, companyId, countryCode, type, opti
|
|
|
104
104
|
* Current step state containing the current step and total number of steps
|
|
105
105
|
*/
|
|
106
106
|
stepState: {
|
|
107
|
-
currentStep: Step<"
|
|
107
|
+
currentStep: Step<"contract_details" | "benefits" | "review" | "basic_information" | "select_country">;
|
|
108
108
|
totalSteps: number;
|
|
109
109
|
values: {
|
|
110
|
+
contract_details: FieldValues;
|
|
110
111
|
benefits: FieldValues;
|
|
111
112
|
review: FieldValues;
|
|
112
113
|
basic_information: FieldValues;
|
|
113
|
-
contract_details: FieldValues;
|
|
114
114
|
select_country: FieldValues;
|
|
115
115
|
} | null;
|
|
116
116
|
};
|
|
@@ -12,7 +12,7 @@ import { Step } from './flows/useStepState.js';
|
|
|
12
12
|
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-DJcvCgN2.js';
|
|
13
13
|
import { FieldValues } from 'react-hook-form';
|
|
14
14
|
import { BasicInformationStep } from './flows/ContractorOnboarding/components/BasicInformationStep.js';
|
|
15
|
-
import { g as SelectCountryStep } from './types-
|
|
15
|
+
import { g as SelectCountryStep } from './types-B48IQTY-.js';
|
|
16
16
|
import { FlowOptions, JSFModify } from './flows/types.js';
|
|
17
17
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
18
18
|
|
|
@@ -41,12 +41,12 @@ declare const useContractorOnboarding: ({ countryCode, externalId, employmentId,
|
|
|
41
41
|
* Current step state containing the current step and total number of steps
|
|
42
42
|
*/
|
|
43
43
|
stepState: {
|
|
44
|
-
currentStep: Step<"
|
|
44
|
+
currentStep: Step<"contract_details" | "review" | "basic_information" | "select_country" | "contract_preview" | "pricing_plan">;
|
|
45
45
|
totalSteps: number;
|
|
46
46
|
values: {
|
|
47
|
+
contract_details: FieldValues;
|
|
47
48
|
review: FieldValues;
|
|
48
49
|
basic_information: FieldValues;
|
|
49
|
-
contract_details: FieldValues;
|
|
50
50
|
select_country: FieldValues;
|
|
51
51
|
contract_preview: FieldValues;
|
|
52
52
|
pricing_plan: FieldValues;
|
|
@@ -2,7 +2,7 @@ import { E as Employment, T as ListTimeoffResponse, W as TimeoffStatus, X as Tim
|
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
4
4
|
import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
|
|
5
|
-
import { E as Employment$1 } from './types-
|
|
5
|
+
import { E as Employment$1 } from './types-B48IQTY-.js';
|
|
6
6
|
|
|
7
7
|
type DaysAndHours = {
|
|
8
8
|
hours: number;
|
package/package.json
CHANGED
package/dist/chunk-4T6PRR6R.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{agrees_to_pto_amount:{const:"no"}},required:["agrees_to_pto_amount"]},then:{properties:{agrees_to_pto_amount_notes:{type:"string"}},required:["agrees_to_pto_amount_notes"]},else:{properties:{agrees_to_pto_amount_notes:!1,timesheet_file:!1}}}],properties:{timeoff_statement:{type:"null",title:"Timeoff statement","x-jsf-presentation":{inputType:"hidden",statement:{title:"Make sure these paid time off records are correct",description:"You must pay the employee for any unused accrued paid time off, so please check these records carefully.",inputType:"statement",severity:"warning"},meta:{ignoreValue:!0}}},paid_time_off_info:{type:"null",title:"Paid time off info","x-jsf-presentation":{inputType:"hidden"},meta:{ignoreValue:!0}},agrees_to_pto_amount:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Are these paid time off records correct?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},agrees_to_pto_amount_notes:{description:"Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.",maxLength:1e3,title:"Provide time off details",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},timesheet_file:{description:"Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.",title:"Timesheet document",type:["string","null"],"x-jsf-presentation":{inputType:"file",accept:".pdf"}}},required:["agrees_to_pto_amount"],type:"object","x-jsf-order":["timeoff_statement","paid_time_off_info","agrees_to_pto_amount","agrees_to_pto_amount_notes","timesheet_file"]}}};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-4T6PRR6R.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/json-schemas/paidTimeOff.ts"],"sourcesContent":["export const paidTimeOffSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n timeoff_statement: {\n type: 'null',\n title: 'Timeoff statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n statement: {\n title: 'Make sure these paid time off records are correct',\n description:\n 'You must pay the employee for any unused accrued paid time off, so please check these records carefully.',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n paid_time_off_info: {\n type: 'null',\n title: 'Paid time off info',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n meta: {\n ignoreValue: true,\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n },\n },\n },\n required: ['agrees_to_pto_amount'],\n type: 'object',\n 'x-jsf-order': [\n 'timeoff_statement',\n 'paid_time_off_info',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAoB,CAC/B,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,kBAAmB,CACjB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,UAAW,CACT,MAAO,oDACP,YACE,2GACF,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,mBAAoB,CAClB,KAAM,OACN,MAAO,qBACP,qBAAsB,CACpB,UAAW,QACb,EACA,KAAM,CACJ,YAAa,EACf,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQ,MACV,CACF,CACF,EACA,SAAU,CAAC,sBAAsB,EACjC,KAAM,SACN,cAAe,CACb,oBACA,qBACA,uBACA,6BACA,gBACF,CACF,CACF,CACF","names":["paidTimeOffSchema"]}
|
package/dist/chunk-GC23RRCI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{will_challenge_termination:{const:"yes"}},required:["will_challenge_termination"]},then:{properties:{will_challenge_termination_description:{type:"string"}},required:["will_challenge_termination_description"]},else:{properties:{will_challenge_termination_description:!1}}}],properties:{termination_reason:{title:"Termination reason",description:"Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.",type:"string",oneOf:[{const:"gross_misconduct",title:"Gross misconduct"},{const:"performance",title:"Performance"},{const:"workforce_reduction",title:"Workforce Reduction"},{const:"values",title:"Values"},{const:"compliance_issue",title:"Compliance issue"},{const:"incapacity_to_perform_inherent_duties",title:"Incapacity To perform inherent duties"},{const:"mutual_agreement",title:"Mutual agreement"},{const:"cancellation_before_start_date",title:"Decision to cancel hiring before the employee starts"},{const:"job_abandonment",title:"Job abandonment"},{const:"dissatisfaction_with_remote_service",title:"Dissatisfaction with EOR service"},{const:"end_of_fixed_term_contract_compliance_issue",title:"End of fixed-term contract"},{const:"other",title:"Other"}],"x-jsf-presentation":{inputType:"select"}},reason_description:{description:"",maxLength:1e3,title:"Termination reason details",type:"string","x-jsf-presentation":{inputType:"textarea"}},additional_comments:{description:"",maxLength:1e3,title:"Additional details regarding this termination process.",type:"string","x-jsf-presentation":{inputType:"textarea"}},termination_reason_files:{description:"Please upload any supporting documents regarding the termination reason.",title:"Termination reason files",type:"string","x-jsf-presentation":{inputType:"file",accept:".pdf",multiple:!0}},risk_assesment_info:{description:"",title:"Risk assessment info",type:"null","x-jsf-presentation":{inputType:"hidden"}},risk_assessment_reasons:{description:"",title:"This employee is...",type:"array",items:{anyOf:[{const:"sick_leave",title:"Currently on or recently returned from sick leave"},{const:"family_leave",title:"Currently on or recently returned from maternity, paternity, or other family leave"},{const:"pregnant_or_breastfeeding",title:"Pregnant or breastfeeding"},{const:"requested_medical_or_family_leave",title:"Requested medical or family leave"},{const:"disabled_or_health_condition",title:"Disabled or has a health condition"},{const:"member_of_union_or_works_council",title:"A member of a union or works council"},{const:"caring_responsibilities",title:"Caring responsibilities"},{const:"reported_concerns_with_workplace",title:"Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions"},{const:"none_of_these",title:"To the best of my knowledge, I am not aware of any of these"}]},"x-jsf-presentation":{inputType:"checkbox",direction:"column"}},will_challenge_termination:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Do you consider it is likely that the employee will challenge their termination?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},will_challenge_termination_description:{description:"",maxLength:1e3,title:"Please explain how the employee will challenge their termination",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},proposed_termination_date_info:{description:"",title:"Proposed termination date info",type:"null","x-jsf-presentation":{inputType:"hidden"}},proposed_termination_date:{description:"",format:"date",maxLength:255,title:"Proposed termination date",type:"string","x-jsf-presentation":{inputType:"date"}}},required:["termination_reason","reason_description","risk_assessment_reasons","will_challenge_termination","proposed_termination_date"],type:"object","x-jsf-order":["termination_reason","reason_description","additional_comments","termination_reason_files","risk_assesment_info","risk_assessment_reasons","will_challenge_termination","will_challenge_termination_description","proposed_termination_date_info","proposed_termination_date"]}}};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-GC23RRCI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/json-schemas/terminationDetails.ts"],"sourcesContent":["export const terminationDetailsSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n will_challenge_termination: {\n const: 'yes',\n },\n },\n required: ['will_challenge_termination'],\n },\n then: {\n properties: {\n will_challenge_termination_description: {\n type: 'string',\n },\n },\n required: ['will_challenge_termination_description'],\n },\n else: {\n properties: {\n will_challenge_termination_description: false,\n },\n },\n },\n ],\n properties: {\n termination_reason: {\n title: 'Termination reason',\n description:\n 'Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.',\n type: 'string',\n oneOf: [\n {\n const: 'gross_misconduct',\n title: 'Gross misconduct',\n },\n {\n const: 'performance',\n title: 'Performance',\n },\n {\n const: 'workforce_reduction',\n title: 'Workforce Reduction',\n },\n {\n const: 'values',\n title: 'Values',\n },\n {\n const: 'compliance_issue',\n title: 'Compliance issue',\n },\n {\n const: 'incapacity_to_perform_inherent_duties',\n title: 'Incapacity To perform inherent duties',\n },\n {\n const: 'mutual_agreement',\n title: 'Mutual agreement',\n },\n {\n const: 'cancellation_before_start_date',\n title: 'Decision to cancel hiring before the employee starts',\n },\n {\n const: 'job_abandonment',\n title: 'Job abandonment',\n },\n {\n const: 'dissatisfaction_with_remote_service',\n title: 'Dissatisfaction with EOR service',\n },\n {\n const: 'end_of_fixed_term_contract_compliance_issue',\n title: 'End of fixed-term contract',\n },\n {\n const: 'other',\n title: 'Other',\n },\n ],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n reason_description: {\n description: '',\n maxLength: 1000,\n title: 'Termination reason details',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n additional_comments: {\n description: '',\n maxLength: 1000,\n title: 'Additional details regarding this termination process.',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n termination_reason_files: {\n description:\n 'Please upload any supporting documents regarding the termination reason.',\n title: 'Termination reason files',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n multiple: true,\n },\n },\n risk_assesment_info: {\n description: '',\n title: 'Risk assessment info',\n type: 'null',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n },\n risk_assessment_reasons: {\n description: '',\n title: 'This employee is...',\n type: 'array',\n items: {\n anyOf: [\n {\n const: 'sick_leave',\n title: 'Currently on or recently returned from sick leave',\n },\n {\n const: 'family_leave',\n title:\n 'Currently on or recently returned from maternity, paternity, or other family leave',\n },\n {\n const: 'pregnant_or_breastfeeding',\n title: 'Pregnant or breastfeeding',\n },\n {\n const: 'requested_medical_or_family_leave',\n title: 'Requested medical or family leave',\n },\n {\n const: 'disabled_or_health_condition',\n title: 'Disabled or has a health condition',\n },\n {\n const: 'member_of_union_or_works_council',\n title: 'A member of a union or works council',\n },\n {\n const: 'caring_responsibilities',\n title: 'Caring responsibilities',\n },\n {\n const: 'reported_concerns_with_workplace',\n title:\n 'Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions',\n },\n {\n const: 'none_of_these',\n title:\n 'To the best of my knowledge, I am not aware of any of these',\n },\n ],\n },\n 'x-jsf-presentation': {\n inputType: 'checkbox',\n direction: 'column',\n },\n },\n will_challenge_termination: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title:\n 'Do you consider it is likely that the employee will challenge their termination?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n will_challenge_termination_description: {\n description: '',\n maxLength: 1000,\n title:\n 'Please explain how the employee will challenge their termination',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n proposed_termination_date_info: {\n description: '',\n title: 'Proposed termination date info',\n type: 'null',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n },\n proposed_termination_date: {\n description: '',\n format: 'date',\n maxLength: 255,\n title: 'Proposed termination date',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'date',\n },\n },\n },\n required: [\n 'termination_reason',\n 'reason_description',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'proposed_termination_date',\n ],\n type: 'object',\n 'x-jsf-order': [\n 'termination_reason',\n 'reason_description',\n 'additional_comments',\n 'termination_reason_files',\n 'risk_assesment_info',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'will_challenge_termination_description',\n 'proposed_termination_date_info',\n 'proposed_termination_date',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAA2B,CACtC,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,2BAA4B,CAC1B,MAAO,KACT,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,CACtC,KAAM,QACR,CACF,EACA,SAAU,CAAC,wCAAwC,CACrD,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,EAC1C,CACF,CACF,CACF,EACA,WAAY,CACV,mBAAoB,CAClB,MAAO,qBACP,YACE,oGACF,KAAM,SACN,MAAO,CACL,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,cACP,MAAO,aACT,EACA,CACE,MAAO,sBACP,MAAO,qBACT,EACA,CACE,MAAO,SACP,MAAO,QACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,wCACP,MAAO,uCACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,iCACP,MAAO,sDACT,EACA,CACE,MAAO,kBACP,MAAO,iBACT,EACA,CACE,MAAO,sCACP,MAAO,kCACT,EACA,CACE,MAAO,8CACP,MAAO,4BACT,EACA,CACE,MAAO,QACP,MAAO,OACT,CACF,EACA,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,mBAAoB,CAClB,YAAa,GACb,UAAW,IACX,MAAO,6BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,UAAW,IACX,MAAO,yDACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,yBAA0B,CACxB,YACE,2EACF,MAAO,2BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,OACX,OAAQ,OACR,SAAU,EACZ,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,MAAO,uBACP,KAAM,OACN,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,wBAAyB,CACvB,YAAa,GACb,MAAO,sBACP,KAAM,QACN,MAAO,CACL,MAAO,CACL,CACE,MAAO,aACP,MAAO,mDACT,EACA,CACE,MAAO,eACP,MACE,oFACJ,EACA,CACE,MAAO,4BACP,MAAO,2BACT,EACA,CACE,MAAO,oCACP,MAAO,mCACT,EACA,CACE,MAAO,+BACP,MAAO,oCACT,EACA,CACE,MAAO,mCACP,MAAO,sCACT,EACA,CACE,MAAO,0BACP,MAAO,yBACT,EACA,CACE,MAAO,mCACP,MACE,2LACJ,EACA,CACE,MAAO,gBACP,MACE,6DACJ,CACF,CACF,EACA,qBAAsB,CACpB,UAAW,WACX,UAAW,QACb,CACF,EACA,2BAA4B,CAC1B,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MACE,mFACF,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,uCAAwC,CACtC,YAAa,GACb,UAAW,IACX,MACE,mEACF,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,+BAAgC,CAC9B,YAAa,GACb,MAAO,iCACP,KAAM,OACN,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,0BAA2B,CACzB,YAAa,GACb,OAAQ,OACR,UAAW,IACX,MAAO,4BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,MACb,CACF,CACF,EACA,SAAU,CACR,qBACA,qBACA,0BACA,6BACA,2BACF,EACA,KAAM,SACN,cAAe,CACb,qBACA,qBACA,sBACA,2BACA,sBACA,0BACA,6BACA,yCACA,iCACA,2BACF,CACF,CACF,CACF","names":["terminationDetailsSchema"]}
|
package/dist/chunk-KOIHMAAP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-GC23RRCI.js";import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-N6G4VZXF.js";import{a as m}from"./chunk-4T6PRR6R.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
-
//# sourceMappingURL=chunk-KOIHMAAP.js.map
|
package/dist/chunk-LRGEEPGK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-WVJDCDGZ.js";import{B as M,E as k,d as F,f as C,i as g,j as S,l as j,n as w,o as v,q as E,t as O,u as q,v as P,x,y as V}from"./chunk-3O3Q24JL.js";import{b as U}from"./chunk-Z5WMKCRJ.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-PAQW5BFW.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as p,modify as d}from"@remoteoss/json-schema-form";import{useMutation as c,useQuery as f}from"@tanstack/react-query";var $=n(t=>{let{client:r}=a();return f({queryKey:["employment",t],retry:!1,enabled:!!t,select:n(({data:e})=>e?.data.employment,"select"),queryFn:n(async()=>{let e=await q({client:r,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn")})},"useEmployment"),ee=n(t=>{let{client:r}=a();return f({queryKey:["company",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let e=await v({client:r,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn"),select:n(({data:e})=>e.data.company,"select")})},"useCompany"),te=n(t=>{let{client:r}=a();return f({queryKey:["benefit-offers",t],retry:!1,enabled:!!t,queryFn:n(async()=>g({client:r,path:{employment_id:t}}).then(e=>{if(e.error||!e.data)throw new Error("Failed to fetch benefit offers data");return e}),"queryFn"),select:n(({data:e})=>e?.data?.reduce((o,s)=>({...o,[s.benefit_group.slug]:{value:s.benefit_tier?.slug??"no",...s.benefit_group?.filter?.slug?{filter:s.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),ne=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>k({client:t,headers:{Authorization:""},path:r}),"mutationFn")})},"useEmploymentInvite"),re=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>w({client:t,body:r}),"mutationFn")})},"useCreateReserveInvoice"),oe=n(({countryCode:t,form:r,fieldValues:e,options:o,query:s={}})=>{let{client:i}=a(),m=o?.jsonSchemaVersion?.form_schema?.[r]?{json_schema_version:o.jsonSchemaVersion.form_schema[r]}:{};return f({queryKey:["onboarding-json-schema-form",t,r],retry:!1,queryFn:n(async()=>{let l=await E({client:i,headers:{Authorization:""},path:{country_code:t,form:r},query:{skip_benefits:!0,...s,...m}});if(l.error||!l.data)throw new Error("Failed to fetch onboarding schema");return l},"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:l})=>{let u=l?.data||{};if(o&&o.jsfModify){let{schema:y}=d(u,o.jsfModify);u=y}let z=U(u.properties||{},"money").reduce((y,_)=>(y[_]=b(e[_]),y),{}),A={...e,...z};return{meta:{"x-jsf-fieldsets":u["x-jsf-fieldsets"]},...p(u,{initialValues:A})}},"select")})},"useJSONSchemaForm"),se=n((t,r,e)=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:s}=a();return f({queryKey:["benefit-offers-schema",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let i=await O({client:s,path:{employment_id:t},query:o});if(i.error||!i.data)throw new Error("Failed to fetch benefit offers schema");return i},"queryFn"),select:n(({data:i})=>{let m=i?.data?.schema||{};if(e&&e.jsfModify?.benefits){let{schema:h}=d(m,e.jsfModify.benefits);m=h}let l=Object.keys(r).length>0;return p(m,{initialValues:l?{...r}:{}})},"select")})},"useBenefitOffersSchema"),ae=n(t=>{let{client:r}=a(),e=t?.jsonSchemaVersion?.form_schema?.employment_basic_information?{json_schema_version:t.jsonSchemaVersion.form_schema.employment_basic_information}:{};return c({mutationFn:n(o=>C({client:r,headers:{Authorization:""},body:o,query:{...e}}),"mutationFn")})},"useCreateEmployment"),ie=n(t=>{let{client:r}=a(),e={employment_basic_information_json_schema_version:t?.jsonSchemaVersion?.form_schema?.employment_basic_information,employment_contract_details_json_schema_version:t?.jsonSchemaVersion?.form_schema?.contract_details},o=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));return c({mutationFn:n(({employmentId:s,...i})=>P({client:r,headers:{Authorization:""},body:i,path:{employment_id:s},query:{skip_benefits:!0,...o}}),"mutationFn")})},"useUpdateEmployment"),ce=n(t=>{let{client:r}=a();return c({mutationFn:n(({employmentId:e,...o})=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{};return S({client:r,body:o,path:{employment_id:e},query:{...s}})},"mutationFn")})},"useUpdateBenefitsOffers"),me=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>j({client:t,headers:{Authorization:""},body:r}),"mutationFn")})},"useMagicLink"),B=n(t=>{let{client:r}=a();return f({...t,queryKey:["countries"],retry:!1,queryFn:n(async()=>{let e=await V({client:r,headers:{Authorization:""}});if(e.error||!e.data)throw new Error("Failed to fetch supported countries");return e},"queryFn"),select:n(({data:e})=>e?.data?.filter(o=>o.eor_onboarding).map(o=>({label:o.name,value:o.code}))||[],"select")})},"useCountries"),le=n(t=>{let{data:r,isLoading:e}=B(t?.queryOptions),{schema:o}=d(R.data.schema,t?.jsfModify||{}),s=p(o);if(r){let i=s.fields.find(m=>m.name==="country");i&&(i.options=r)}return{isLoading:e,selectCountryForm:s}},"useCountriesSchemaField"),ue=n(({type:t="spread"})=>{let{client:r}=a();return c({mutationFn:n(e=>(t==="no_spread"?F:M)({client:r,body:e}),"mutationFn")})},"useConvertCurrency"),fe=n(()=>{let{client:t}=a();return c({mutationFn:n(({employmentId:r,...e})=>x({client:t,path:{employment_id:r},body:e}),"mutationFn")})},"useUpsertContractEligibility");export{$ as a,ee as b,te as c,ne as d,re as e,oe as f,se as g,ae as h,ie as i,ce as j,me as k,le as l,ue as m,fe as n};
|
|
2
|
-
//# sourceMappingURL=chunk-LRGEEPGK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/api.ts"],"sourcesContent":["import {\n ConvertCurrencyParams,\n CreateContractEligibilityParams,\n EmploymentCreateParams,\n EmploymentFullParams,\n getIndexBenefitOffer,\n getShowCompany,\n getShowEmployment,\n getShowFormCountry,\n getShowSchema,\n getSupportedCountry,\n MagicLinkParams,\n patchUpdateEmployment2,\n postConvertRawCurrencyConverter,\n postConvertWithSpreadCurrencyConverter,\n postCreateContractEligibility,\n postCreateEmployment2,\n postCreateRiskReserve,\n postGenerateMagicLink,\n postInviteEmploymentInvitation,\n PostInviteEmploymentInvitationData,\n putUpdateBenefitOffer,\n UnifiedEmploymentUpsertBenefitOffersRequest,\n} from '@/src/client';\nimport { convertToCents } from '@/src/components/form/utils';\nimport { useClient } from '@/src/context';\nimport { selectCountryStepSchema } from '@/src/flows/Onboarding/json-schemas/selectCountryStep';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { FlowOptions, JSONSchemaFormType } from '@/src/flows/types';\nimport { findFieldsByType } from '@/src/flows/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';\n\nexport const useEmployment = (employmentId: string | undefined) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n enabled: !!employmentId,\n select: ({ data }) => {\n return data?.data.employment;\n },\n queryFn: async () => {\n const response = await getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n employment_id: employmentId as string,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n });\n};\n\nexport const useCompany = (companyId: string) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['company', companyId],\n retry: false,\n enabled: !!companyId,\n queryFn: async () => {\n const response = await getShowCompany({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n select: ({ data }) => {\n return data.data.company;\n },\n });\n};\n\nexport const useBenefitOffers = (employmentId: string | undefined) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n return getIndexBenefitOffer({\n client: client as Client,\n path: {\n employment_id: employmentId as string,\n },\n }).then((response) => {\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers data');\n }\n\n return response;\n });\n },\n select: ({ data }) =>\n data?.data?.reduce(\n (acc, item) => {\n return {\n ...acc,\n [item.benefit_group.slug]: {\n value: item.benefit_tier?.slug ?? 'no',\n ...(item.benefit_group?.filter?.slug\n ? { filter: item.benefit_group?.filter?.slug }\n : {}),\n },\n };\n },\n {} as Record<string, { value: string }>,\n ),\n });\n};\n/**\n * Use this hook to invite an employee to the onboarding flow\n * @returns\n */\nexport const useEmploymentInvite = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: PostInviteEmploymentInvitationData['path']) => {\n return postInviteEmploymentInvitation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: payload,\n });\n },\n });\n};\n\nexport const useCreateReserveInvoice = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: { employment_slug: string }) => {\n return postCreateRiskReserve({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Use this hook to get the JSON schema form for the onboarding flow\n * @param param0\n * @returns\n */\nexport const useJSONSchemaForm = ({\n countryCode,\n form,\n fieldValues,\n options,\n query = {},\n}: {\n countryCode: string;\n form: JSONSchemaFormType;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n}) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema?.[form]\n ? {\n json_schema_version: options.jsonSchemaVersion.form_schema[form],\n }\n : {};\n return useQuery({\n queryKey: ['onboarding-json-schema-form', countryCode, form],\n retry: false,\n queryFn: async () => {\n const response = await getShowFormCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n country_code: countryCode,\n form: form,\n },\n query: {\n skip_benefits: true,\n ...query,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch onboarding schema');\n }\n\n return response;\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n let jsfSchema = data?.data || {};\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 useBenefitOffersSchema = (\n employmentId: string,\n fieldValues: FieldValues,\n options: OnboardingFlowProps['options'],\n) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers-schema', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n const response = await getShowSchema({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n query: jsonSchemaQueryParam,\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers schema');\n }\n\n return response;\n },\n select: ({ data }) => {\n let jsfSchema = data?.data?.schema || {};\n\n if (options && options.jsfModify?.benefits) {\n const { schema } = modify(jsfSchema, options.jsfModify.benefits);\n jsfSchema = schema;\n }\n const hasFieldValues = Object.keys(fieldValues).length > 0;\n const result = createHeadlessForm(jsfSchema, {\n // we need to clone the fieldValues to prevent side effects\n // if we don't do this, the benefits get included in the other steps\n initialValues: hasFieldValues ? { ...fieldValues } : {},\n });\n return result;\n },\n });\n};\n\n/**\n * Use this hook to create an employment\n * @returns\n */\nexport const useCreateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema\n ?.employment_basic_information\n ? {\n json_schema_version:\n options.jsonSchemaVersion.form_schema.employment_basic_information,\n }\n : {};\n return useMutation({\n mutationFn: (payload: EmploymentCreateParams) => {\n return postCreateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useUpdateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParams = {\n employment_basic_information_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.employment_basic_information,\n employment_contract_details_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.contract_details,\n };\n\n const filteredQueryParams = Object.fromEntries(\n Object.entries(jsonSchemaQueryParams).filter(\n ([, value]) => value !== undefined,\n ),\n );\n\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: EmploymentFullParams & { employmentId: string }) => {\n return patchUpdateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n skip_benefits: true,\n ...filteredQueryParams,\n },\n });\n },\n });\n};\n\nexport const useUpdateBenefitsOffers = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: UnifiedEmploymentUpsertBenefitOffersRequest & {\n employmentId: string;\n }) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n return putUpdateBenefitOffer({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useMagicLink = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (params: MagicLinkParams) => {\n return postGenerateMagicLink({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: params,\n });\n },\n });\n};\n\nconst useCountries = (queryOptions?: { enabled?: boolean }) => {\n const { client } = useClient();\n return useQuery({\n ...queryOptions,\n queryKey: ['countries'],\n retry: false,\n queryFn: async () => {\n const response = await getSupportedCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch supported countries');\n }\n\n return response;\n },\n select: ({ data }) => {\n return (\n data?.data\n ?.filter((country) => country.eor_onboarding)\n .map((country) => {\n return {\n label: country.name,\n value: country.code,\n };\n }) || []\n );\n },\n });\n};\n\nexport const useCountriesSchemaField = (\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } },\n) => {\n const { data: countries, isLoading } = useCountries(options?.queryOptions);\n\n const { schema: selectCountrySchema } = modify(\n selectCountryStepSchema.data.schema,\n options?.jsfModify || {},\n );\n\n const selectCountryForm = createHeadlessForm(selectCountrySchema);\n\n if (countries) {\n const countryField = selectCountryForm.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n }\n }\n\n return {\n isLoading,\n selectCountryForm,\n };\n};\n\nexport const useConvertCurrency = ({\n type = 'spread',\n}: {\n type?: 'spread' | 'no_spread';\n}) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: ConvertCurrencyParams) => {\n const apiFn =\n type === 'no_spread'\n ? postConvertRawCurrencyConverter\n : postConvertWithSpreadCurrencyConverter;\n return apiFn({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useUpsertContractEligibility = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: { employmentId: string } & CreateContractEligibilityParams) => {\n return postCreateContractEligibility({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n body: payload,\n });\n },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","names":["createHeadlessForm","modify","useMutation","useQuery","useEmployment","__name","employmentId","client","useClient","useQuery","data","response","getShowEmployment","useCompany","companyId","getShowCompany","useBenefitOffers","getIndexBenefitOffer","acc","item","useEmploymentInvite","useMutation","payload","postInviteEmploymentInvitation","useCreateReserveInvoice","postCreateRiskReserve","useJSONSchemaForm","countryCode","form","fieldValues","options","query","jsonSchemaQueryParam","getShowFormCountry","jsfSchema","schema","modify","moneyFieldsData","findFieldsByType","field","convertToCents","initialValues","createHeadlessForm","useBenefitOffersSchema","getShowSchema","hasFieldValues","useCreateEmployment","postCreateEmployment2","useUpdateEmployment","jsonSchemaQueryParams","filteredQueryParams","value","patchUpdateEmployment2","useUpdateBenefitsOffers","putUpdateBenefitOffer","useMagicLink","params","postGenerateMagicLink","useCountries","queryOptions","getSupportedCountry","country","useCountriesSchemaField","countries","isLoading","selectCountrySchema","selectCountryStepSchema","selectCountryForm","countryField","useConvertCurrency","type","postConvertRawCurrencyConverter","postConvertWithSpreadCurrencyConverter","useUpsertContractEligibility","postCreateContractEligibility"]}
|
package/dist/chunk-OXCEJQFC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as B}from"./chunk-BV3PGYSH.js";import{a as ye,b as Ge,c as Je,d as qe,e as Ke,f as Ye,g as je,h as Ze,i as Xe,j as Ce,k as et,l as xe,m as be,o as Se,q as tt,r as ot,s as rt}from"./chunk-D6X2WCEG.js";import{b as Qe}from"./chunk-HPHWQU34.js";import{b as _e}from"./chunk-ANQ4HVVK.js";import{a as ve,b as $}from"./chunk-WVDTHFGS.js";import{b as S}from"./chunk-3ZWDIEEM.js";import{a as ne,b as ae,c as b,d as Ae,e as Oe,f as Ue,g as ze,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 h,e as oe}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as wo,useEffect as Ro,useRef as Ht}from"react";import{Fragment as Ot,jsx as A,jsxs as se}from"react/jsx-runtime";function le({name:e,defaultValue:t,description:n,label:o,onChange:s,multiple:d,options:c,component:F,...f}){let{components:l}=S(),{control:a}=b(),u=r((m,i,g)=>{let p=g.value?[...g.value]:[];i?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(y=>y!==m))},"handleCheckboxChange");return A(k,{control:a,name:e,defaultValue:t,render:({field:m,fieldState:i})=>{let g=F||l?.checkbox;if(g){let p={name:e,description:n,label:o,defaultValue:t,multiple:d,options:c,...f};return A(g,{field:{...m,onChange:r(y=>{if(d){let{checked:x,value:v}=y.target;u(v,x,m),s?.(x);return}m.onChange(y),s?.(y)},"onChange")},fieldState:i,fieldData:p})}return se(w,{"data-field":e,className:h(`RemoteFlows__CheckBoxField__Item__${e}`),children:[A(R,{children:se(Ot,{children:[c&&d?A(N,{children:o}):null,c&&d?c.map(p=>se("div",{className:"flex space-x-2",children:[A(ye,{id:p.value,onCheckedChange:y=>{u(p.value,y===!0,m),s?.(y,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),A(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):se("div",{className:"flex space-x-2",children:[A(ye,{id:e,onCheckedChange:p=>{m.onChange(p),s?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),A(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:o})]})]})}),n&&A(P,{children:n}),i.error&&A(D,{})]})}})}r(le,"CheckBoxField");import{CalendarIcon as Gt}from"lucide-react";import{PopoverClose as Jt}from"@radix-ui/react-popover";import{ChevronLeft as Ut,ChevronRight as Vt}from"lucide-react";import{DayPicker as zt}from"react-day-picker";import{jsx as ke}from"react/jsx-runtime";function nt({className:e,classNames:t,showOutsideDays:n=!0,...o}){return ke(zt,{showOutsideDays:n,className:h("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:h(ve({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:h("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",o.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:h(ve({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,...d})=>ke(Ut,{className:h("size-4",s),...d}),"IconLeft"),IconRight:r(({className:s,...d})=>ke(Vt,{className:h("size-4",s),...d}),"IconRight")},...o})}r(nt,"Calendar");import*as U from"@radix-ui/react-popover";import{jsx as ie}from"react/jsx-runtime";function me({...e}){return ie(U.Root,{"data-slot":"popover",...e})}r(me,"Popover");function de({...e}){return ie(U.Trigger,{"data-slot":"popover-trigger",...e})}r(de,"PopoverTrigger");function ce({className:e,align:t="center",sideOffset:n=4,...o}){return ie(U.Portal,{children:ie(U.Content,{"data-slot":"popover-content",align:t,sideOffset:n,className:h("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),...o})})}r(ce,"PopoverContent");import{format as at,parse as qt}from"date-fns";import{Fragment as Kt,jsx as M,jsxs as Ne}from"react/jsx-runtime";function st({description:e,label:t,name:n,minDate:o,onChange:s,component:d,...c}){let{components:F}=S(),{control:f}=b(),l;return c.meta?.mot&&typeof c.meta.mot=="number"?l=Ve(c.meta.mot):o&&(l=qt(o,"yyyy-MM-dd",new Date)),M(k,{control:f,name:n,render:({field:a,fieldState:u})=>{let m=d||F?.date;if(m){let i={description:e,label:t,name:n,onChange:s,...l&&{minDate:l.toISOString()},...c};return M(m,{field:{...a,onChange:r(g=>{a.onChange(g),s?.(g)},"onChange")},fieldState:u,fieldData:i})}return Ne(w,{"data-field":n,className:`flex flex-col RemoteFlows__DatePickerField__Item__${n}`,children:[M(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Ne(me,{children:[M(de,{asChild:!0,children:M(R,{children:M("div",{children:Ne($,{type:"button",variant:"outline",className:h("w-full pl-3 text-left font-normal",!a.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${n}`,children:[a.value&&M(Kt,{children:at(a.value,"yyyy-MM-dd")}),M(Gt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),M(ce,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:M(nt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:a.value?new Date(a.value):void 0,onSelect:i=>{a.onChange(i?at(i,"yyyy-MM-dd"):null),s?.(i)},defaultMonth:l,components:{DayContent:r(i=>M(Jt,{children:i.date.getDate()}),"DayContent")},...l&&{disabled:r(i=>i<l,"disabled")}})})]}),e?M(P,{children:e}):null,u.error&&M(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(st,"DatePickerField");import{useState as Yt,useRef as jt}from"react";import{Upload as Zt,X as Xt}from"lucide-react";import{jsx as V,jsxs as we}from"react/jsx-runtime";function lt({onChange:e,className:t,multiple:n}){let[o,s]=Yt([]),d=jt(null),c=r(l=>{l.preventDefault(),d.current?.click()},"handleClick"),F=r(l=>{if(l.target.files&&l.target.files.length>0){let a=Array.from(l.target.files);s(a),e(l)}},"handleChange"),f=r(l=>{s(a=>a.filter(u=>u!==l))},"onRemoveFile");return we("div",{className:h("flex flex-col items-start gap-4",t),children:[V("input",{type:"file",ref:d,onChange:F,className:"hidden","aria-label":"File upload",multiple:n}),we($,{type:"button",onClick:c,className:"gap-2",children:[V(Zt,{className:"h-4 w-4"}),"Choose File"]}),o.length===0&&V("div",{className:"text-sm",children:n?V("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):V("span",{className:"font-medium",children:"No file selected."})}),o.length>0&&o.map((l,a)=>we("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",V("span",{className:"font-medium",children:l.name})," (",Math.round(l.size/1024)," KB)",V($,{variant:"ghost",onClick:()=>f(l),children:V(Xt,{})})]},a))]})}r(lt,"FileUploader");import{jsx as z,jsxs as eo}from"react/jsx-runtime";var Qt=r(e=>new Promise((t,n)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result),o.onerror=s=>n(s)}),"toBase64"),it=r(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async o=>{let s=await Qt(o);return{name:o.name,content:s.split(",")[1]}}))},"convertFilesToBase64");function mt({name:e,description:t,label:n,multiple:o,onChange:s,component:d,...c}){let{components:F}=S(),{control:f}=b();return z(k,{control:f,name:e,render:({field:l,fieldState:a})=>{let u=d||F?.file;if(u){let m={name:e,description:t,label:n,multiple:o,...c};return z(u,{field:{...l,value:null,onChange:r(async i=>{let g=await it(i);l.onChange(g),s?.(g)},"onChange")},fieldState:a,fieldData:m})}return eo(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[z(N,{className:"RemoteFlows__FileUpload__Label",children:n}),z(R,{children:z(lt,{onChange:async m=>{let i=await it(m);l.onChange(i),s?.(i)},multiple:o,className:h("RemoteFlows__FileUpload__Input")})}),t&&z("div",{className:"flex items-center justify-between",children:z(P,{className:"RemoteFlows__FileUpload__Description",children:t})}),a.error&&z(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(mt,"FileUploadField");import{jsx as Re}from"react/jsx-runtime";function ue(e){let{components:t}=S(),{control:n}=b(),o=e.component||t?.number;return o?Re(k,{control:n,name:e.name,render:({field:s,fieldState:d})=>Re(o,{field:{...s,onChange:r(c=>{s.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Re(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ue,"NumberField");import{Fragment as to}from"react";import{jsx as W,jsxs as Pe}from"react/jsx-runtime";function dt({name:e,defaultValue:t,description:n,label:o,options:s,onChange:d,component:c,...F}){let{components:f}=S(),{control:l}=b();return W(k,{control:l,name:e,defaultValue:t,render:({field:a,fieldState:u})=>{let m=c||f?.radio;if(m){let i={name:e,defaultValue:t,description:n,label:o,options:s,...F};return W(m,{field:{...a,onChange:r(g=>{a.onChange(g),d?.(g)},"onChange")},fieldState:u,fieldData:i})}return Pe(w,{className:h("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:o}),W(R,{children:W(Ge,{"aria-label":o||e,onValueChange:i=>{a.onChange(i),d?.(i)},value:a.value,className:"flex flex-col space-y-3",children:s?.map(i=>W(to,{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:i.value,className:"RemoteFlows__RadioField__Input",disabled:i.disabled})}),Pe("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:i.label}),i.description&&W(P,{className:"mt-2",children:i.description})]})]})},i.value))})}),n&&W(P,{children:n}),u.error&&W(D,{})]})}})}r(dt,"RadioGroupField");import{jsx as E,jsxs as ct}from"react/jsx-runtime";function ut({label:e,name:t,options:n,defaultValue:o,description:s,onChange:d,component:c,...F}){let{control:f}=b(),{components:l}=S();return E(k,{defaultValue:o,control:f,name:t,render:({field:a,fieldState:u})=>{let m=c||l?.select;if(m){let i={label:e,name:t,options:n,defaultValue:o,description:s,onChange:d,...F};return E(m,{field:{...a,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;a.onChange(p),d?.(p)},"onChange")},fieldState:u,fieldData:i})}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:a.value||"",onValueChange:i=>{let g=F.jsonType==="number"?Number(i):i;a.onChange(g),d?.(g)},children:[E(je,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:E("span",{className:"absolute",children:E(Ye,{placeholder:e})})}),E(Ze,{className:"RemoteFlows__SelectField__Content",children:E(Ke,{className:"RemoteFlows__SelectField__Group",children:n.map(i=>E(Xe,{value:i.value,className:"RemoteFlows__SelectField__SelectItem",disabled:i.disabled,children:i.label},i.value))})})]})})}),s&&E(P,{children:s}),u.error&&E(D,{})]})}})}r(ut,"SelectField");import{useState as lo}from"react";import{Fragment as oo,useState as ro}from"react";import{Check as no,ChevronDownIcon as ao,X as so}from"lucide-react";import{Command as Y}from"cmdk";import{SearchIcon as tn}from"lucide-react";import{jsx as j,jsxs as an}from"react/jsx-runtime";function pt({className:e,...t}){return j(Y,{"data-slot":"command",className:h("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(pt,"Command");function ft({className:e,...t}){return j(Y.List,{"data-slot":"command-list",className:h("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ft,"CommandList");function Ft({...e}){return j(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(Ft,"CommandEmpty");function gt({className:e,...t}){return j(Y.Group,{"data-slot":"command-group",className:h("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(gt,"CommandGroup");function ht({className:e,...t}){return j(Y.Separator,{"data-slot":"command-separator",className:h("bg-border -mx-1 h-px",e),...t})}r(ht,"CommandSeparator");function _t({className:e,...t}){return j(Y.Item,{"data-slot":"command-item",className:h("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(_t,"CommandItem");import{jsx as L,jsxs as Z}from"react/jsx-runtime";function pe({options:e,selected:t,onChange:n,placeholder:o,...s}){let[d,c]=ro(!1),F=r(a=>{n(t.filter(u=>u.value!==a.value))},"handleUnselect"),f=e.some(a=>a.category),l=e.reduce((a,u)=>{let m=u.category||"Uncategorized";return a[m]||(a[m]=[]),a[m].push(u),a},{});return Z(me,{open:d,onOpenChange:c,...s,children:[L(de,{children:Z($,{variant:"outline",role:"combobox","aria-expanded":d,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(a=>Z(Qe,{variant:"secondary",className:"mr-1 mb-1",children:[a.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${a.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(a)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>F(a),children:L(so,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},a.label)):L("span",{className:"text-foreground",children:o})}),L(ao,{className:"size-4"})]})}),L(ce,{align:"start",className:"w-full p-0",children:L(pt,{children:Z(ft,{children:[L(Ft,{children:"No item found."}),Object.entries(l).map(([a,u],m)=>Z(oo,{children:[m>0&&L(ht,{}),L(gt,{heading:f?a:void 0,children:u.map(i=>{let g=t.some(p=>p.value===i.value);return Z(_t,{onSelect:()=>{n(g?t.filter(p=>p.value!==i.value):[...t,i])},children:[L(no,{className:h("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),i.label]},i.label)})})]},a))]})})})]})}r(pe,"MultiSelect");import{jsx as G,jsxs as io}from"react/jsx-runtime";function yt({label:e,name:t,options:n,defaultValue:o,description:s,onChange:d,$meta:c,component:F,...f}){let{control:l}=b(),{components:a}=S(),[u,m]=lo([]);return G(k,{defaultValue:o,control:l,name:t,render:({field:i,fieldState:g})=>{let p=F||a?.countries;if(p){let v={label:e,name:t,options:n,defaultValue:o,description:s,onChange:d,$meta:c,...f};return G(p,{field:{...i,onChange:r(T=>{i.onChange(T),d?.(T)},"onChange")},fieldState:g,fieldData:v})}let y=[...Object.entries(c?.regions||{}).map(([v,T])=>({value:T,label:v,category:"Regions"})),...Object.entries(c?.subregions||{}).map(([v,T])=>({value:T,label:v,category:"Subregions"})),...n.map(v=>({...v,value:v.value,label:v.label,category:"Countries"}))],x=r(v=>{let T=v.map(({value:K})=>K);i.onChange(T),d?.(T),m(v)},"handleChange");return io(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[G(N,{className:"RemoteFlows__CountryField__Label",children:e}),G(R,{children:G(pe,{options:y,selected:u,onChange:x,...f})}),s&&G(P,{children:s}),g.error&&G(D,{})]})}})}r(yt,"CountryField");import*as vt from"react";import{jsx as mo}from"react/jsx-runtime";var De=vt.forwardRef(({className:e,...t},n)=>mo("textarea",{className:h("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:n,...t}));De.displayName="Textarea";import{jsx as J,jsxs as Te}from"react/jsx-runtime";function Ct({name:e,description:t,label:n,onChange:o,maxLength:s,component:d,...c}){let{components:F}=S(),{control:f}=b();return J(k,{control:f,name:e,render:({field:l,fieldState:a})=>{let u=d||F?.textarea;if(u){let i={name:e,description:t,label:n,maxLength:s,...c};return J(u,{field:{...l,onChange:r(g=>{l.onChange(g),o?.(g)},"onChange")},fieldState:a,fieldData:i})}let m=l.value?.length??0;return Te(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[J(N,{className:"RemoteFlows__TextArea__Label",children:n}),J(R,{children:J(De,{...l,value:l.value??"",onChange:i=>{l.onChange(i),o?.(i)},className:h(a.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:n})}),(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:[m,"/",s]})]}),a.error&&J(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(Ct,"TextAreaField");import{jsx as Ie}from"react/jsx-runtime";function xt(e){let{components:t}=S(),{control:n}=b(),o=e.component||t?.email;return o?Ie(k,{control:n,name:e.name,render:({field:s,fieldState:d})=>Ie(o,{field:{...s,onChange:r(c=>{s.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Ie(B,{...e,type:"email"})}r(xt,"EmailField");import{jsx as bt}from"react/jsx-runtime";function St(e){let{control:t}=b();return bt(k,{control:t,name:e.name,render:({field:n})=>bt("input",{...n,type:"hidden"})})}r(St,"HiddenField");import ho,{useEffect as _o,useState as $t}from"react";var kt=r((e,t,n)=>{if(e&&"reportValidity"in e){let o=ne(n,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},"r"),$e=r((e,t)=>{for(let n in t.fields){let o=t.fields[n];o&&o.ref&&"reportValidity"in o.ref?kt(o.ref,n,e):o&&o.refs&&o.refs.forEach(s=>kt(s,n,e))}},"o"),wt=r((e,t)=>{t.shouldUseNativeValidation&&$e(e,t);let n={};for(let o in e){let s=ne(t.fields,o),d=Object.assign(e[o]||{},{ref:s&&s.ref});if(co(t.names||Object.keys(e),o)){let c=Object.assign({},ne(n,o));ae(c,"root",d),ae(n,o,c)}else ae(n,o,d)}return n},"s"),co=r((e,t)=>{let n=Nt(t);return e.some(o=>Nt(o).match(`^${n}\\.\\d+`))},"i");function Nt(e){return e.replace(/\]|\[/g,"")}r(Nt,"n");function Rt(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),function(o,s,d){try{return Promise.resolve(function(c,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[n.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:s}))).then(function(l){return d.shouldUseNativeValidation&&$e({},d),{values:n.raw?Object.assign({},o):l,errors:{}}}))}catch(l){return F(l)}return f&&f.then?f.then(void 0,F):f}(0,function(c){if(!c.inner)throw c;return{values:{},errors:wt((F=c,f=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(F.inner||[]).reduce(function(l,a){if(l[a.path]||(l[a.path]={message:a.message,type:a.type}),f){var u=l[a.path].types,m=u&&u[a.type];l[a.path]=Ae(a.path,f,l,a.type,m?[].concat(m,a.message):a.message)}return l},{})),d)};var F,f}))}catch(c){return Promise.reject(c)}}}r(Rt,"o");import*as I from"yup";import Pt from"lodash.groupby";import X from"lodash.capitalize";var Dt=60,fe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function uo(e){if(e<60)return`${e}m`;let t=Math.floor(e/Dt),n=e%Dt;return n>0?`${t}h${n}m`:`${t}h`}r(uo,"convertBreakDurationToHours");function Tt(e){let t=e.reduce((n,o)=>o.hours+n,0);return Number(t.toFixed(2))}r(Tt,"calculateTotalWorkHours");function po(e,t){let n=t.map(({day:d})=>d.toLowerCase()),o=n.indexOf(e),s=null;for(;o<n.length&&!s;){let d=n[o],c=n[o+1],F=fe.indexOf(d)+1;fe[F]===c||(s=d),o+=1}return s}r(po,"findLastConsecutiveDay");function fo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(fo,"shouldSummarizeSchedule");function Fo(e){return Number.parseInt(e.break_duration_minutes)>0}r(Fo,"shouldSummarizeBreaks");function It(e){let t=e.filter(fo),n=Pt(t,F=>`${F.start_time}|${F.end_time}`),o=e.filter(Fo),s=Pt(o,"break_duration_minutes"),d=Object.keys(n).map(F=>{let f=n[F],l=f[0].day,[a,u]=F.split("|"),m=`from <span>${a.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,i=po(l,f),p=(i?f.findIndex(y=>y.day===i):-1)===f.length-1;return f.length===1?`${X(l)}, ${m}`:!p||!i?f.reduce((y,x,v)=>{let T=X(x.day);return v===f.length-1?`${y}and ${T}, ${m}`:`${y}<span>${T}</span>, `},""):`<span>${X(l)}</span> to <span>${X(i)}</span>, ${m}`}),c=Object.keys(s).reverse().map((F,f)=>{let l=f===0,a=s[F],u=uo(parseInt(F,10));if(Object.keys(s).length===1)return`With ${u} daily breaks`;if(a.length===1){let m=`${u} break on ${X(a[0].day)}.`;return l?`With ${m}`:m}return a.reduce((m,i,g)=>{let p=X(i.day);return g===0?`${m} ${p}`:g===a.length-1?`${m}, and ${p}.`:`${m}, ${p}`},l?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:d,breakSummary:c}}r(It,"buildWorkScheduleSummary");function Me(e){let{checked:t,start_time:n,end_time:o,break_duration_minutes:s}=e;if(!t)return 0;let[d,c]=n.split(":").map(Number),[F,f]=o.split(":").map(Number),l=d*60+c,m=(F*60+f-l-Number.parseInt(s||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Me,"calculateHours");var go={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function Fe(e){return go[e]}r(Fe,"getShortWeekday");import{jsx as _,jsxs as H}from"react/jsx-runtime";var yo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.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:I.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:I.number().default(0),break_duration_minutes:I.string().default("0")}),vo=I.object({schedule:I.array(yo)});function Co({defaultSchedule:e,onSubmit:t}){let[n,o]=$t(!1),s=fe.map(p=>{let y=e.find(x=>x.day.toLowerCase()===Fe(p).toLowerCase()||x.day.toLowerCase()===p.toLowerCase());return y?{...y,day:Fe(p),checked:!0}:{...e[0],checked:!1,day:Fe(p)}}),d=Ue({defaultValues:{schedule:s},resolver:Rt(vo)}),{handleSubmit:c,watch:F,reset:f,control:l,formState:a}=d,{fields:u}=Oe({name:"schedule",control:l}),m=F("schedule");function i(p){let y=p.schedule.filter(({checked:x})=>x).map(x=>({...x,hours:Me(x)}));t(y),o(!1)}r(i,"handleSubmitWorkingHours");function g(){f(),o(!1)}return r(g,"handleCancel"),_("div",{className:"flex items-center justify-between",children:H(Ce,{open:n,onOpenChange:o,children:[_(et,{asChild:!0,children:_($,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(xe,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[_(be,{children:_(Se,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),_(ze,{...d,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("div",{className:"rounded-lg",children:[_("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."}),H("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[_("div",{className:"col-span-2"}),_("div",{className:"col-span-3 text-center",children:"START"}),_("div",{className:"col-span-1 text-center"}),_("div",{className:"col-span-3 text-center",children:"END"}),_("div",{className:"col-span-2 text-center",children:"HOURS"})]}),_("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((p,y)=>{let x=m[y],v=Me(x);return H(ho.Fragment,{children:[H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[_("div",{className:"col-span-2 flex items-center gap-3",children:_(le,{label:p.day,name:`schedule.${y}.checked`})}),_("div",{className:"col-span-3",children:_(B,{name:`schedule.${y}.start_time`,includeErrorMessage:!1})}),_("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),_("div",{className:"col-span-3",children:_(B,{name:`schedule.${y}.end_time`,includeErrorMessage:!1})}),_("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(v)?"-":`${v} hours`})]}),H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[_("div",{className:"col-span-2 text-gray-500",children:"Break"}),_("div",{className:"col-span-2",children:_(B,{name:`schedule.${y}.break_duration_minutes`,includeErrorMessage:!1})}),_("div",{className:"col-span-2 text-gray-500",children:"minutes"}),_("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(a.errors).length>0&&_("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[_($,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),_($,{type:"button",className:"submit-button",onClick:c(i),children:"Save Schedule"})]})]})})]})]})})}r(Co,"WorkScheduleSelectionForm");function Mt(e){let{components:t}=S(),{setValue:n,control:o,watch:s}=b(),d=s(e.name),[c,F]=$t(d),{workHoursSummary:f,breakSummary:l}=It(c),a=Tt(c);_o(()=>{n(e.name,c)},[c,e.name,n]);function u(i){F(i)}r(u,"onSubmit");let m=e.component||t?.["work-schedule"];return m?_(k,{control:o,name:e.name,render:({field:i,fieldState:g})=>_(m,{field:{...i,onChange:r(p=>{i.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:l,totalWorkHours:a}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[_("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[_("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),_("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:l.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",_("span",{children:a})," hours per week"]}),_(Co,{defaultSchedule:c,onSubmit:u})]})]})}r(Mt,"WorkScheduleField");import{useState as xo}from"react";import{jsx as q,jsxs as bo}from"react/jsx-runtime";function Et({label:e,name:t,options:n,defaultValue:o,description:s,onChange:d,component:c,...F}){let{control:f}=b(),{components:l}=S(),[a,u]=xo();return q(k,{defaultValue:o,control:f,name:t,render:({field:m,fieldState:i})=>{let g=c||l?.["multi-select"];if(g){let y={label:e,name:t,options:n,defaultValue:o,description:s,onChange:d,...F};return q(g,{field:{...m,onChange:r(x=>{m.onChange(x),d?.(x)},"onChange")},fieldState:i,fieldData:y})}let p=a||n.filter(y=>m.value.includes(y.value));return bo(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[q(N,{className:"RemoteFlows__SelectField__Label",children:e}),q(R,{children:q(pe,{options:n,selected:p,onChange:y=>{let x=y.map(({value:v})=>v);m.onChange(x),d?.(x),u(y)},...F})}),s&&q(P,{children:s}),i.error&&q(D,{})]})}})}r(Et,"MultiSelectField");import{jsx as So}from"react/jsx-runtime";var Wt=r(e=>So(ue,{maxLength:15,...e}),"MoneyField");var Ee={checkbox:le,text:B,email:xt,money:Wt,select:ut,"multi-select":Et,radio:dt,number:ue,file:mt,date:st,textarea:Ct,countries:yt,hidden:St,"work-schedule":Mt};import{AlertCircle as ko}from"lucide-react";import{jsx as ge,jsxs as No}from"react/jsx-runtime";function Lt({title:e,description:t,severity:n}){let{components:o}=S();if(o?.statement){let s=o?.statement;return ge(s,{data:{title:e,description:oe(t),severity:n}})}return No(tt,{variant:"warning",children:[ge(ko,{className:"h-4 w-4"}),e&&ge(ot,{children:e}),t&&ge(rt,{dangerouslySetInnerHTML:{__html:oe(t)}})]})}r(Lt,"Statement");import{Fragment as Do,jsx as O,jsxs as Q}from"react/jsx-runtime";var Po=r(({isExpanded:e,onToggle:t,className:n,...o})=>O($,{type:"button",className:h("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",n),variant:"default",onClick:t,...o,children:e?"Remove":"Define"}),"DefaultToggleButton");function us({label:e,name:t,fields:n,description:o,components:s,statement:d,isFlatFieldset:c,extra:F,variant:f="outset",features:l,meta:a}){let{helpCenter:u}=a||{},{watch:m,setValue:i,trigger:g,formState:p}=b(),{components:y}=S(),x=l?.toggle?.stateField,v=x?m(x):l?.toggle?.defaultExpanded??!0,T=n.map(({name:C})=>`${t}.${C}`),K=m(T),We=Ht(K),ee=Ht(null),Bt=r(()=>{x&&i(x,!v)},"toggleExpanded");Ro(()=>{let C=K,re=We.current,he=p.isSubmitted||p.submitCount>0,Be=!1;for(let te=0;te<C.length;te++)if(C[te]!==void 0&&re[te]!==C[te]){Be=!0;break}return Be&&he&&(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{g()},50)),We.current=[...C],()=>{ee.current&&clearTimeout(ee.current)}},[K,g,p.isSubmitted,p.submitCount]);let At=y?.fieldsetToggle||Po,Le=`${t}-content`,He=`${t}-header`;return Q("fieldset",{className:h("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[O("legend",{className:h("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),u?.callToAction&&u?.id&&f==="outset"&&O(_e,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:u.id,children:u.callToAction}),f==="inset"&&Q(Do,{children:[Q("div",{className:"RemoteFlows__FieldSetField__Header",id:He,"data-state":v?"expanded":"collapsed","aria-expanded":v,children:[O("h3",{className:h("RemoteFlows__FieldSetField__Title"),children:e}),l?.toggle?.enabled&&O(At,{isExpanded:v,onToggle:Bt,"aria-expanded":v,"aria-controls":Le,"aria-label":`${v?"Hide":"Show"} ${e}`,className:h("RemoteFlows__FieldSetField__Toggle",l.toggle?.className),children:v?l.toggle.labels?.collapse??"Remove":l.toggle.labels?.expand??"Define"})]}),u?.callToAction&&u?.id&&O(_e,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:u.id,children:u.callToAction})]}),v&&Q("div",{id:Le,"aria-labelledby":He,role:"region",children:[o?O("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:oe(o)}}):null,Q("div",{className:"grid gap-4",children:[n.map(C=>{C.calculateDynamicProperties&&(C={...C,...C.calculateDynamicProperties(K,C)||{}});let re=Ee[C.type];if(C.isVisible===!1||C.deprecated)return null;if(C.Component){let{Component:he}=C;return O(he,{...C},C.name)}return C.type==="select"&&C.multiple&&(re=Ee["multi-select"]),Q(wo,{children:[O(re,{...C,name:`${c?C.name:`${t}.${C.name}`}`,component:s?.[C.type]}),C.extra?C.extra:null]},`${c?C.name:`${t}.${C.name}`}`)}),F||null,d?O(Lt,{...d}):null]})]})]})}r(us,"FieldSetField");export{Ee as a,Lt as b,us as c};
|
|
2
|
-
//# sourceMappingURL=chunk-OXCEJQFC.js.map
|