@remoteoss/remote-flows 0.18.0 → 0.18.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-QKKEFL4Z.js → chunk-2RZABLV2.js} +2 -2
- package/dist/chunk-6GMGXSKN.js +2 -0
- package/dist/{chunk-NGJXBBXW.js → chunk-FTW6Z4IF.js} +2 -2
- package/dist/chunk-JUJZENG7.js +2 -0
- package/dist/chunk-JUJZENG7.js.map +1 -0
- package/dist/{chunk-5BQOPJTQ.js → chunk-NCA3UCCX.js} +2 -2
- package/dist/{chunk-OT2DXWYZ.js → chunk-UWIFE5LJ.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +2 -2
- package/dist/flows/ContractAmendment/hooks.d.ts +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- package/dist/flows/CostCalculator/context.d.ts +2 -2
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +2 -2
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +2 -2
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +2 -2
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +2 -2
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +2 -2
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +2 -2
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +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/context.d.ts +2 -2
- package/dist/flows/Onboarding/hooks.d.ts +2 -2
- package/dist/flows/Onboarding/index.d.ts +2 -2
- 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.d.ts +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +1 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +1 -1
- package/dist/flows/Termination/context.d.ts +2 -2
- package/dist/flows/Termination/hooks.d.ts +1 -1
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +1 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{remoteFlows-BLMhusyP.d.ts → remoteFlows-BdsVZGGF.d.ts} +1 -1
- package/dist/{types.gen-CaXCWhlP.d.ts → types.gen-nWJIP4db.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-HSW5HMHH.js +0 -2
- package/dist/chunk-NTEIOU72.js +0 -2
- package/dist/chunk-NTEIOU72.js.map +0 -1
- /package/dist/{chunk-QKKEFL4Z.js.map → chunk-2RZABLV2.js.map} +0 -0
- /package/dist/{chunk-HSW5HMHH.js.map → chunk-6GMGXSKN.js.map} +0 -0
- /package/dist/{chunk-NGJXBBXW.js.map → chunk-FTW6Z4IF.js.map} +0 -0
- /package/dist/{chunk-5BQOPJTQ.js.map → chunk-NCA3UCCX.js.map} +0 -0
- /package/dist/{chunk-OT2DXWYZ.js.map → chunk-UWIFE5LJ.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-XGEKV3FC.js";import{a as p}from"./chunk-53NFLDRX.js";import{a as m}from"./chunk-DCRLPAJL.js";import{a as n}from"./chunk-QQ7KPOLK.js";import{a as e}from"./chunk-UWIFE5LJ.js";import{a as T}from"./chunk-A6EYY3FO.js";import{a}from"./chunk-CYKK3LPJ.js";import{a as f}from"./chunk-RZTT3MEP.js";import{a as t}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as u}from"react/jsx-runtime";var A=i(({employmentId:d,render:s,options:l})=>{let y=c(),o=e({employmentId:d,options:l});return u(t.Provider,{value:{formId:y,terminationBag:o},children:s({terminationBag:o,components:{SubmitButton:m,TimeOff:n,Back:r,EmployeeComunicationStep:a,TerminationDetailsStep:p,PaidTimeOffStep:f,AdditionalDetailsStep:T}})})},"TerminationFlow");export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2RZABLV2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as m}from"./chunk-W5DG5WWJ.js";import{a as e}from"./chunk-VX2UC3HG.js";import{a as i}from"./chunk-XSHHMBMT.js";import{a as o}from"./chunk-JODJFARP.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6GMGXSKN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as f,d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as f,d}from"./chunk-JUJZENG7.js";import{a as u}from"./chunk-HN5HLFTB.js";import{a as m}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-CFIJKJXD.js";import{f as y}from"./chunk-3BREUYLG.js";import{a as c}from"./chunk-P37U34EQ.js";import{useEffect as h,useId as b,useState as B}from"react";import{jsx as E}from"react/jsx-runtime";var i=c((r,e,o)=>o&&o[e]?o[e]:r[e]?r[e]/100:0,"getDefaultManagementFee"),T=c(({estimationOptions:r=f,defaultValues:e={countryRegionSlug:"",currencySlug:"",salary:"",benefits:{}},options:o,render:S,version:p="standard"})=>{let F=b(),[R,g]=B("USD"),_=c(s=>{g(s);let t=i(u,s,r.managementFees);t&&a.setValue("management.management_fee",t)},"onCurrencyChange"),n=d({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:r,version:p,options:{...o,onCurrencyChange:_}}),v=C(n.handleValidation),K=e.currencySlug?"":i(u,R,r.managementFees),a=y({resolver:v,defaultValues:{country:e?.countryRegionSlug,currency:e?.currencySlug,region:"",salary:e?.salary,salary_conversion:"",salary_converted:"",hiring_budget:e?.hiringBudget||"employee_annual_salary",management:{management_fee:K},benefits:e?.benefits,estimation_title:r.title},shouldUnregister:!1,mode:"onBlur"});return h(()=>{if(e.currencySlug&&n.currencies&&r.includeManagementFee){let t=n.currencies.find(l=>l.value===e.currencySlug)?.label;if(t){g(t);let l=i(u,t,r.managementFees);a.setValue("management.management_fee",l)}}},[e.currencySlug,n.currencies,r.includeManagementFee,r.managementFees,a]),E(m.Provider,{value:{form:a,formId:F,costCalculatorBag:n},children:S(n)})},"CostCalculatorFlow");export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FTW6Z4IF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as W}from"./chunk-ALYKEN3E.js";import{a as K}from"./chunk-VFRHMNLJ.js";import{a as G,b as I,c as z,e as Q}from"./chunk-V2YORDAL.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as N}from"./chunk-CFIJKJXD.js";import{c as X}from"./chunk-U4NWXPI5.js";import{c as M}from"./chunk-PAQW5BFW.js";import{a as i}from"./chunk-P37U34EQ.js";import{number as Re,object as ae}from"yup";import{createHeadlessForm as he,modify as Fe}from"@remoteoss/json-schema-form";import{useCallback as Ve,useEffect as Y,useMemo as Me,useState as j}from"react";import{string as Z,ValidationError as ee}from"yup";import{jsx as te}from"react/jsx-runtime";var k={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},je=i(t=>{let{schema:a}=Fe(K.data.schema,t?.jsfModify||{});return he(a)},"useStaticSchema");function Pe(t,a){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return a==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}i(Pe,"getSalaryTitle");var Ne=i(({defaultRegion:t,defaultCurrency:a,defaultSalary:l,estimationOptions:s,options:r,version:o}={estimationOptions:k})=>{let[c,S]=j(t),[P,R]=j(),[d,q]=j(),[H,ie]=j(),{data:_,isLoading:oe}=G({includePremiumBenefits:s.includePremiumBenefits}),{data:f,isLoading:se}=I(),le=c||P?.value,{data:w,isLoading:ue}=Q(le,{includePremiumBenefits:s.includePremiumBenefits,options:r}),U=z(),E=P?.currency,p=r?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Ve(()=>{let e=E&&d?E!==d:!1;return E!==d?{from:d,to:E,shouldSwapOrder:e}:{from:E,to:d,shouldSwapOrder:e}},[E,d]),J=s.showManagementFee,$=s.includeEstimationTitle,ce=Me(()=>{let{from:e,to:n,shouldSwapOrder:m}=L(),u=Pe(p,H);return{fields:{salary:{...p,title:u,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:n},Component:i(y=>te(W,{...y,shouldSwapOrder:m,conversionType:o==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...r?.jsfModify?.fields?.hiring_budget,presentation:{hidden:o=="marketing"}},management:{...r?.jsfModify?.fields?.management,properties:{...r?.jsfModify?.fields?.management?.properties,management_fee:{...r?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:d||"USD"}}}},presentation:{...typeof r?.jsfModify?.fields?.management=="object"?(r?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:i(y=>te(X,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...r?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[d,p,H,F?.salary_conversion_properties?.description,F?.salary_conversion_properties?.label,l,L,r?.jsfModify?.fields?.management,J,o,$,r?.jsfModify?.fields?.estimation_title]),g=je({jsfModify:{fields:{...r?.jsfModify?.fields,...ce?.fields}}});Y(()=>{if(t&&_){let e=_.find(({value:n})=>n===t);e&&R(e)}},[t,_]),Y(()=>{if(a&&f){let e=f.find(({value:n})=>n===a);e&&q(e.label)}},[a,f]);async function me(e){try{await x.validate(e,{abortEarly:!1})}catch(n){return{data:null,error:n}}return new Promise((n,m)=>{U.mutate(re(e,s,o),{onSuccess:i(u=>{u.data?n({data:u.data,error:null}):m({data:null,error:u.error})},"onSuccess"),onError:i(u=>{m({data:null,error:u})},"onError")})})}i(me,"onSubmit");function de(e){let n=_?.find(({value:m})=>m===e);n&&n.childRegions.length===0&&n.hasAdditionalFields?S(n.regionSlug):S(void 0),R(n)}i(de,"onCountryChange");function fe(e){S(e)}i(fe,"onRegionChange");function ge(e){ie(e.target.value)}i(ge,"onHiringBudgetChange");function ye(e){let n=f?.find(m=>m.value===e)?.label;q(n),r?.onCurrencyChange?.(n||"")}i(ye,"onChangeCurrency");let b=g.fields.find(e=>e.name==="region");if(b){let e=P?.childRegions.map(n=>({value:n.slug,label:n.name}))??[];b.options=e,b.isVisible=e.length>0,b.required=e.length>0,b.onChange=fe,b.schema=e.length>0?Z().transform(n=>typeof n=="string"?n:"").required("Region is required"):Z()}if(f){let e=g.fields.find(n=>n.name==="currency");e&&(e.options=f,e.onChange=ye)}let v=g.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=ge),_){let e=g.fields.find(n=>n.name==="country");e&&(e.options=_,e.onChange=de)}let pe=i(()=>{R(void 0),S(t)},"resetForm"),D=[...g.fields.filter(e=>e.name!=="management"),...w?.fields||[],...g.fields.filter(e=>e.name==="management")],x=ne(g.fields,d||"USD",s.includeEstimationTitle);async function Ce(e){let n=null;r?.onValidation?.(e);let m=M(e,D);try{await x.validate(m,{abortEarly:!1}),n={formErrors:{},yupError:new ee([],e)}}catch(h){let T=N(h);n={formErrors:Object.entries(T).reduce((O,[A,V])=>({...O,[A]:V.message}),{}),yupError:h}}let u=w?.handleValidation(m),y=[...n?.yupError.inner||[],...u?.yupError?.inner||[]],B={...n?.yupError?.value||{},...u?.yupError?.value||{}};return{formErrors:{...n?.formErrors||{},...u?.formErrors||{}},yupError:new ee(y,B)}}return i(Ce,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:x,parseFormValues:i(e=>{let{country:n,region:m,currency:u,salary_converted:y,hiring_budget:B,salary_conversion:h,management:T,estimation_title:O,...A}=e,V=e.salary;y==="salary_conversion"&&(V=h);let _e=M({country:n,region:m,salary:V,salary_converted:y,salary_conversion:h,hiring_budget:B,currency:u,management:T,estimation_title:O},g.fields),Ee=M(A,w?.fields||[]),be={currency_code:f?.find(Se=>Se.value===u)?.label};return{..._e,...Ee,...be}},"parseFormValues"),handleValidation:Ce,isSubmitting:U.isPending,isLoading:oe&&se&&ue,onSubmit:me,resetForm:pe,currencies:f}},"useCostCalculator");function ne(t,a,l){let s=t.reduce((r,o)=>(o.name==="salary"||o.name==="salary_conversion"?r[o.name]=o.schema.when("salary_converted",{is:i(c=>c===o.name,"is"),then:i(c=>c.required("Required field"),"then"),otherwise:i(c=>c.optional(),"otherwise")}):o.name==="management"?r[o.name]=ae({management_fee:Re().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(a?C[a]:C.USD,()=>`Management fee cannot exceed ${(a?C[a]:C.USD)/100} ${a}`)}):o.name==="estimation_title"&&l?r[o.name]=o.schema.required("Required field"):r[o.name]=o.schema,r),{});return ae(s)}i(ne,"buildValidationSchema");function we(t){let a="benefit-";return Object.keys(t).reduce((l,s)=>{let r=t[s];if(r==="none")return l;let c={benefit_group_slug:s.replace(a,""),benefit_tier_slug:r};return[...l,c]},[])}i(we,"formatBenefits");function xe(t,a,l){let s=Number(t.management?.management_fee),r=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||a.title,age:t.age??void 0,...t.benefits&&{benefits:we(t.benefits)},...a.includeManagementFee&&s&&{discount:{quoted_amount:a.showManagementFee?s:C[r]||C.USD,text:""}}},...Be(t,l)}}i(xe,"mapValueToEmployment");function Be(t,a){let l=a==="marketing"||t.salary_converted==="salary_conversion",s=a==="standard"&&t.salary_converted==="salary",r=t.hiring_budget==="my_hiring_budget";if(l){let o=t.salary_converted==="salary_conversion";return r?{annual_total_cost_in_employer_currency:t.salary}:{[o?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?r?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}i(Be,"getSalaryFields");function re(t,a=k,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(o=>o.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:a.includeBenefits,include_cost_breakdowns:a.includeCostBreakdowns,include_premium_benefits:a.includePremiumBenefits,include_management_fee:a.includeManagementFee,employments:s.map(r=>xe(r,a,l))}}i(re,"buildPayload");export{ne as a,re as b,k as c,Ne as d};
|
|
2
|
+
//# sourceMappingURL=chunk-JUJZENG7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/CostCalculator/utils.ts","../src/flows/CostCalculator/hooks.tsx"],"sourcesContent":["import type {\n CostCalculatorEmploymentParam,\n CostCalculatorEstimateParams,\n} from '@/src/client';\n\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { AnyObjectSchema, number, object } from 'yup';\nimport { CostCalculatorVersion, defaultEstimationOptions } from './hooks';\nimport type {\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n CurrencyKey,\n} from './types';\nimport { BASE_RATES } from '@/src/flows/CostCalculator/constants';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(\n fields: $TSFixMe[],\n employerBillingCurrency: string,\n includeEstimationTitle?: boolean,\n) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n // Special handling for salary fields\n if (field.name === 'salary' || field.name === 'salary_conversion') {\n fieldsSchemaAcc[field.name] = (field.schema as AnyObjectSchema).when(\n 'salary_converted',\n {\n is: (val: string | null) => val === field.name,\n then: (schema) => schema.required('Required field'),\n otherwise: (schema) => schema.optional(),\n },\n );\n } else if (field.name === 'management') {\n fieldsSchemaAcc[field.name] = object({\n management_fee: number()\n .transform((value) => {\n return isNaN(value) ? undefined : value;\n })\n .min(0, 'Management fee must be greater than or equal to 0')\n .max(\n employerBillingCurrency\n ? BASE_RATES[employerBillingCurrency as CurrencyKey]\n : BASE_RATES.USD,\n () => {\n const maxValue = employerBillingCurrency\n ? BASE_RATES[employerBillingCurrency as CurrencyKey]\n : BASE_RATES.USD;\n const displayValue = maxValue / 100;\n return `Management fee cannot exceed ${displayValue} ${employerBillingCurrency}`;\n },\n ),\n });\n } else if (field.name === 'estimation_title' && includeEstimationTitle) {\n // Make estimation_title required when includeEstimationTitle is true\n fieldsSchemaAcc[field.name] = (\n field.schema as AnyObjectSchema\n ).required('Required field');\n } else {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n }\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\n/**\n * Format the benefits to the expected format by the API.\n * @param benefits\n * @returns\n */\nfunction formatBenefits(benefits: Record<string, string>) {\n const needle = 'benefit-';\n return Object.keys(benefits).reduce<\n Array<{ benefit_group_slug: string; benefit_tier_slug: string }>\n >((acc, key) => {\n const benefitTierSlug = benefits[key];\n if (benefitTierSlug === 'none') {\n return acc;\n }\n const benefitGroupSlug = key.replace(needle, '');\n const benefitEntry = {\n benefit_group_slug: benefitGroupSlug,\n benefit_tier_slug: benefitTierSlug,\n };\n return [...acc, benefitEntry];\n }, []);\n}\n\nfunction mapValueToEmployment(\n value: CostCalculatorEstimationSubmitValues,\n estimationOptions: CostCalculatorEstimationOptions,\n version: CostCalculatorVersion,\n): CostCalculatorEmploymentParam {\n const managementFee = Number(value.management?.management_fee);\n const currencyCode = value.currency_code;\n\n const base: CostCalculatorEmploymentParam = {\n region_slug: value.region || value.country,\n employment_term: value.contract_duration_type ?? 'fixed',\n title: value.estimation_title || estimationOptions.title,\n age: value.age ?? undefined,\n ...(value.benefits && { benefits: formatBenefits(value.benefits) }),\n ...(estimationOptions.includeManagementFee &&\n managementFee && {\n discount: {\n quoted_amount: estimationOptions.showManagementFee\n ? managementFee\n : BASE_RATES[currencyCode as keyof typeof BASE_RATES] ||\n BASE_RATES.USD,\n text: '',\n },\n }),\n };\n\n return {\n ...base,\n ...getSalaryFields(value, version),\n };\n}\n\nfunction getSalaryFields(\n value: CostCalculatorEstimationSubmitValues,\n version: CostCalculatorVersion,\n): Partial<CostCalculatorEmploymentParam> {\n const isMarketing =\n version === 'marketing' || value.salary_converted === 'salary_conversion';\n const isStandard =\n version === 'standard' && value.salary_converted === 'salary';\n const useHiringBudget = value.hiring_budget === 'my_hiring_budget';\n\n if (isMarketing) {\n const useEmployerCurrency = value.salary_converted === 'salary_conversion';\n return useHiringBudget\n ? {\n annual_total_cost_in_employer_currency: value.salary,\n }\n : {\n [useEmployerCurrency\n ? 'annual_gross_salary_in_employer_currency'\n : 'annual_gross_salary']: value.salary,\n };\n }\n\n if (isStandard) {\n return useHiringBudget\n ? {\n annual_total_cost: value.salary,\n }\n : {\n annual_gross_salary: value.salary,\n };\n }\n\n return {};\n}\n\n/**\n * Build the payload for the cost calculator estimation.\n * @param values\n * @param estimationOptions\n * @returns\n */\nexport function buildPayload(\n values:\n | CostCalculatorEstimationSubmitValues\n | CostCalculatorEstimationSubmitValues[],\n estimationOptions: CostCalculatorEstimationOptions = defaultEstimationOptions,\n version: CostCalculatorVersion = 'standard',\n): CostCalculatorEstimateParams {\n const employments = Array.isArray(values) ? values : [values];\n\n if (employments.length === 0) {\n throw new Error('At least one employment value is required');\n }\n\n if (employments.length > 1) {\n const currencies = new Set(employments.map((v) => v.currency));\n if (currencies.size > 1) {\n console.warn(\n 'Multiple currencies detected in array. Using currency from first employment.',\n );\n }\n }\n\n return {\n employer_currency_slug: employments[0].currency,\n include_benefits: estimationOptions.includeBenefits,\n include_cost_breakdowns: estimationOptions.includeCostBreakdowns,\n include_premium_benefits: estimationOptions.includePremiumBenefits,\n include_management_fee: estimationOptions.includeManagementFee,\n employments: employments.map((value) =>\n mapValueToEmployment(value, estimationOptions, version),\n ),\n };\n}\n","import {\n CostCalculatorEstimateResponse,\n MinimalRegion,\n PostCreateEstimationError,\n} from '@/src/client';\nimport { jsonSchema } from '@/src/flows/CostCalculator/jsonSchema';\nimport type {\n CostCalculatorEstimationFormValues,\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n EstimationError,\n UseCostCalculatorOptions,\n} from '@/src/flows/CostCalculator/types';\nimport type { JSFModify, Result } from '@/src/flows/types';\n\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { iterateErrors } from '@/src/components/form/yupValidationResolver';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { string, ValidationError } from 'yup';\nimport { buildPayload, buildValidationSchema } from './utils';\nimport {\n useCompanyCurrencies,\n useCostCalculatorCountries,\n useCostCalculatorEstimation,\n useRegionFields,\n} from '@/src/flows/CostCalculator/api';\nimport { $TSFixMe, JSFField } from '@/src/types/remoteFlows';\nimport { SalaryField } from '@/src/flows/CostCalculator/components/SalaryField';\nimport {\n FieldSetField,\n FieldSetProps,\n} from '@/src/components/form/fields/FieldSetField';\n\nexport type CostCalculatorVersion = 'standard' | 'marketing';\n\ntype CostCalculatorCountry = {\n value: string;\n label: string;\n childRegions: MinimalRegion[];\n hasAdditionalFields: boolean | undefined;\n regionSlug: string;\n currency: string;\n};\n\ntype JSFValidationError = {\n formErrors: Record<\n string,\n {\n type: string;\n message: string;\n }\n >;\n yupError: ValidationError;\n};\n\nexport const defaultEstimationOptions: CostCalculatorEstimationOptions = {\n title: 'Estimation',\n includeBenefits: false,\n includeCostBreakdowns: false,\n includePremiumBenefits: false,\n enableCurrencyConversion: false,\n includeEstimationTitle: false,\n includeManagementFee: false,\n};\n\ntype UseCostCalculatorParams = {\n /**\n * The default region slug to preselect a country and a region.\n */\n defaultRegion?: string;\n /**\n * The default currency slug to preselect a currency.\n */\n defaultCurrency?: string;\n\n /**\n * The default salary to preselect a salary.\n */\n defaultSalary?: string;\n /**\n * The estimation options.\n */\n estimationOptions: CostCalculatorEstimationOptions;\n options?: UseCostCalculatorOptions;\n version?: CostCalculatorVersion;\n};\n\nconst useStaticSchema = (options?: { jsfModify?: JSFModify }) => {\n const { schema: jsonSchemaModified } = modify(\n jsonSchema.data.schema,\n options?.jsfModify || {},\n );\n\n return createHeadlessForm(jsonSchemaModified);\n};\n\ntype HiringBudget = 'my_hiring_budget' | 'employee_annual_salary';\n\nfunction getSalaryTitle(\n salaryField: unknown,\n hiringBudget?: HiringBudget,\n): string {\n if (\n typeof salaryField === 'object' &&\n salaryField !== null &&\n 'title' in salaryField\n ) {\n const title = (salaryField as { title?: string }).title;\n if (title) return title;\n }\n return hiringBudget === 'my_hiring_budget'\n ? 'Hiring budget'\n : \"Employee's annual salary\";\n}\n\n/**\n * Hook to use the cost calculator.\n */\nexport const useCostCalculator = (\n {\n defaultRegion,\n defaultCurrency,\n defaultSalary,\n estimationOptions,\n options,\n version,\n }: UseCostCalculatorParams = {\n estimationOptions: defaultEstimationOptions,\n },\n) => {\n const [selectedRegion, setSelectedRegion] = useState<string | undefined>(\n defaultRegion,\n );\n const [selectedCountry, setSelectedCountry] =\n useState<CostCalculatorCountry>();\n const [employerBillingCurrency, setEmployerBillingCurrency] = useState<\n string | undefined\n >();\n const [hiringBudget, setHiringBudget] = useState<HiringBudget>();\n const { data: countries, isLoading: isLoadingCountries } =\n useCostCalculatorCountries({\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n });\n const { data: currencies, isLoading: isLoadingCurrencies } =\n useCompanyCurrencies();\n\n const jsonSchemaRegionSlug = selectedRegion || selectedCountry?.value;\n\n const { data: jsonSchemaRegionFields, isLoading: isLoadingRegionFields } =\n useRegionFields(jsonSchemaRegionSlug, {\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n options,\n });\n const costCalculatorEstimationMutation = useCostCalculatorEstimation();\n const employeeBillingCurrency = selectedCountry?.currency;\n\n const salaryField = options?.jsfModify?.fields?.salary;\n const salaryFieldPresentation =\n salaryField &&\n typeof salaryField === 'object' &&\n 'presentation' in salaryField\n ? (\n salaryField as {\n presentation?: {\n salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const getCurrencies = useCallback(() => {\n const shouldSwapOrder =\n employeeBillingCurrency && employerBillingCurrency\n ? employeeBillingCurrency !== employerBillingCurrency\n : false;\n\n if (employeeBillingCurrency !== employerBillingCurrency) {\n return {\n from: employerBillingCurrency,\n to: employeeBillingCurrency,\n shouldSwapOrder,\n };\n }\n\n return {\n from: employeeBillingCurrency,\n to: employerBillingCurrency,\n shouldSwapOrder,\n };\n }, [employeeBillingCurrency, employerBillingCurrency]);\n\n const showManagementField = estimationOptions.showManagementFee;\n const showEstimationTitleField = estimationOptions.includeEstimationTitle;\n const customFields = useMemo(() => {\n const { from, to, shouldSwapOrder } = getCurrencies();\n const salaryTitle = getSalaryTitle(salaryField, hiringBudget);\n\n return {\n fields: {\n salary: {\n ...salaryField,\n title: salaryTitle,\n presentation: {\n salary_conversion_properties: {\n label:\n salaryFieldPresentation?.salary_conversion_properties?.label,\n description:\n salaryFieldPresentation?.salary_conversion_properties\n ?.description,\n },\n currencies: { from, to },\n Component: (\n props: JSFField & { currencies: { from: string; to: string } },\n ) => {\n return (\n <SalaryField\n {...props}\n shouldSwapOrder={shouldSwapOrder}\n conversionType={\n version === 'marketing' ? 'no_spread' : 'spread'\n }\n defaultValue={defaultSalary}\n />\n );\n },\n },\n },\n hiring_budget: {\n ...options?.jsfModify?.fields?.hiring_budget,\n presentation: {\n hidden: version == 'marketing',\n },\n },\n management: {\n ...options?.jsfModify?.fields?.management,\n properties: {\n ...(options?.jsfModify?.fields?.management as $TSFixMe)?.properties,\n management_fee: {\n ...(options?.jsfModify?.fields?.management as $TSFixMe)\n ?.properties?.management_fee,\n 'x-jsf-presentation': {\n inputType: 'money',\n additionalProps: {\n currency: employerBillingCurrency || 'USD',\n },\n },\n },\n },\n presentation: {\n ...(typeof options?.jsfModify?.fields?.management === 'object'\n ? (\n options?.jsfModify?.fields?.management as Record<\n string,\n $TSFixMe\n >\n )['x-jsf-presentation']\n : {}),\n hidden: !showManagementField,\n Component: (props: FieldSetProps) => {\n return (\n <FieldSetField\n {...props}\n variant='inset'\n features={{\n toggle: {\n enabled: true,\n stateField: 'management._expanded',\n labels: {\n expand: 'Define',\n collapse: 'Remove',\n },\n },\n }}\n />\n );\n },\n },\n },\n estimation_title: {\n ...options?.jsfModify?.fields?.estimation_title,\n 'x-jsf-presentation': {\n hidden: !showEstimationTitleField,\n },\n },\n },\n };\n }, [\n employerBillingCurrency,\n salaryField,\n hiringBudget,\n salaryFieldPresentation?.salary_conversion_properties?.description,\n salaryFieldPresentation?.salary_conversion_properties?.label,\n defaultSalary,\n getCurrencies,\n options?.jsfModify?.fields?.management,\n showManagementField,\n version,\n showEstimationTitleField,\n options?.jsfModify?.fields?.estimation_title,\n ]);\n\n const fieldsJSONSchema = useStaticSchema({\n jsfModify: {\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n });\n\n useEffect(() => {\n // Initialize selectedCountry from defaultRegion\n if (defaultRegion && countries) {\n const defaultCountry = countries.find(\n ({ value }) => value === defaultRegion,\n );\n if (defaultCountry) {\n setSelectedCountry(defaultCountry);\n }\n }\n }, [defaultRegion, countries]);\n\n useEffect(() => {\n // Initialize selectedCurrency from defaultCurrency\n if (defaultCurrency && currencies) {\n const defaultCurrencyObj = currencies.find(\n ({ value }) => value === defaultCurrency,\n );\n if (defaultCurrencyObj) {\n setEmployerBillingCurrency(defaultCurrencyObj.label);\n }\n }\n }, [defaultCurrency, currencies]);\n\n /**\n * Submit the estimation form with the given values.\n * @param values\n */\n async function onSubmit(\n values: CostCalculatorEstimationSubmitValues,\n ): Promise<Result<CostCalculatorEstimateResponse, EstimationError>> {\n try {\n await validationSchema.validate(values, { abortEarly: false });\n } catch (err) {\n return {\n data: null,\n error: err as ValidationError,\n };\n }\n\n return new Promise((resolve, reject) => {\n costCalculatorEstimationMutation.mutate(\n buildPayload(values, estimationOptions, version),\n {\n onSuccess: (response) => {\n if (response.data) {\n resolve({\n data: response.data,\n error: null,\n });\n } else {\n reject({\n data: null,\n error: response.error as PostCreateEstimationError,\n });\n }\n },\n onError: (error) => {\n reject({\n data: null,\n error: error as PostCreateEstimationError,\n });\n },\n },\n );\n });\n }\n\n /**\n * If the selected country has no child regions and has additional fields,\n * set the current region to the country's region slug and fetch the region fields.\n * @param country\n */\n function onCountryChange(country: string) {\n const currentCountry = countries?.find(({ value }) => value === country);\n\n if (\n currentCountry &&\n currentCountry.childRegions.length === 0 &&\n currentCountry.hasAdditionalFields\n ) {\n setSelectedRegion(currentCountry.regionSlug);\n } else {\n setSelectedRegion(undefined);\n }\n setSelectedCountry(currentCountry);\n }\n\n /**\n * Update the selected region and fetch the region fields.\n * @param region\n */\n function onRegionChange(region: string) {\n setSelectedRegion(region);\n }\n\n function onHiringBudgetChange(event: React.ChangeEvent<HTMLInputElement>) {\n setHiringBudget(event.target.value as HiringBudget);\n }\n\n function onChangeCurrency(currency: string) {\n const selectedCurrency = currencies?.find(\n (c) => c.value === currency,\n )?.label;\n setEmployerBillingCurrency(selectedCurrency);\n options?.onCurrencyChange?.(selectedCurrency || '');\n }\n\n const regionField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'region',\n );\n\n if (regionField) {\n const regions =\n selectedCountry?.childRegions.map((region) => ({\n value: region.slug,\n label: region.name,\n })) ?? [];\n regionField.options = regions;\n regionField.isVisible = regions.length > 0;\n regionField.required = regions.length > 0;\n regionField.onChange = onRegionChange;\n regionField.schema =\n regions.length > 0\n ? string()\n .transform((value) => (typeof value === 'string' ? value : ''))\n .required('Region is required')\n : string();\n }\n\n if (currencies) {\n const currencyField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'currency',\n );\n if (currencyField) {\n currencyField.options = currencies;\n currencyField.onChange = onChangeCurrency;\n }\n }\n\n const hiringBudgetField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'hiring_budget',\n );\n if (hiringBudgetField) {\n hiringBudgetField.onChange = onHiringBudgetChange;\n }\n\n if (countries) {\n const countryField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n countryField.onChange = onCountryChange;\n }\n }\n\n const resetForm = () => {\n setSelectedCountry(undefined);\n setSelectedRegion(defaultRegion);\n };\n\n const allFields = [\n ...fieldsJSONSchema.fields.filter((field) => field.name !== 'management'),\n ...(jsonSchemaRegionFields?.fields || []),\n ...fieldsJSONSchema.fields.filter((field) => field.name === 'management'),\n ];\n\n const validationSchema = buildValidationSchema(\n fieldsJSONSchema.fields,\n employerBillingCurrency || 'USD',\n estimationOptions.includeEstimationTitle,\n );\n\n async function handleValidation(values: CostCalculatorEstimationFormValues) {\n let errors: JSFValidationError | null = null;\n\n options?.onValidation?.(values);\n const parsedValues = parseJSFToValidate(values, allFields);\n\n // 1. validate static fields first using Yup validate function\n try {\n await validationSchema.validate(parsedValues, {\n abortEarly: false,\n });\n errors = {\n formErrors: {},\n yupError: new ValidationError([], values),\n };\n } catch (error) {\n const iterateResult = iterateErrors(error as ValidationError);\n\n errors = {\n // convert the errors to a format that can be used in the form\n formErrors: Object.entries(iterateResult).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.message }),\n {},\n ),\n yupError: error as ValidationError,\n };\n }\n\n // 2. validate json schema fields using the handleValidation (from json-schema-form)\n const handleValidationResult =\n jsonSchemaRegionFields?.handleValidation(parsedValues);\n\n // 3. combine the errors from both validations\n const combinedInnerErrors = [\n ...(errors?.yupError.inner || []),\n ...(handleValidationResult?.yupError?.inner || []),\n ];\n const combinedValues = {\n ...(errors?.yupError?.value || {}),\n ...(handleValidationResult?.yupError?.value || {}),\n };\n\n return {\n formErrors: {\n ...(errors?.formErrors || {}),\n ...(handleValidationResult?.formErrors || {}),\n },\n yupError: new ValidationError(combinedInnerErrors, combinedValues),\n };\n }\n\n return {\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState: {\n current: 0,\n total: 1,\n isLastStep: true,\n },\n /**\n * Array of form fields from the cost calculator schema + dynamic region fields like benefits, age, etc.\n */\n fields: allFields,\n /**\n * Validation schema for the cost calculator form\n */\n validationSchema,\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (\n values: CostCalculatorEstimationFormValues,\n ): CostCalculatorEstimationSubmitValues => {\n const {\n country,\n region,\n currency,\n salary_converted,\n hiring_budget,\n salary_conversion,\n management,\n estimation_title,\n ...rest\n } = values;\n\n // If the salary has been converted, we take the one the user has inputted\n let salary = values.salary;\n if (salary_converted === 'salary_conversion') {\n salary = salary_conversion;\n }\n\n const jsonSchemaStaticFieldValues = {\n country,\n region,\n salary,\n salary_converted,\n salary_conversion,\n hiring_budget,\n currency,\n management,\n estimation_title,\n };\n\n const parsedStaticFields = parseJSFToValidate(\n jsonSchemaStaticFieldValues,\n fieldsJSONSchema.fields,\n );\n\n const parsedRegionFields = parseJSFToValidate(\n rest,\n jsonSchemaRegionFields?.fields || [],\n );\n\n const additionalFields = {\n currency_code: currencies?.find((c) => c.value === currency)?.label,\n };\n\n return {\n ...parsedStaticFields,\n ...parsedRegionFields,\n ...additionalFields,\n } as CostCalculatorEstimationSubmitValues;\n },\n /**\n * Function to handle validation of the cost calculator form\n * @param values - Form values to validate\n * @returns Validation result\n */\n handleValidation,\n /**\n * Whether the cost calculator form is currently being submitted\n */\n isSubmitting: costCalculatorEstimationMutation.isPending,\n /**\n * Whether the cost calculator form is currently loading\n */\n isLoading:\n isLoadingCountries && isLoadingCurrencies && isLoadingRegionFields,\n /**\n * Function to submit the cost calculator form\n */\n onSubmit,\n /**\n * Function to reset the cost calculator form\n */\n resetForm,\n\n /**\n * Currencies data useful to get the currency if you have a currencySlug\n */\n currencies,\n };\n};\n"],"mappings":"qVAMA,OAA0B,UAAAA,GAAQ,UAAAC,OAAc,MCWhD,OAAS,sBAAAC,GAAoB,UA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AM,MACpC,CACN,CAEA,OAAIgB,EACKC,EACH,CACE,kBAAmBjB,EAAM,MAC3B,EACA,CACE,oBAAqBA,EAAM,MAC7B,EAGC,CAAC,CACV,CAlCSL,EAAAmB,GAAA,mBA0CF,SAASK,GACdC,EAGAV,EAAqDW,EACrDV,EAAiC,WACH,CAC9B,IAAMW,EAAc,MAAM,QAAQF,CAAM,EAAIA,EAAS,CAACA,CAAM,EAE5D,GAAIE,EAAY,SAAW,EACzB,MAAM,IAAI,MAAM,2CAA2C,EAG7D,OAAIA,EAAY,OAAS,GACJ,IAAI,IAAIA,EAAY,IAAKC,GAAMA,EAAE,QAAQ,CAAC,EAC9C,KAAO,GACpB,QAAQ,KACN,8EACF,EAIG,CACL,uBAAwBD,EAAY,CAAC,EAAE,SACvC,iBAAkBZ,EAAkB,gBACpC,wBAAyBA,EAAkB,sBAC3C,yBAA0BA,EAAkB,uBAC5C,uBAAwBA,EAAkB,qBAC1C,YAAaY,EAAY,IAAKtB,GAC5BS,GAAqBT,EAAOU,EAAmBC,CAAO,CACxD,CACF,CACF,CAhCgBhB,EAAAwB,GAAA","names":["number","object","createHeadlessForm","modify","useCallback","useEffect","useMemo","useState","string","ValidationError","jsx","defaultEstimationOptions","useStaticSchema","__name","options","jsonSchemaModified","modify","jsonSchema","createHeadlessForm","getSalaryTitle","salaryField","hiringBudget","title","useCostCalculator","defaultRegion","defaultCurrency","defaultSalary","estimationOptions","version","selectedRegion","setSelectedRegion","useState","selectedCountry","setSelectedCountry","employerBillingCurrency","setEmployerBillingCurrency","setHiringBudget","countries","isLoadingCountries","useCostCalculatorCountries","currencies","isLoadingCurrencies","useCompanyCurrencies","jsonSchemaRegionSlug","jsonSchemaRegionFields","isLoadingRegionFields","useRegionFields","costCalculatorEstimationMutation","useCostCalculatorEstimation","employeeBillingCurrency","salaryFieldPresentation","getCurrencies","useCallback","shouldSwapOrder","showManagementField","showEstimationTitleField","customFields","useMemo","from","to","salaryTitle","props","SalaryField","FieldSetField","fieldsJSONSchema","useEffect","defaultCountry","value","defaultCurrencyObj","onSubmit","values","validationSchema","err","resolve","reject","buildPayload","response","error","onCountryChange","country","currentCountry","onRegionChange","region","onHiringBudgetChange","event","onChangeCurrency","currency","selectedCurrency","c","regionField","field","regions","string","currencyField","hiringBudgetField","countryField","resetForm","allFields","buildValidationSchema","handleValidation","errors","parsedValues","parseJSFToValidate","ValidationError","iterateResult","iterateErrors","acc","key","handleValidationResult","combinedInnerErrors","combinedValues","salary_converted","hiring_budget","salary_conversion","management","estimation_title","rest","salary","parsedStaticFields","parsedRegionFields","additionalFields","buildValidationSchema","fields","employerBillingCurrency","includeEstimationTitle","fieldsSchema","fieldsSchemaAcc","field","__name","val","schema","object","number","value","BASE_RATES","formatBenefits","benefits","needle","acc","key","benefitTierSlug","benefitEntry","mapValueToEmployment","estimationOptions","version","managementFee","currencyCode","getSalaryFields","isMarketing","isStandard","useHiringBudget","useEmployerCurrency","buildPayload","values","defaultEstimationOptions","employments","v"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-63HVO7J5.js";import{a as p}from"./chunk-73H6SO2E.js";import{a as i}from"./chunk-7JQPHRUK.js";import{a as S}from"./chunk-Z7WBY27D.js";import{a as c}from"./chunk-5KHLOGTR.js";import{a as m}from"./chunk-4B36XRKA.js";import{a as r}from"./chunk-TLC5WQY2.js";import{a as f}from"./chunk-CEUBVUKV.js";import{a as s}from"./chunk-BF2D5O5H.js";import{a as n}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-ZOKSYPOP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as R,useState as D}from"react";import{jsx as P}from"react/jsx-runtime";var K=t(({employmentId:d,companyId:b,countryCode:u,type:g="employee",externalId:B,skipSteps:l,initialValues:v,render:O,options:y})=>{let I=R(),o=e({companyId:b,countryCode:u,employmentId:d,type:g,options:y,skipSteps:l,externalId:B,initialValues:v}),[w,C]=D({showReserveInvoice:!1,showInviteSuccessful:!1});return P(n.Provider,{value:{formId:I,onboardingBag:o,creditScore:w,setCreditScore:C},children:O({onboardingBag:o,components:{BasicInformationStep:r,ContractDetailsStep:s,BenefitsStep:f,SubmitButton:i,SaveDraftButton:c,BackButton:a,OnboardingInvite:p,SelectCountryStep:m,ReviewStep:S}})})},"OnboardingFlow");export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NCA3UCCX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-WWANHPT7.js";import{a as P}from"./chunk-6GMGXSKN.js";import{a as S}from"./chunk-XFD3ULUF.js";import{a as F}from"./chunk-S4XU4SE7.js";import{a as y}from"./chunk-Z5WMKCRJ.js";import{a as V}from"./chunk-QW4JPW6J.js";import{b as p}from"./chunk-EGQJ7UBR.js";import{a as T}from"./chunk-PJBAQZ6G.js";import{d as _}from"./chunk-3ZWDIEEM.js";import{c as s}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as h,modify as x}from"@remoteoss/json-schema-form";import{useMutation as K,useQuery as L}from"@tanstack/react-query";import q from"lodash.omitby";import A from"lodash.isnull";import R from"lodash.omit";function z(o){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...o}}e(z,"buildInitialValues");var B=e(()=>{let{client:o}=_();return K({mutationFn:e(n=>p({client:o,body:n}),"mutationFn")})},"useCreateTermination"),I=e(({formValues:o,jsfModify:n,step:m})=>L({queryKey:["rmt-flows-termination-schema",m],queryFn:e(()=>P[m]??S,"queryFn"),select:e(({data:u})=>{let i=u?.schema||{};if(n){let{schema:d}=x(i,n);i=d}return h(i||{},{initialValues:o||{}})},"select")}),"useTerminationSchema"),ue=e(({employmentId:o,options:n})=>{let{fieldValues:m,setFieldValues:u,stepState:i,previousStep:f,nextStep:d}=T(F),k={...i.values?.[i.currentStep.name],...m},{data:r,isLoading:w}=I({formValues:k,jsfModify:n?.jsfModify,step:i.currentStep.name}),l=h(g.data.schema),c=B(),{mutateAsync:b}=V(c);async function C(a){if(!o)throw new Error("Employment id is missing");if(r){let t=s(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:j}=t,D=j==="yes"?{employee_awareness:{date:t.customer_informed_employee_date,note:t.customer_informed_employee_description}}:void 0,H=y(t,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),J=R(H,"customer_informed_employee_date","customer_informed_employee_description"),O=q({...J,...D},A);return b({employment_id:o,termination_details:O,type:"termination"})}}e(C,"onSubmit");function M(){f()}e(M,"back");function v(){d()}e(v,"next");let E=z({...i.values?.employee_communication,...i.values?.termination_details,...i.values?.paid_time_off,...i.values?.additional_information});return{employmentId:o,stepState:i,fields:r?.fields||[],isLoading:w,isSubmitting:c.isPending,initialValues:E,handleValidation:e(a=>{if(r){let t=s(a,r?.fields);return r?.handleValidation(t)}return null},"handleValidation"),checkFieldUpdates:e(a=>{if(l){let t=s(a,l?.fields,{isPartialValidation:!0});u(t)}},"checkFieldUpdates"),parseFormValues:e(a=>s(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:C,back:M,next:v}},"useTermination");export{ue as a};
|
|
2
|
+
//# sourceMappingURL=chunk-UWIFE5LJ.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-
|
|
2
|
+
import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-nWJIP4db.js';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
|
|
5
5
|
type ContractAmendmentConfirmationFormProps = {
|
|
@@ -5,7 +5,7 @@ import { ContractAmendmentForm } from './ContractAmendmentForm.js';
|
|
|
5
5
|
import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
|
|
6
6
|
import { useContractAmendment } from './hooks.js';
|
|
7
7
|
import { ContractAmendmentParams } from './types.js';
|
|
8
|
-
import '../../types.gen-
|
|
8
|
+
import '../../types.gen-nWJIP4db.js';
|
|
9
9
|
import 'react-hook-form';
|
|
10
10
|
import 'react';
|
|
11
11
|
import '../../mutations-B6HWH-rZ.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-
|
|
2
|
+
import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-nWJIP4db.js';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
|
|
5
5
|
type ContractAmendmentFormProps = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { S as SuccessResponse, E as ErrorResponse } from '../../mutations-B6HWH-rZ.js';
|
|
2
|
-
import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-
|
|
2
|
+
import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-nWJIP4db.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
5
|
-
import '../../remoteFlows-
|
|
5
|
+
import '../../remoteFlows-BdsVZGGF.js';
|
|
6
6
|
import * as react_hook_form from 'react-hook-form';
|
|
7
7
|
import { useContractAmendment } from './hooks.js';
|
|
8
8
|
import { Step } from '../useStepState.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SuccessResponse, E as ErrorResponse } from '../../mutations-B6HWH-rZ.js';
|
|
2
|
-
import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-
|
|
2
|
+
import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-nWJIP4db.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
5
5
|
import { Step } from '../useStepState.js';
|
|
@@ -4,7 +4,7 @@ export { ContractAmendmentForm } from './ContractAmendmentForm.js';
|
|
|
4
4
|
export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
|
|
5
5
|
export { useContractAmendment } from './hooks.js';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
|
-
import '../../types.gen-
|
|
7
|
+
import '../../types.gen-nWJIP4db.js';
|
|
8
8
|
import 'react-hook-form';
|
|
9
9
|
import './ContractAmendmentBack.js';
|
|
10
10
|
import 'react';
|
|
@@ -3,7 +3,7 @@ import React__default from 'react';
|
|
|
3
3
|
import { useCostCalculator, CostCalculatorVersion } from './hooks.js';
|
|
4
4
|
import { CostCalculatorEstimationOptions, UseCostCalculatorOptions } from './types.js';
|
|
5
5
|
import 'yup';
|
|
6
|
-
import '../../types.gen-
|
|
6
|
+
import '../../types.gen-nWJIP4db.js';
|
|
7
7
|
import '../types.js';
|
|
8
8
|
import '@remoteoss/json-schema-form';
|
|
9
9
|
import './constants.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-FTW6Z4IF.js";import"../../chunk-JUJZENG7.js";import"../../chunk-ALYKEN3E.js";import"../../chunk-NBCZF2FO.js";import"../../chunk-PHN4XMPV.js";import"../../chunk-BFOGH4SF.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-VFRHMNLJ.js";import"../../chunk-V2YORDAL.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-N5I33LIN.js";import"../../chunk-ANXYPRBG.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{a as CostCalculatorFlow};
|
|
2
2
|
//# sourceMappingURL=CostCalculatorFlow.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CostCalculatorEstimationSubmitValues, CostCalculatorEstimationResponse, EstimationError } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-nWJIP4db.js';
|
|
4
4
|
import './constants.js';
|
|
5
5
|
import '../types.js';
|
|
6
6
|
import '@remoteoss/json-schema-form';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { h as MinimalCountry, M as MinimalRegion } from '../../../types.gen-nWJIP4db.js';
|
|
3
3
|
import { CostCalculatorEstimation } from '../types.js';
|
|
4
4
|
import '../constants.js';
|
|
5
5
|
import '../../types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { c as CostCalculatorEstimateResponse } from '../../../types.gen-
|
|
2
|
+
import { c as CostCalculatorEstimateResponse } from '../../../types.gen-nWJIP4db.js';
|
|
3
3
|
|
|
4
4
|
interface CostCalculatorResultProps {
|
|
5
5
|
employmentData: CostCalculatorEstimateResponse['data'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CostCalculatorEstimation } from '../types.js';
|
|
3
|
-
import '../../../types.gen-
|
|
3
|
+
import '../../../types.gen-nWJIP4db.js';
|
|
4
4
|
import '../constants.js';
|
|
5
5
|
import '../../types.js';
|
|
6
6
|
import '@remoteoss/json-schema-form';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
|
-
import { d as CostCalculatorEstimatePdfResponse, e as PostCreateEstimationPdfError, f as CostCalculatorEstimateParams, M as MinimalRegion, c as CostCalculatorEstimateResponse, g as PostCreateEstimationError } from '../../types.gen-
|
|
3
|
+
import { d as CostCalculatorEstimatePdfResponse, e as PostCreateEstimationPdfError, f as CostCalculatorEstimateParams, M as MinimalRegion, c as CostCalculatorEstimateResponse, g as PostCreateEstimationError } from '../../types.gen-nWJIP4db.js';
|
|
4
4
|
import { CostCalculatorEstimationOptions } from './types.js';
|
|
5
5
|
import { JSFModify } from '../types.js';
|
|
6
6
|
import './constants.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as JSFField } from '../../../remoteFlows-
|
|
2
|
+
import { a as JSFField } from '../../../remoteFlows-BdsVZGGF.js';
|
|
3
3
|
import 'react-hook-form';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'yup';
|
|
6
|
-
import '../../../types.gen-
|
|
6
|
+
import '../../../types.gen-nWJIP4db.js';
|
|
7
7
|
import '../../../types-Zg1n_9wh.js';
|
|
8
8
|
|
|
9
9
|
type SalaryFieldProps = JSFField & {
|
|
@@ -2,8 +2,8 @@ import { Result } from '../types.js';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useCostCalculator } from './hooks.js';
|
|
4
4
|
import { CostCalculatorEstimationFormValues, CostCalculatorEstimationSubmitValues, EstimationError } from './types.js';
|
|
5
|
-
import { c as CostCalculatorEstimateResponse } from '../../types.gen-
|
|
6
|
-
import { $ as $TSFixMe } from '../../remoteFlows-
|
|
5
|
+
import { c as CostCalculatorEstimateResponse } from '../../types.gen-nWJIP4db.js';
|
|
6
|
+
import { $ as $TSFixMe } from '../../remoteFlows-BdsVZGGF.js';
|
|
7
7
|
import * as yup from 'yup';
|
|
8
8
|
import { UseFormReturn } from 'react-hook-form';
|
|
9
9
|
import '@remoteoss/json-schema-form';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { ValidationError } from 'yup';
|
|
3
|
-
import { c as CostCalculatorEstimateResponse } from '../../types.gen-
|
|
3
|
+
import { c as CostCalculatorEstimateResponse } from '../../types.gen-nWJIP4db.js';
|
|
4
4
|
import { CostCalculatorEstimationOptions, UseCostCalculatorOptions, CostCalculatorEstimationFormValues, CostCalculatorEstimationSubmitValues, EstimationError } from './types.js';
|
|
5
5
|
import { Result } from '../types.js';
|
|
6
6
|
import './constants.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a,d as b}from"../../chunk-
|
|
1
|
+
import{c as a,d as b}from"../../chunk-JUJZENG7.js";import"../../chunk-ALYKEN3E.js";import"../../chunk-NBCZF2FO.js";import"../../chunk-PHN4XMPV.js";import"../../chunk-BFOGH4SF.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-VFRHMNLJ.js";import"../../chunk-V2YORDAL.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-N5I33LIN.js";import"../../chunk-ANXYPRBG.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{a as defaultEstimationOptions,b as useCostCalculator};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -14,11 +14,11 @@ export { EstimationError } from './types.js';
|
|
|
14
14
|
import 'react/jsx-runtime';
|
|
15
15
|
import 'react';
|
|
16
16
|
import 'yup';
|
|
17
|
-
import '../../types.gen-
|
|
17
|
+
import '../../types.gen-nWJIP4db.js';
|
|
18
18
|
import '../types.js';
|
|
19
19
|
import '@remoteoss/json-schema-form';
|
|
20
20
|
import '@tanstack/react-query';
|
|
21
|
-
import '../../remoteFlows-
|
|
21
|
+
import '../../remoteFlows-BdsVZGGF.js';
|
|
22
22
|
import 'react-hook-form';
|
|
23
23
|
import '../../types-Zg1n_9wh.js';
|
|
24
24
|
import './constants.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-Z3BMF4BO.js";import{a as l}from"../../chunk-MLB2I27G.js";import"../../chunk-E5YN6OT3.js";import{a as k}from"../../chunk-R2UI3WAJ.js";import{a as j}from"../../chunk-6ZPISRAG.js";import"../../chunk-4RULC3AZ.js";import"../../chunk-H4KE45NG.js";import"../../chunk-6NKUEDYP.js";import"../../chunk-I2A4EFDY.js";import"../../chunk-4R3ITKOA.js";import"../../chunk-ZE3YT3Q6.js";import"../../chunk-NVMZDPMF.js";import"../../chunk-XJVYASHX.js";import{a as d}from"../../chunk-
|
|
1
|
+
import"../../chunk-Z3BMF4BO.js";import{a as l}from"../../chunk-MLB2I27G.js";import"../../chunk-E5YN6OT3.js";import{a as k}from"../../chunk-R2UI3WAJ.js";import{a as j}from"../../chunk-6ZPISRAG.js";import"../../chunk-4RULC3AZ.js";import"../../chunk-H4KE45NG.js";import"../../chunk-6NKUEDYP.js";import"../../chunk-I2A4EFDY.js";import"../../chunk-4R3ITKOA.js";import"../../chunk-ZE3YT3Q6.js";import"../../chunk-NVMZDPMF.js";import"../../chunk-XJVYASHX.js";import{a as d}from"../../chunk-FTW6Z4IF.js";import{b as a,d as c}from"../../chunk-JUJZENG7.js";import"../../chunk-ALYKEN3E.js";import"../../chunk-NBCZF2FO.js";import"../../chunk-PHN4XMPV.js";import"../../chunk-BFOGH4SF.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-VFRHMNLJ.js";import{a as e}from"../../chunk-3O2RD3RK.js";import{a as g}from"../../chunk-OZ63OC3N.js";import{a as f}from"../../chunk-A4KEKMEQ.js";import{d as b}from"../../chunk-V2YORDAL.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-KSHK3ZPX.js";import{a as i}from"../../chunk-HQI6W7PR.js";import{a as h}from"../../chunk-DYB3RWP7.js";import"../../chunk-CRXPRR3R.js";import"../../chunk-UHS3QRA3.js";import"../../chunk-N5I33LIN.js";import"../../chunk-LBUNJ5J3.js";import"../../chunk-ANXYPRBG.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-2VS6B3PC.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{i as CostCalculatorDisclaimer,d as CostCalculatorFlow,e as CostCalculatorForm,g as CostCalculatorResetButton,l as CostCalculatorResults,f as CostCalculatorSubmitButton,j as EstimationResults,k as SummaryResults,a as buildCostCalculatorEstimationPayload,h as disclaimerData,c as useCostCalculator,b as useCostCalculatorEstimationPdf};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as EmploymentTermType, g as PostCreateEstimationError, V as ValidationError, j as CostCalculatorEmployment } from '../../types.gen-nWJIP4db.js';
|
|
2
2
|
import { BASE_RATES } from './constants.js';
|
|
3
3
|
import { JSFModify } from '../types.js';
|
|
4
4
|
import '@remoteoss/json-schema-form';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as CostCalculatorEstimateParams } from '../../types.gen-
|
|
2
|
-
import { $ as $TSFixMe } from '../../remoteFlows-
|
|
1
|
+
import { f as CostCalculatorEstimateParams } from '../../types.gen-nWJIP4db.js';
|
|
2
|
+
import { $ as $TSFixMe } from '../../remoteFlows-BdsVZGGF.js';
|
|
3
3
|
import { AnyObjectSchema } from 'yup';
|
|
4
4
|
import { CostCalculatorVersion } from './hooks.js';
|
|
5
5
|
import { CostCalculatorEstimationSubmitValues, CostCalculatorEstimationOptions } from './types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-JUJZENG7.js";import"../../chunk-ALYKEN3E.js";import"../../chunk-NBCZF2FO.js";import"../../chunk-PHN4XMPV.js";import"../../chunk-BFOGH4SF.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-VFRHMNLJ.js";import"../../chunk-V2YORDAL.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-N5I33LIN.js";import"../../chunk-ANXYPRBG.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{b as buildPayload,a as buildValidationSchema};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -12,14 +12,14 @@ import { SelectCountryStep } from './components/SelectCountryStep.js';
|
|
|
12
12
|
import { ReviewStep } from './components/ReviewStep.js';
|
|
13
13
|
import { SaveDraftButton } from './components/SaveDraftButton.js';
|
|
14
14
|
import '@tanstack/query-core';
|
|
15
|
-
import '../../types.gen-
|
|
15
|
+
import '../../types.gen-nWJIP4db.js';
|
|
16
16
|
import '../../mutations-B6HWH-rZ.js';
|
|
17
17
|
import '@remoteoss/json-schema-form';
|
|
18
18
|
import '../useStepState.js';
|
|
19
19
|
import 'react-hook-form';
|
|
20
20
|
import './utils.js';
|
|
21
21
|
import '../types.js';
|
|
22
|
-
import '../../remoteFlows-
|
|
22
|
+
import '../../remoteFlows-BdsVZGGF.js';
|
|
23
23
|
import 'yup';
|
|
24
24
|
import '../../types-Zg1n_9wh.js';
|
|
25
25
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-NCA3UCCX.js";import"../../chunk-63HVO7J5.js";import"../../chunk-73H6SO2E.js";import"../../chunk-7JQPHRUK.js";import"../../chunk-Z7WBY27D.js";import"../../chunk-5KHLOGTR.js";import"../../chunk-4B36XRKA.js";import"../../chunk-TLC5WQY2.js";import"../../chunk-CEUBVUKV.js";import"../../chunk-BF2D5O5H.js";import"../../chunk-56DXHJNR.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-ZOKSYPOP.js";import"../../chunk-VAIBLWOY.js";import"../../chunk-7C2Z2EE5.js";import"../../chunk-F66G33YT.js";import"../../chunk-PHN4XMPV.js";import"../../chunk-BFOGH4SF.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-2VS6B3PC.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=OnboardingFlow.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { l as Employment, s as Company, S as SuccessResponse, t as PostInviteEmploymentInvitationError, u as PostCreateRiskReserveError, n as EmploymentCreationResponse, o as PostCreateEmployment2Error, k as EmploymentCreateParams, p as EmploymentResponse, q as PatchUpdateEmployment2Error, v as EmploymentFullParams, r as PutUpdateBenefitOfferError, U as UnifiedEmploymentUpsertBenefitOffersRequest, w as MagicLinkResponse, x as UnprocessableEntityResponse, y as MagicLinkParams, z as ConvertCurrencyResponse, A as PostConvertRawCurrencyConverterError, B as ConvertCurrencyParams, D as PostCreateContractEligibilityError, F as CreateContractEligibilityParams } from '../../types.gen-nWJIP4db.js';
|
|
4
4
|
import { OnboardingFlowParams } from './types.js';
|
|
5
5
|
import { JSONSchemaFormType, FlowOptions } from '../types.js';
|
|
6
|
-
import { J as JSFFieldset } from '../../remoteFlows-
|
|
6
|
+
import { J as JSFFieldset } from '../../remoteFlows-BdsVZGGF.js';
|
|
7
7
|
import { FieldValues } from 'react-hook-form';
|
|
8
8
|
import 'react';
|
|
9
9
|
import 'yup';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as JSFField } from '../../../remoteFlows-
|
|
2
|
+
import { a as JSFField } from '../../../remoteFlows-BdsVZGGF.js';
|
|
3
3
|
import 'react-hook-form';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'yup';
|
|
6
|
-
import '../../../types.gen-
|
|
6
|
+
import '../../../types.gen-nWJIP4db.js';
|
|
7
7
|
import '../../../types-Zg1n_9wh.js';
|
|
8
8
|
|
|
9
9
|
type AnnualGrossSalaryProps = JSFField & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { BasicInformationFormPayload } from '../types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { n as EmploymentCreationResponse } from '../../../types.gen-nWJIP4db.js';
|
|
4
4
|
import { N as NormalizedFieldError } from '../../../mutations-B6HWH-rZ.js';
|
|
5
5
|
import '../../types.js';
|
|
6
6
|
import '@remoteoss/json-schema-form';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as Components } from '../../../remoteFlows-
|
|
3
|
-
import { S as SuccessResponse } from '../../../types.gen-
|
|
2
|
+
import { C as Components } from '../../../remoteFlows-BdsVZGGF.js';
|
|
3
|
+
import { S as SuccessResponse } from '../../../types.gen-nWJIP4db.js';
|
|
4
4
|
import { BenefitsFormPayload } from '../types.js';
|
|
5
5
|
import { N as NormalizedFieldError } from '../../../mutations-B6HWH-rZ.js';
|
|
6
6
|
import 'react-hook-form';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { p as EmploymentResponse } from '../../../types.gen-nWJIP4db.js';
|
|
3
3
|
import { ContractDetailsFormPayload } from '../types.js';
|
|
4
4
|
import { N as NormalizedFieldError } from '../../../mutations-B6HWH-rZ.js';
|
|
5
5
|
import '../../types.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
3
3
|
import { BasicInformationFormPayload, BenefitsFormPayload, ContractDetailsFormPayload } from '../types.js';
|
|
4
|
-
import { C as Components } from '../../../remoteFlows-
|
|
5
|
-
import '../../../types.gen-
|
|
4
|
+
import { C as Components } from '../../../remoteFlows-BdsVZGGF.js';
|
|
5
|
+
import '../../../types.gen-nWJIP4db.js';
|
|
6
6
|
import '../../types.js';
|
|
7
7
|
import 'react-hook-form';
|
|
8
8
|
import 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
import { F as FieldError } from '../../../mutations-B6HWH-rZ.js';
|
|
4
|
-
import { S as SuccessResponse } from '../../../types.gen-
|
|
4
|
+
import { S as SuccessResponse } from '../../../types.gen-nWJIP4db.js';
|
|
5
5
|
|
|
6
6
|
type OnboardingInviteProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onError'> & {
|
|
7
7
|
onSuccess?: ({ data, employmentStatus, }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { SelectCountryFormPayload, SelectCountrySuccess } from '../types.js';
|
|
3
3
|
import { N as NormalizedFieldError } from '../../../mutations-B6HWH-rZ.js';
|
|
4
|
-
import '../../../types.gen-
|
|
4
|
+
import '../../../types.gen-nWJIP4db.js';
|
|
5
5
|
import '../../types.js';
|
|
6
6
|
import '@remoteoss/json-schema-form';
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
2
|
-
import { J as JSFFieldset } from '../../remoteFlows-
|
|
2
|
+
import { J as JSFFieldset } from '../../remoteFlows-BdsVZGGF.js';
|
|
3
3
|
import { Meta } from './types.js';
|
|
4
4
|
import { STEPS } from './utils.js';
|
|
5
|
-
import {
|
|
5
|
+
import { n as EmploymentCreationResponse, o as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, r as PutUpdateBenefitOfferError, l as Employment } from '../../types.gen-nWJIP4db.js';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
8
8
|
import * as react_hook_form from 'react-hook-form';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
2
|
-
import {
|
|
2
|
+
import { n as EmploymentCreationResponse, o as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, r as PutUpdateBenefitOfferError, l as Employment } from '../../types.gen-nWJIP4db.js';
|
|
3
3
|
import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
@@ -8,7 +8,7 @@ import { Step } from '../useStepState.js';
|
|
|
8
8
|
import { STEPS } from './utils.js';
|
|
9
9
|
import { FieldValues } from 'react-hook-form';
|
|
10
10
|
import { OnboardingFlowParams, Meta } from './types.js';
|
|
11
|
-
import { J as JSFFieldset } from '../../remoteFlows-
|
|
11
|
+
import { J as JSFFieldset } from '../../remoteFlows-BdsVZGGF.js';
|
|
12
12
|
import '../types.js';
|
|
13
13
|
import 'yup';
|
|
14
14
|
import '../../types-Zg1n_9wh.js';
|
|
@@ -5,14 +5,14 @@ import 'react/jsx-runtime';
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import './hooks.js';
|
|
7
7
|
import '@tanstack/query-core';
|
|
8
|
-
import '../../types.gen-
|
|
8
|
+
import '../../types.gen-nWJIP4db.js';
|
|
9
9
|
import '../../mutations-B6HWH-rZ.js';
|
|
10
10
|
import '@remoteoss/json-schema-form';
|
|
11
11
|
import '../useStepState.js';
|
|
12
12
|
import 'react-hook-form';
|
|
13
13
|
import './utils.js';
|
|
14
14
|
import '../types.js';
|
|
15
|
-
import '../../remoteFlows-
|
|
15
|
+
import '../../remoteFlows-BdsVZGGF.js';
|
|
16
16
|
import 'yup';
|
|
17
17
|
import '../../types-Zg1n_9wh.js';
|
|
18
18
|
import './components/BasicInformationStep.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-NCA3UCCX.js";import"../../chunk-63HVO7J5.js";import"../../chunk-73H6SO2E.js";import"../../chunk-7JQPHRUK.js";import"../../chunk-Z7WBY27D.js";import"../../chunk-5KHLOGTR.js";import"../../chunk-4B36XRKA.js";import"../../chunk-TLC5WQY2.js";import"../../chunk-CEUBVUKV.js";import"../../chunk-BF2D5O5H.js";import"../../chunk-56DXHJNR.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-ZOKSYPOP.js";import"../../chunk-VAIBLWOY.js";import"../../chunk-7C2Z2EE5.js";import"../../chunk-F66G33YT.js";import"../../chunk-PHN4XMPV.js";import"../../chunk-BFOGH4SF.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-2VS6B3PC.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as EmploymentCreateParams, l as Employment$1 } from '../../types.gen-nWJIP4db.js';
|
|
2
2
|
import { FlowOptions, JSFModify } from '../types.js';
|
|
3
3
|
import '@remoteoss/json-schema-form';
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Employment } from './types.js';
|
|
2
2
|
import { Step } from '../useStepState.js';
|
|
3
3
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
4
|
-
import '../../types.gen-
|
|
4
|
+
import '../../types.gen-nWJIP4db.js';
|
|
5
5
|
import '../types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react-hook-form';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import { O as OffboardingResponse } from '../../types.gen-
|
|
3
|
+
import { O as OffboardingResponse } from '../../types.gen-nWJIP4db.js';
|
|
4
4
|
|
|
5
5
|
type AdditionalDetailsFormProps = {
|
|
6
6
|
requesterName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-nWJIP4db.js';
|
|
4
4
|
|
|
5
5
|
type EmployeeComunicationProps = {
|
|
6
6
|
onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-nWJIP4db.js';
|
|
4
4
|
|
|
5
5
|
type PaidTimeOffFormProps = {
|
|
6
6
|
onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-nWJIP4db.js';
|
|
4
4
|
|
|
5
5
|
type TerminationDetailsFormProps = {
|
|
6
6
|
onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;
|
|
@@ -10,7 +10,7 @@ import { PaidTimeOffForm } from './PaidTimeOffForm.js';
|
|
|
10
10
|
import { AdditionalDetailsForm } from './AdditionalDetailsForm.js';
|
|
11
11
|
import { JSFModify } from '../types.js';
|
|
12
12
|
import './types.js';
|
|
13
|
-
import '../../types.gen-
|
|
13
|
+
import '../../types.gen-nWJIP4db.js';
|
|
14
14
|
import '../../mutations-B6HWH-rZ.js';
|
|
15
15
|
import '@remoteoss/json-schema-form';
|
|
16
16
|
import '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-2RZABLV2.js";import"../../chunk-XGEKV3FC.js";import"../../chunk-53NFLDRX.js";import"../../chunk-DCRLPAJL.js";import"../../chunk-QQ7KPOLK.js";import"../../chunk-UWIFE5LJ.js";import"../../chunk-WWANHPT7.js";import"../../chunk-6GMGXSKN.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-A6EYY3FO.js";import"../../chunk-CYKK3LPJ.js";import"../../chunk-RZTT3MEP.js";import"../../chunk-MRMVBBVZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-2VS6B3PC.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-GGBEM452.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
|
|
2
2
|
//# sourceMappingURL=TerminationFlow.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
3
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
4
|
-
import '../../types.gen-
|
|
4
|
+
import '../../types.gen-nWJIP4db.js';
|
|
5
5
|
|
|
6
6
|
type TerminationFormProps = {
|
|
7
7
|
onSubmit: (payload: TerminationFormValues) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EmploymentShowResponse, L as ListTimeoffResponse } from '../../types.gen-
|
|
1
|
+
import { E as EmploymentShowResponse, L as ListTimeoffResponse } from '../../types.gen-nWJIP4db.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
declare const TimeOff: ({ render, }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { O as OffboardingResponse,
|
|
1
|
+
import { O as OffboardingResponse, m as PostCreateOffboardingError } from '../../types.gen-nWJIP4db.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
4
|
-
import '../../remoteFlows-
|
|
4
|
+
import '../../remoteFlows-BdsVZGGF.js';
|
|
5
5
|
import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
|
|
6
6
|
import { Step } from '../useStepState.js';
|
|
7
7
|
import { useTermination } from './hooks.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OffboardingResponse,
|
|
1
|
+
import { O as OffboardingResponse, m as PostCreateOffboardingError } from '../../types.gen-nWJIP4db.js';
|
|
2
2
|
import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
|
|
3
3
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
4
4
|
import { Step } from '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-UWIFE5LJ.js";import"../../chunk-WWANHPT7.js";import"../../chunk-6GMGXSKN.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as useTermination};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -3,7 +3,7 @@ export { TerminationFormValues } from './types.js';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import './hooks.js';
|
|
6
|
-
import '../../types.gen-
|
|
6
|
+
import '../../types.gen-nWJIP4db.js';
|
|
7
7
|
import '../../mutations-B6HWH-rZ.js';
|
|
8
8
|
import '@remoteoss/json-schema-form';
|
|
9
9
|
import '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-M22FKNEY.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-M22FKNEY.js";import{a}from"../../chunk-2RZABLV2.js";import"../../chunk-XGEKV3FC.js";import"../../chunk-53NFLDRX.js";import"../../chunk-DCRLPAJL.js";import"../../chunk-QQ7KPOLK.js";import"../../chunk-UWIFE5LJ.js";import"../../chunk-WWANHPT7.js";import"../../chunk-6GMGXSKN.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-A6EYY3FO.js";import"../../chunk-CYKK3LPJ.js";import"../../chunk-RZTT3MEP.js";import"../../chunk-MRMVBBVZ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-2VS6B3PC.js";import"../../chunk-U4NWXPI5.js";import"../../chunk-ZTDKPUB5.js";import"../../chunk-GGBEM452.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-ZSDJZMQW.js";import"../../chunk-GP237GUO.js";import"../../chunk-TXSJL3HC.js";import"../../chunk-EGQJ7UBR.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-7VUILYZ3.js";import"../../chunk-3BREUYLG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-BI6U55BD.js";import"../../chunk-3LOVCTCN.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-6GMGXSKN.js";import"../../../chunk-W5DG5WWJ.js";import"../../../chunk-VX2UC3HG.js";import"../../../chunk-XSHHMBMT.js";import"../../../chunk-JODJFARP.js";import"../../../chunk-P37U34EQ.js";export{a as schema};
|
|
2
2
|
//# sourceMappingURL=schema.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -22,14 +22,14 @@ export { OnboardingFlow, OnboardingRenderProps } from './flows/Onboarding/Onboar
|
|
|
22
22
|
export { OnboardingInviteProps } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
23
23
|
export { BasicInformationFormPayload, BenefitsFormPayload, ContractDetailsFormPayload, CreditRiskState, CreditRiskStatus, Employment, Meta, SelectCountryFormPayload, SelectCountrySuccess } from './flows/Onboarding/types.js';
|
|
24
24
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
25
|
-
import { E as EmploymentShowResponse, G as TimeoffStatus, L as ListTimeoffResponse } from './types.gen-
|
|
26
|
-
export {
|
|
25
|
+
import { E as EmploymentShowResponse, G as TimeoffStatus, L as ListTimeoffResponse } from './types.gen-nWJIP4db.js';
|
|
26
|
+
export { s as Company, C as ContractAmendmentAutomatableResponse, j as CostCalculatorEmployment, c as CostCalculatorEstimateResponse, H as Currency, n as EmploymentCreationResponse, p as EmploymentResponse, O as OffboardingResponse, S as SuccessResponse } from './types.gen-nWJIP4db.js';
|
|
27
27
|
import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
|
|
28
28
|
export { t as transformYupErrorsIntoObject } from './utils-CjDMg_Yr.js';
|
|
29
29
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
30
30
|
import { PropsWithChildren } from 'react';
|
|
31
|
-
import { R as RemoteFlowsSDKProps } from './remoteFlows-
|
|
32
|
-
export { $ as $TSFixMe, B as ButtonComponentProps, C as Components, F as FieldComponentProps, b as FieldSetToggleComponentProps, S as StatementComponentProps, Z as ZendeskDrawerComponentProps } from './remoteFlows-
|
|
31
|
+
import { R as RemoteFlowsSDKProps } from './remoteFlows-BdsVZGGF.js';
|
|
32
|
+
export { $ as $TSFixMe, B as ButtonComponentProps, C as Components, F as FieldComponentProps, b as FieldSetToggleComponentProps, S as StatementComponentProps, Z as ZendeskDrawerComponentProps } from './remoteFlows-BdsVZGGF.js';
|
|
33
33
|
export { F as FieldError, N as NormalizedFieldError } from './mutations-B6HWH-rZ.js';
|
|
34
34
|
import 'yup';
|
|
35
35
|
import './flows/types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-M22FKNEY.js";import{a as
|
|
1
|
+
import"./chunk-M22FKNEY.js";import"./chunk-GULCZWSK.js";import{a as dr}from"./chunk-NCA3UCCX.js";import"./chunk-63HVO7J5.js";import"./chunk-73H6SO2E.js";import"./chunk-7JQPHRUK.js";import"./chunk-Z7WBY27D.js";import"./chunk-5KHLOGTR.js";import"./chunk-4B36XRKA.js";import"./chunk-TLC5WQY2.js";import"./chunk-CEUBVUKV.js";import"./chunk-BF2D5O5H.js";import"./chunk-56DXHJNR.js";import"./chunk-PGWKJ6FK.js";import"./chunk-ZOKSYPOP.js";import"./chunk-VAIBLWOY.js";import"./chunk-7C2Z2EE5.js";import"./chunk-F66G33YT.js";import{a as lr}from"./chunk-2RZABLV2.js";import"./chunk-XGEKV3FC.js";import"./chunk-53NFLDRX.js";import"./chunk-DCRLPAJL.js";import"./chunk-QQ7KPOLK.js";import"./chunk-UWIFE5LJ.js";import"./chunk-WWANHPT7.js";import"./chunk-6GMGXSKN.js";import"./chunk-W5DG5WWJ.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-XFD3ULUF.js";import"./chunk-JODJFARP.js";import"./chunk-S4XU4SE7.js";import"./chunk-Z3BMF4BO.js";import{a as N}from"./chunk-MLB2I27G.js";import"./chunk-E5YN6OT3.js";import{a as D}from"./chunk-R2UI3WAJ.js";import{a as j}from"./chunk-6ZPISRAG.js";import"./chunk-4RULC3AZ.js";import"./chunk-H4KE45NG.js";import"./chunk-6NKUEDYP.js";import"./chunk-I2A4EFDY.js";import"./chunk-4R3ITKOA.js";import"./chunk-ZE3YT3Q6.js";import"./chunk-NVMZDPMF.js";import"./chunk-XJVYASHX.js";import"./chunk-A6EYY3FO.js";import"./chunk-CYKK3LPJ.js";import"./chunk-RZTT3MEP.js";import"./chunk-MRMVBBVZ.js";import"./chunk-MRYRNB7Y.js";import{a as _}from"./chunk-FTW6Z4IF.js";import{b as F,d as T}from"./chunk-JUJZENG7.js";import"./chunk-ALYKEN3E.js";import{a as z}from"./chunk-NBCZF2FO.js";import"./chunk-PHN4XMPV.js";import"./chunk-BFOGH4SF.js";import"./chunk-WVJDCDGZ.js";import"./chunk-VFRHMNLJ.js";import{a as B}from"./chunk-3O2RD3RK.js";import{a as S}from"./chunk-OZ63OC3N.js";import{a as E}from"./chunk-A4KEKMEQ.js";import{d as R}from"./chunk-V2YORDAL.js";import"./chunk-HN5HLFTB.js";import"./chunk-KSHK3ZPX.js";import"./chunk-A7ZJQCNU.js";import{a as A}from"./chunk-HQI6W7PR.js";import{a as I}from"./chunk-DYB3RWP7.js";import"./chunk-CRXPRR3R.js";import"./chunk-UHS3QRA3.js";import"./chunk-N5I33LIN.js";import"./chunk-LBUNJ5J3.js";import"./chunk-ANXYPRBG.js";import"./chunk-Z5WMKCRJ.js";import{a as sr}from"./chunk-JB55FFG6.js";import{a as er}from"./chunk-A522V6XF.js";import"./chunk-CFIJKJXD.js";import"./chunk-2VS6B3PC.js";import"./chunk-U4NWXPI5.js";import"./chunk-ZTDKPUB5.js";import{a as or}from"./chunk-ITSQE6EW.js";import{a as cr}from"./chunk-QXPWESEW.js";import{a as ir,b as nr}from"./chunk-GGBEM452.js";import"./chunk-QW4JPW6J.js";import"./chunk-3AEKPMIN.js";import"./chunk-ZSDJZMQW.js";import"./chunk-GP237GUO.js";import"./chunk-TXSJL3HC.js";import{a as v}from"./chunk-EGQJ7UBR.js";import"./chunk-PJBAQZ6G.js";import"./chunk-7P5B6XHM.js";import{a as u,c as h}from"./chunk-3ZWDIEEM.js";import"./chunk-7VUILYZ3.js";import{a as tr}from"./chunk-DBDVBJDV.js";import"./chunk-3BREUYLG.js";import{b as C}from"./chunk-PAQW5BFW.js";import"./chunk-BI6U55BD.js";import"./chunk-TVZAFTPT.js";import{c as P,d as m}from"./chunk-3LOVCTCN.js";import{a as t}from"./chunk-P37U34EQ.js";import{QueryClient as $,QueryClientProvider as G}from"@tanstack/react-query";function d(r){let a=document.documentElement;Object.keys(r).forEach(e=>{let o=r[e];o&&a.style.setProperty(e,o)})}t(d,"setCssProperties");function O(r){let a={};return Object.keys(r).forEach(e=>{a[`--${e}`]=r[e]}),a}t(O,"mapThemeColors");function K(r){return{"--spacing":r}}t(K,"mapThemeSpacing");function V(r){return{"--radius":r}}t(V,"mapThemeBorderRadius");function U(r){return{"--fontSizeBase":r.fontSizeBase}}t(U,"mapThemeFont");function w(r){r?.colors&&d(O(r.colors)),r?.spacing&&d(K(r.spacing)),r?.borderRadius&&d(V(r.borderRadius)),r?.font&&d(U(r.font))}t(w,"applyTheme");import{createContext as W,useEffect as M,useMemo as L}from"react";import{jsx as Q}from"react/jsx-runtime";var q=W({theme:{}});function f(r){M(()=>{r.theme&&Object.keys(r.theme).length>0&&w(r.theme)},[r.theme]);let a=L(()=>({theme:r.theme}),[r.theme]);return Q(q.Provider,{value:a,children:r.children})}t(f,"ThemeProvider");var x={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 Y}from"@tanstack/react-query";import{useRef as b}from"react";function Z(r){try{return new URL(r),!0}catch{return!1}}t(Z,"isValidUrl");var y=t(({auth:r,options:a,authId:e="default"})=>{let o=b(null),{refetch:c}=Y({queryKey:["auth",e],queryFn:r,enabled:!1}),s=a?.environment?x[a?.environment]:"https://gateway.remote.com",l=v.getConfig(),g="0.18.1";a?.environment&&a?.environment!=="production"&&m(g);let p=!!a?.proxy&&Z(a.proxy.url);return a?.proxy&&!p&&console.error("Invalid proxy URL provided. Using default base URL."),b(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:t(async()=>{function k(i){return!i||Date.now()+6e4>i}if(t(k,"hasTokenExpired"),!o.current||k(o.current.expiresAt)){let{data:i}=await c();i&&(o.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return o.current?.accessToken},"auth")}))},"useAuth");import{jsx as n}from"react/jsx-runtime";var H=new $;function J({children:r,auth:a,authId:e,proxy:o,environment:c}){let s=y({auth:a,authId:e,options:{proxy:o,environment:c}});return n(h.Provider,{value:{client:s.current},children:r})}t(J,"RemoteFlowContextWrapper");function rr({children:r,components:a}){return n(u.Provider,{value:a?{components:a}:{components:{}},children:r})}t(rr,"FormFieldsProvider");function ar({auth:r,authId:a,children:e,components:o,theme:c,proxy:s,environment:l}){return n(G,{client:H,children:n(rr,{components:o,children:n(J,{auth:r,authId:a,proxy:s,environment:l,children:n(f,{theme:c,children:e})})})})}t(ar,"RemoteFlows");export{tr as ContractAmendmentConfirmationForm,sr as ContractAmendmentFlow,er as ContractAmendmentForm,or as ContractAmendmentSubmit,A as CostCalculatorDisclaimer,_ as CostCalculatorFlow,B as CostCalculatorForm,S as CostCalculatorResetButton,N as CostCalculatorResults,E as CostCalculatorSubmitButton,j as EstimationResults,dr as OnboardingFlow,ar as RemoteFlows,D as SummaryResults,lr as TerminationFlow,F as buildCostCalculatorEstimationPayload,C as convertFromCents,I as disclaimerData,P as transformYupErrorsIntoObject,cr as useContractAmendment,T as useCostCalculator,R as useCostCalculatorEstimationPdf,ir as useEmploymentQuery,nr as useTimeOffQuery,z as zendeskArticles};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
2
2
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { AnySchema } from 'yup';
|
|
4
|
-
import { I as HelpCenterArticle } from './types.gen-
|
|
4
|
+
import { I as HelpCenterArticle } from './types.gen-nWJIP4db.js';
|
|
5
5
|
import { S as SupportedTypes } from './types-Zg1n_9wh.js';
|
|
6
6
|
|
|
7
7
|
type ThemeProviderProps = PropsWithChildren<{
|
|
@@ -1392,4 +1392,4 @@ type PostInviteEmploymentInvitationErrors = {
|
|
|
1392
1392
|
};
|
|
1393
1393
|
type PostInviteEmploymentInvitationError = PostInviteEmploymentInvitationErrors[keyof PostInviteEmploymentInvitationErrors];
|
|
1394
1394
|
|
|
1395
|
-
export type {
|
|
1395
|
+
export type { PostConvertRawCurrencyConverterError as A, ConvertCurrencyParams as B, ContractAmendmentAutomatableResponse as C, PostCreateContractEligibilityError as D, EmploymentShowResponse as E, CreateContractEligibilityParams as F, TimeoffStatus as G, Currency as H, HelpCenterArticle as I, ListTimeoffResponse as L, MinimalRegion as M, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, CostCalculatorEstimatePdfResponse as d, PostCreateEstimationPdfError as e, CostCalculatorEstimateParams as f, PostCreateEstimationError as g, MinimalCountry as h, EmploymentTermType as i, CostCalculatorEmployment as j, EmploymentCreateParams as k, Employment as l, PostCreateOffboardingError as m, EmploymentCreationResponse as n, PostCreateEmployment2Error as o, EmploymentResponse as p, PatchUpdateEmployment2Error as q, PutUpdateBenefitOfferError as r, Company as s, PostInviteEmploymentInvitationError as t, PostCreateRiskReserveError as u, EmploymentFullParams as v, MagicLinkResponse as w, UnprocessableEntityResponse as x, MagicLinkParams as y, ConvertCurrencyResponse as z };
|
package/package.json
CHANGED
package/dist/chunk-HSW5HMHH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-VX2UC3HG.js";import{a as i}from"./chunk-XSHHMBMT.js";import{a as o}from"./chunk-JODJFARP.js";import{a as m}from"./chunk-W5DG5WWJ.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
-
//# sourceMappingURL=chunk-HSW5HMHH.js.map
|
package/dist/chunk-NTEIOU72.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as W}from"./chunk-ALYKEN3E.js";import{a as K}from"./chunk-VFRHMNLJ.js";import{a as G,b as I,c as z,e as Q}from"./chunk-V2YORDAL.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as N}from"./chunk-CFIJKJXD.js";import{c as X}from"./chunk-U4NWXPI5.js";import{c as M}from"./chunk-PAQW5BFW.js";import{a as i}from"./chunk-P37U34EQ.js";import{number as Re,object as ae}from"yup";import{createHeadlessForm as he,modify as Fe}from"@remoteoss/json-schema-form";import{useCallback as Ve,useEffect as Y,useMemo as Me,useState as j}from"react";import{string as Z,ValidationError as ee}from"yup";import{jsx as te}from"react/jsx-runtime";var k={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},je=i(t=>{let{schema:a}=Fe(K.data.schema,t?.jsfModify||{});return he(a)},"useStaticSchema");function Pe(t,a){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return a==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}i(Pe,"getSalaryTitle");var Ne=i(({defaultRegion:t,defaultCurrency:a,defaultSalary:l,estimationOptions:s,options:r,version:o}={estimationOptions:k})=>{let[u,S]=j(t),[P,R]=j(),[d,q]=j(),[H,ie]=j(),{data:_,isLoading:oe}=G({includePremiumBenefits:s.includePremiumBenefits}),{data:f,isLoading:se}=I(),le=u||P?.value,{data:w,isLoading:ce}=Q(le,{includePremiumBenefits:s.includePremiumBenefits,options:r}),U=z(),E=P?.currency,p=r?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Ve(()=>{let e=E&&d?E!==d:!1;return E!==d?{from:d,to:E,shouldSwapOrder:e}:{from:E,to:d,shouldSwapOrder:e}},[E,d]),J=s.showManagementFee,$=s.includeEstimationTitle,ue=Me(()=>{let{from:e,to:n,shouldSwapOrder:m}=L(),c=Pe(p,H);return{fields:{salary:{...p,title:c,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:n},Component:i(y=>te(W,{...y,shouldSwapOrder:m,conversionType:o==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{presentation:{hidden:o=="marketing"}},management:{...r?.jsfModify?.fields?.management,properties:{...r?.jsfModify?.fields?.management?.properties,management_fee:{...r?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:d||"USD"}}}},presentation:{...typeof r?.jsfModify?.fields?.management=="object"?(r?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:i(y=>te(X,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...r?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[d,p,H,F?.salary_conversion_properties?.description,F?.salary_conversion_properties?.label,l,L,r?.jsfModify?.fields?.management,J,o,$,r?.jsfModify?.fields?.estimation_title]),g=je({jsfModify:{fields:{...r?.jsfModify?.fields,...ue?.fields}}});Y(()=>{if(t&&_){let e=_.find(({value:n})=>n===t);e&&R(e)}},[t,_]),Y(()=>{if(a&&f){let e=f.find(({value:n})=>n===a);e&&q(e.label)}},[a,f]);async function me(e){try{await x.validate(e,{abortEarly:!1})}catch(n){return{data:null,error:n}}return new Promise((n,m)=>{U.mutate(re(e,s,o),{onSuccess:i(c=>{c.data?n({data:c.data,error:null}):m({data:null,error:c.error})},"onSuccess"),onError:i(c=>{m({data:null,error:c})},"onError")})})}i(me,"onSubmit");function de(e){let n=_?.find(({value:m})=>m===e);n&&n.childRegions.length===0&&n.hasAdditionalFields?S(n.regionSlug):S(void 0),R(n)}i(de,"onCountryChange");function fe(e){S(e)}i(fe,"onRegionChange");function ge(e){ie(e.target.value)}i(ge,"onHiringBudgetChange");function ye(e){let n=f?.find(m=>m.value===e)?.label;q(n),r?.onCurrencyChange?.(n||"")}i(ye,"onChangeCurrency");let b=g.fields.find(e=>e.name==="region");if(b){let e=P?.childRegions.map(n=>({value:n.slug,label:n.name}))??[];b.options=e,b.isVisible=e.length>0,b.required=e.length>0,b.onChange=fe,b.schema=e.length>0?Z().transform(n=>typeof n=="string"?n:"").required("Region is required"):Z()}if(f){let e=g.fields.find(n=>n.name==="currency");e&&(e.options=f,e.onChange=ye)}let v=g.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=ge),_){let e=g.fields.find(n=>n.name==="country");e&&(e.options=_,e.onChange=de)}let pe=i(()=>{R(void 0),S(t)},"resetForm"),D=[...g.fields.filter(e=>e.name!=="management"),...w?.fields||[],...g.fields.filter(e=>e.name==="management")],x=ne(g.fields,d||"USD",s.includeEstimationTitle);async function Ce(e){let n=null;r?.onValidation?.(e);let m=M(e,D);try{await x.validate(m,{abortEarly:!1}),n={formErrors:{},yupError:new ee([],e)}}catch(h){let T=N(h);n={formErrors:Object.entries(T).reduce((O,[A,V])=>({...O,[A]:V.message}),{}),yupError:h}}let c=w?.handleValidation(m),y=[...n?.yupError.inner||[],...c?.yupError?.inner||[]],B={...n?.yupError?.value||{},...c?.yupError?.value||{}};return{formErrors:{...n?.formErrors||{},...c?.formErrors||{}},yupError:new ee(y,B)}}return i(Ce,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:x,parseFormValues:i(e=>{let{country:n,region:m,currency:c,salary_converted:y,hiring_budget:B,salary_conversion:h,management:T,estimation_title:O,...A}=e,V=e.salary;y==="salary_conversion"&&(V=h);let _e=M({country:n,region:m,salary:V,salary_converted:y,salary_conversion:h,hiring_budget:B,currency:c,management:T,estimation_title:O},g.fields),Ee=M(A,w?.fields||[]),be={currency_code:f?.find(Se=>Se.value===c)?.label};return{..._e,...Ee,...be}},"parseFormValues"),handleValidation:Ce,isSubmitting:U.isPending,isLoading:oe&&se&&ce,onSubmit:me,resetForm:pe,currencies:f}},"useCostCalculator");function ne(t,a,l){let s=t.reduce((r,o)=>(o.name==="salary"||o.name==="salary_conversion"?r[o.name]=o.schema.when("salary_converted",{is:i(u=>u===o.name,"is"),then:i(u=>u.required("Required field"),"then"),otherwise:i(u=>u.optional(),"otherwise")}):o.name==="management"?r[o.name]=ae({management_fee:Re().transform(u=>isNaN(u)?void 0:u).min(0,"Management fee must be greater than or equal to 0").max(a?C[a]:C.USD,()=>`Management fee cannot exceed ${(a?C[a]:C.USD)/100} ${a}`)}):o.name==="estimation_title"&&l?r[o.name]=o.schema.required("Required field"):r[o.name]=o.schema,r),{});return ae(s)}i(ne,"buildValidationSchema");function we(t){let a="benefit-";return Object.keys(t).reduce((l,s)=>{let r=t[s];if(r==="none")return l;let u={benefit_group_slug:s.replace(a,""),benefit_tier_slug:r};return[...l,u]},[])}i(we,"formatBenefits");function xe(t,a,l){let s=Number(t.management?.management_fee),r=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||a.title,age:t.age??void 0,...t.benefits&&{benefits:we(t.benefits)},...a.includeManagementFee&&s&&{discount:{quoted_amount:a.showManagementFee?s:C[r]||C.USD,text:""}}},...Be(t,l)}}i(xe,"mapValueToEmployment");function Be(t,a){let l=a==="marketing"||t.salary_converted==="salary_conversion",s=a==="standard"&&t.salary_converted==="salary",r=t.hiring_budget==="my_hiring_budget";if(l){let o=t.salary_converted==="salary_conversion";return r?{annual_total_cost_in_employer_currency:t.salary}:{[o?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?r?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}i(Be,"getSalaryFields");function re(t,a=k,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(o=>o.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:a.includeBenefits,include_cost_breakdowns:a.includeCostBreakdowns,include_premium_benefits:a.includePremiumBenefits,include_management_fee:a.includeManagementFee,employments:s.map(r=>xe(r,a,l))}}i(re,"buildPayload");export{ne as a,re as b,k as c,Ne as d};
|
|
2
|
-
//# sourceMappingURL=chunk-NTEIOU72.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/utils.ts","../src/flows/CostCalculator/hooks.tsx"],"sourcesContent":["import type {\n CostCalculatorEmploymentParam,\n CostCalculatorEstimateParams,\n} from '@/src/client';\n\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { AnyObjectSchema, number, object } from 'yup';\nimport { CostCalculatorVersion, defaultEstimationOptions } from './hooks';\nimport type {\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n CurrencyKey,\n} from './types';\nimport { BASE_RATES } from '@/src/flows/CostCalculator/constants';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(\n fields: $TSFixMe[],\n employerBillingCurrency: string,\n includeEstimationTitle?: boolean,\n) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n // Special handling for salary fields\n if (field.name === 'salary' || field.name === 'salary_conversion') {\n fieldsSchemaAcc[field.name] = (field.schema as AnyObjectSchema).when(\n 'salary_converted',\n {\n is: (val: string | null) => val === field.name,\n then: (schema) => schema.required('Required field'),\n otherwise: (schema) => schema.optional(),\n },\n );\n } else if (field.name === 'management') {\n fieldsSchemaAcc[field.name] = object({\n management_fee: number()\n .transform((value) => {\n return isNaN(value) ? undefined : value;\n })\n .min(0, 'Management fee must be greater than or equal to 0')\n .max(\n employerBillingCurrency\n ? BASE_RATES[employerBillingCurrency as CurrencyKey]\n : BASE_RATES.USD,\n () => {\n const maxValue = employerBillingCurrency\n ? BASE_RATES[employerBillingCurrency as CurrencyKey]\n : BASE_RATES.USD;\n const displayValue = maxValue / 100;\n return `Management fee cannot exceed ${displayValue} ${employerBillingCurrency}`;\n },\n ),\n });\n } else if (field.name === 'estimation_title' && includeEstimationTitle) {\n // Make estimation_title required when includeEstimationTitle is true\n fieldsSchemaAcc[field.name] = (\n field.schema as AnyObjectSchema\n ).required('Required field');\n } else {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n }\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\n/**\n * Format the benefits to the expected format by the API.\n * @param benefits\n * @returns\n */\nfunction formatBenefits(benefits: Record<string, string>) {\n const needle = 'benefit-';\n return Object.keys(benefits).reduce<\n Array<{ benefit_group_slug: string; benefit_tier_slug: string }>\n >((acc, key) => {\n const benefitTierSlug = benefits[key];\n if (benefitTierSlug === 'none') {\n return acc;\n }\n const benefitGroupSlug = key.replace(needle, '');\n const benefitEntry = {\n benefit_group_slug: benefitGroupSlug,\n benefit_tier_slug: benefitTierSlug,\n };\n return [...acc, benefitEntry];\n }, []);\n}\n\nfunction mapValueToEmployment(\n value: CostCalculatorEstimationSubmitValues,\n estimationOptions: CostCalculatorEstimationOptions,\n version: CostCalculatorVersion,\n): CostCalculatorEmploymentParam {\n const managementFee = Number(value.management?.management_fee);\n const currencyCode = value.currency_code;\n\n const base: CostCalculatorEmploymentParam = {\n region_slug: value.region || value.country,\n employment_term: value.contract_duration_type ?? 'fixed',\n title: value.estimation_title || estimationOptions.title,\n age: value.age ?? undefined,\n ...(value.benefits && { benefits: formatBenefits(value.benefits) }),\n ...(estimationOptions.includeManagementFee &&\n managementFee && {\n discount: {\n quoted_amount: estimationOptions.showManagementFee\n ? managementFee\n : BASE_RATES[currencyCode as keyof typeof BASE_RATES] ||\n BASE_RATES.USD,\n text: '',\n },\n }),\n };\n\n return {\n ...base,\n ...getSalaryFields(value, version),\n };\n}\n\nfunction getSalaryFields(\n value: CostCalculatorEstimationSubmitValues,\n version: CostCalculatorVersion,\n): Partial<CostCalculatorEmploymentParam> {\n const isMarketing =\n version === 'marketing' || value.salary_converted === 'salary_conversion';\n const isStandard =\n version === 'standard' && value.salary_converted === 'salary';\n const useHiringBudget = value.hiring_budget === 'my_hiring_budget';\n\n if (isMarketing) {\n const useEmployerCurrency = value.salary_converted === 'salary_conversion';\n return useHiringBudget\n ? {\n annual_total_cost_in_employer_currency: value.salary,\n }\n : {\n [useEmployerCurrency\n ? 'annual_gross_salary_in_employer_currency'\n : 'annual_gross_salary']: value.salary,\n };\n }\n\n if (isStandard) {\n return useHiringBudget\n ? {\n annual_total_cost: value.salary,\n }\n : {\n annual_gross_salary: value.salary,\n };\n }\n\n return {};\n}\n\n/**\n * Build the payload for the cost calculator estimation.\n * @param values\n * @param estimationOptions\n * @returns\n */\nexport function buildPayload(\n values:\n | CostCalculatorEstimationSubmitValues\n | CostCalculatorEstimationSubmitValues[],\n estimationOptions: CostCalculatorEstimationOptions = defaultEstimationOptions,\n version: CostCalculatorVersion = 'standard',\n): CostCalculatorEstimateParams {\n const employments = Array.isArray(values) ? values : [values];\n\n if (employments.length === 0) {\n throw new Error('At least one employment value is required');\n }\n\n if (employments.length > 1) {\n const currencies = new Set(employments.map((v) => v.currency));\n if (currencies.size > 1) {\n console.warn(\n 'Multiple currencies detected in array. Using currency from first employment.',\n );\n }\n }\n\n return {\n employer_currency_slug: employments[0].currency,\n include_benefits: estimationOptions.includeBenefits,\n include_cost_breakdowns: estimationOptions.includeCostBreakdowns,\n include_premium_benefits: estimationOptions.includePremiumBenefits,\n include_management_fee: estimationOptions.includeManagementFee,\n employments: employments.map((value) =>\n mapValueToEmployment(value, estimationOptions, version),\n ),\n };\n}\n","import {\n CostCalculatorEstimateResponse,\n MinimalRegion,\n PostCreateEstimationError,\n} from '@/src/client';\nimport { jsonSchema } from '@/src/flows/CostCalculator/jsonSchema';\nimport type {\n CostCalculatorEstimationFormValues,\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n EstimationError,\n UseCostCalculatorOptions,\n} from '@/src/flows/CostCalculator/types';\nimport type { JSFModify, Result } from '@/src/flows/types';\n\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { iterateErrors } from '@/src/components/form/yupValidationResolver';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { string, ValidationError } from 'yup';\nimport { buildPayload, buildValidationSchema } from './utils';\nimport {\n useCompanyCurrencies,\n useCostCalculatorCountries,\n useCostCalculatorEstimation,\n useRegionFields,\n} from '@/src/flows/CostCalculator/api';\nimport { $TSFixMe, JSFField } from '@/src/types/remoteFlows';\nimport { SalaryField } from '@/src/flows/CostCalculator/components/SalaryField';\nimport {\n FieldSetField,\n FieldSetProps,\n} from '@/src/components/form/fields/FieldSetField';\n\nexport type CostCalculatorVersion = 'standard' | 'marketing';\n\ntype CostCalculatorCountry = {\n value: string;\n label: string;\n childRegions: MinimalRegion[];\n hasAdditionalFields: boolean | undefined;\n regionSlug: string;\n currency: string;\n};\n\ntype JSFValidationError = {\n formErrors: Record<\n string,\n {\n type: string;\n message: string;\n }\n >;\n yupError: ValidationError;\n};\n\nexport const defaultEstimationOptions: CostCalculatorEstimationOptions = {\n title: 'Estimation',\n includeBenefits: false,\n includeCostBreakdowns: false,\n includePremiumBenefits: false,\n enableCurrencyConversion: false,\n includeEstimationTitle: false,\n includeManagementFee: false,\n};\n\ntype UseCostCalculatorParams = {\n /**\n * The default region slug to preselect a country and a region.\n */\n defaultRegion?: string;\n /**\n * The default currency slug to preselect a currency.\n */\n defaultCurrency?: string;\n\n /**\n * The default salary to preselect a salary.\n */\n defaultSalary?: string;\n /**\n * The estimation options.\n */\n estimationOptions: CostCalculatorEstimationOptions;\n options?: UseCostCalculatorOptions;\n version?: CostCalculatorVersion;\n};\n\nconst useStaticSchema = (options?: { jsfModify?: JSFModify }) => {\n const { schema: jsonSchemaModified } = modify(\n jsonSchema.data.schema,\n options?.jsfModify || {},\n );\n\n return createHeadlessForm(jsonSchemaModified);\n};\n\ntype HiringBudget = 'my_hiring_budget' | 'employee_annual_salary';\n\nfunction getSalaryTitle(\n salaryField: unknown,\n hiringBudget?: HiringBudget,\n): string {\n if (\n typeof salaryField === 'object' &&\n salaryField !== null &&\n 'title' in salaryField\n ) {\n const title = (salaryField as { title?: string }).title;\n if (title) return title;\n }\n return hiringBudget === 'my_hiring_budget'\n ? 'Hiring budget'\n : \"Employee's annual salary\";\n}\n\n/**\n * Hook to use the cost calculator.\n */\nexport const useCostCalculator = (\n {\n defaultRegion,\n defaultCurrency,\n defaultSalary,\n estimationOptions,\n options,\n version,\n }: UseCostCalculatorParams = {\n estimationOptions: defaultEstimationOptions,\n },\n) => {\n const [selectedRegion, setSelectedRegion] = useState<string | undefined>(\n defaultRegion,\n );\n const [selectedCountry, setSelectedCountry] =\n useState<CostCalculatorCountry>();\n const [employerBillingCurrency, setEmployerBillingCurrency] = useState<\n string | undefined\n >();\n const [hiringBudget, setHiringBudget] = useState<HiringBudget>();\n const { data: countries, isLoading: isLoadingCountries } =\n useCostCalculatorCountries({\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n });\n const { data: currencies, isLoading: isLoadingCurrencies } =\n useCompanyCurrencies();\n\n const jsonSchemaRegionSlug = selectedRegion || selectedCountry?.value;\n\n const { data: jsonSchemaRegionFields, isLoading: isLoadingRegionFields } =\n useRegionFields(jsonSchemaRegionSlug, {\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n options,\n });\n const costCalculatorEstimationMutation = useCostCalculatorEstimation();\n const employeeBillingCurrency = selectedCountry?.currency;\n\n const salaryField = options?.jsfModify?.fields?.salary;\n const salaryFieldPresentation =\n salaryField &&\n typeof salaryField === 'object' &&\n 'presentation' in salaryField\n ? (\n salaryField as {\n presentation?: {\n salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const getCurrencies = useCallback(() => {\n const shouldSwapOrder =\n employeeBillingCurrency && employerBillingCurrency\n ? employeeBillingCurrency !== employerBillingCurrency\n : false;\n\n if (employeeBillingCurrency !== employerBillingCurrency) {\n return {\n from: employerBillingCurrency,\n to: employeeBillingCurrency,\n shouldSwapOrder,\n };\n }\n\n return {\n from: employeeBillingCurrency,\n to: employerBillingCurrency,\n shouldSwapOrder,\n };\n }, [employeeBillingCurrency, employerBillingCurrency]);\n\n const showManagementField = estimationOptions.showManagementFee;\n const showEstimationTitleField = estimationOptions.includeEstimationTitle;\n const customFields = useMemo(() => {\n const { from, to, shouldSwapOrder } = getCurrencies();\n const salaryTitle = getSalaryTitle(salaryField, hiringBudget);\n\n return {\n fields: {\n salary: {\n ...salaryField,\n title: salaryTitle,\n presentation: {\n salary_conversion_properties: {\n label:\n salaryFieldPresentation?.salary_conversion_properties?.label,\n description:\n salaryFieldPresentation?.salary_conversion_properties\n ?.description,\n },\n currencies: { from, to },\n Component: (\n props: JSFField & { currencies: { from: string; to: string } },\n ) => {\n return (\n <SalaryField\n {...props}\n shouldSwapOrder={shouldSwapOrder}\n conversionType={\n version === 'marketing' ? 'no_spread' : 'spread'\n }\n defaultValue={defaultSalary}\n />\n );\n },\n },\n },\n hiring_budget: {\n presentation: {\n hidden: version == 'marketing',\n },\n },\n management: {\n ...options?.jsfModify?.fields?.management,\n properties: {\n ...(options?.jsfModify?.fields?.management as $TSFixMe)?.properties,\n management_fee: {\n ...(options?.jsfModify?.fields?.management as $TSFixMe)\n ?.properties?.management_fee,\n 'x-jsf-presentation': {\n inputType: 'money',\n additionalProps: {\n currency: employerBillingCurrency || 'USD',\n },\n },\n },\n },\n presentation: {\n ...(typeof options?.jsfModify?.fields?.management === 'object'\n ? (\n options?.jsfModify?.fields?.management as Record<\n string,\n $TSFixMe\n >\n )['x-jsf-presentation']\n : {}),\n hidden: !showManagementField,\n Component: (props: FieldSetProps) => {\n return (\n <FieldSetField\n {...props}\n variant='inset'\n features={{\n toggle: {\n enabled: true,\n stateField: 'management._expanded',\n labels: {\n expand: 'Define',\n collapse: 'Remove',\n },\n },\n }}\n />\n );\n },\n },\n },\n estimation_title: {\n ...options?.jsfModify?.fields?.estimation_title,\n 'x-jsf-presentation': {\n hidden: !showEstimationTitleField,\n },\n },\n },\n };\n }, [\n employerBillingCurrency,\n salaryField,\n hiringBudget,\n salaryFieldPresentation?.salary_conversion_properties?.description,\n salaryFieldPresentation?.salary_conversion_properties?.label,\n defaultSalary,\n getCurrencies,\n options?.jsfModify?.fields?.management,\n showManagementField,\n version,\n showEstimationTitleField,\n options?.jsfModify?.fields?.estimation_title,\n ]);\n\n const fieldsJSONSchema = useStaticSchema({\n jsfModify: {\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n });\n\n useEffect(() => {\n // Initialize selectedCountry from defaultRegion\n if (defaultRegion && countries) {\n const defaultCountry = countries.find(\n ({ value }) => value === defaultRegion,\n );\n if (defaultCountry) {\n setSelectedCountry(defaultCountry);\n }\n }\n }, [defaultRegion, countries]);\n\n useEffect(() => {\n // Initialize selectedCurrency from defaultCurrency\n if (defaultCurrency && currencies) {\n const defaultCurrencyObj = currencies.find(\n ({ value }) => value === defaultCurrency,\n );\n if (defaultCurrencyObj) {\n setEmployerBillingCurrency(defaultCurrencyObj.label);\n }\n }\n }, [defaultCurrency, currencies]);\n\n /**\n * Submit the estimation form with the given values.\n * @param values\n */\n async function onSubmit(\n values: CostCalculatorEstimationSubmitValues,\n ): Promise<Result<CostCalculatorEstimateResponse, EstimationError>> {\n try {\n await validationSchema.validate(values, { abortEarly: false });\n } catch (err) {\n return {\n data: null,\n error: err as ValidationError,\n };\n }\n\n return new Promise((resolve, reject) => {\n costCalculatorEstimationMutation.mutate(\n buildPayload(values, estimationOptions, version),\n {\n onSuccess: (response) => {\n if (response.data) {\n resolve({\n data: response.data,\n error: null,\n });\n } else {\n reject({\n data: null,\n error: response.error as PostCreateEstimationError,\n });\n }\n },\n onError: (error) => {\n reject({\n data: null,\n error: error as PostCreateEstimationError,\n });\n },\n },\n );\n });\n }\n\n /**\n * If the selected country has no child regions and has additional fields,\n * set the current region to the country's region slug and fetch the region fields.\n * @param country\n */\n function onCountryChange(country: string) {\n const currentCountry = countries?.find(({ value }) => value === country);\n\n if (\n currentCountry &&\n currentCountry.childRegions.length === 0 &&\n currentCountry.hasAdditionalFields\n ) {\n setSelectedRegion(currentCountry.regionSlug);\n } else {\n setSelectedRegion(undefined);\n }\n setSelectedCountry(currentCountry);\n }\n\n /**\n * Update the selected region and fetch the region fields.\n * @param region\n */\n function onRegionChange(region: string) {\n setSelectedRegion(region);\n }\n\n function onHiringBudgetChange(event: React.ChangeEvent<HTMLInputElement>) {\n setHiringBudget(event.target.value as HiringBudget);\n }\n\n function onChangeCurrency(currency: string) {\n const selectedCurrency = currencies?.find(\n (c) => c.value === currency,\n )?.label;\n setEmployerBillingCurrency(selectedCurrency);\n options?.onCurrencyChange?.(selectedCurrency || '');\n }\n\n const regionField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'region',\n );\n\n if (regionField) {\n const regions =\n selectedCountry?.childRegions.map((region) => ({\n value: region.slug,\n label: region.name,\n })) ?? [];\n regionField.options = regions;\n regionField.isVisible = regions.length > 0;\n regionField.required = regions.length > 0;\n regionField.onChange = onRegionChange;\n regionField.schema =\n regions.length > 0\n ? string()\n .transform((value) => (typeof value === 'string' ? value : ''))\n .required('Region is required')\n : string();\n }\n\n if (currencies) {\n const currencyField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'currency',\n );\n if (currencyField) {\n currencyField.options = currencies;\n currencyField.onChange = onChangeCurrency;\n }\n }\n\n const hiringBudgetField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'hiring_budget',\n );\n if (hiringBudgetField) {\n hiringBudgetField.onChange = onHiringBudgetChange;\n }\n\n if (countries) {\n const countryField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n countryField.onChange = onCountryChange;\n }\n }\n\n const resetForm = () => {\n setSelectedCountry(undefined);\n setSelectedRegion(defaultRegion);\n };\n\n const allFields = [\n ...fieldsJSONSchema.fields.filter((field) => field.name !== 'management'),\n ...(jsonSchemaRegionFields?.fields || []),\n ...fieldsJSONSchema.fields.filter((field) => field.name === 'management'),\n ];\n\n const validationSchema = buildValidationSchema(\n fieldsJSONSchema.fields,\n employerBillingCurrency || 'USD',\n estimationOptions.includeEstimationTitle,\n );\n\n async function handleValidation(values: CostCalculatorEstimationFormValues) {\n let errors: JSFValidationError | null = null;\n\n options?.onValidation?.(values);\n const parsedValues = parseJSFToValidate(values, allFields);\n\n // 1. validate static fields first using Yup validate function\n try {\n await validationSchema.validate(parsedValues, {\n abortEarly: false,\n });\n errors = {\n formErrors: {},\n yupError: new ValidationError([], values),\n };\n } catch (error) {\n const iterateResult = iterateErrors(error as ValidationError);\n\n errors = {\n // convert the errors to a format that can be used in the form\n formErrors: Object.entries(iterateResult).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.message }),\n {},\n ),\n yupError: error as ValidationError,\n };\n }\n\n // 2. validate json schema fields using the handleValidation (from json-schema-form)\n const handleValidationResult =\n jsonSchemaRegionFields?.handleValidation(parsedValues);\n\n // 3. combine the errors from both validations\n const combinedInnerErrors = [\n ...(errors?.yupError.inner || []),\n ...(handleValidationResult?.yupError?.inner || []),\n ];\n const combinedValues = {\n ...(errors?.yupError?.value || {}),\n ...(handleValidationResult?.yupError?.value || {}),\n };\n\n return {\n formErrors: {\n ...(errors?.formErrors || {}),\n ...(handleValidationResult?.formErrors || {}),\n },\n yupError: new ValidationError(combinedInnerErrors, combinedValues),\n };\n }\n\n return {\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState: {\n current: 0,\n total: 1,\n isLastStep: true,\n },\n /**\n * Array of form fields from the cost calculator schema + dynamic region fields like benefits, age, etc.\n */\n fields: allFields,\n /**\n * Validation schema for the cost calculator form\n */\n validationSchema,\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (\n values: CostCalculatorEstimationFormValues,\n ): CostCalculatorEstimationSubmitValues => {\n const {\n country,\n region,\n currency,\n salary_converted,\n hiring_budget,\n salary_conversion,\n management,\n estimation_title,\n ...rest\n } = values;\n\n // If the salary has been converted, we take the one the user has inputted\n let salary = values.salary;\n if (salary_converted === 'salary_conversion') {\n salary = salary_conversion;\n }\n\n const jsonSchemaStaticFieldValues = {\n country,\n region,\n salary,\n salary_converted,\n salary_conversion,\n hiring_budget,\n currency,\n management,\n estimation_title,\n };\n\n const parsedStaticFields = parseJSFToValidate(\n jsonSchemaStaticFieldValues,\n fieldsJSONSchema.fields,\n );\n\n const parsedRegionFields = parseJSFToValidate(\n rest,\n jsonSchemaRegionFields?.fields || [],\n );\n\n const additionalFields = {\n currency_code: currencies?.find((c) => c.value === currency)?.label,\n };\n\n return {\n ...parsedStaticFields,\n ...parsedRegionFields,\n ...additionalFields,\n } as CostCalculatorEstimationSubmitValues;\n },\n /**\n * Function to handle validation of the cost calculator form\n * @param values - Form values to validate\n * @returns Validation result\n */\n handleValidation,\n /**\n * Whether the cost calculator form is currently being submitted\n */\n isSubmitting: costCalculatorEstimationMutation.isPending,\n /**\n * Whether the cost calculator form is currently loading\n */\n isLoading:\n isLoadingCountries && isLoadingCurrencies && isLoadingRegionFields,\n /**\n * Function to submit the cost calculator form\n */\n onSubmit,\n /**\n * Function to reset the cost calculator form\n */\n resetForm,\n\n /**\n * Currencies data useful to get the currency if you have a currencySlug\n */\n currencies,\n };\n};\n"],"mappings":"qVAMA,OAA0B,UAAAA,GAAQ,UAAAC,OAAc,MCWhD,OAAS,sBAAAC,GAAoB,UAAAC,OAAc,8BAC3C,OAAS,eAAAC,GAAa,aAAAC,EAAW,WAAAC,GAAS,YAAAC,MAAgB,QAC1D,OAAS,UAAAC,EAAQ,mBAAAC,OAA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,GACdC,EAGAV,EAAqDW,EACrDV,EAAiC,WACH,CAC9B,IAAMW,EAAc,MAAM,QAAQF,CAAM,EAAIA,EAAS,CAACA,CAAM,EAE5D,GAAIE,EAAY,SAAW,EACzB,MAAM,IAAI,MAAM,2CAA2C,EAG7D,OAAIA,EAAY,OAAS,GACJ,IAAI,IAAIA,EAAY,IAAKC,GAAMA,EAAE,QAAQ,CAAC,EAC9C,KAAO,GACpB,QAAQ,KACN,8EACF,EAIG,CACL,uBAAwBD,EAAY,CAAC,EAAE,SACvC,iBAAkBZ,EAAkB,gBACpC,wBAAyBA,EAAkB,sBAC3C,yBAA0BA,EAAkB,uBAC5C,uBAAwBA,EAAkB,qBAC1C,YAAaY,EAAY,IAAKtB,GAC5BS,GAAqBT,EAAOU,EAAmBC,CAAO,CACxD,CACF,CACF,CAhCgBhB,EAAAwB,GAAA","names":["number","object","createHeadlessForm","modify","useCallback","useEffect","useMemo","useState","string","ValidationError","jsx","defaultEstimationOptions","useStaticSchema","__name","options","jsonSchemaModified","modify","jsonSchema","createHeadlessForm","getSalaryTitle","salaryField","hiringBudget","title","useCostCalculator","defaultRegion","defaultCurrency","defaultSalary","estimationOptions","version","selectedRegion","setSelectedRegion","useState","selectedCountry","setSelectedCountry","employerBillingCurrency","setEmployerBillingCurrency","setHiringBudget","countries","isLoadingCountries","useCostCalculatorCountries","currencies","isLoadingCurrencies","useCompanyCurrencies","jsonSchemaRegionSlug","jsonSchemaRegionFields","isLoadingRegionFields","useRegionFields","costCalculatorEstimationMutation","useCostCalculatorEstimation","employeeBillingCurrency","salaryFieldPresentation","getCurrencies","useCallback","shouldSwapOrder","showManagementField","showEstimationTitleField","customFields","useMemo","from","to","salaryTitle","props","SalaryField","FieldSetField","fieldsJSONSchema","useEffect","defaultCountry","value","defaultCurrencyObj","onSubmit","values","validationSchema","err","resolve","reject","buildPayload","response","error","onCountryChange","country","currentCountry","onRegionChange","region","onHiringBudgetChange","event","onChangeCurrency","currency","selectedCurrency","c","regionField","field","regions","string","currencyField","hiringBudgetField","countryField","resetForm","allFields","buildValidationSchema","handleValidation","errors","parsedValues","parseJSFToValidate","ValidationError","iterateResult","iterateErrors","acc","key","handleValidationResult","combinedInnerErrors","combinedValues","salary_converted","hiring_budget","salary_conversion","management","estimation_title","rest","salary","parsedStaticFields","parsedRegionFields","additionalFields","buildValidationSchema","fields","employerBillingCurrency","includeEstimationTitle","fieldsSchema","fieldsSchemaAcc","field","__name","val","schema","object","number","value","BASE_RATES","formatBenefits","benefits","needle","acc","key","benefitTierSlug","benefitEntry","mapValueToEmployment","estimationOptions","version","managementFee","currencyCode","getSalaryFields","isMarketing","isStandard","useHiringBudget","useEmployerCurrency","buildPayload","values","defaultEstimationOptions","employments","v"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|