@remoteoss/remote-flows 0.28.0 → 0.28.2
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-HFI2MD3H.js → chunk-2H54PI4L.js} +2 -2
- package/dist/{chunk-FFMKAMWP.js → chunk-BPTG5PRM.js} +2 -2
- package/dist/{chunk-L3C4AHZJ.js → chunk-CNID6L26.js} +2 -2
- package/dist/{chunk-HMNHKZGD.js → chunk-EJGOCUZS.js} +2 -2
- package/dist/{chunk-UFBTCHEI.js → chunk-EPFXYDIP.js} +2 -2
- package/dist/chunk-IOBB4OZJ.js +2 -0
- package/dist/chunk-IOBB4OZJ.js.map +1 -0
- package/dist/{chunk-UTBVLDKY.js → chunk-LWPOUUZF.js} +2 -2
- package/dist/{chunk-Z42H2QEW.js → chunk-N3QYXQ3V.js} +2 -2
- package/dist/{chunk-ZY5U2UNT.js → chunk-NWYFBV22.js} +2 -2
- package/dist/{chunk-BMDZJNJV.js → chunk-PTMHPPZ4.js} +2 -2
- package/dist/{chunk-QPTO4XXU.js → chunk-PZV24NHM.js} +2 -2
- package/dist/{chunk-ZWZJ4XOY.js → chunk-VU2RMWMI.js} +2 -2
- package/dist/{chunk-RINDVT6U.js → chunk-YSH6TRSA.js} +2 -2
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-LRGEEPGK.js +0 -2
- package/dist/chunk-LRGEEPGK.js.map +0 -1
- /package/dist/{chunk-HFI2MD3H.js.map → chunk-2H54PI4L.js.map} +0 -0
- /package/dist/{chunk-FFMKAMWP.js.map → chunk-BPTG5PRM.js.map} +0 -0
- /package/dist/{chunk-L3C4AHZJ.js.map → chunk-CNID6L26.js.map} +0 -0
- /package/dist/{chunk-HMNHKZGD.js.map → chunk-EJGOCUZS.js.map} +0 -0
- /package/dist/{chunk-UFBTCHEI.js.map → chunk-EPFXYDIP.js.map} +0 -0
- /package/dist/{chunk-UTBVLDKY.js.map → chunk-LWPOUUZF.js.map} +0 -0
- /package/dist/{chunk-Z42H2QEW.js.map → chunk-N3QYXQ3V.js.map} +0 -0
- /package/dist/{chunk-ZY5U2UNT.js.map → chunk-NWYFBV22.js.map} +0 -0
- /package/dist/{chunk-BMDZJNJV.js.map → chunk-PTMHPPZ4.js.map} +0 -0
- /package/dist/{chunk-QPTO4XXU.js.map → chunk-PZV24NHM.js.map} +0 -0
- /package/dist/{chunk-ZWZJ4XOY.js.map → chunk-VU2RMWMI.js.map} +0 -0
- /package/dist/{chunk-RINDVT6U.js.map → chunk-YSH6TRSA.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{m as K}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{m as K}from"./chunk-IOBB4OZJ.js";import{a as w}from"./chunk-BV3PGYSH.js";import{b as J}from"./chunk-3ZWDIEEM.js";import{c as G}from"./chunk-CNDSIADP.js";import{a as t,b as d,c as Me}from"./chunk-P37U34EQ.js";var L=d((Et,U)=>{"use strict";function Pe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}t(Pe,"isObject");U.exports=Pe});var X=d(($t,V)=>{"use strict";var _e=typeof global=="object"&&global&&global.Object===Object&&global;V.exports=_e});var F=d((qt,z)=>{"use strict";var ke=X(),we=typeof self=="object"&&self&&self.Object===Object&&self,Le=ke||we||Function("return this")();z.exports=Le});var Y=d((It,Q)=>{"use strict";var Fe=F(),Ae=t(function(){return Fe.Date.now()},"now");Q.exports=Ae});var ee=d((Pt,Z)=>{"use strict";var We=/\s/;function De(e){for(var n=e.length;n--&&We.test(e.charAt(n)););return n}t(De,"trimmedEndIndex");Z.exports=De});var ne=d((kt,te)=>{"use strict";var Be=ee(),Ne=/^\s+/;function He(e){return e&&e.slice(0,Be(e)+1).replace(Ne,"")}t(He,"baseTrim");te.exports=He});var A=d((Lt,re)=>{"use strict";var Ge=F(),Je=Ge.Symbol;re.exports=Je});var ae=d((Ft,se)=>{"use strict";var oe=A(),ie=Object.prototype,Ke=ie.hasOwnProperty,Ue=ie.toString,O=oe?oe.toStringTag:void 0;function Ve(e){var n=Ke.call(e,O),r=e[O];try{e[O]=void 0;var o=!0}catch{}var s=Ue.call(e);return o&&(n?e[O]=r:delete e[O]),s}t(Ve,"getRawTag");se.exports=Ve});var ue=d((Wt,ce)=>{"use strict";var Xe=Object.prototype,ze=Xe.toString;function Qe(e){return ze.call(e)}t(Qe,"objectToString");ce.exports=Qe});var me=d((Bt,le)=>{"use strict";var fe=A(),Ye=ae(),Ze=ue(),et="[object Null]",tt="[object Undefined]",de=fe?fe.toStringTag:void 0;function nt(e){return e==null?e===void 0?tt:et:de&&de in Object(e)?Ye(e):Ze(e)}t(nt,"baseGetTag");le.exports=nt});var pe=d((Ht,ge)=>{"use strict";function rt(e){return e!=null&&typeof e=="object"}t(rt,"isObjectLike");ge.exports=rt});var ve=d((Jt,be)=>{"use strict";var ot=me(),it=pe(),st="[object Symbol]";function at(e){return typeof e=="symbol"||it(e)&&ot(e)==st}t(at,"isSymbol");be.exports=at});var Te=d((Ut,xe)=>{"use strict";var ct=ne(),ye=L(),ut=ve(),he=NaN,ft=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,lt=/^0o[0-7]+$/i,mt=parseInt;function gt(e){if(typeof e=="number")return e;if(ut(e))return he;if(ye(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ye(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ct(e);var r=dt.test(e);return r||lt.test(e)?mt(e.slice(2),r?2:8):ft.test(e)?he:+e}t(gt,"toNumber");xe.exports=gt});var je=d((Xt,Se)=>{"use strict";var pt=L(),W=Y(),Ce=Te(),bt="Expected a function",vt=Math.max,yt=Math.min;function ht(e,n,r){var o,s,p,l,a,c,m=0,E=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(bt);n=Ce(n)||0,pt(r)&&(E=!!r.leading,u="maxWait"in r,p=u?vt(Ce(r.maxWait)||0,n):p,h="trailing"in r?!!r.trailing:h);function x(i){var g=o,y=s;return o=s=void 0,m=i,l=e.apply(y,g),l}t(x,"invokeFunc");function R(i){return m=i,a=setTimeout(v,n),E?x(i):l}t(R,"leadingEdge");function C(i){var g=i-c,y=i-m,M=n-g;return u?yt(M,p-y):M}t(C,"remainingWait");function $(i){var g=i-c,y=i-m;return c===void 0||g>=n||g<0||u&&y>=p}t($,"shouldInvoke");function v(){var i=W();if($(i))return b(i);a=setTimeout(v,C(i))}t(v,"timerExpired");function b(i){return a=void 0,h&&o?x(i):(o=s=void 0,l)}t(b,"trailingEdge");function q(){a!==void 0&&clearTimeout(a),m=0,o=c=s=a=void 0}t(q,"cancel");function I(){return a===void 0?l:b(W())}t(I,"flush");function S(){var i=W(),g=$(i);if(o=arguments,s=this,c=i,g){if(a===void 0)return R(c);if(u)return clearTimeout(a),a=setTimeout(v,n),x(c)}return a===void 0&&(a=setTimeout(v,n)),l}return t(S,"debounced"),S.cancel=q,S.flush=I,S}t(ht,"debounce");Se.exports=ht});import{useState as Ct,useCallback as St,useEffect as Re,useRef as $e}from"react";var Ee=Me(je(),1);import{useCallback as xt,useEffect as Tt,useRef as Oe}from"react";function D(e,n){let r=Oe(e);Tt(()=>{r.current=e},[e]);let o=Oe((0,Ee.default)(s=>{r.current(s)},n)).current;return xt(s=>{o(s)},[o])}t(D,"useDebounce");import{Fragment as Ot,jsx as T,jsxs as qe}from"react/jsx-runtime";var jt=t(({description:e,showConversion:n,targetCurrency:r,className:o,onClick:s})=>{let{components:p}=J(),l=n?`Hide ${r} conversion`:`Show ${r} conversion`,a=p?.button;return qe("span",{className:o,children:[e," ",a?T(a,{className:`${o.replace("-description","-button")}`,"data-type":"inline",onClick:s,children:l}):T("button",{className:`${o.replace("-description","-button")}`,onClick:s,children:l})]})},"DescriptionWithConversion"),cn=t(({sourceCurrency:e,targetCurrency:n,mainFieldName:r,conversionFieldName:o,conversionProperties:s,classNamePrefix:p,description:l,conversionType:a="spread",...c})=>{let[m,E]=Ct(!1),{setValue:u,watch:h}=G(),x=h(r||c.name),R=$e(!0),C=$e(new Map),$=e&&n&&e!==n,{mutateAsync:v}=K({type:a}),b=`${c.name}_converted`;Re(()=>{u(b,r||c.name)},[u,r,c.name,b]),Re(()=>{if(R.current){R.current=!1;return}u(o,"")},[e,o,u]);let q=St(async(f,j,k,B)=>{if(!f)return;let N=`${j}_${k}_${f}`,H=C.current.get(N);if(H){u(B,H.targetAmount);return}try{let P=await v({source_currency:j,target_currency:k,amount:Number(f)});if(P.data?.data?.conversion_data?.target_amount){let _=P.data.data.conversion_data.target_amount;if(_){u(B,_?.toString()),C.current.set(N,{targetAmount:_.toString()});let Ie=`${k}_${j}_${_}`;C.current.set(Ie,{targetAmount:f.toString()})}}}catch(P){console.error("Error converting currency:",P)}},[v,u]),I=D(f=>q(f,e,n,o),500),S=D(f=>q(f,n,e,r||c.name),500),i=t(f=>{u(b,r||c.name),m&&I(f.target.value)},"handleMainFieldChange"),g=t(f=>{u(b,o),S(f.target.value)},"handleConversionFieldChange"),y=t(f=>{f.preventDefault(),E(j=>!j),!m&&x&&I(x)},"toggleConversion"),M=$?T(jt,{targetCurrency:n,description:l,showConversion:m,className:`${p}-description`,onClick:y}):l;return qe(Ot,{children:[T(w,{...c,name:r||c.name,additionalProps:{currency:e},description:M,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:i}),m&&T(w,{additionalProps:{currency:n},name:o,label:s?.label||"Conversion",description:s?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:g}),T("input",{type:"hidden",name:b,value:h(b)||r||c.name})]})},"CurrencyConversionField");export{cn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2H54PI4L.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-QDYWPG2R.js";import{a as s}from"./chunk-WCIJHQMP.js";import{a as m}from"./chunk-ZQ6MG635.js";import{a}from"./chunk-YSH6TRSA.js";import{a as i}from"./chunk-OIN3HGOQ.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-5KHLOGTR.js";import{a as n}from"./chunk-AODV6HT2.js";import{a as p}from"./chunk-GWLOE7WJ.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-CNID6L26.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BPTG5PRM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Le}from"./chunk-VAIBLWOY.js";import{a as Te}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as Le}from"./chunk-VAIBLWOY.js";import{a as Te}from"./chunk-LWPOUUZF.js";import{a as Ce,b as Oe,c as Pe,d as Me}from"./chunk-FB2QGVI2.js";import{a as ue,b as ye,c as pe,f as _e,g as Se,h as be,i as ge,j as Fe,l as Ee,n as he}from"./chunk-IOBB4OZJ.js";import{a as R}from"./chunk-2YTBWEC7.js";import{a as Ve}from"./chunk-PJBAQZ6G.js";import{c as h,d as L,f as W}from"./chunk-PAQW5BFW.js";import{g as V}from"./chunk-43WMZDDH.js";import{a as l}from"./chunk-P37U34EQ.js";import{useEffect as ot,useMemo as d,useRef as it,useState as je}from"react";import st from"lodash.mergewith";import{jsx as ke}from"react/jsx-runtime";var at={employment_basic_information:"basic_information",contract_details:"contract_details"},rt={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},ct=l(({isLoadingBasicInformationForm:f,isLoadingContractDetailsForm:I,isLoadingEmployment:J,isLoadingBenefitsOffersSchema:N,isLoadingBenefitOffers:o,isLoadingCompany:A,isLoadingCountries:C,employmentStatus:s,employmentId:_,currentStepName:a,basicInformationFields:D,contractDetailsFields:c})=>{let O=f||I||J||N||o||A||C,r=s&&Pe.includes(s),j=s&&!Me.includes(s),k=!!(_&&r&&a!=="review"),w=O||k,B=!!(k&&!O&&D.length>0&&c.length>0);return{isLoading:w,isNavigatingToReview:B,isEmploymentReadOnly:r,canInvite:j}},"getLoadingStates"),Ft=l(({employmentId:f,companyId:I,countryCode:J,type:N,options:o,skipSteps:A,externalId:C,initialValues:s})=>{let _=it({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[a,D]=je(f),[c,O]=je(J||null),{data:r,isLoading:j,refetch:k}=ue(a);f&&r?.country?.code&&!c&&O(r.country.code);let{data:w,isLoading:B}=pe(a),{data:q,isLoading:G,refetch:we}=ye(I),Be=A?.includes("select_country")?Oe:Ce,{fieldValues:S,stepState:n,setFieldValues:qe,previousStep:ve,nextStep:Re,goToStep:U,setStepValues:$}=Ve(Be),{selectCountryForm:v,isLoading:z}=Ee({jsfModify:o?.jsfModify?.select_country,jsonSchemaVersion:o?.jsonSchemaVersion,queryOptions:{enabled:n.currentStep.name==="select_country"}}),K=be(o),Y=ge(o),Q=Fe(o),Ie=he(),{mutateAsync:Je}=R(K),{mutateAsync:X}=R(Y),{mutateAsync:Ne}=R(Q),Ae=rt[n.currentStep.name]||"employment_basic_information",De=at[Ae],Ue=r?.[De]||{},Z=l(({form:e,options:i={},query:m={}})=>{let H=Object.keys(S).length>0?{...s,...n.values?.[n.currentStep.name],...S}:{...s,...Ue};return _e({countryCode:c,form:e,fieldValues:H,query:m,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0},jsonSchemaVersion:i.jsonSchemaVersion}})},"useJSONSchema"),xe=!!(c&&(n.currentStep.name==="basic_information"||f)),He=!!(c&&(n.currentStep.name==="contract_details"||f)),{data:u,isLoading:ee}=Z({form:"employment_basic_information",options:{jsfModify:o?.jsfModify?.basic_information,jsonSchemaVersion:o?.jsonSchemaVersion,queryOptions:{enabled:xe}}}),b=o?.jsfModify?.contract_details?.fields?.annual_gross_salary,x=b&&typeof b=="object"&&"presentation"in b?b.presentation:void 0,te=o?.jsfModify?.contract_details?.fields?.equity_compensation,We=d(()=>({fields:{annual_gross_salary:{...b,presentation:{annual_gross_salary_conversion_properties:{label:x?.annual_gross_salary_conversion_properties?.label,description:x?.annual_gross_salary_conversion_properties?.description},desiredCurrency:q?.desired_currency,Component:l(e=>ke(Te,{desiredCurrency:q?.desired_currency||"",...e}),"Component")}},equity_compensation:{...te,presentation:{calculateDynamicProperties:l((e,i)=>{let m=e.equity_compensation?.offer_equity_compensation,M=i?.meta?.cost;return{extra:ke(Le,{offerEquity:m,equityCost:M})}},"calculateDynamicProperties")}}}}),[b,x,q?.desired_currency,te]),{data:y,isLoading:ne}=Z({form:"contract_details",query:{employment_id:a},options:{jsfModify:{...o?.jsfModify?.contract_details,fields:{...o?.jsfModify?.contract_details?.fields,...We.fields}},queryOptions:{enabled:He},jsonSchemaVersion:o?.jsonSchemaVersion}}),{data:P,isLoading:oe}=Se(a,S,o),ie=d(()=>{if(n.currentStep.name==="benefits"){let e={...n.values?.[n.currentStep.name],...S};return st({},w,e)}return{}},[n.currentStep.name,w,n.values,S]),t=d(()=>({select_country:v?.fields||[],basic_information:u?.fields||[],contract_details:y?.fields||[],benefits:P?.fields||[],review:[]}),[v?.fields,u?.fields,y?.fields,P?.fields]),Ge={select_country:null,basic_information:u?.meta["x-jsf-fieldsets"],contract_details:y?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:$e,basic_information:se={},contract_details:ae={},status:re}=r||{},ce=$e?.code,le=n.currentStep.name,g=d(()=>L(t.select_country,{country:c||ce||""}),[t.select_country,c,ce]),F=d(()=>{let e={...s,...se};return L(t.basic_information,e)},[t.basic_information,se,s]),p=d(()=>{let e={...s,...ae};return L(t.contract_details,e)},[t.contract_details,ae,s]),E=d(()=>{let e={...s,...ie};return L(t.benefits,e)},[t.benefits,ie,s]),ze=d(()=>r?{select_country:g,basic_information:W(t.basic_information,F),contract_details:r?.contract_details!==null?W(t.contract_details,p):p,benefits:E}:{select_country:g,basic_information:F,contract_details:p,benefits:E},[g,F,p,E,r,t]),{isLoading:Ke,isNavigatingToReview:me,isEmploymentReadOnly:Ye,canInvite:Qe}=d(()=>ct({isLoadingBasicInformationForm:ee,isLoadingContractDetailsForm:ne,isLoadingEmployment:j,isLoadingBenefitsOffersSchema:oe,isLoadingBenefitOffers:B,isLoadingCompany:G,isLoadingCountries:z,employmentId:f,employmentStatus:re,basicInformationFields:t.basic_information,contractDetailsFields:t.contract_details,currentStepName:le}),[ee,ne,j,oe,B,G,z,f,re,t.basic_information,t.contract_details,le]);ot(()=>{me&&(_.current={select_country:V(g,t.select_country),basic_information:V(F,t.basic_information),contract_details:V(p,t.contract_details),benefits:V(E,t.benefits)},$({select_country:g,basic_information:F,contract_details:p,benefits:E,review:{}}),U("review"))},[F,E,p,U,me,g,$,t.basic_information,t.benefits,t.contract_details,t.select_country]);let de=l(e=>v&&n.currentStep.name==="select_country"?e:u&&n.currentStep.name==="basic_information"?h(e,u?.fields,{isPartialValidation:!1}):y&&n.currentStep.name==="contract_details"?h(e,y?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function Xe(e){let i=n.currentStep.name;i in _.current&&(_.current[i]=V(e,t[i]));let m=de(e);switch(we(),n.currentStep.name){case"select_country":return O(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let M=!a&&c,H=a&&c&&r?.country&&r?.country.code!==c;if(M||H){let nt={basic_information:m,type:N,country_code:c,external_id:C};try{let T=await Je(nt),fe=T.data?.data?.employment?.id;return D(fe),await Ie.mutateAsync({employmentId:fe,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1}),T}catch(T){throw console.error("Error creating onboarding:",T),T}}else if(a)return X({employmentId:a,basic_information:m,pricing_plan_details:{frequency:"monthly"},external_id:C});return}case"contract_details":return X({employmentId:a,external_id:C,...{contract_details:m,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Ne({employmentId:a,...e})}}l(Xe,"onSubmit");function Ze(){ve()}l(Ze,"back");function et(){Re()}l(et,"next");function tt(e){U(e)}return l(tt,"goTo"),{employmentId:a,creditRiskStatus:q?.default_legal_entity_credit_risk_status,fieldValues:S,stepState:n,fields:t[n.currentStep.name],isLoading:Ke,isSubmitting:K.isPending||Y.isPending||Q.isPending,initialValues:ze,handleValidation:l(e=>{if(n.currentStep.name==="select_country")return v.handleValidation(e);if(n.currentStep.name==="benefits"&&P){let i=h(e,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(u&&n.currentStep.name==="basic_information"){let i=h(e,u?.fields,{isPartialValidation:!1});return u?.handleValidation(i)}if(y&&n.currentStep.name==="contract_details"){let i=h(e,y?.fields,{isPartialValidation:!1});return y?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:qe,parseFormValues:de,onSubmit:Xe,back:Ze,next:et,goTo:tt,meta:{fields:_.current,fieldsets:Ge[n.currentStep.name]},refetchEmployment:k,employment:r,isEmploymentReadOnly:Ye,canInvite:Qe}},"useOnboarding");export{Ft as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CNID6L26.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-QTYDDIVO.js";import{a as i}from"./chunk-OU4Y73FX.js";import{a as e}from"./chunk-AUZWLETL.js";import{a as c}from"./chunk-IQKZWU7I.js";import{a as d}from"./chunk-AWDGLK2T.js";import{a as n}from"./chunk-5ZR7EFPY.js";import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-QTYDDIVO.js";import{a as i}from"./chunk-OU4Y73FX.js";import{a as e}from"./chunk-AUZWLETL.js";import{a as c}from"./chunk-IQKZWU7I.js";import{a as d}from"./chunk-AWDGLK2T.js";import{a as n}from"./chunk-5ZR7EFPY.js";import{a as f}from"./chunk-PTMHPPZ4.js";import{a as m}from"./chunk-DPY77ASH.js";import{a as t}from"./chunk-TOA3JILU.js";import{a}from"./chunk-NWYFBV22.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as u}from"react";import{jsx as v}from"react/jsx-runtime";var A=r(({render:g,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O,options:l})=>{let o=a({options:l,employmentId:C,externalId:S,countryCode:b,skipSteps:s,initialValues:O}),P=u();return v(t.Provider,{value:{contractorOnboardingBag:o,formId:P},children:g({contractorOnboardingBag:o,components:{BasicInformationStep:e,SelectCountryStep:i,BackButton:n,SubmitButton:m,PricingPlanStep:p,ContractDetailsStep:c,ContractPreviewStep:d,OnboardingInvite:f}})})},"ContractorOnboardingFlow");export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EJGOCUZS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-2H54PI4L.js";import{a as m,b as y}from"./chunk-ANQ4HVVK.js";import{c}from"./chunk-CNDSIADP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(y,{className:"text-sm",zendeskId:m.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(l,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EPFXYDIP.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as R}from"./chunk-WVJDCDGZ.js";import{B as M,E as k,d as F,f as C,i as g,j as S,l as j,n as w,o as v,q as E,t as O,u as q,v as P,x,y as V}from"./chunk-3O3Q24JL.js";import{b as U}from"./chunk-Z5WMKCRJ.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-PAQW5BFW.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as p,modify as d}from"@remoteoss/json-schema-form";import{useMutation as c,useQuery as f}from"@tanstack/react-query";var $=n(t=>{let{client:r}=a();return f({queryKey:["employment",t],retry:!1,enabled:!!t,select:n(({data:e})=>e?.data.employment,"select"),queryFn:n(async()=>{let e=await q({client:r,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn")})},"useEmployment"),ee=n(t=>{let{client:r}=a();return f({queryKey:["company",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let e=await v({client:r,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn"),select:n(({data:e})=>e.data.company,"select")})},"useCompany"),te=n(t=>{let{client:r}=a();return f({queryKey:["benefit-offers",t],retry:!1,enabled:!!t,queryFn:n(async()=>g({client:r,path:{employment_id:t}}).then(e=>{if(e.error||!e.data)throw new Error("Failed to fetch benefit offers data");return e}),"queryFn"),select:n(({data:e})=>e?.data?.reduce((o,s)=>({...o,[s.benefit_group.slug]:{value:s.benefit_tier?.slug??"no",...s.benefit_group?.filter?.slug?{filter:s.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),ne=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>k({client:t,headers:{Authorization:""},path:r}),"mutationFn")})},"useEmploymentInvite"),re=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>w({client:t,body:r}),"mutationFn")})},"useCreateReserveInvoice"),oe=n(({countryCode:t,form:r,fieldValues:e,options:o,query:s={}})=>{let{client:i}=a(),m=o?.jsonSchemaVersion?.form_schema?.[r]?{json_schema_version:o.jsonSchemaVersion.form_schema[r]}:{};return f({queryKey:["onboarding-json-schema-form",t,r],retry:!1,queryFn:n(async()=>{let l=await E({client:i,headers:{Authorization:""},path:{country_code:t,form:r},query:{skip_benefits:!0,...s,...m}});if(l.error||!l.data)throw new Error("Failed to fetch onboarding schema");return l},"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:l})=>{let u=l?.data||{};if(o&&o.jsfModify){let{schema:y}=d(u,o.jsfModify);u=y}let z=U(u.properties||{},"money").reduce((y,_)=>(y[_]=b(e[_]),y),{}),A=JSON.parse(JSON.stringify({...e,...z}));return{meta:{"x-jsf-fieldsets":u["x-jsf-fieldsets"]},...p(u,{initialValues:A})}},"select")})},"useJSONSchemaForm"),se=n((t,r,e)=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:s}=a();return f({queryKey:["benefit-offers-schema",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let i=await O({client:s,path:{employment_id:t},query:o});if(i.error||!i.data)throw new Error("Failed to fetch benefit offers schema");return i},"queryFn"),select:n(({data:i})=>{let m=i?.data?.schema||{};if(e&&e.jsfModify?.benefits){let{schema:h}=d(m,e.jsfModify.benefits);m=h}let l=Object.keys(r).length>0;return p(m,{initialValues:l?{...r}:{}})},"select")})},"useBenefitOffersSchema"),ae=n(t=>{let{client:r}=a(),e=t?.jsonSchemaVersion?.form_schema?.employment_basic_information?{json_schema_version:t.jsonSchemaVersion.form_schema.employment_basic_information}:{};return c({mutationFn:n(o=>C({client:r,headers:{Authorization:""},body:o,query:{...e}}),"mutationFn")})},"useCreateEmployment"),ie=n(t=>{let{client:r}=a(),e={employment_basic_information_json_schema_version:t?.jsonSchemaVersion?.form_schema?.employment_basic_information,contract_details_json_schema_version:t?.jsonSchemaVersion?.form_schema?.contract_details},o=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));return c({mutationFn:n(({employmentId:s,...i})=>P({client:r,headers:{Authorization:""},body:i,path:{employment_id:s},query:{skip_benefits:!0,...o}}),"mutationFn")})},"useUpdateEmployment"),ce=n(t=>{let{client:r}=a();return c({mutationFn:n(({employmentId:e,...o})=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{};return S({client:r,body:o,path:{employment_id:e},query:{...s}})},"mutationFn")})},"useUpdateBenefitsOffers"),me=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>j({client:t,headers:{Authorization:""},body:r}),"mutationFn")})},"useMagicLink"),B=n(t=>{let{client:r}=a();return f({...t,queryKey:["countries"],retry:!1,queryFn:n(async()=>{let e=await V({client:r,headers:{Authorization:""}});if(e.error||!e.data)throw new Error("Failed to fetch supported countries");return e},"queryFn"),select:n(({data:e})=>e?.data?.filter(o=>o.eor_onboarding).map(o=>({label:o.name,value:o.code}))||[],"select")})},"useCountries"),le=n(t=>{let{data:r,isLoading:e}=B(t?.queryOptions),{schema:o}=d(R.data.schema,t?.jsfModify||{}),s=p(o);if(r){let i=s.fields.find(m=>m.name==="country");i&&(i.options=r)}return{isLoading:e,selectCountryForm:s}},"useCountriesSchemaField"),ue=n(({type:t="spread"})=>{let{client:r}=a();return c({mutationFn:n(e=>(t==="no_spread"?F:M)({client:r,body:e}),"mutationFn")})},"useConvertCurrency"),fe=n(()=>{let{client:t}=a();return c({mutationFn:n(({employmentId:r,...e})=>x({client:t,path:{employment_id:r},body:e}),"mutationFn")})},"useUpsertContractEligibility");export{$ as a,ee as b,te as c,ne as d,re as e,oe as f,se as g,ae as h,ie as i,ce as j,me as k,le as l,ue as m,fe as n};
|
|
2
|
+
//# sourceMappingURL=chunk-IOBB4OZJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/Onboarding/api.ts"],"sourcesContent":["import {\n ConvertCurrencyParams,\n CreateContractEligibilityParams,\n EmploymentCreateParams,\n EmploymentFullParams,\n getIndexBenefitOffer,\n getShowCompany,\n getShowEmployment,\n getShowFormCountry,\n getShowSchema,\n getSupportedCountry,\n MagicLinkParams,\n patchUpdateEmployment2,\n postConvertRawCurrencyConverter,\n postConvertWithSpreadCurrencyConverter,\n postCreateContractEligibility,\n postCreateEmployment2,\n postCreateRiskReserve,\n postGenerateMagicLink,\n postInviteEmploymentInvitation,\n PostInviteEmploymentInvitationData,\n putUpdateBenefitOffer,\n UnifiedEmploymentUpsertBenefitOffersRequest,\n} from '@/src/client';\nimport { convertToCents } from '@/src/components/form/utils';\nimport { useClient } from '@/src/context';\nimport { selectCountryStepSchema } from '@/src/flows/Onboarding/json-schemas/selectCountryStep';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { FlowOptions, JSONSchemaFormType } from '@/src/flows/types';\nimport { findFieldsByType } from '@/src/flows/utils';\nimport { JSFFieldset } from '@/src/types/remoteFlows';\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { FieldValues } from 'react-hook-form';\n\nexport const useEmployment = (employmentId: string | undefined) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n enabled: !!employmentId,\n select: ({ data }) => {\n return data?.data.employment;\n },\n queryFn: async () => {\n const response = await getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n employment_id: employmentId as string,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n });\n};\n\nexport const useCompany = (companyId: string) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['company', companyId],\n retry: false,\n enabled: !!companyId,\n queryFn: async () => {\n const response = await getShowCompany({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n select: ({ data }) => {\n return data.data.company;\n },\n });\n};\n\nexport const useBenefitOffers = (employmentId: string | undefined) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n return getIndexBenefitOffer({\n client: client as Client,\n path: {\n employment_id: employmentId as string,\n },\n }).then((response) => {\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers data');\n }\n\n return response;\n });\n },\n select: ({ data }) =>\n data?.data?.reduce(\n (acc, item) => {\n return {\n ...acc,\n [item.benefit_group.slug]: {\n value: item.benefit_tier?.slug ?? 'no',\n ...(item.benefit_group?.filter?.slug\n ? { filter: item.benefit_group?.filter?.slug }\n : {}),\n },\n };\n },\n {} as Record<string, { value: string }>,\n ),\n });\n};\n/**\n * Use this hook to invite an employee to the onboarding flow\n * @returns\n */\nexport const useEmploymentInvite = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: PostInviteEmploymentInvitationData['path']) => {\n return postInviteEmploymentInvitation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: payload,\n });\n },\n });\n};\n\nexport const useCreateReserveInvoice = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: { employment_slug: string }) => {\n return postCreateRiskReserve({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Use this hook to get the JSON schema form for the onboarding flow\n * @param param0\n * @returns\n */\nexport const useJSONSchemaForm = ({\n countryCode,\n form,\n fieldValues,\n options,\n query = {},\n}: {\n countryCode: string;\n form: JSONSchemaFormType;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n}) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema?.[form]\n ? {\n json_schema_version: options.jsonSchemaVersion.form_schema[form],\n }\n : {};\n return useQuery({\n queryKey: ['onboarding-json-schema-form', countryCode, form],\n retry: false,\n queryFn: async () => {\n const response = await getShowFormCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n country_code: countryCode,\n form: form,\n },\n query: {\n skip_benefits: true,\n ...query,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch onboarding schema');\n }\n\n return response;\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n let jsfSchema = data?.data || {};\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n\n // Contract details contains x-jsf-logic that need to be calculated every time a form value changes\n // In particular there are calculations involving the annual_gross_salary field. However this field value doesn't get\n // here in cents. So we need to convert the money fields to cents, so that the calculations are correct.\n const moneyFields = findFieldsByType(jsfSchema.properties || {}, 'money');\n const moneyFieldsData = moneyFields.reduce<Record<string, number | null>>(\n (acc, field) => {\n acc[field] = convertToCents(fieldValues[field]);\n return acc;\n },\n {},\n );\n\n const initialValues = JSON.parse(\n JSON.stringify({\n ...fieldValues,\n ...moneyFieldsData,\n }),\n );\n\n return {\n meta: {\n 'x-jsf-fieldsets': jsfSchema['x-jsf-fieldsets'] as JSFFieldset,\n },\n ...createHeadlessForm(jsfSchema, {\n initialValues,\n }),\n };\n },\n });\n};\n\nexport const useBenefitOffersSchema = (\n employmentId: string,\n fieldValues: FieldValues,\n options: OnboardingFlowProps['options'],\n) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers-schema', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n const response = await getShowSchema({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n query: jsonSchemaQueryParam,\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers schema');\n }\n\n return response;\n },\n select: ({ data }) => {\n let jsfSchema = data?.data?.schema || {};\n\n if (options && options.jsfModify?.benefits) {\n const { schema } = modify(jsfSchema, options.jsfModify.benefits);\n jsfSchema = schema;\n }\n const hasFieldValues = Object.keys(fieldValues).length > 0;\n const result = createHeadlessForm(jsfSchema, {\n // we need to clone the fieldValues to prevent side effects\n // if we don't do this, the benefits get included in the other steps\n initialValues: hasFieldValues ? { ...fieldValues } : {},\n });\n return result;\n },\n });\n};\n\n/**\n * Use this hook to create an employment\n * @returns\n */\nexport const useCreateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema\n ?.employment_basic_information\n ? {\n json_schema_version:\n options.jsonSchemaVersion.form_schema.employment_basic_information,\n }\n : {};\n return useMutation({\n mutationFn: (payload: EmploymentCreateParams) => {\n return postCreateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useUpdateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParams = {\n employment_basic_information_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.employment_basic_information,\n contract_details_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.contract_details,\n };\n\n const filteredQueryParams = Object.fromEntries(\n Object.entries(jsonSchemaQueryParams).filter(\n ([, value]) => value !== undefined,\n ),\n );\n\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: EmploymentFullParams & { employmentId: string }) => {\n return patchUpdateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n skip_benefits: true,\n ...filteredQueryParams,\n },\n });\n },\n });\n};\n\nexport const useUpdateBenefitsOffers = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: UnifiedEmploymentUpsertBenefitOffersRequest & {\n employmentId: string;\n }) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n return putUpdateBenefitOffer({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useMagicLink = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (params: MagicLinkParams) => {\n return postGenerateMagicLink({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: params,\n });\n },\n });\n};\n\nconst useCountries = (queryOptions?: { enabled?: boolean }) => {\n const { client } = useClient();\n return useQuery({\n ...queryOptions,\n queryKey: ['countries'],\n retry: false,\n queryFn: async () => {\n const response = await getSupportedCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch supported countries');\n }\n\n return response;\n },\n select: ({ data }) => {\n return (\n data?.data\n ?.filter((country) => country.eor_onboarding)\n .map((country) => {\n return {\n label: country.name,\n value: country.code,\n };\n }) || []\n );\n },\n });\n};\n\nexport const useCountriesSchemaField = (\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } },\n) => {\n const { data: countries, isLoading } = useCountries(options?.queryOptions);\n\n const { schema: selectCountrySchema } = modify(\n selectCountryStepSchema.data.schema,\n options?.jsfModify || {},\n );\n\n const selectCountryForm = createHeadlessForm(selectCountrySchema);\n\n if (countries) {\n const countryField = selectCountryForm.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n }\n }\n\n return {\n isLoading,\n selectCountryForm,\n };\n};\n\nexport const useConvertCurrency = ({\n type = 'spread',\n}: {\n type?: 'spread' | 'no_spread';\n}) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: ConvertCurrencyParams) => {\n const apiFn =\n type === 'no_spread'\n ? postConvertRawCurrencyConverter\n : postConvertWithSpreadCurrencyConverter;\n return apiFn({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useUpsertContractEligibility = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: { employmentId: string } & CreateContractEligibilityParams) => {\n return postCreateContractEligibility({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n body: payload,\n });\n },\n });\n};\n"],"mappings":"6UAgCA,OAAS,sBAAAA,EAAoB,UAAAC,MAAc,8BAC3C,OAAS,eAAAC,EAAa,YAAAC,MAAgB,wBAG/B,IAAMC,EAAgBC,EAACC,GAAqC,CACjE,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,aAAcH,CAAY,EACrC,MAAO,GACP,QAAS,CAAC,CAACA,EACX,OAAQD,EAAA,CAAC,CAAE,KAAAK,CAAK,IACPA,GAAM,KAAK,WADZ,UAGR,QAASL,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMC,EAAkB,CACvC,OAAQL,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CACJ,cAAeD,CACjB,CACF,CAAC,EAGD,GAAIK,EAAS,OAAS,CAACA,EAAS,KAC9B,MAAM,IAAI,MAAM,iCAAiC,EAGnD,OAAOA,CACT,EAjBS,UAkBX,CAAC,CACH,EA7B6B,iBA+BhBE,GAAaR,EAACS,GAAsB,CAC/C,GAAM,CAAE,OAAAP,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,UAAWK,CAAS,EAC/B,MAAO,GACP,QAAS,CAAC,CAACA,EACX,QAAST,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMI,EAAe,CACpC,OAAQR,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CACJ,WAAYO,CACd,CACF,CAAC,EAED,GAAIH,EAAS,OAAS,CAACA,EAAS,KAC9B,MAAM,IAAI,MAAM,iCAAiC,EAGnD,OAAOA,CACT,EAhBS,WAiBT,OAAQN,EAAA,CAAC,CAAE,KAAAK,CAAK,IACPA,E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AAE,CAAO,EAAIC,EAAU,EAC7B,OAAOa,EAAY,CACjB,WAAYhB,EAAA,CAAC,CACX,aAAAC,EACA,GAAGgB,CACL,IACSoD,EAA8B,CACnC,OAAQnE,EACR,KAAM,CACJ,cAAeD,CACjB,EACA,KAAMgB,CACR,CAAC,EAVS,aAYd,CAAC,CACH,EAhB4C","names":["createHeadlessForm","modify","useMutation","useQuery","useEmployment","__name","employmentId","client","useClient","useQuery","data","response","getShowEmployment","useCompany","companyId","getShowCompany","useBenefitOffers","getIndexBenefitOffer","acc","item","useEmploymentInvite","useMutation","payload","postInviteEmploymentInvitation","useCreateReserveInvoice","postCreateRiskReserve","useJSONSchemaForm","countryCode","form","fieldValues","options","query","jsonSchemaQueryParam","getShowFormCountry","jsfSchema","schema","modify","moneyFieldsData","findFieldsByType","field","convertToCents","initialValues","createHeadlessForm","useBenefitOffersSchema","getShowSchema","hasFieldValues","useCreateEmployment","postCreateEmployment2","useUpdateEmployment","jsonSchemaQueryParams","filteredQueryParams","value","patchUpdateEmployment2","useUpdateBenefitsOffers","putUpdateBenefitOffer","useMagicLink","params","postGenerateMagicLink","useCountries","queryOptions","getSupportedCountry","country","useCountriesSchemaField","countries","isLoading","selectCountrySchema","selectCountryStepSchema","selectCountryForm","countryField","useConvertCurrency","type","postConvertRawCurrencyConverter","postConvertWithSpreadCurrencyConverter","useUpsertContractEligibility","postCreateContractEligibility"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-2H54PI4L.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LWPOUUZF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-7AC3W7WD.js";import{a as e}from"./chunk-53KVZ4BP.js";import{a as p}from"./chunk-2FKEF3OG.js";import{a as n}from"./chunk-6VRUYYUV.js";import{a}from"./chunk-UQOWSJ2B.js";import{a as r}from"./chunk-P5WUODPR.js";import{a as f}from"./chunk-6LJRRFK2.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as F}from"react/jsx-runtime";var k=i(({employmentId:l,render:T,options:d,initialValues:s})=>{let u=c(),o=t({employmentId:l,options:d,initialValues:s});return F(m.Provider,{value:{formId:u,terminationBag:o},children:T({terminationBag:o,components:{SubmitButton:r,Back:n,EmployeeComunicationStep:e,TerminationDetailsStep:a,PaidTimeOffStep:p,AdditionalDetailsStep:f}})})},"TerminationFlow");export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-N3QYXQ3V.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as X,d as Z}from"./chunk-FB2QGVI2.js";import{a as $,f as K,h as Y,l as z}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as X,d as Z}from"./chunk-FB2QGVI2.js";import{a as $,f as K,h as Y,l as z}from"./chunk-IOBB4OZJ.js";import{a as tt,b as et,c as nt,d as ot,e as rt}from"./chunk-BDPCUDJB.js";import{a as at,b as it}from"./chunk-U6RM2N4A.js";import{a as T}from"./chunk-2YTBWEC7.js";import{a as Q}from"./chunk-PJBAQZ6G.js";import{c as f,d as E}from"./chunk-PAQW5BFW.js";import{g as w}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Nt,useMemo as m,useRef as qt,useState as k}from"react";var At={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},xt={employment_basic_information:"basic_information"},te=p(({countryCode:ct,externalId:st,employmentId:y,skipSteps:lt,options:d,initialValues:i})=>{let[r,B]=k(ct||null),[a,mt]=k(y),[M,dt]=k(void 0),v=qt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),ut=lt?.includes("select_country")?it:at,{fieldValues:b,stepState:e,setFieldValues:pt,previousStep:ft,nextStep:yt,goToStep:D,setStepValues:J}=Q(ut),{data:c,isLoading:I,refetch:_t}=$(a),{status:_}=c||{},j=_&&X.includes(_),St=_&&!Z.includes(_),gt=m(()=>_==="invited"?"invited":"not_invited",[_]),N=Y(d),q=ot(),A=et(),{mutateAsync:bt}=T(N),{mutateAsync:Ct}=T(q),{mutateAsync:ht}=T(A);y&&c?.country?.code&&!r&&B(c.country.code);let{selectCountryForm:P,isLoading:Ft}=z({jsfModify:d?.jsfModify?.select_country,jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="select_country"}}),Vt=At[e.currentStep.name]||"contractor_basic_information",Et=xt[Vt],wt=c?.[Et]||{},vt=p(({form:t,options:o={},query:S={}})=>{let g=Object.keys(b).length>0?{...i,...e.values?.[e.currentStep.name],...b}:{...i,...wt};return K({countryCode:r,form:t,fieldValues:g,query:S,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),Pt=!!(r&&(e.currentStep.name==="basic_information"||y)),Ot=!!(r&&(e.currentStep.name==="contract_details"||y)),{data:s,isLoading:Tt}=vt({form:"contractor_basic_information",options:{jsfModify:d?.jsfModify?.basic_information,queryOptions:{enabled:Pt},jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:l,isLoading:Mt}=rt({countryCode:r,fieldValues:b,options:{queryOptions:{enabled:Ot},jsfModify:d?.jsfModify?.contract_details,jsonSchemaVersion:d?.jsonSchemaVersion}}),{data:u}=tt({fieldValues:b,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Dt,isLoading:It}=nt({employmentId:a,contractDocumentId:M,options:{queryOptions:{enabled:!!M}}}),n=m(()=>({select_country:P?.fields||[],basic_information:s?.fields||[],pricing_plan:[],contract_details:l?.fields||[],contract_preview:u?.fields||[],review:[]}),[P?.fields,s?.fields,l?.fields,u?.fields]),jt={select_country:null,basic_information:s?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:l?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Rt,basic_information:x={},contract_details:O={}}=c||{},U=Rt?.code,C=m(()=>E(n.select_country,{country:r||U||""}),[n.select_country,r,U]),h=m(()=>{let t={...i,...x};return E(n.basic_information,t)},[n.basic_information,x,i]),F=m(()=>{let t={...i,...O};return E(n.contract_details,t)},[n.contract_details,O,i]),H=m(()=>{let t={...i,...O};return E(n.contract_preview,t)},[n.contract_preview,O,i]),Lt=m(()=>({select_country:C,basic_information:h,contract_details:F,contract_preview:H,pricing_plan:{}}),[C,h,F,H]),G=m(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Nt(()=>{G&&(v.current={select_country:w(C,n.select_country),basic_information:w(h,n.basic_information),contract_details:w(F,n.contract_details),contract_preview:{},pricing_plan:{}},J({select_country:C,basic_information:h,contract_details:F,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[G,D,C,h,F,J,n.select_country,n.basic_information,n.contract_details]);let kt=p(t=>{D(t)},"goTo"),W=p(t=>P&&e.currentStep.name==="select_country"?t:s&&e.currentStep.name==="basic_information"?f(t,s?.fields,{isPartialValidation:!1}):l&&e.currentStep.name==="contract_details"?f(t,l?.fields,{isPartialValidation:!1}):u&&e.currentStep.name==="contract_preview"?f(t,u?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Bt(t){let o=e.currentStep.name;o in v.current&&(v.current[o]=w(t,n[o]));let S=W(t);switch(e.currentStep.name){case"select_country":return B(S.country),Promise.resolve({data:{countryCode:S.country}});case"basic_information":{let R=!a&&r,g=a&&r&&c?.country&&c?.country.code!==r;if(R||g){let L={basic_information:S,type:"contractor",country_code:r,external_id:st};try{let V=await bt(L),Jt=V.data?.data?.employment?.id;return mt(Jt),V}catch(V){throw console.error("Error creating onboarding:",V),V}}else if(a)return Promise.resolve({data:{employmentId:a}});return}case"contract_details":{let g=await Ct({employmentId:a,payload:{contract_document:S}}),L=g.data?.data?.contract_document?.id;return dt(L),g}case"contract_preview":return ht({employmentId:a,contractDocumentId:M,payload:{signature:t.signature}});case"pricing_plan":return Promise.resolve({data:{pricingPlan:t}});default:throw new Error("Invalid step state")}}return p(Bt,"onSubmit"),{isLoading:Ft||Tt||I||Mt||It,fieldValues:b,stepState:e,checkFieldUpdates:pt,back:ft,next:yt,goTo:kt,onSubmit:Bt,fields:n[e.currentStep.name],meta:{fields:v.current,fieldsets:jt[e.currentStep.name]},parseFormValues:W,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return P.handleValidation(t);if(s&&e.currentStep.name==="basic_information"){let o=f(t,s?.fields,{isPartialValidation:!1});return s?.handleValidation(o)}if(l&&e.currentStep.name==="contract_details"){let o=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(u&&e.currentStep.name==="contract_preview"){let o=f(t,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Lt,employmentId:a,refetchEmployment:_t,isSubmitting:N.isPending||q.isPending||A.isPending,documentPreviewPdf:Dt,canInvite:St,isEmploymentReadOnly:j,invitedStatus:gt,employment:c}},"useContractorOnboarding");export{te as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NWYFBV22.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as p}from"./chunk-TOA3JILU.js";import{d as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as p}from"./chunk-TOA3JILU.js";import{d as u}from"./chunk-IOBB4OZJ.js";import{a as l}from"./chunk-2YTBWEC7.js";import{b as c}from"./chunk-WVDTHFGS.js";import{b as d}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as y}from"react/jsx-runtime";function k({onSubmit:f,onSuccess:E,onError:i,render:s,...o}){let{components:v}=d(),{contractorOnboardingBag:r}=p(),n=u(),{mutateAsync:b}=l(n),m=e(async()=>{try{if(await f?.(),r.employmentId){let t=await b({employment_id:r.employmentId});if(t.data){await E?.({data:t.data,employmentStatus:"invited"}),r.refetchEmployment();return}t.error&&i?.({error:t.error,rawError:t.rawError,fieldErrors:[]})}}catch(t){i?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),a=v?.button;return a?y(a,{...o,disabled:n.isPending||o.disabled,onClick:t=>{m(),o.onClick?.(t)},children:s({employmentStatus:"invited"})}):y(c,{...o,disabled:n.isPending||o.disabled,onClick:()=>{m()},children:s({employmentStatus:"invited"})})}e(k,"OnboardingInvite");export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PTMHPPZ4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as d,d as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as d,d as S}from"./chunk-VU2RMWMI.js";import{a as u}from"./chunk-HN5HLFTB.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-CFIJKJXD.js";import{f as y}from"./chunk-CNDSIADP.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var i=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,s)=>!e&&!r?.management_fee&&n?i(u,n,s):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:s,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(g=>{m(g);let a=i(u,g,n.managementFees);a&&c.setValue("management.management_fee",a)},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:"",hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(l=>l.value===e.currencySlug)?.label;if(a){m(a);let l=i(u,a,n.managementFees);c.setValue("management.management_fee",l)}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:s(t)})},"CostCalculatorFlow");export{W as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PZV24NHM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as X}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as X}from"./chunk-EPFXYDIP.js";import{a as I,b as z,c as Q,f as W}from"./chunk-RC3XP5WU.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as G}from"./chunk-VFRHMNLJ.js";import{a as K}from"./chunk-CFIJKJXD.js";import{c as Y}from"./chunk-DB7ITLRX.js";import{a as Z}from"./chunk-2YTBWEC7.js";import{c as V}from"./chunk-PAQW5BFW.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Te,object as oe}from"yup";import{createHeadlessForm as Ve,modify as je}from"@remoteoss/json-schema-form";import{useCallback as Re,useEffect as ee,useMemo as Pe,useRef as we,useState as j}from"react";import{string as te,ValidationError as ne}from"yup";import{jsx as re}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},xe=o(t=>{let{schema:i}=je(G.data.schema,t?.jsfModify||{});return Ve(i)},"useStaticSchema");function Be(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(Be,"getSalaryTitle");var Qe=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let c=we({fields:{}}),[k,E]=j(t),[R,P]=j(),[m,q]=j(),[H,se]=j(),{data:_,isLoading:le}=I({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=z(),ue=k||R?.value,{data:w,isLoading:me}=W(ue,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=Q(),{mutateAsync:de}=Z(U),b=R?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Re(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,fe=Pe(()=>{let{from:e,to:r,shouldSwapOrder:u}=L(),g=Be(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>re(X,{...y,shouldSwapOrder:u,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>re(Y,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=xe({jsfModify:{fields:{...n?.jsfModify?.fields,...fe?.fields}}});ee(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&P(e)}},[t,_]),ee(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ge(e){return de(ae(e,s,a))}o(ge,"onSubmit");function ye(e){let r=_?.find(({value:u})=>u===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),P(r)}o(ye,"onCountryChange");function pe(e){E(e)}o(pe,"onRegionChange");function Ce(e){se(e.target.value)}o(Ce,"onHiringBudgetChange");function _e(e){let r=d?.find(u=>u.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(_e,"onChangeCurrency");let S=f.fields.find(e=>e.name==="region");if(S){let e=R?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];S.options=e,S.isVisible=e.length>0,S.required=e.length>0,S.onChange=pe,S.schema=e.length>0?te().transform(r=>typeof r=="string"?r:"").required("Region is required"):te()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=_e)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=Ce),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=ye)}let be=o(()=>{P(void 0),E(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...w?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ie(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let u=V(e,D);try{await N.validate(u,{abortEarly:!1}),r={formErrors:{},yupError:new ne([],e)}}catch(h){let B=K(h);r={formErrors:Object.entries(B).reduce((T,[A,M])=>({...T,[A]:M.message}),{}),yupError:h}}let g=w?.handleValidation(u),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new ne(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(e=>{let{country:r,region:u,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:h,management:B,estimation_title:T,...A}=e,M=e.salary;y==="salary_conversion"&&(M=h);let he=V({country:r,region:u,salary:M,salary_converted:y,salary_conversion:h,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Ee=V(A,w?.fields||[]),Fe={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Ee,...Fe}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:le&&ce&&me,onSubmit:ge,resetForm:be,currencies:d,meta:{fields:c.current?.fields}}},"useCostCalculator");function ie(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(c=>c===a.name,"is"),then:o(c=>c.required("Required field"),"then"),otherwise:o(c=>c.optional(),"otherwise")}):a.name==="management"?n[a.name]=oe({management_fee:Te().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return oe(s)}o(ie,"buildValidationSchema");function Ae(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let c={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,c]},[])}o(Ae,"formatBenefits");function Oe(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Ae(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...ke(t,l)}}o(Oe,"mapValueToEmployment");function ke(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(ke,"getSalaryFields");function ae(t,i=O,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(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Oe(n,i,l))}}o(ae,"buildPayload");export{ie as a,ae as b,O as c,Qe as d};
|
|
2
|
+
//# sourceMappingURL=chunk-VU2RMWMI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-IOBB4OZJ.js";import{a as m}from"./chunk-2YTBWEC7.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YSH6TRSA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-EJGOCUZS.js";import"../../chunk-QTYDDIVO.js";import"../../chunk-OU4Y73FX.js";import"../../chunk-AUZWLETL.js";import"../../chunk-IQKZWU7I.js";import"../../chunk-AWDGLK2T.js";import"../../chunk-TM7Q7RHH.js";import"../../chunk-5ZR7EFPY.js";import"../../chunk-PTMHPPZ4.js";import"../../chunk-DPY77ASH.js";import"../../chunk-TOA3JILU.js";import"../../chunk-NWYFBV22.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=ContractorOnboarding.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-PTMHPPZ4.js";import"../../../chunk-TOA3JILU.js";import"../../../chunk-IOBB4OZJ.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-Z5WMKCRJ.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as OnboardingInvite};
|
|
2
2
|
//# sourceMappingURL=OnboardingInvite.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-NWYFBV22.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as useContractorOnboarding};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-DKFUZO5P.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-DKFUZO5P.js";import{a}from"../../chunk-EJGOCUZS.js";import"../../chunk-QTYDDIVO.js";import"../../chunk-OU4Y73FX.js";import"../../chunk-AUZWLETL.js";import"../../chunk-IQKZWU7I.js";import"../../chunk-AWDGLK2T.js";import"../../chunk-TM7Q7RHH.js";import"../../chunk-5ZR7EFPY.js";import"../../chunk-PTMHPPZ4.js";import"../../chunk-DPY77ASH.js";import"../../chunk-TOA3JILU.js";import"../../chunk-NWYFBV22.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BDPCUDJB.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-U6RM2N4A.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-PZV24NHM.js";import"../../chunk-VU2RMWMI.js";import"../../chunk-EPFXYDIP.js";import"../../chunk-2H54PI4L.js";import"../../chunk-RC3XP5WU.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-VFRHMNLJ.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as CostCalculatorFlow};
|
|
2
2
|
//# sourceMappingURL=CostCalculatorFlow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-EPFXYDIP.js";import"../../../chunk-2H54PI4L.js";import"../../../chunk-IOBB4OZJ.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-ANQ4HVVK.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-TWIUL2P3.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-Z5WMKCRJ.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as SalaryField};
|
|
2
2
|
//# sourceMappingURL=SalaryField.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a,d as b}from"../../chunk-
|
|
1
|
+
import{c as a,d as b}from"../../chunk-VU2RMWMI.js";import"../../chunk-EPFXYDIP.js";import"../../chunk-2H54PI4L.js";import"../../chunk-RC3XP5WU.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-VFRHMNLJ.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as defaultEstimationOptions,b as useCostCalculator};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-Z3BMF4BO.js";import{a as m}from"../../chunk-RAHCZTQ3.js";import"../../chunk-BCXRPHWY.js";import"../../chunk-MQWVZSGH.js";import{a as
|
|
1
|
+
import"../../chunk-Z3BMF4BO.js";import{a as m}from"../../chunk-RAHCZTQ3.js";import"../../chunk-BCXRPHWY.js";import"../../chunk-MQWVZSGH.js";import{a as k}from"../../chunk-W55MUSAS.js";import{a as l}from"../../chunk-H425RKFI.js";import"../../chunk-DTHBG6BD.js";import"../../chunk-CVIWZYO3.js";import"../../chunk-E6OBNWMU.js";import"../../chunk-5NPET4ZO.js";import"../../chunk-R645TMO5.js";import"../../chunk-ZSCKSEAA.js";import"../../chunk-ZE3YT3Q6.js";import{a as g}from"../../chunk-UPXJJBXZ.js";import{a as j}from"../../chunk-Q4BKFSTW.js";import{a as i}from"../../chunk-DYB3RWP7.js";import{a as e}from"../../chunk-PZV24NHM.js";import{b as a,d}from"../../chunk-VU2RMWMI.js";import"../../chunk-EPFXYDIP.js";import"../../chunk-2H54PI4L.js";import{d as b,e as c}from"../../chunk-RC3XP5WU.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-VFRHMNLJ.js";import{a as f}from"../../chunk-PYKEYPGA.js";import{a as h}from"../../chunk-ANGJCT4I.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-7R347KBY.js";import"../../chunk-AFRA4BIW.js";import"../../chunk-3A47R5RQ.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{j as CostCalculatorDisclaimer,e as CostCalculatorFlow,f as CostCalculatorForm,h as CostCalculatorResetButton,m as CostCalculatorResults,g as CostCalculatorSubmitButton,k as EstimationResults,l as SummaryResults,a as buildCostCalculatorEstimationPayload,i as disclaimerData,d as useCostCalculator,c as useCostCalculatorEstimationCsv,b as useCostCalculatorEstimationPdf};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-VU2RMWMI.js";import"../../chunk-EPFXYDIP.js";import"../../chunk-2H54PI4L.js";import"../../chunk-RC3XP5WU.js";import"../../chunk-HN5HLFTB.js";import"../../chunk-VFRHMNLJ.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{b as buildPayload,a as buildValidationSchema};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-BPTG5PRM.js";import"../../chunk-QDYWPG2R.js";import"../../chunk-WCIJHQMP.js";import"../../chunk-ZQ6MG635.js";import"../../chunk-YSH6TRSA.js";import"../../chunk-OIN3HGOQ.js";import"../../chunk-Z7WBY27D.js";import"../../chunk-5KHLOGTR.js";import"../../chunk-AODV6HT2.js";import"../../chunk-GWLOE7WJ.js";import"../../chunk-5MYWJJBQ.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-CNID6L26.js";import"../../chunk-VAIBLWOY.js";import"../../chunk-LWPOUUZF.js";import"../../chunk-2H54PI4L.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=OnboardingFlow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{c as useBenefitOffers,g as useBenefitOffersSchema,b as useCompany,m as useConvertCurrency,l as useCountriesSchemaField,h as useCreateEmployment,e as useCreateReserveInvoice,a as useEmployment,d as useEmploymentInvite,f as useJSONSchemaForm,k as useMagicLink,j as useUpdateBenefitsOffers,i as useUpdateEmployment,n as useUpsertContractEligibility};
|
|
2
2
|
//# sourceMappingURL=api.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-LWPOUUZF.js";import"../../../chunk-2H54PI4L.js";import"../../../chunk-IOBB4OZJ.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-BV3PGYSH.js";import"../../../chunk-PD24XKD6.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-Z5WMKCRJ.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-CNDSIADP.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-MQ6F5LE4.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as AnnualGrossSalary};
|
|
2
2
|
//# sourceMappingURL=AnnualGrossSalary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-YSH6TRSA.js";import"../../../chunk-PGWKJ6FK.js";import"../../../chunk-IOBB4OZJ.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-2YTBWEC7.js";import"../../../chunk-ZX5OIIJX.js";import"../../../chunk-3O3Q24JL.js";import"../../../chunk-Z5WMKCRJ.js";import"../../../chunk-WVDTHFGS.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-PAQW5BFW.js";import"../../../chunk-43WMZDDH.js";import"../../../chunk-P37U34EQ.js";export{a as OnboardingInvite};
|
|
2
2
|
//# sourceMappingURL=OnboardingInvite.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-CNID6L26.js";import"../../chunk-VAIBLWOY.js";import"../../chunk-LWPOUUZF.js";import"../../chunk-2H54PI4L.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-PD24XKD6.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as useOnboarding};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-BPTG5PRM.js";import"../../chunk-QDYWPG2R.js";import"../../chunk-WCIJHQMP.js";import"../../chunk-ZQ6MG635.js";import"../../chunk-YSH6TRSA.js";import"../../chunk-OIN3HGOQ.js";import"../../chunk-Z7WBY27D.js";import"../../chunk-5KHLOGTR.js";import"../../chunk-AODV6HT2.js";import"../../chunk-GWLOE7WJ.js";import"../../chunk-5MYWJJBQ.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-CNID6L26.js";import"../../chunk-VAIBLWOY.js";import"../../chunk-LWPOUUZF.js";import"../../chunk-2H54PI4L.js";import"../../chunk-FB2QGVI2.js";import"../../chunk-IOBB4OZJ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-N3QYXQ3V.js";import"../../chunk-7AC3W7WD.js";import"../../chunk-6IL4TB7S.js";import"../../chunk-IWA5B4U6.js";import"../../chunk-7VOQAVM4.js";import"../../chunk-VM2DQCZO.js";import"../../chunk-EHAZWZ3O.js";import"../../chunk-SLMJEZJ7.js";import"../../chunk-BOTWQMOJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-53KVZ4BP.js";import"../../chunk-2FKEF3OG.js";import"../../chunk-6VRUYYUV.js";import"../../chunk-UQOWSJ2B.js";import"../../chunk-P5WUODPR.js";import"../../chunk-6LJRRFK2.js";import"../../chunk-MRPXDND2.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JBUNDNKJ.js";import"../../chunk-7R347KBY.js";import"../../chunk-AFRA4BIW.js";import"../../chunk-3A47R5RQ.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-DZ7FZ4L2.js";import"../../chunk-NP4G3N5P.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-R3DJNVHR.js";import"../../chunk-LMYJ6V44.js";import"../../chunk-N6G4VZXF.js";import"../../chunk-XPKVRYIU.js";import"../../chunk-VDRNNOVA.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
|
|
2
2
|
//# sourceMappingURL=TerminationFlow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-FZ7FWFJX.js";import{a as c}from"../../chunk-WLBRCGTG.js";import{a as b}from"../../chunk-QIQTM4HB.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-FZ7FWFJX.js";import{a as c}from"../../chunk-WLBRCGTG.js";import{a as b}from"../../chunk-QIQTM4HB.js";import{a}from"../../chunk-N3QYXQ3V.js";import"../../chunk-7AC3W7WD.js";import"../../chunk-6IL4TB7S.js";import"../../chunk-IWA5B4U6.js";import"../../chunk-7VOQAVM4.js";import"../../chunk-VM2DQCZO.js";import"../../chunk-EHAZWZ3O.js";import"../../chunk-SLMJEZJ7.js";import"../../chunk-BOTWQMOJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-53KVZ4BP.js";import"../../chunk-2FKEF3OG.js";import"../../chunk-6VRUYYUV.js";import"../../chunk-UQOWSJ2B.js";import"../../chunk-P5WUODPR.js";import"../../chunk-6LJRRFK2.js";import"../../chunk-MRPXDND2.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JBUNDNKJ.js";import"../../chunk-7R347KBY.js";import"../../chunk-AFRA4BIW.js";import"../../chunk-3A47R5RQ.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-DZ7FZ4L2.js";import"../../chunk-NP4G3N5P.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-R3DJNVHR.js";import"../../chunk-LMYJ6V44.js";import"../../chunk-N6G4VZXF.js";import"../../chunk-XPKVRYIU.js";import"../../chunk-VDRNNOVA.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{c as TerminationDialogInfoContent,a as TerminationFlow,b as TerminationReasonsDetailContent};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-GULCZWSK.js";import{a as wt}from"./chunk-BPTG5PRM.js";import"./chunk-QDYWPG2R.js";import"./chunk-WCIJHQMP.js";import"./chunk-ZQ6MG635.js";import"./chunk-YSH6TRSA.js";import"./chunk-OIN3HGOQ.js";import"./chunk-Z7WBY27D.js";import"./chunk-5KHLOGTR.js";import"./chunk-AODV6HT2.js";import"./chunk-GWLOE7WJ.js";import"./chunk-5MYWJJBQ.js";import"./chunk-PGWKJ6FK.js";import"./chunk-CNID6L26.js";import"./chunk-VAIBLWOY.js";import"./chunk-LWPOUUZF.js";import"./chunk-Z3BMF4BO.js";import{a as O}from"./chunk-RAHCZTQ3.js";import"./chunk-BCXRPHWY.js";import"./chunk-MQWVZSGH.js";import{a as D}from"./chunk-W55MUSAS.js";import{a as I}from"./chunk-H425RKFI.js";import"./chunk-DTHBG6BD.js";import"./chunk-CVIWZYO3.js";import"./chunk-E6OBNWMU.js";import"./chunk-5NPET4ZO.js";import"./chunk-R645TMO5.js";import"./chunk-ZSCKSEAA.js";import"./chunk-ZE3YT3Q6.js";import{a as _}from"./chunk-UPXJJBXZ.js";import"./chunk-FZ7FWFJX.js";import{a as ft}from"./chunk-WLBRCGTG.js";import{a as mt}from"./chunk-QIQTM4HB.js";import{a as j}from"./chunk-Q4BKFSTW.js";import{a as S}from"./chunk-DYB3RWP7.js";import{a as R}from"./chunk-PZV24NHM.js";import{b as L,d as P}from"./chunk-VU2RMWMI.js";import"./chunk-EPFXYDIP.js";import"./chunk-2H54PI4L.js";import{d as A,e as z}from"./chunk-RC3XP5WU.js";import"./chunk-HN5HLFTB.js";import"./chunk-VFRHMNLJ.js";import{a as W}from"./chunk-PYKEYPGA.js";import{a as E}from"./chunk-ANGJCT4I.js";import"./chunk-KSHK3ZPX.js";import{a as ht}from"./chunk-N3QYXQ3V.js";import"./chunk-7AC3W7WD.js";import"./chunk-6IL4TB7S.js";import"./chunk-IWA5B4U6.js";import"./chunk-7VOQAVM4.js";import"./chunk-VM2DQCZO.js";import"./chunk-EHAZWZ3O.js";import"./chunk-SLMJEZJ7.js";import"./chunk-BOTWQMOJ.js";import"./chunk-S4XU4SE7.js";import"./chunk-53KVZ4BP.js";import"./chunk-2FKEF3OG.js";import"./chunk-6VRUYYUV.js";import"./chunk-UQOWSJ2B.js";import"./chunk-P5WUODPR.js";import"./chunk-DKFUZO5P.js";import{a as bt}from"./chunk-EJGOCUZS.js";import"./chunk-QTYDDIVO.js";import"./chunk-OU4Y73FX.js";import"./chunk-AUZWLETL.js";import"./chunk-IQKZWU7I.js";import"./chunk-AWDGLK2T.js";import"./chunk-TM7Q7RHH.js";import"./chunk-5ZR7EFPY.js";import"./chunk-PTMHPPZ4.js";import"./chunk-DPY77ASH.js";import"./chunk-TOA3JILU.js";import"./chunk-NWYFBV22.js";import"./chunk-FB2QGVI2.js";import"./chunk-IOBB4OZJ.js";import"./chunk-WVJDCDGZ.js";import"./chunk-BDPCUDJB.js";import"./chunk-R2MHAPWD.js";import"./chunk-U6RM2N4A.js";import"./chunk-6LJRRFK2.js";import"./chunk-MRPXDND2.js";import"./chunk-MRYRNB7Y.js";import"./chunk-A7ZJQCNU.js";import{a as ut}from"./chunk-MGVP76ZI.js";import{a as nt}from"./chunk-6KIQIVKA.js";import"./chunk-CFIJKJXD.js";import"./chunk-JO4722R7.js";import"./chunk-DB7ITLRX.js";import"./chunk-BV3PGYSH.js";import{a as it}from"./chunk-OW5QGJD4.js";import{a as vt}from"./chunk-CYPGWEOO.js";import{a as ct,b as st,c as lt,d as dt,e as pt,f as gt}from"./chunk-KDUM4EZJ.js";import"./chunk-SGE4DLC3.js";import"./chunk-2YTBWEC7.js";import"./chunk-JTOLQCOG.js";import"./chunk-JBUNDNKJ.js";import"./chunk-7R347KBY.js";import"./chunk-AFRA4BIW.js";import"./chunk-3A47R5RQ.js";import"./chunk-D6X2WCEG.js";import"./chunk-HPHWQU34.js";import{a as F,b as T}from"./chunk-ANQ4HVVK.js";import"./chunk-PD24XKD6.js";import"./chunk-TWIUL2P3.js";import"./chunk-ZX5OIIJX.js";import"./chunk-DZ7FZ4L2.js";import"./chunk-NP4G3N5P.js";import"./chunk-XFD3ULUF.js";import"./chunk-R3DJNVHR.js";import"./chunk-LMYJ6V44.js";import"./chunk-N6G4VZXF.js";import"./chunk-XPKVRYIU.js";import"./chunk-VDRNNOVA.js";import{a as v}from"./chunk-3O3Q24JL.js";import"./chunk-PJBAQZ6G.js";import"./chunk-Z5WMKCRJ.js";import"./chunk-EKKRQI6B.js";import"./chunk-WVDTHFGS.js";import{a as u,c as h}from"./chunk-3ZWDIEEM.js";import{a as ot}from"./chunk-LWGVLLBH.js";import"./chunk-CNDSIADP.js";import{b as C}from"./chunk-PAQW5BFW.js";import"./chunk-MQ6F5LE4.js";import"./chunk-TVZAFTPT.js";import{c as B,d as m}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{QueryClient as $,QueryClientProvider as J}from"@tanstack/react-query";function d(t){let a=document.documentElement;Object.keys(t).forEach(e=>{let o=t[e];o&&a.style.setProperty(e,o)})}r(d,"setCssProperties");function N(t){let a={};return Object.keys(t).forEach(e=>{a[`--${e}`]=t[e]}),a}r(N,"mapThemeColors");function q(t){return{"--spacing":t}}r(q,"mapThemeSpacing");function K(t){return{"--radius":t}}r(K,"mapThemeBorderRadius");function U(t){return{"--fontSizeBase":t.fontSizeBase}}r(U,"mapThemeFont");function f(t){t?.colors&&d(N(t.colors)),t?.spacing&&d(q(t.spacing)),t?.borderRadius&&d(K(t.borderRadius)),t?.font&&d(U(t.font))}r(f,"applyTheme");import{createContext as V,useEffect as M,useMemo as Y}from"react";import{jsx as Q}from"react/jsx-runtime";var H=V({theme:{}});function w(t){M(()=>{t.theme&&Object.keys(t.theme).length>0&&f(t.theme)},[t.theme]);let a=Y(()=>({theme:t.theme}),[t.theme]);return Q(H.Provider,{value:a,children:t.children})}r(w,"ThemeProvider");var b={local:"http://localhost:4000/api/eor",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as X}from"@hey-api/client-fetch";import{useQuery as Z}from"@tanstack/react-query";import{useRef as x}from"react";function G(t){try{return new URL(t),!0}catch{return!1}}r(G,"isValidUrl");var y=r(({auth:t,options:a,authId:e="default"})=>{let o=x(null),{refetch:c}=Z({queryKey:["auth",e],queryFn:t,enabled:!1}),s=a?.environment?b[a?.environment]:"https://gateway.remote.com",l=v.getConfig(),g="0.28.2";a?.environment&&a?.environment!=="production"&&m(g);let p=!!a?.proxy&&G(a.proxy.url);return a?.proxy&&!p&&console.error("Invalid proxy URL provided. Using default base URL."),x(X({...l,headers:{...l.headers,...p?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":g},baseUrl:p?a.proxy?.url:s,auth:r(async()=>{function k(n){return!n||Date.now()+6e4>n}if(r(k,"hasTokenExpired"),!o.current||k(o.current.expiresAt)){let{data:n}=await c();n&&(o.current={accessToken:n.accessToken,expiresAt:Date.now()+n.expiresIn*1e3})}return o.current?.accessToken},"auth")}))},"useAuth");import{jsx as i}from"react/jsx-runtime";var tt=new $;function at({children:t,auth:a,authId:e,proxy:o,environment:c}){let s=y({auth:a,authId:e,options:{proxy:o,environment:c}});return i(h.Provider,{value:{client:s.current},children:t})}r(at,"RemoteFlowContextWrapper");function rt({children:t,components:a}){return i(u.Provider,{value:a?{components:a}:{components:{}},children:t})}r(rt,"FormFieldsProvider");function et({auth:t,authId:a,children:e,components:o,theme:c,proxy:s,environment:l}){return i(J,{client:tt,children:i(rt,{components:o,children:i(at,{auth:t,authId:a,proxy:s,environment:l,children:i(w,{theme:c,children:e})})})})}r(et,"RemoteFlows");export{ot as ContractAmendmentConfirmationForm,ut as ContractAmendmentFlow,nt as ContractAmendmentForm,it as ContractAmendmentSubmit,bt as ContractorOnboardingFlow,j as CostCalculatorDisclaimer,R as CostCalculatorFlow,W as CostCalculatorForm,E as CostCalculatorResetButton,O as CostCalculatorResults,_ as CostCalculatorSubmitButton,D as EstimationResults,wt as OnboardingFlow,et as RemoteFlows,I as SummaryResults,ft as TerminationDialogInfoContent,ht as TerminationFlow,mt as TerminationReasonsDetailContent,T as ZendeskTriggerButton,L as buildCostCalculatorEstimationPayload,C as convertFromCents,S as disclaimerData,B as transformYupErrorsIntoObject,dt as useBookedTimeoffBeforeAndAfterTerminationQuery,vt as useContractAmendment,P as useCostCalculator,z as useCostCalculatorEstimationCsv,A as useCostCalculatorEstimationPdf,ct as useEmploymentQuery,lt as usePaidTimeoffBreakdownQuery,pt as useSummaryTimeOffDataQuery,gt as useTimeOffLeavePoliciesSummaryQuery,st as useTimeOffQuery,F as zendeskArticles};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
package/dist/chunk-LRGEEPGK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-WVJDCDGZ.js";import{B as M,E as k,d as F,f as C,i as g,j as S,l as j,n as w,o as v,q as E,t as O,u as q,v as P,x,y as V}from"./chunk-3O3Q24JL.js";import{b as U}from"./chunk-Z5WMKCRJ.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-PAQW5BFW.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as p,modify as d}from"@remoteoss/json-schema-form";import{useMutation as c,useQuery as f}from"@tanstack/react-query";var $=n(t=>{let{client:r}=a();return f({queryKey:["employment",t],retry:!1,enabled:!!t,select:n(({data:e})=>e?.data.employment,"select"),queryFn:n(async()=>{let e=await q({client:r,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn")})},"useEmployment"),ee=n(t=>{let{client:r}=a();return f({queryKey:["company",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let e=await v({client:r,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn"),select:n(({data:e})=>e.data.company,"select")})},"useCompany"),te=n(t=>{let{client:r}=a();return f({queryKey:["benefit-offers",t],retry:!1,enabled:!!t,queryFn:n(async()=>g({client:r,path:{employment_id:t}}).then(e=>{if(e.error||!e.data)throw new Error("Failed to fetch benefit offers data");return e}),"queryFn"),select:n(({data:e})=>e?.data?.reduce((o,s)=>({...o,[s.benefit_group.slug]:{value:s.benefit_tier?.slug??"no",...s.benefit_group?.filter?.slug?{filter:s.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),ne=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>k({client:t,headers:{Authorization:""},path:r}),"mutationFn")})},"useEmploymentInvite"),re=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>w({client:t,body:r}),"mutationFn")})},"useCreateReserveInvoice"),oe=n(({countryCode:t,form:r,fieldValues:e,options:o,query:s={}})=>{let{client:i}=a(),m=o?.jsonSchemaVersion?.form_schema?.[r]?{json_schema_version:o.jsonSchemaVersion.form_schema[r]}:{};return f({queryKey:["onboarding-json-schema-form",t,r],retry:!1,queryFn:n(async()=>{let l=await E({client:i,headers:{Authorization:""},path:{country_code:t,form:r},query:{skip_benefits:!0,...s,...m}});if(l.error||!l.data)throw new Error("Failed to fetch onboarding schema");return l},"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:l})=>{let u=l?.data||{};if(o&&o.jsfModify){let{schema:y}=d(u,o.jsfModify);u=y}let z=U(u.properties||{},"money").reduce((y,_)=>(y[_]=b(e[_]),y),{}),A={...e,...z};return{meta:{"x-jsf-fieldsets":u["x-jsf-fieldsets"]},...p(u,{initialValues:A})}},"select")})},"useJSONSchemaForm"),se=n((t,r,e)=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:s}=a();return f({queryKey:["benefit-offers-schema",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let i=await O({client:s,path:{employment_id:t},query:o});if(i.error||!i.data)throw new Error("Failed to fetch benefit offers schema");return i},"queryFn"),select:n(({data:i})=>{let m=i?.data?.schema||{};if(e&&e.jsfModify?.benefits){let{schema:h}=d(m,e.jsfModify.benefits);m=h}let l=Object.keys(r).length>0;return p(m,{initialValues:l?{...r}:{}})},"select")})},"useBenefitOffersSchema"),ae=n(t=>{let{client:r}=a(),e=t?.jsonSchemaVersion?.form_schema?.employment_basic_information?{json_schema_version:t.jsonSchemaVersion.form_schema.employment_basic_information}:{};return c({mutationFn:n(o=>C({client:r,headers:{Authorization:""},body:o,query:{...e}}),"mutationFn")})},"useCreateEmployment"),ie=n(t=>{let{client:r}=a(),e={employment_basic_information_json_schema_version:t?.jsonSchemaVersion?.form_schema?.employment_basic_information,employment_contract_details_json_schema_version:t?.jsonSchemaVersion?.form_schema?.contract_details},o=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));return c({mutationFn:n(({employmentId:s,...i})=>P({client:r,headers:{Authorization:""},body:i,path:{employment_id:s},query:{skip_benefits:!0,...o}}),"mutationFn")})},"useUpdateEmployment"),ce=n(t=>{let{client:r}=a();return c({mutationFn:n(({employmentId:e,...o})=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{};return S({client:r,body:o,path:{employment_id:e},query:{...s}})},"mutationFn")})},"useUpdateBenefitsOffers"),me=n(()=>{let{client:t}=a();return c({mutationFn:n(r=>j({client:t,headers:{Authorization:""},body:r}),"mutationFn")})},"useMagicLink"),B=n(t=>{let{client:r}=a();return f({...t,queryKey:["countries"],retry:!1,queryFn:n(async()=>{let e=await V({client:r,headers:{Authorization:""}});if(e.error||!e.data)throw new Error("Failed to fetch supported countries");return e},"queryFn"),select:n(({data:e})=>e?.data?.filter(o=>o.eor_onboarding).map(o=>({label:o.name,value:o.code}))||[],"select")})},"useCountries"),le=n(t=>{let{data:r,isLoading:e}=B(t?.queryOptions),{schema:o}=d(R.data.schema,t?.jsfModify||{}),s=p(o);if(r){let i=s.fields.find(m=>m.name==="country");i&&(i.options=r)}return{isLoading:e,selectCountryForm:s}},"useCountriesSchemaField"),ue=n(({type:t="spread"})=>{let{client:r}=a();return c({mutationFn:n(e=>(t==="no_spread"?F:M)({client:r,body:e}),"mutationFn")})},"useConvertCurrency"),fe=n(()=>{let{client:t}=a();return c({mutationFn:n(({employmentId:r,...e})=>x({client:t,path:{employment_id:r},body:e}),"mutationFn")})},"useUpsertContractEligibility");export{$ as a,ee as b,te as c,ne as d,re as e,oe as f,se as g,ae as h,ie as i,ce as j,me as k,le as l,ue as m,fe as n};
|
|
2
|
-
//# sourceMappingURL=chunk-LRGEEPGK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/api.ts"],"sourcesContent":["import {\n ConvertCurrencyParams,\n CreateContractEligibilityParams,\n EmploymentCreateParams,\n EmploymentFullParams,\n getIndexBenefitOffer,\n getShowCompany,\n getShowEmployment,\n getShowFormCountry,\n getShowSchema,\n getSupportedCountry,\n MagicLinkParams,\n patchUpdateEmployment2,\n postConvertRawCurrencyConverter,\n postConvertWithSpreadCurrencyConverter,\n postCreateContractEligibility,\n postCreateEmployment2,\n postCreateRiskReserve,\n postGenerateMagicLink,\n postInviteEmploymentInvitation,\n PostInviteEmploymentInvitationData,\n putUpdateBenefitOffer,\n UnifiedEmploymentUpsertBenefitOffersRequest,\n} from '@/src/client';\nimport { convertToCents } from '@/src/components/form/utils';\nimport { useClient } from '@/src/context';\nimport { selectCountryStepSchema } from '@/src/flows/Onboarding/json-schemas/selectCountryStep';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { FlowOptions, JSONSchemaFormType } from '@/src/flows/types';\nimport { findFieldsByType } from '@/src/flows/utils';\nimport { JSFFieldset } from '@/src/types/remoteFlows';\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { FieldValues } from 'react-hook-form';\n\nexport const useEmployment = (employmentId: string | undefined) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n enabled: !!employmentId,\n select: ({ data }) => {\n return data?.data.employment;\n },\n queryFn: async () => {\n const response = await getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n employment_id: employmentId as string,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n });\n};\n\nexport const useCompany = (companyId: string) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['company', companyId],\n retry: false,\n enabled: !!companyId,\n queryFn: async () => {\n const response = await getShowCompany({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n select: ({ data }) => {\n return data.data.company;\n },\n });\n};\n\nexport const useBenefitOffers = (employmentId: string | undefined) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n return getIndexBenefitOffer({\n client: client as Client,\n path: {\n employment_id: employmentId as string,\n },\n }).then((response) => {\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers data');\n }\n\n return response;\n });\n },\n select: ({ data }) =>\n data?.data?.reduce(\n (acc, item) => {\n return {\n ...acc,\n [item.benefit_group.slug]: {\n value: item.benefit_tier?.slug ?? 'no',\n ...(item.benefit_group?.filter?.slug\n ? { filter: item.benefit_group?.filter?.slug }\n : {}),\n },\n };\n },\n {} as Record<string, { value: string }>,\n ),\n });\n};\n/**\n * Use this hook to invite an employee to the onboarding flow\n * @returns\n */\nexport const useEmploymentInvite = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: PostInviteEmploymentInvitationData['path']) => {\n return postInviteEmploymentInvitation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: payload,\n });\n },\n });\n};\n\nexport const useCreateReserveInvoice = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: { employment_slug: string }) => {\n return postCreateRiskReserve({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Use this hook to get the JSON schema form for the onboarding flow\n * @param param0\n * @returns\n */\nexport const useJSONSchemaForm = ({\n countryCode,\n form,\n fieldValues,\n options,\n query = {},\n}: {\n countryCode: string;\n form: JSONSchemaFormType;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n}) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema?.[form]\n ? {\n json_schema_version: options.jsonSchemaVersion.form_schema[form],\n }\n : {};\n return useQuery({\n queryKey: ['onboarding-json-schema-form', countryCode, form],\n retry: false,\n queryFn: async () => {\n const response = await getShowFormCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n country_code: countryCode,\n form: form,\n },\n query: {\n skip_benefits: true,\n ...query,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch onboarding schema');\n }\n\n return response;\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n let jsfSchema = data?.data || {};\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n\n // Contract details contains x-jsf-logic that need to be calculated every time a form value changes\n // In particular there are calculations involving the annual_gross_salary field. However this field value doesn't get\n // here in cents. So we need to convert the money fields to cents, so that the calculations are correct.\n const moneyFields = findFieldsByType(jsfSchema.properties || {}, 'money');\n const moneyFieldsData = moneyFields.reduce<Record<string, number | null>>(\n (acc, field) => {\n acc[field] = convertToCents(fieldValues[field]);\n return acc;\n },\n {},\n );\n\n const initialValues = {\n ...fieldValues,\n ...moneyFieldsData,\n };\n\n return {\n meta: {\n 'x-jsf-fieldsets': jsfSchema['x-jsf-fieldsets'] as JSFFieldset,\n },\n ...createHeadlessForm(jsfSchema, {\n initialValues,\n }),\n };\n },\n });\n};\n\nexport const useBenefitOffersSchema = (\n employmentId: string,\n fieldValues: FieldValues,\n options: OnboardingFlowProps['options'],\n) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers-schema', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n const response = await getShowSchema({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n query: jsonSchemaQueryParam,\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers schema');\n }\n\n return response;\n },\n select: ({ data }) => {\n let jsfSchema = data?.data?.schema || {};\n\n if (options && options.jsfModify?.benefits) {\n const { schema } = modify(jsfSchema, options.jsfModify.benefits);\n jsfSchema = schema;\n }\n const hasFieldValues = Object.keys(fieldValues).length > 0;\n const result = createHeadlessForm(jsfSchema, {\n // we need to clone the fieldValues to prevent side effects\n // if we don't do this, the benefits get included in the other steps\n initialValues: hasFieldValues ? { ...fieldValues } : {},\n });\n return result;\n },\n });\n};\n\n/**\n * Use this hook to create an employment\n * @returns\n */\nexport const useCreateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.form_schema\n ?.employment_basic_information\n ? {\n json_schema_version:\n options.jsonSchemaVersion.form_schema.employment_basic_information,\n }\n : {};\n return useMutation({\n mutationFn: (payload: EmploymentCreateParams) => {\n return postCreateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useUpdateEmployment = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParams = {\n employment_basic_information_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.employment_basic_information,\n employment_contract_details_json_schema_version:\n options?.jsonSchemaVersion?.form_schema?.contract_details,\n };\n\n const filteredQueryParams = Object.fromEntries(\n Object.entries(jsonSchemaQueryParams).filter(\n ([, value]) => value !== undefined,\n ),\n );\n\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: EmploymentFullParams & { employmentId: string }) => {\n return patchUpdateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n skip_benefits: true,\n ...filteredQueryParams,\n },\n });\n },\n });\n};\n\nexport const useUpdateBenefitsOffers = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: UnifiedEmploymentUpsertBenefitOffersRequest & {\n employmentId: string;\n }) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n return putUpdateBenefitOffer({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useMagicLink = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (params: MagicLinkParams) => {\n return postGenerateMagicLink({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: params,\n });\n },\n });\n};\n\nconst useCountries = (queryOptions?: { enabled?: boolean }) => {\n const { client } = useClient();\n return useQuery({\n ...queryOptions,\n queryKey: ['countries'],\n retry: false,\n queryFn: async () => {\n const response = await getSupportedCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch supported countries');\n }\n\n return response;\n },\n select: ({ data }) => {\n return (\n data?.data\n ?.filter((country) => country.eor_onboarding)\n .map((country) => {\n return {\n label: country.name,\n value: country.code,\n };\n }) || []\n );\n },\n });\n};\n\nexport const useCountriesSchemaField = (\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } },\n) => {\n const { data: countries, isLoading } = useCountries(options?.queryOptions);\n\n const { schema: selectCountrySchema } = modify(\n selectCountryStepSchema.data.schema,\n options?.jsfModify || {},\n );\n\n const selectCountryForm = createHeadlessForm(selectCountrySchema);\n\n if (countries) {\n const countryField = selectCountryForm.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n }\n }\n\n return {\n isLoading,\n selectCountryForm,\n };\n};\n\nexport const useConvertCurrency = ({\n type = 'spread',\n}: {\n type?: 'spread' | 'no_spread';\n}) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: ConvertCurrencyParams) => {\n const apiFn =\n type === 'no_spread'\n ? postConvertRawCurrencyConverter\n : postConvertWithSpreadCurrencyConverter;\n return apiFn({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useUpsertContractEligibility = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: { employmentId: string } & CreateContractEligibilityParams) => {\n return postCreateContractEligibility({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n body: payload,\n });\n },\n });\n};\n"],"mappings":"6UAgCA,OAAS,sBAAAA,EAAoB,UAAAC,MAAc,8BAC3C,OAAS,eAAAC,EAAa,YAAAC,MAAgB,wBAG/B,IAAMC,EAAgBC,EAACC,GAAqC,CACjE,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,aAAcH,CAAY,EACrC,MAAO,GACP,QAAS,CAAC,CAACA,EACX,OAAQD,EAAA,CAAC,CAAE,KAAAK,CAAK,IACPA,GAAM,KAAK,WADZ,UAGR,QAASL,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMC,EAAkB,CACvC,OAAQL,EACR,QAAS,CACP,cAAe,EACj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oB,EAAI7B,EACtC8B,EAAwB,KAAK,OAC7BpC,GAAS,WAAa,CAAC,CACzB,EAEMqC,EAAoBzB,EAAmBuB,CAAmB,EAEhE,GAAIF,EAAW,CACb,IAAMK,EAAeD,EAAkB,OAAO,KAC3C5B,GAAUA,EAAM,OAAS,SAC5B,EACI6B,IACFA,EAAa,QAAUL,EAE3B,CAEA,MAAO,CACL,UAAAC,EACA,kBAAAG,CACF,CACF,EAzBuC,2BA2B1BE,GAAqBhE,EAAA,CAAC,CACjC,KAAAiE,EAAO,QACT,IAEM,CACJ,GAAM,CAAE,OAAA/D,CAAO,EAAIC,EAAU,EAC7B,OAAOa,EAAY,CACjB,WAAYhB,EAACiB,IAETgD,IAAS,YACLC,EACAC,GACO,CACX,OAAQjE,EACR,KAAMe,CACR,CAAC,EARS,aAUd,CAAC,CACH,EAlBkC,sBAoBrBmD,GAA+BpE,EAAA,IAAM,CAChD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAC7B,OAAOa,EAAY,CACjB,WAAYhB,EAAA,CAAC,CACX,aAAAC,EACA,GAAGgB,CACL,IACSoD,EAA8B,CACnC,OAAQnE,EACR,KAAM,CACJ,cAAeD,CACjB,EACA,KAAMgB,CACR,CAAC,EAVS,aAYd,CAAC,CACH,EAhB4C","names":["createHeadlessForm","modify","useMutation","useQuery","useEmployment","__name","employmentId","client","useClient","useQuery","data","response","getShowEmployment","useCompany","companyId","getShowCompany","useBenefitOffers","getIndexBenefitOffer","acc","item","useEmploymentInvite","useMutation","payload","postInviteEmploymentInvitation","useCreateReserveInvoice","postCreateRiskReserve","useJSONSchemaForm","countryCode","form","fieldValues","options","query","jsonSchemaQueryParam","getShowFormCountry","jsfSchema","schema","modify","moneyFieldsData","findFieldsByType","field","convertToCents","initialValues","createHeadlessForm","useBenefitOffersSchema","getShowSchema","hasFieldValues","useCreateEmployment","postCreateEmployment2","useUpdateEmployment","jsonSchemaQueryParams","filteredQueryParams","value","patchUpdateEmployment2","useUpdateBenefitsOffers","putUpdateBenefitOffer","useMagicLink","params","postGenerateMagicLink","useCountries","queryOptions","getSupportedCountry","country","useCountriesSchemaField","countries","isLoading","selectCountrySchema","selectCountryStepSchema","selectCountryForm","countryField","useConvertCurrency","type","postConvertRawCurrencyConverter","postConvertWithSpreadCurrencyConverter","useUpsertContractEligibility","postCreateContractEligibility"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|