@zeniai/web-app-ui 5.1.44-qa → 5.1.45-dev
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/assets/AddressRoutes-CMaX3PoD.js +1 -0
- package/dist/assets/AddressScreen-C3jTD0QX.js +9 -0
- package/dist/assets/{AiCfoScreen-BPdC66wo.js → AiCfoScreen-BtMMWn6B.js} +5 -5
- package/dist/assets/{BillPayApprovalRoutes-QJ1EpW6M.js → BillPayApprovalRoutes-DU855VPd.js} +1 -1
- package/dist/assets/{BillPayRoutes-Bna0uGqV.js → BillPayRoutes-DzxfBsX4.js} +8 -8
- package/dist/assets/{BusinessVerificationPageScreen-0dmMGz8A.js → BusinessVerificationPageScreen-BiME3gzl.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-BtSV6YdK.js → CardsAiCfoScreen-Dk4_VP17.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-DKr2nu1e.js → ChargeCardRoutes-BozcfSlm.js} +1 -1
- package/dist/assets/CompanyPassportScreen-DNxF2lkY.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-BYP_nDK9.js → ConnectionAuthScreen-DXqmojb9.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B-ksGe-B.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CxS9lLTl.js → CustomerOnboardingRoutes-_VvrC-ga.js} +3 -3
- package/dist/assets/{DashboardRoutes-D2v4ZF_E.js → DashboardRoutes-Dovp7HGT.js} +1 -1
- package/dist/assets/{DefaultTenantHome-Dbi3Jzbe.js → DefaultTenantHome-D8-0czPn.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-D62ComgW.js +18 -0
- package/dist/assets/DrawerScreen-Bzib8YfV.js +1 -0
- package/dist/assets/EntityDetailRoutes-BJQoxnJC.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CUBrIS6y.js → ExpenseAutomationRoutes-BEvk-l6F.js} +4 -4
- package/dist/assets/{FeaturePreviewScreen-AUOPnl37.js → FeaturePreviewScreen-KfiUQgFU.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-IFaSwoId.js → HubSpotOAuthCallbackScreen-Cn6vvoeb.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BIAaZldq.js → MagicLinkRoutes-DmvvOL_Y.js} +6 -6
- package/dist/assets/MagicLinkSignInScreen-BTFCnths.js +12 -0
- package/dist/assets/{MobileAppDrawer-CLztF99b.js → MobileAppDrawer-DY_LJNf1.js} +1 -1
- package/dist/assets/NotFoundScreen-98Ef_Sqs.js +1 -0
- package/dist/assets/{NotificationRoutes-Bt0oSYPF.js → NotificationRoutes-BkpJw4hc.js} +1 -1
- package/dist/assets/OAuthConsentScreen-GPiaPY5A.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DE9xTiJG.js +1 -0
- package/dist/assets/{PeopleRoutes-Dj-CT0eD.js → PeopleRoutes--3fASQ5h.js} +3 -3
- package/dist/assets/{PerformanceRoutes-DsWM-lYk.js → PerformanceRoutes-zr7-gR8p.js} +1 -1
- package/dist/assets/{Preview-CFdBsxvl.js → Preview-B1kObDl3.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-eD76plFQ.js → QBOConnectionScreen-Bn0720kQ.js} +1 -1
- package/dist/assets/{ReferralListScreen-DxoomfXt.js → ReferralListScreen-B9-Pm2jb.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-B7uUwiM0.js → ReimbursementApprovalRoutes-DgN-DZyX.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B5p0qX7h.js → ReimbursementApprovalRuleDetailScreen-B-QO8l6D.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Dh1G5yct.js → ReimbursementRoutes-C_8B-Cx9.js} +4 -4
- package/dist/assets/{ReportsRoutes-y7MnzGll.js → ReportsRoutes-3IlP_YGU.js} +1 -1
- package/dist/assets/RewardsRoutes-Bn0Tad-r.js +1 -0
- package/dist/assets/{ScreenRoutes-B-k_ZyHL.js → ScreenRoutes-BZhSovog.js} +2 -2
- package/dist/assets/{SettingsRoutes-X4MKf4TH.js → SettingsRoutes-D8sH0k-9.js} +4 -4
- package/dist/assets/{SetupPagesScreen-Uer5YsTX.js → SetupPagesScreen-CyzzOWiJ.js} +5 -5
- package/dist/assets/SignInScreen-B7g5AeOc.js +1 -0
- package/dist/assets/SignOutScreen-Kk_O7nh6.js +9 -0
- package/dist/assets/{TaskListScreen-CoC_5M60.js → TaskListScreen-VdSyXs6p.js} +2 -2
- package/dist/assets/{TaskRoutes-DEDS1cCa.js → TaskRoutes-BEWp0wJa.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-BMVLeepD.js → TransactionDetailRoutes-DZjZQ9RI.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BOsA-UF4.js → TransactionDetailScreen-idWMKJZo.js} +2 -2
- package/dist/assets/TransactionListRoutes-BhOdNCNy.js +1 -0
- package/dist/assets/{TreasuryRoutes-CzaTrrCq.js → TreasuryRoutes-BQN9aD4y.js} +5 -5
- package/dist/assets/{VendorsRoutes-CA2szW0j.js → VendorsRoutes-CavsRr3z.js} +10 -10
- package/dist/assets/WiseConfirmationScreen-Donx26qC.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-B92jFFWR.js → ZeniAccountRoutes-CYGjvO6a.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-Czxe84tm.js → ZeniAccountStatementScreen-BBbz4J4l.js} +1 -1
- package/dist/assets/{accountMappingHelper-CUOH4oaZ.js → accountMappingHelper-Bg3QrS2B.js} +1 -1
- package/dist/assets/{analytics-CVef-z80.js → analytics-CR-Ji6KN.js} +1 -1
- package/dist/assets/{analyticsHelper-DO0i_Ozz.js → analyticsHelper-BkTwMm2V.js} +1 -1
- package/dist/assets/{core-BZimyUuM.js → core-B1V19BTM.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CfH0YvB4.js → decodeURIComponentSafe-62zSMNJP.js} +1 -1
- package/dist/assets/{dnd-Ck7mLEKI.js → dnd-DY5CyMCW.js} +1 -1
- package/dist/assets/{empty-CDMj19T8.js → empty-BKpizSQk.js} +1 -1
- package/dist/assets/{empty-B1O8rDIf.js → empty-DJY9ZnQE.js} +1 -1
- package/dist/assets/{emptyVideoElement-DHeCITuJ.js → emptyVideoElement-DyEXr5u4.js} +1 -1
- package/dist/assets/{epic-C8TvJLbh.js → epic-BoLhMkLB.js} +1 -1
- package/dist/assets/getLocaleForTenant-BaJta4jx.js +1 -0
- package/dist/assets/{index-aKhhTDIh.js → index-B1BV6O_s.js} +11648 -11648
- package/dist/assets/{index-DUwckqJX.js → index-B32kgZ2L.js} +1 -1
- package/dist/assets/{index-B4buEPtI.js → index-BWk0p_4u.js} +1 -1
- package/dist/assets/{index-W-rD4OTh.js → index-C1O76jd1.js} +1 -1
- package/dist/assets/{index-BX9FlrZ4.js → index-CUT1Jf2m.js} +2 -2
- package/dist/assets/{index-ky9cAsxd.js → index-Cd64f4Pj.js} +1 -1
- package/dist/assets/{index-CGgy5RAo.js → index-Rl-vwFod.js} +1 -1
- package/dist/assets/{index-BHYDqIxo.js → index-jGxvchTd.js} +1 -1
- package/dist/assets/{lexical-D_s6IbSB.js → lexical-DtEMPKph.js} +1 -1
- package/dist/assets/{liveblocks-PtDFv95_.js → liveblocks-DtJmjn-F.js} +1 -1
- package/dist/assets/{lottie-D7iBAvwy.js → lottie-PNrYlsmY.js} +1 -1
- package/dist/assets/{mui-BcLZDyi8.js → mui-D6ES9V4N.js} +1 -1
- package/dist/assets/{pathToGoBack-Bmk3vSys.js → pathToGoBack-BkwIN_c3.js} +1 -1
- package/dist/assets/{pdf-CPbk6pQ4.js → pdf-C3786_Gz.js} +4 -4
- package/dist/assets/{pdf-lib-DYmF-pgM.js → pdf-lib-D3JDQVpu.js} +1 -1
- package/dist/assets/{plaid-CooQT--5.js → plaid-Cvs9FZAe.js} +1 -1
- package/dist/assets/{pusher-KpZt7gt8.js → pusher-DQiFD9Ci.js} +1 -1
- package/dist/assets/{react-CgKzDvVo.js → react-BQWMbpQu.js} +1 -1
- package/dist/assets/{react-1GR8h5rv.js → react-CTxsS9D9.js} +1 -1
- package/dist/assets/{react-jDouMY6r.js → react-DkNWIPJu.js} +1 -1
- package/dist/assets/{react-xjRx_xkd.js → react-ZHmjCTUq.js} +1 -1
- package/dist/assets/{react-C5ff31Q5.js → react-nBgf2eOj.js} +1 -1
- package/dist/assets/{react-BByj9tRX.js → react-nsy5XQiM.js} +1 -1
- package/dist/assets/{recharts-Nefi66IQ.js → recharts-C_sYuD8f.js} +1 -1
- package/dist/assets/{routePaths-DQbleX1q.js → routePaths-BaN0YLzj.js} +1 -1
- package/dist/assets/{sentry-mCXLUbmc.js → sentry-DJoVhts9.js} +1 -1
- package/dist/assets/{url-V8qFg-31.js → url-CZfStJg6.js} +1 -1
- package/dist/assets/{url-DwL5mRAv.js → url-Dh3D7a-t.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C07ZgQEG.js → useAiCfoDashboardSuggestedQuestionsChips-B-gQ2ZCu.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B1ysHqFw.js +1 -0
- package/dist/assets/{useDeviceId-r7OfXqIX.js → useDeviceId-zuDOu7ni.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-ClxKOF2S.js → useInitialThreadRequest-BrZkGF4L.js} +1 -1
- package/dist/assets/{utils-C9yOAUzR.js → utils-B1ItiyXC.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CCFVon-p.js → withTransactionSidePanel-CUAVvG-3.js} +4 -4
- package/dist/assets/{zeni-epic-state-D1RAQ_Ab.js → zeni-epic-state-Ct7fOB-u.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-B61fN_Ku.js +0 -1
- package/dist/assets/AddressScreen-BF-3RAYM.js +0 -9
- package/dist/assets/CompanyPassportScreen-BOxFkTz6.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-4HAF86rh.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BHpce-fZ.js +0 -18
- package/dist/assets/DrawerScreen-QceXJJGv.js +0 -1
- package/dist/assets/EntityDetailRoutes-cFyrvi31.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BVEM6zNA.js +0 -12
- package/dist/assets/NotFoundScreen-BVW1mHQl.js +0 -1
- package/dist/assets/OAuthConsentScreen-86UCYr7M.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DDpGKk3b.js +0 -1
- package/dist/assets/RewardsRoutes-Fh9U07tc.js +0 -1
- package/dist/assets/SignInScreen-BpX_mdSj.js +0 -1
- package/dist/assets/SignOutScreen-gWOZtfBm.js +0 -9
- package/dist/assets/TransactionListRoutes-D-o7gV2V.js +0 -1
- package/dist/assets/WiseConfirmationScreen-BcU-8yI5.js +0 -12
- package/dist/assets/getLocaleForTenant-B-mnTkE0.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BY9akMo_.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-PtDFv95_.js";import{h as de,g as Ce,i as Me,u as pe,j as o,N as Sa,s as At,n as De,t as yn,o as as,p as se}from"./core-BZimyUuM.js";import{bs as Pe,QX as ts,QY as ns,fM as ln,QZ as In,fF as kn,Q_ as En,Q$ as An,R0 as Dn,R1 as _n,fG as Pn,fH as wn,R2 as vn,g1 as Tn,g2 as $a,R3 as Fn,R4 as rs,fL as ss,fK as cs,R5 as os,g4 as Rn,g5 as sa,R6 as is,R7 as ds,fO as ls,fN as us,R8 as xn,hC as Qe,g0 as Bn,f$ as Ln,R9 as ms,eV as Cs,A_ as ps,AZ as hs,B1 as fs,B3 as gs,e$ as bs,eS as On,Ra as Ss,Rb as ys,f4 as Un,Rc as Is,f5 as jn,B9 as ks,B6 as Es,eT as fe,Rd as Qa,f8 as we,f9 as ve,fa as Te,gr as ca,ct as oa,Re as ia,Rf as Dt,uA as za,kx as Za,Rg as Ya,BH as ka,BJ as qe,BK as _t,kn as Mn,Rh as da,Bv as _a,Ri as As,Rj as Ds,By as Ja,Rk as _s,Pk as Xa,eX as Nn,BE as ga,hN as Ps,Rl as Vn,Rm as la,bq as ws,Rn as vs,gc as et,gb as at,Cc as Ts,ga as tt,P0 as Fs,Ro as Hn,cm as Gn,cN as Rs,Pj as wa,CN as $n,Rp as un,Cn as Pa,Rq as zn,CO as xs,PM as Bs,CP as Ls,DL as Os,tX as Us,DF as js,Rr as Ms,BI as na,Rs as Ns,Rt as Vs,Ru as Hs,Rv as Gs,Rw as $s,Rx as Pt,Ry as zs,BZ as Zn,BS as Zs,Rz as Ys,gt as Ks,C6 as Yn,Ca as Kn,gs as Ws,RA as qs,Cz as Wn,RB as Qs,RC as Js,RD as Xs,C8 as qn,BV as Qn,BB as Jn,C2 as Xn,C0 as er,C4 as ec,RE as ar,RF as ac,f1 as tc,f2 as nc,f3 as rc,RG as nt,g6 as tr,cO as wt,RH as sc,RI as cc,RJ as oc,RK as ic,Ci as St,CG as dc,CC as lc,Ce as uc,CE as mc,Cu as Cc,Cw as pc,RL as nr,CM as Ga,Js as hc,RM as fc,RN as gc,RO as bc,RP as rr,RQ as Sc,D7 as yc,Cm as sr,Ch as je,Cl as Ic,RR as kc,RS as Ec,Bs as Ac,RT as cr,eW as or,RU as Dc,Bu as _c,Bt as mn,RV as Pc,RW as wc,RX as vc,LZ as Tc,RY as vt,RZ as Fc,xA as ir,l5 as Rc,hD as xc,Dc as Bc,R_ as dr,fS as Lc,fT as Oc,R$ as Uc,df as jc,g3 as Mc,D2 as Nc,CY as We,bt as Vc,bF as Hc,cy as Gc,bG as $c,La as zc}from"./zeni-epic-state-D1RAQ_Ab.js";import{A as Fe,cf as lr,p as _e,cg as ur,ch as mr,ci as Zc,O as ua,Y as Tt,cj as Yc,ck as Kc,V as Cr,c as pr,X as hr,q as ye,a as le,x as K,aq as ya,cl as fr,cm as Wc,cn as qc,z as re,B as va,c4 as rt,co as Qc,cp as Jc,cq as Xc,cr as eo,cs as ao,J as Ta,aN as ze,bo as Ft,ct as to,y as Fa,i as st,m as Rt,d as J,a7 as ct,cu as no,bA as ba,cv as yt,cw as ro,v as xt,cx as so,at as gr,a2 as It,cy as co,W as br,f as Sr,cz as oo,cA as io,cB as lo,cC as uo,cD as mo,cE as Co,o as Ka,cF as po,cG as ho,cH as pt,I as fo,cI as go,cJ as bo,cK as So,cL as yo,cM as Io,a9 as ko}from"./index-aKhhTDIh.js";import{n as Ne,D as yr,S as Eo}from"./mui-BcLZDyi8.js";import{a as r}from"./sentry-mCXLUbmc.js";import{u as Ra}from"./useAskAiCfoHostNavButtonProps-BY9akMo_.js";import{M as Ie}from"./MobileAppDrawer-CLztF99b.js";import{d as Bt}from"./recharts-Nefi66IQ.js";import{g as Ae,a as xa,b as Ir,c as Re,d as xe,e as Je,f as Xe,h as ea,A as Ao,i as Lt,P as Do,j as Ot,s as Ia,k as kr,l as ra,m as Er,n as _o,o as Ar,p as Po,S as Cn}from"./SetupPagesScreen-Uer5YsTX.js";import{u as Dr}from"./useInitialThreadRequest-ClxKOF2S.js";import ot from"./NotFoundScreen-BVW1mHQl.js";import{n as pn}from"./utils-C9yOAUzR.js";import{t as wo}from"./AddressScreen-BF-3RAYM.js";import"./analytics-CVef-z80.js";import"./plaid-CooQT--5.js";import"./dnd-Ck7mLEKI.js";import"./stripe-DMRn4zHo.js";import"./lottie-D7iBAvwy.js";import"./lexical-D_s6IbSB.js";import"./pdf-CPbk6pQ4.js";import"./analyticsHelper-DO0i_Ozz.js";import"./routePaths-DQbleX1q.js";import"./BusinessVerificationPageScreen-0dmMGz8A.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0dd3f148-e855-4071-866b-fa42db718da1",e._sentryDebugIdIdentifier="sentry-dbid-0dd3f148-e855-4071-866b-fa42db718da1")}catch{}})();const vo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},_r=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:vo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)}),{spendManagement:{chargeCard:{cardPolicyPage:hn}}}=ua.getLocalizedStrings(),To=e=>Bn(e,!1),Fo=e=>Ln(e.name,!1);function Ro(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(v=>{g(v)},[]),i=r.useCallback(()=>{_(!0)},[_]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:R}=Ra({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(ts()),a(ns()),a(ln())},[a]);const D=o(v=>In(v.cardPolicyState)),d=o(v=>kn(v.cardPolicyState)),j=o(v=>En(v.cardPolicyState)),P=o(v=>An(v.cardPolicyState)),B=o(v=>Dn(v.cardPolicyState)),p=o(v=>_n(v.cardPolicyState)),h=o(v=>Pn(v.cardPolicyState)),w=o(v=>wn(v.cardPolicyState)),u=o(v=>vn(v.cardPolicyState)),T=o(v=>v.chargeCardConfigState.receiptRequiredAboveAmount.amount),k=o(v=>v.chargeCardConfigState.fetchState);r.useEffect(()=>{D!=="Completed"&&D!=="In-Progress"&&a(Tn())},[a,D]),r.useEffect(()=>{w==="Completed"&&u===""||w==="In-Progress"||a($a())},[a,w,u]);const M=o(v=>Fn(v.createCardPolicyState)),A=o(v=>rs(v.createCardPolicyState)),y=o(v=>ss(v.cardPolicyState)),L=o(v=>cs(v.cardPolicyState)),l=o(v=>os(v.createCardPolicyState)),C=o(v=>Rn(v));r.useEffect(()=>{C.fetchState==="Not-Started"&&a(sa(!1,!1,!1))},[C.fetchState,a]);const N=r.useMemo(()=>d.map(To),[d]),G=r.useMemo(()=>h.map(Fo),[h]),O=r.useMemo(()=>C.cards.filter(v=>!lr(v.status.code)).map(_r),[C.cards]),U=D==="Completed"&&C.fetchState==="Completed"&&k==="Completed";r.useEffect(()=>{U&&l==null&&a(is({cardsMasterList:O,defaultRequireReceiptAmount:T,suggestedAllowMerchants:j,suggestedBlockMerchants:P,suggestedAllowCategories:B,suggestedBlockCategories:p}))},[k,a,U,l,O,T,j,P,B,p]);const z=r.useMemo(()=>Bt(v=>{a($a(v))},250),[a]);r.useEffect(()=>()=>{z.cancel()},[z]);const Z=r.useCallback(v=>{z(v)},[z]),I=M.fetchState,x=t!=null?`/${t}/cards/policy`:"..",Y=r.useCallback(()=>{const v=_e(n.state?.pathnameStackToGoBack),ee=v.poppedPathname??x;e(ee,{state:{pathnameStackToGoBack:v.newStack}})},[n.state,e,x]),q=r.useCallback(()=>{e(x)},[e,x]),E=r.useCallback(v=>{a(ds(v))},[a]),V=r.useCallback(v=>{const ee=ur(v);a(ls({templates:[ee]}))},[a]),Q=r.useCallback(v=>{v.length!==0&&a(us(v))},[a]),X=r.useCallback(()=>{a(ln())},[a]),S=r.useRef(I);r.useEffect(()=>{const v=S.current;S.current=I,I==="Completed"&&v!=="Completed"&&A!=null&&(a(xn()),a(Qe({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(x))},[a,I,A,e,x]);const F=I==="Error"?M.error?.message??hn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?l==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(mr,{showUploadDocumentSection:!0,navBarTitle:hn.createPageTitle,onBackClick:Y,onClickMenuIcon:i,isAiCfoAccessEnabled:m,onAskAiCfoClick:R})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Zc,{formDraft:l,vendorSearchOptions:G,categorySearchOptions:N,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:Z,submitState:I,submitErrorMessage:F,documentUploadState:y,uploadedFileName:L,isAiCfoAccessEnabled:m,onAskAiCfoClick:R,onBackClick:Y,onCancelClick:q,onClickMenuIcon:i,onFormChange:E,onSubmit:V,onUploadDocument:Q,onRemoveDocument:X})]}):c.jsx(Sa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:xo}}}=ua.getLocalizedStrings(),Bo=e=>Bn(e,!1),Lo=e=>Ln(e.name,!1);function Oo(){const e=de(),n=Ce(),{tenantEmailDomain:t,templateId:a}=Me(),s=pe(),b=Fe(),f=Pe(b?.loggedInUserRoleMap),[g,_]=r.useState(!1),i=r.useCallback(F=>{_(F)},[]),m=r.useCallback(()=>{i(!0)},[i]),{isAiCfoAccessEnabled:R,onAskAiCfoClick:D}=Ra({mobileExploreReferrer:"Card Policy"}),d=o(F=>ms(F)),j=o(F=>In(F.cardPolicyState)),P=o(F=>kn(F.cardPolicyState)),B=o(F=>En(F.cardPolicyState)),p=o(F=>An(F.cardPolicyState)),h=o(F=>Dn(F.cardPolicyState)),w=o(F=>_n(F.cardPolicyState)),u=o(F=>Pn(F.cardPolicyState)),T=o(F=>wn(F.cardPolicyState)),k=o(F=>vn(F.cardPolicyState)),M=o(F=>Rn(F)),A=o(F=>a!=null?Cs(F.cardPolicyState,a):void 0),y=r.useMemo(()=>d.templateId===a&&d.formDraft!=null?d.formDraft:A!=null?ps(A):void 0,[d.templateId,d.formDraft,A,a]);r.useEffect(()=>{if(a==null)return;const F=d.detailFetchState.fetchState;d.templateId===a&&(F==="Completed"||F==="In-Progress")||A!=null||s(hs(a))},[s,a,d.templateId,d.detailFetchState.fetchState,A]),r.useEffect(()=>{j!=="Completed"&&j!=="In-Progress"&&s(Tn())},[s,j]),r.useEffect(()=>{T==="Completed"&&k===""||T==="In-Progress"||s($a())},[s,T,k]);const L=o(F=>F.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{M.fetchState==="Not-Started"&&s(sa(!1,!1,!1))},[M.fetchState,s]);const l=r.useMemo(()=>P.map(Bo),[P]),C=r.useMemo(()=>u.map(Lo),[u]),N=r.useMemo(()=>M.cards.filter(F=>!lr(F.status.code)).map(_r),[M.cards]);Tt({isDataReady:y!=null});const G=r.useMemo(()=>{if(y!=null)return Yc({draft:y,cardRows:N,categorySearchOptions:l,vendorSearchOptions:C,defaultRequireReceiptAmount:L,suggestedAllowMerchants:B,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:w})},[y,N,l,C,L,B,p,h,w]),[O,U]=r.useState(void 0),z=r.useRef(!1);r.useEffect(()=>{z.current||O!=null||G==null||(z.current=!0,U(G))},[O,G]);const Z=r.useCallback(F=>{U(F)},[]),I=r.useMemo(()=>Bt(F=>{s($a(F))},250),[s]);r.useEffect(()=>()=>{I.cancel()},[I]);const x=r.useCallback(F=>{I(F)},[I]),Y=d.updateFetchState.fetchState,q=t!=null?`/${t}/cards/policy`:"..",E=r.useCallback(()=>{const F=_e(n.state?.pathnameStackToGoBack),v=F.poppedPathname??q;e(v,{state:{pathnameStackToGoBack:F.newStack}})},[n.state,e,q]),V=r.useCallback(()=>{e(q)},[e,q]),Q=r.useCallback(F=>{if(a==null)return;const v=ur(F);s(fs(v)),s(gs(a))},[s,a]),X=r.useRef(Y);r.useEffect(()=>{const F=X.current;X.current=Y,Y==="Completed"&&F!=="Completed"&&(s(Qe({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(q))},[s,Y,e,q]);const S=Y==="Error"?d.updateFetchState.error?.message??xo.updatePolicyGenericErrorMessage:void 0;return!f||t==null||a==null?c.jsx(Sa,{to:"..",replace:!0}):O!=null&&j==="Completed"&&M.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(Kc,{templateName:d.template?.name??"",formDraft:O,vendorSearchOptions:C,categorySearchOptions:l,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:x,submitState:Y,submitErrorMessage:S,isAiCfoAccessEnabled:R,onAskAiCfoClick:D,onBackClick:E,onCancelClick:V,onClickMenuIcon:m,onFormChange:Z,onSubmit:Q})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(mr,{showUploadDocumentSection:!1,navBarTitle:d.template?.name,onBackClick:E,onClickMenuIcon:m,isAiCfoAccessEnabled:R,onAskAiCfoClick:D})]})}function Pr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function wr(e){return o(n=>e==null||e===""?{chips:ht,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ht:ht,isResolved:s}}(bs(n,e)),At)}const ht=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Uo,subheadline:jo,pageTitle:Mo}}}}=ua.getLocalizedStrings(),No=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Vo(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(I=>{g(I)},[]),i=r.useCallback(()=>{_(!0)},[_]),{useFeatureGate:m}=le(),{isFeatureEnabled:R}=m(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:D}=m(K.isCardPolicyEnabled),{isAiCfoAccessEnabled:d,onAskAiCfoClick:j}=Ra({mobileExploreReferrer:"Card Policy"}),P=o(I=>Ss(I)),B=o(I=>Fn(I.createCardPolicyState)),p=o(I=>ys(I.createCardPolicyState)),h=o(I=>p==null?[]:Un(I.aiCfoState,p).filter(x=>x.kind==="creating_policy"),At),w=B.fetchState==="In-Progress"?Math.max(h.length,1):0,u=o(I=>Is(I.createCardPolicyState)),T=ya(B.fetchState);r.useEffect(()=>{T==="In-Progress"&&B.fetchState==="Completed"&&p!=null&&(a(xn()),h.forEach(I=>{a(jn({chatSessionId:p,id:I.id,entityIds:u,kind:"created_policy"}))}))},[B.fetchState,a,p,u,h,T]);const k=P.fetchState.fetchState;r.useEffect(()=>{k!=="Not-Started"&&k!=="Error"||a(ks())},[a,k]);const M=P.archiveFetchState.fetchState,A=ya(M);r.useEffect(()=>{A==="In-Progress"&&M==="Completed"&&a(Qe({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[M,a,A]);const y=r.useMemo(()=>P.templates.map(No),[P.templates]);Tt({isDataReady:P.fetchState.fetchState==="Completed"});const L=y.length>0||w>0,l=function(I){const{hasAnyPolicies:x,isChargeCardAdmin:Y,isFileUploadEnabled:q}=I,E=de(),V=Ce(),{tenantEmailDomain:Q}=Me(),{isAiCfoOpen:X,setIsAiCfoOpen:S}=Cr(),F=pr(),v=hr(),ee=o(ce=>On(ce)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:W,isResolved:ke}=wr("card_policy"),be=r.useMemo(()=>Pr(W,ke,3),[W,ke]),[ge,ae]=r.useState(""),ue=v&&F&&Q!=null&&!X,oe=r.useCallback(ce=>{if(Q==null)return;const Ea=ye(V.state?.pathnameStackToGoBack,V.pathname);E(`/${Q}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:Ea,referrer:"card_policy_hero",aiCfoInitialQuestion:ce,aiCfoShouldSubmit:ce!=null&&ce.trim().length>0}})},[V.pathname,V.state,E,Q]),te=r.useCallback(ce=>{ce.trim().length!==0&&(ae(""),oe(ce))},[oe]),Ze=r.useCallback(()=>{const ce=ge.trim();ce.length!==0&&(ae(""),oe(ce))},[ge,oe]),Ee=r.useCallback(()=>{},[]),ne=r.useCallback(ce=>{ae(ce)},[]),Ye=r.useCallback(()=>{S(!0)},[S]),Be=r.useCallback(()=>{oe(void 0)},[oe]);return r.useMemo(()=>{if(ue&&!x&&Y)return{aiAgentName:Mo,headline:Uo,subheadline:jo,promptChips:be,composer:{currentInput:ge,isSubmitting:ee,isFileUploadEnabled:q,onInputChange:ne,onSubmit:Ze,onStopSubmit:Ee},onPromptClick:te,onOpenSidePanel:Ye,onOpenFullView:Be,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[ge,x,ue,Y,q,ee,ne,Be,Ye,te,Ee,Ze,be])}({hasAnyPolicies:L,isChargeCardAdmin:b,isFileUploadEnabled:R}),C=D&&l!=null?c.jsx(fr,{...l}):null,N=d&&C==null,G=r.useCallback(()=>{const I=_e(n.state?.pathnameStackToGoBack),x=I.poppedPathname??"..";e(x,{state:{pathnameStackToGoBack:I.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),U=r.useCallback(I=>{t!=null&&e(`/${t}/cards/policy/${I}/edit`)},[e,t]),z=r.useCallback(I=>{a(Es(I))},[a]),Z=P.fetchState.fetchState;return!L&&Z!=="Completed"&&Z!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Wc,{onBackClick:G,onNewPolicyClick:O,onClickMenuIcon:i,isAiCfoAccessEnabled:d,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(qc,{policies:y,archivingTemplateId:P.archiveTargetTemplateId,pendingCreationCount:w,onBackClick:G,onNewPolicyClick:O,onEditPolicyClick:U,onArchivePolicyClick:z,onClickMenuIcon:i,policyAiCfoHero:C,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})}function Ho(){const e=de(),{cardId:n}=Me(),t=pe(),a=re.getSignedInUser(),s=o(W=>fe(W)),b=Fe(),f=Pe(b?.loggedInUserRoleMap),{useFeatureGate:g}=le();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,i]=r.useState(!1),m=o(W=>Qa(W).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const R=s.userRole.includes("charge_card_user"),{isFeatureEnabled:D}=g(K.isChargeCardFeatureEnabled),d=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=g(K.isDebitCardFeatureEnabled),P=we(s),B=ve(s),p=Te(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=Re({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),u=xe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:D,isBookKeepingTenant:B,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:h}),T=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(W=>ca(W,s.companyId)),M=oa(k.controllers),{creditAccount:A,creditAccountRepayment:y}=o(W=>ia(W)),L=o(W=>W.classListState.fetchState),l=!R&&u&&d,C=o(W=>Dt(W,n,l,u)),[N,G]=r.useState(!1),O=C.chargeCard,U=O?.cardCreatedByUser?.userId,z=o(W=>U!=null?za(W.userRoleState,U):void 0),Z=z?.accountingClassIDs[0],I=o(W=>Z!=null?Za(W.classState,{classId:Z,reportId:"class_list"}):void 0),x=O?.cardHolderUser?.userId,Y=o(W=>x!=null?za(W.userRoleState,x):void 0),q=Y?.accountingClassIDs[0],E=o(W=>q!=null?Za(W.classState,{classId:q,reportId:"class_list"}):void 0),V=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",Q=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{m&&_===!1&&V&&(i(!0),setTimeout(()=>{t(Ya()),Q&&t(Qe({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[m,_,V,Q]),r.useEffect(()=>{N||C.fetchState==="Completed"||C.fetchState==="In-Progress"||n==null||(G(!0),t(ka(n,l,!1)))},[N,C,n,t]),r.useEffect(()=>{if(C.fetchState==="Completed"&&(V===!1||V&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||m===!1&&_===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const W=Ae(s.tenantEmailDomain,n,a,O,m);e(W)}},[C.fetchState,m,V]),r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&d&&f&&t(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&u&&d&&f&&t(_t()),L!=="Completed"&&L!=="In-Progress"&&t(Mn())},[A.fetchState,y.fetchState,t,u,d,f,L]);const X=()=>{if(a!=null&&n!=null){t(Ya());const W=Ae(s.tenantEmailDomain,n,a);e(W)}},S=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",F=Je(u,w,T,d),v=xa(u,d,f,A,y),ee=Ir(S,C);return C.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:m}),c.jsx(Qc,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:d,productInformation:F,creditAccountInformation:v,debitAccountInformation:ee,chargeCardDetailView:C,creditAccount:A,classListFetchState:L,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:I?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ut=e=>{const{events:n,onEvent:t,onSubscribed:a}=e,s=Jc(),b=r.useRef(t),f=r.useRef(a),g=r.useRef(0);r.useEffect(()=>{b.current=t},[t]),r.useEffect(()=>{f.current=a},[a]);const _=r.useMemo(()=>[...n].sort().join("|"),[n]);r.useEffect(()=>{if(s==null||n.length===0)return;const i=[],m=new Set,R=()=>{if(f.current==null)return;const D=Date.now();D-g.current<5e3||(g.current=D,f.current())};return n.forEach(D=>{const[d,j]=Xc(D);if(j==="")return;const P=s.channel(d),B=h=>{b.current(j,h)};let p;if(P?.subscribed===!0)p=P,p.bind(j,B),m.has(d)||(m.add(d),R()),i.push(()=>{P.unbind(j,B)});else{if(p=P??s.subscribe(d),p.bind(j,B),!m.has(d)){m.add(d);const h=()=>{R()};p.bind("pusher:subscription_succeeded",h),i.push(()=>{p.unbind("pusher:subscription_succeeded",h)})}i.push(()=>{p.unbind(j,B)})}}),()=>{i.forEach(D=>D())}},[s,_])},vr="charge-card-transaction-update",Tr="charge-card-transaction-created",Fr="charge-card-transaction-declined",Rr="charge-card-transaction-updated",xr="charge-card-transaction-receipt-uploaded",ma="charge-card-status-update",jt="charge-card-spending-updated",it="credit-account-balance-updated",dt="charge-card-created",Mt="charge-card-limit-updated",Nt="charge-card-limit-reset",Vt="charge-card-renamed",Go="charge-card-department-updated",Br="charge-card-repayment-completed",Lr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",La="charge-card-cashback-earned",Ca=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),$o=[La,Ba],zo=De(function(e){const n=da(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(As({uiState:{sortKey:n,sortOrder:t}}))}}})(ao);function Zo(){const e=de(),n=pe(),t=Ce(),a=re.getSignedInUser(),s=o(j=>fe(j)),{useFeatureGate:b}=le(),{isFeatureEnabled:f}=b(K.isCardsCommentingEnabled),[g,_]=r.useState(!1),i=o(j=>da(j)),m=Dr(s.companyId,{clearParams:i.fetchState==="Completed"}),R=r.useCallback(()=>{const j=_e(t.state?.pathnameStackToGoBack),P=j.poppedPathname??Yo(s.tenantEmailDomain);e(P,{state:{pathnameStackToGoBack:j.newStack}})},[e,t,s.tenantEmailDomain]),D=Xe(s);if(Ut({events:Ca(D,$o),onEvent:j=>{switch(j){case La:case Ba:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{g||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(_(!0),n(_a()))},[g,i,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const d=i.cashbackSummary?.cashbackEarned?.amount!=null&&i.fetchState!=="Not-Started";return i.fetchState!=="In-Progress"||d?(i.cashbackSummary?.cashbackEarned?.amount??0)===0&&i.fetchState==="Completed"?c.jsx(ot,{}):c.jsx(zo,{onBackClick:R,isCardsCommentingEnabled:f,initialOpenThreadRequest:m}):c.jsx(eo,{onBackClick:R})}const Yo=e=>`/${e}/cards`,Ko={containerWidth:new Fa(100,58)},Wo=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f}=le(),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[R,D]=r.useState(!1),[d,j]=r.useState(!1),P=re.getSignedInUser();if(P==null)throw Error("Can't access onboarding card page without signing in...");const B=o(E=>fe(E));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=f(ze.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,w=o(E=>Ds(E,s)),u=w.chargeCard,T=o(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:k}=le(),{isFeatureEnabled:M}=k(K.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(K.isDebitCardFeatureEnabled),y=Te(A,B),L=Re({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:y}),l=!!B.companyChargeCardInfo?.info?.isChargeCardEnabled,C=B.userRole.includes("charge_card_user"),N=we(B),G=ve(B),O=B.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=xe({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:O}),z=!C&&U&&l;r.useEffect(()=>{g===!1&&T!=="In-Progress"&&T!=="Completed"&&(t(Ja()),_(!0)),i===!1&&w.fetchState==="Not-Started"&&(m(!0),t(ka(s,z,U)))},[i,w.fetchState,g,T]);const Z=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(R===!1&&(Z===!1||Z&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==P.userId)){const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);a(E,{state:{pathnameStackToGoBack:V}})}else if(R&&w.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(_s({chargeCardId:s}));const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(E,{state:{pathnameStackToGoBack:V}})}}},[w.fetchState,u?.type.code,R,w.isRefreshingViewInBackground]);const I=re.getZeniOtpTokenForCardHolder(s),x=o(E=>Nn(E.userState,P.userId)),Y=()=>{u?.status?.code!=="active"&&t(ga(s,!0))};r.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&R===!1&&(setTimeout(Y,3e3),D(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const q=E=>{j(E)};if(T!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(x?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Jo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:d,handleDrawerToggle:q}),c.jsx(qo,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:x.phone,signedInUser:P,isSandboxEnv:Ft(),chargeCardDetailState:w,signedInUserToken:I,navigate:a,currentTenant:B,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?c.jsx(Qo,{windowSize:n,children:e}):null]})},qo=De(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=Ps(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const f=Vn(e,s),g=n.updateStatus,_=la(e,!1,!1,!1);let i=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(i=!0);const m=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(ws())||m,showMenuIcon:i,shippingAddress:b,vgsVaultId:st.cardVaultId,twoFAView:f,activationWaitStatus:g,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:i=>{e(Ts(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onCVVActivateSuccess:()=>{e(vs({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("onboard")===!0?ea(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(to),Qo=Ne.div`
|
|
1
|
+
import{j as c}from"./liveblocks-DtJmjn-F.js";import{h as de,g as Ce,i as Me,u as pe,j as o,N as Sa,s as At,n as De,t as yn,o as as,p as se}from"./core-B1V19BTM.js";import{bs as Pe,QX as ts,QY as ns,fM as ln,QZ as In,fF as kn,Q_ as En,Q$ as An,R0 as Dn,R1 as _n,fG as Pn,fH as wn,R2 as vn,g1 as Tn,g2 as $a,R3 as Fn,R4 as rs,fL as ss,fK as cs,R5 as os,g4 as Rn,g5 as sa,R6 as is,R7 as ds,fO as ls,fN as us,R8 as xn,hC as Qe,g0 as Bn,f$ as Ln,R9 as ms,eV as Cs,A_ as ps,AZ as hs,B1 as fs,B3 as gs,e$ as bs,eS as On,Ra as Ss,Rb as ys,f4 as Un,Rc as Is,f5 as jn,B9 as ks,B6 as Es,eT as fe,Rd as Qa,f8 as we,f9 as ve,fa as Te,gr as ca,ct as oa,Re as ia,Rf as Dt,uA as za,kx as Za,Rg as Ya,BH as ka,BJ as qe,BK as _t,kn as Mn,Rh as da,Bv as _a,Ri as As,Rj as Ds,By as Ja,Rk as _s,Pk as Xa,eX as Nn,BE as ga,hN as Ps,Rl as Vn,Rm as la,bq as ws,Rn as vs,gc as et,gb as at,Cc as Ts,ga as tt,P0 as Fs,Ro as Hn,cm as Gn,cN as Rs,Pj as wa,CN as $n,Rp as un,Cn as Pa,Rq as zn,CO as xs,PM as Bs,CP as Ls,DL as Os,tX as Us,DF as js,Rr as Ms,BI as na,Rs as Ns,Rt as Vs,Ru as Hs,Rv as Gs,Rw as $s,Rx as Pt,Ry as zs,BZ as Zn,BS as Zs,Rz as Ys,gt as Ks,C6 as Yn,Ca as Kn,gs as Ws,RA as qs,Cz as Wn,RB as Qs,RC as Js,RD as Xs,C8 as qn,BV as Qn,BB as Jn,C2 as Xn,C0 as er,C4 as ec,RE as ar,RF as ac,f1 as tc,f2 as nc,f3 as rc,RG as nt,g6 as tr,cO as wt,RH as sc,RI as cc,RJ as oc,RK as ic,Ci as St,CG as dc,CC as lc,Ce as uc,CE as mc,Cu as Cc,Cw as pc,RL as nr,CM as Ga,Js as hc,RM as fc,RN as gc,RO as bc,RP as rr,RQ as Sc,D7 as yc,Cm as sr,Ch as je,Cl as Ic,RR as kc,RS as Ec,Bs as Ac,RT as cr,eW as or,RU as Dc,Bu as _c,Bt as mn,RV as Pc,RW as wc,RX as vc,LZ as Tc,RY as vt,RZ as Fc,xA as ir,l5 as Rc,hD as xc,Dc as Bc,R_ as dr,fS as Lc,fT as Oc,R$ as Uc,df as jc,g3 as Mc,D2 as Nc,CY as We,bt as Vc,bF as Hc,cy as Gc,bG as $c,La as zc}from"./zeni-epic-state-Ct7fOB-u.js";import{A as Fe,cf as lr,p as _e,cg as ur,ch as mr,ci as Zc,O as ua,_ as Tt,cj as Yc,ck as Kc,V as Cr,c as pr,Z as hr,n as ye,a as le,d as K,aq as ya,cl as fr,cm as Wc,cn as qc,z as re,B as va,c4 as rt,co as Qc,cp as Jc,cq as Xc,cr as eo,cs as ao,J as Ta,aN as ze,bo as Ft,ct as to,D as Fa,i as st,m as Rt,e as J,a7 as ct,cu as no,bA as ba,cv as yt,cw as ro,w as xt,cx as so,at as gr,a2 as It,cy as co,X as br,g as Sr,cz as oo,cA as io,cB as lo,cC as uo,cD as mo,cE as Co,o as Ka,cF as po,cG as ho,cH as pt,s as fo,cI as go,cJ as bo,cK as So,cL as yo,cM as Io,a9 as ko}from"./index-B1BV6O_s.js";import{n as Ne,D as yr,S as Eo}from"./mui-D6ES9V4N.js";import{a as r}from"./sentry-DJoVhts9.js";import{u as Ra}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{M as Ie}from"./MobileAppDrawer-DY_LJNf1.js";import{d as Bt}from"./recharts-C_sYuD8f.js";import{g as Ae,a as xa,b as Ir,c as Re,d as xe,e as Je,f as Xe,h as ea,A as Ao,i as Lt,P as Do,j as Ot,s as Ia,k as kr,l as ra,m as Er,n as _o,o as Ar,p as Po,S as Cn}from"./SetupPagesScreen-CyzzOWiJ.js";import{u as Dr}from"./useInitialThreadRequest-BrZkGF4L.js";import ot from"./NotFoundScreen-98Ef_Sqs.js";import{n as pn}from"./utils-B1ItiyXC.js";import{t as wo}from"./AddressScreen-C3jTD0QX.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./analyticsHelper-BkTwMm2V.js";import"./routePaths-BaN0YLzj.js";import"./BusinessVerificationPageScreen-BiME3gzl.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3c969ea0-5fed-482e-9bb2-bd065b243ede",e._sentryDebugIdIdentifier="sentry-dbid-3c969ea0-5fed-482e-9bb2-bd065b243ede")}catch{}})();const vo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},_r=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:vo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)}),{spendManagement:{chargeCard:{cardPolicyPage:hn}}}=ua.getLocalizedStrings(),To=e=>Bn(e,!1),Fo=e=>Ln(e.name,!1);function Ro(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(v=>{g(v)},[]),i=r.useCallback(()=>{_(!0)},[_]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:R}=Ra({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(ts()),a(ns()),a(ln())},[a]);const D=o(v=>In(v.cardPolicyState)),d=o(v=>kn(v.cardPolicyState)),j=o(v=>En(v.cardPolicyState)),P=o(v=>An(v.cardPolicyState)),B=o(v=>Dn(v.cardPolicyState)),p=o(v=>_n(v.cardPolicyState)),h=o(v=>Pn(v.cardPolicyState)),w=o(v=>wn(v.cardPolicyState)),u=o(v=>vn(v.cardPolicyState)),T=o(v=>v.chargeCardConfigState.receiptRequiredAboveAmount.amount),k=o(v=>v.chargeCardConfigState.fetchState);r.useEffect(()=>{D!=="Completed"&&D!=="In-Progress"&&a(Tn())},[a,D]),r.useEffect(()=>{w==="Completed"&&u===""||w==="In-Progress"||a($a())},[a,w,u]);const M=o(v=>Fn(v.createCardPolicyState)),A=o(v=>rs(v.createCardPolicyState)),y=o(v=>ss(v.cardPolicyState)),L=o(v=>cs(v.cardPolicyState)),l=o(v=>os(v.createCardPolicyState)),C=o(v=>Rn(v));r.useEffect(()=>{C.fetchState==="Not-Started"&&a(sa(!1,!1,!1))},[C.fetchState,a]);const N=r.useMemo(()=>d.map(To),[d]),G=r.useMemo(()=>h.map(Fo),[h]),O=r.useMemo(()=>C.cards.filter(v=>!lr(v.status.code)).map(_r),[C.cards]),U=D==="Completed"&&C.fetchState==="Completed"&&k==="Completed";r.useEffect(()=>{U&&l==null&&a(is({cardsMasterList:O,defaultRequireReceiptAmount:T,suggestedAllowMerchants:j,suggestedBlockMerchants:P,suggestedAllowCategories:B,suggestedBlockCategories:p}))},[k,a,U,l,O,T,j,P,B,p]);const z=r.useMemo(()=>Bt(v=>{a($a(v))},250),[a]);r.useEffect(()=>()=>{z.cancel()},[z]);const Z=r.useCallback(v=>{z(v)},[z]),I=M.fetchState,x=t!=null?`/${t}/cards/policy`:"..",Y=r.useCallback(()=>{const v=_e(n.state?.pathnameStackToGoBack),ee=v.poppedPathname??x;e(ee,{state:{pathnameStackToGoBack:v.newStack}})},[n.state,e,x]),q=r.useCallback(()=>{e(x)},[e,x]),E=r.useCallback(v=>{a(ds(v))},[a]),V=r.useCallback(v=>{const ee=ur(v);a(ls({templates:[ee]}))},[a]),Q=r.useCallback(v=>{v.length!==0&&a(us(v))},[a]),X=r.useCallback(()=>{a(ln())},[a]),S=r.useRef(I);r.useEffect(()=>{const v=S.current;S.current=I,I==="Completed"&&v!=="Completed"&&A!=null&&(a(xn()),a(Qe({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(x))},[a,I,A,e,x]);const F=I==="Error"?M.error?.message??hn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?l==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(mr,{showUploadDocumentSection:!0,navBarTitle:hn.createPageTitle,onBackClick:Y,onClickMenuIcon:i,isAiCfoAccessEnabled:m,onAskAiCfoClick:R})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Zc,{formDraft:l,vendorSearchOptions:G,categorySearchOptions:N,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:Z,submitState:I,submitErrorMessage:F,documentUploadState:y,uploadedFileName:L,isAiCfoAccessEnabled:m,onAskAiCfoClick:R,onBackClick:Y,onCancelClick:q,onClickMenuIcon:i,onFormChange:E,onSubmit:V,onUploadDocument:Q,onRemoveDocument:X})]}):c.jsx(Sa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:xo}}}=ua.getLocalizedStrings(),Bo=e=>Bn(e,!1),Lo=e=>Ln(e.name,!1);function Oo(){const e=de(),n=Ce(),{tenantEmailDomain:t,templateId:a}=Me(),s=pe(),b=Fe(),f=Pe(b?.loggedInUserRoleMap),[g,_]=r.useState(!1),i=r.useCallback(F=>{_(F)},[]),m=r.useCallback(()=>{i(!0)},[i]),{isAiCfoAccessEnabled:R,onAskAiCfoClick:D}=Ra({mobileExploreReferrer:"Card Policy"}),d=o(F=>ms(F)),j=o(F=>In(F.cardPolicyState)),P=o(F=>kn(F.cardPolicyState)),B=o(F=>En(F.cardPolicyState)),p=o(F=>An(F.cardPolicyState)),h=o(F=>Dn(F.cardPolicyState)),w=o(F=>_n(F.cardPolicyState)),u=o(F=>Pn(F.cardPolicyState)),T=o(F=>wn(F.cardPolicyState)),k=o(F=>vn(F.cardPolicyState)),M=o(F=>Rn(F)),A=o(F=>a!=null?Cs(F.cardPolicyState,a):void 0),y=r.useMemo(()=>d.templateId===a&&d.formDraft!=null?d.formDraft:A!=null?ps(A):void 0,[d.templateId,d.formDraft,A,a]);r.useEffect(()=>{if(a==null)return;const F=d.detailFetchState.fetchState;d.templateId===a&&(F==="Completed"||F==="In-Progress")||A!=null||s(hs(a))},[s,a,d.templateId,d.detailFetchState.fetchState,A]),r.useEffect(()=>{j!=="Completed"&&j!=="In-Progress"&&s(Tn())},[s,j]),r.useEffect(()=>{T==="Completed"&&k===""||T==="In-Progress"||s($a())},[s,T,k]);const L=o(F=>F.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{M.fetchState==="Not-Started"&&s(sa(!1,!1,!1))},[M.fetchState,s]);const l=r.useMemo(()=>P.map(Bo),[P]),C=r.useMemo(()=>u.map(Lo),[u]),N=r.useMemo(()=>M.cards.filter(F=>!lr(F.status.code)).map(_r),[M.cards]);Tt({isDataReady:y!=null});const G=r.useMemo(()=>{if(y!=null)return Yc({draft:y,cardRows:N,categorySearchOptions:l,vendorSearchOptions:C,defaultRequireReceiptAmount:L,suggestedAllowMerchants:B,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:w})},[y,N,l,C,L,B,p,h,w]),[O,U]=r.useState(void 0),z=r.useRef(!1);r.useEffect(()=>{z.current||O!=null||G==null||(z.current=!0,U(G))},[O,G]);const Z=r.useCallback(F=>{U(F)},[]),I=r.useMemo(()=>Bt(F=>{s($a(F))},250),[s]);r.useEffect(()=>()=>{I.cancel()},[I]);const x=r.useCallback(F=>{I(F)},[I]),Y=d.updateFetchState.fetchState,q=t!=null?`/${t}/cards/policy`:"..",E=r.useCallback(()=>{const F=_e(n.state?.pathnameStackToGoBack),v=F.poppedPathname??q;e(v,{state:{pathnameStackToGoBack:F.newStack}})},[n.state,e,q]),V=r.useCallback(()=>{e(q)},[e,q]),Q=r.useCallback(F=>{if(a==null)return;const v=ur(F);s(fs(v)),s(gs(a))},[s,a]),X=r.useRef(Y);r.useEffect(()=>{const F=X.current;X.current=Y,Y==="Completed"&&F!=="Completed"&&(s(Qe({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(q))},[s,Y,e,q]);const S=Y==="Error"?d.updateFetchState.error?.message??xo.updatePolicyGenericErrorMessage:void 0;return!f||t==null||a==null?c.jsx(Sa,{to:"..",replace:!0}):O!=null&&j==="Completed"&&M.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(Kc,{templateName:d.template?.name??"",formDraft:O,vendorSearchOptions:C,categorySearchOptions:l,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:x,submitState:Y,submitErrorMessage:S,isAiCfoAccessEnabled:R,onAskAiCfoClick:D,onBackClick:E,onCancelClick:V,onClickMenuIcon:m,onFormChange:Z,onSubmit:Q})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(mr,{showUploadDocumentSection:!1,navBarTitle:d.template?.name,onBackClick:E,onClickMenuIcon:m,isAiCfoAccessEnabled:R,onAskAiCfoClick:D})]})}function Pr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function wr(e){return o(n=>e==null||e===""?{chips:ht,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ht:ht,isResolved:s}}(bs(n,e)),At)}const ht=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Uo,subheadline:jo,pageTitle:Mo}}}}=ua.getLocalizedStrings(),No=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Vo(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(I=>{g(I)},[]),i=r.useCallback(()=>{_(!0)},[_]),{useFeatureGate:m}=le(),{isFeatureEnabled:R}=m(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:D}=m(K.isCardPolicyEnabled),{isAiCfoAccessEnabled:d,onAskAiCfoClick:j}=Ra({mobileExploreReferrer:"Card Policy"}),P=o(I=>Ss(I)),B=o(I=>Fn(I.createCardPolicyState)),p=o(I=>ys(I.createCardPolicyState)),h=o(I=>p==null?[]:Un(I.aiCfoState,p).filter(x=>x.kind==="creating_policy"),At),w=B.fetchState==="In-Progress"?Math.max(h.length,1):0,u=o(I=>Is(I.createCardPolicyState)),T=ya(B.fetchState);r.useEffect(()=>{T==="In-Progress"&&B.fetchState==="Completed"&&p!=null&&(a(xn()),h.forEach(I=>{a(jn({chatSessionId:p,id:I.id,entityIds:u,kind:"created_policy"}))}))},[B.fetchState,a,p,u,h,T]);const k=P.fetchState.fetchState;r.useEffect(()=>{k!=="Not-Started"&&k!=="Error"||a(ks())},[a,k]);const M=P.archiveFetchState.fetchState,A=ya(M);r.useEffect(()=>{A==="In-Progress"&&M==="Completed"&&a(Qe({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[M,a,A]);const y=r.useMemo(()=>P.templates.map(No),[P.templates]);Tt({isDataReady:P.fetchState.fetchState==="Completed"});const L=y.length>0||w>0,l=function(I){const{hasAnyPolicies:x,isChargeCardAdmin:Y,isFileUploadEnabled:q}=I,E=de(),V=Ce(),{tenantEmailDomain:Q}=Me(),{isAiCfoOpen:X,setIsAiCfoOpen:S}=Cr(),F=pr(),v=hr(),ee=o(ce=>On(ce)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:W,isResolved:ke}=wr("card_policy"),be=r.useMemo(()=>Pr(W,ke,3),[W,ke]),[ge,ae]=r.useState(""),ue=v&&F&&Q!=null&&!X,oe=r.useCallback(ce=>{if(Q==null)return;const Ea=ye(V.state?.pathnameStackToGoBack,V.pathname);E(`/${Q}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:Ea,referrer:"card_policy_hero",aiCfoInitialQuestion:ce,aiCfoShouldSubmit:ce!=null&&ce.trim().length>0}})},[V.pathname,V.state,E,Q]),te=r.useCallback(ce=>{ce.trim().length!==0&&(ae(""),oe(ce))},[oe]),Ze=r.useCallback(()=>{const ce=ge.trim();ce.length!==0&&(ae(""),oe(ce))},[ge,oe]),Ee=r.useCallback(()=>{},[]),ne=r.useCallback(ce=>{ae(ce)},[]),Ye=r.useCallback(()=>{S(!0)},[S]),Be=r.useCallback(()=>{oe(void 0)},[oe]);return r.useMemo(()=>{if(ue&&!x&&Y)return{aiAgentName:Mo,headline:Uo,subheadline:jo,promptChips:be,composer:{currentInput:ge,isSubmitting:ee,isFileUploadEnabled:q,onInputChange:ne,onSubmit:Ze,onStopSubmit:Ee},onPromptClick:te,onOpenSidePanel:Ye,onOpenFullView:Be,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[ge,x,ue,Y,q,ee,ne,Be,Ye,te,Ee,Ze,be])}({hasAnyPolicies:L,isChargeCardAdmin:b,isFileUploadEnabled:R}),C=D&&l!=null?c.jsx(fr,{...l}):null,N=d&&C==null,G=r.useCallback(()=>{const I=_e(n.state?.pathnameStackToGoBack),x=I.poppedPathname??"..";e(x,{state:{pathnameStackToGoBack:I.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),U=r.useCallback(I=>{t!=null&&e(`/${t}/cards/policy/${I}/edit`)},[e,t]),z=r.useCallback(I=>{a(Es(I))},[a]),Z=P.fetchState.fetchState;return!L&&Z!=="Completed"&&Z!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Wc,{onBackClick:G,onNewPolicyClick:O,onClickMenuIcon:i,isAiCfoAccessEnabled:d,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(qc,{policies:y,archivingTemplateId:P.archiveTargetTemplateId,pendingCreationCount:w,onBackClick:G,onNewPolicyClick:O,onEditPolicyClick:U,onArchivePolicyClick:z,onClickMenuIcon:i,policyAiCfoHero:C,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})}function Ho(){const e=de(),{cardId:n}=Me(),t=pe(),a=re.getSignedInUser(),s=o(W=>fe(W)),b=Fe(),f=Pe(b?.loggedInUserRoleMap),{useFeatureGate:g}=le();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,i]=r.useState(!1),m=o(W=>Qa(W).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const R=s.userRole.includes("charge_card_user"),{isFeatureEnabled:D}=g(K.isChargeCardFeatureEnabled),d=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=g(K.isDebitCardFeatureEnabled),P=we(s),B=ve(s),p=Te(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=Re({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),u=xe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:D,isBookKeepingTenant:B,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:h}),T=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(W=>ca(W,s.companyId)),M=oa(k.controllers),{creditAccount:A,creditAccountRepayment:y}=o(W=>ia(W)),L=o(W=>W.classListState.fetchState),l=!R&&u&&d,C=o(W=>Dt(W,n,l,u)),[N,G]=r.useState(!1),O=C.chargeCard,U=O?.cardCreatedByUser?.userId,z=o(W=>U!=null?za(W.userRoleState,U):void 0),Z=z?.accountingClassIDs[0],I=o(W=>Z!=null?Za(W.classState,{classId:Z,reportId:"class_list"}):void 0),x=O?.cardHolderUser?.userId,Y=o(W=>x!=null?za(W.userRoleState,x):void 0),q=Y?.accountingClassIDs[0],E=o(W=>q!=null?Za(W.classState,{classId:q,reportId:"class_list"}):void 0),V=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",Q=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{m&&_===!1&&V&&(i(!0),setTimeout(()=>{t(Ya()),Q&&t(Qe({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[m,_,V,Q]),r.useEffect(()=>{N||C.fetchState==="Completed"||C.fetchState==="In-Progress"||n==null||(G(!0),t(ka(n,l,!1)))},[N,C,n,t]),r.useEffect(()=>{if(C.fetchState==="Completed"&&(V===!1||V&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||m===!1&&_===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const W=Ae(s.tenantEmailDomain,n,a,O,m);e(W)}},[C.fetchState,m,V]),r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&d&&f&&t(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&u&&d&&f&&t(_t()),L!=="Completed"&&L!=="In-Progress"&&t(Mn())},[A.fetchState,y.fetchState,t,u,d,f,L]);const X=()=>{if(a!=null&&n!=null){t(Ya());const W=Ae(s.tenantEmailDomain,n,a);e(W)}},S=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",F=Je(u,w,T,d),v=xa(u,d,f,A,y),ee=Ir(S,C);return C.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:m}),c.jsx(Qc,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:d,productInformation:F,creditAccountInformation:v,debitAccountInformation:ee,chargeCardDetailView:C,creditAccount:A,classListFetchState:L,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:I?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ut=e=>{const{events:n,onEvent:t,onSubscribed:a}=e,s=Jc(),b=r.useRef(t),f=r.useRef(a),g=r.useRef(0);r.useEffect(()=>{b.current=t},[t]),r.useEffect(()=>{f.current=a},[a]);const _=r.useMemo(()=>[...n].sort().join("|"),[n]);r.useEffect(()=>{if(s==null||n.length===0)return;const i=[],m=new Set,R=()=>{if(f.current==null)return;const D=Date.now();D-g.current<5e3||(g.current=D,f.current())};return n.forEach(D=>{const[d,j]=Xc(D);if(j==="")return;const P=s.channel(d),B=h=>{b.current(j,h)};let p;if(P?.subscribed===!0)p=P,p.bind(j,B),m.has(d)||(m.add(d),R()),i.push(()=>{P.unbind(j,B)});else{if(p=P??s.subscribe(d),p.bind(j,B),!m.has(d)){m.add(d);const h=()=>{R()};p.bind("pusher:subscription_succeeded",h),i.push(()=>{p.unbind("pusher:subscription_succeeded",h)})}i.push(()=>{p.unbind(j,B)})}}),()=>{i.forEach(D=>D())}},[s,_])},vr="charge-card-transaction-update",Tr="charge-card-transaction-created",Fr="charge-card-transaction-declined",Rr="charge-card-transaction-updated",xr="charge-card-transaction-receipt-uploaded",ma="charge-card-status-update",jt="charge-card-spending-updated",it="credit-account-balance-updated",dt="charge-card-created",Mt="charge-card-limit-updated",Nt="charge-card-limit-reset",Vt="charge-card-renamed",Go="charge-card-department-updated",Br="charge-card-repayment-completed",Lr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",La="charge-card-cashback-earned",Ca=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),$o=[La,Ba],zo=De(function(e){const n=da(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(As({uiState:{sortKey:n,sortOrder:t}}))}}})(ao);function Zo(){const e=de(),n=pe(),t=Ce(),a=re.getSignedInUser(),s=o(j=>fe(j)),{useFeatureGate:b}=le(),{isFeatureEnabled:f}=b(K.isCardsCommentingEnabled),[g,_]=r.useState(!1),i=o(j=>da(j)),m=Dr(s.companyId,{clearParams:i.fetchState==="Completed"}),R=r.useCallback(()=>{const j=_e(t.state?.pathnameStackToGoBack),P=j.poppedPathname??Yo(s.tenantEmailDomain);e(P,{state:{pathnameStackToGoBack:j.newStack}})},[e,t,s.tenantEmailDomain]),D=Xe(s);if(Ut({events:Ca(D,$o),onEvent:j=>{switch(j){case La:case Ba:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{g||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(_(!0),n(_a()))},[g,i,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const d=i.cashbackSummary?.cashbackEarned?.amount!=null&&i.fetchState!=="Not-Started";return i.fetchState!=="In-Progress"||d?(i.cashbackSummary?.cashbackEarned?.amount??0)===0&&i.fetchState==="Completed"?c.jsx(ot,{}):c.jsx(zo,{onBackClick:R,isCardsCommentingEnabled:f,initialOpenThreadRequest:m}):c.jsx(eo,{onBackClick:R})}const Yo=e=>`/${e}/cards`,Ko={containerWidth:new Fa(100,58)},Wo=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f}=le(),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[R,D]=r.useState(!1),[d,j]=r.useState(!1),P=re.getSignedInUser();if(P==null)throw Error("Can't access onboarding card page without signing in...");const B=o(E=>fe(E));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=f(ze.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,w=o(E=>Ds(E,s)),u=w.chargeCard,T=o(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:k}=le(),{isFeatureEnabled:M}=k(K.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(K.isDebitCardFeatureEnabled),y=Te(A,B),L=Re({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:y}),l=!!B.companyChargeCardInfo?.info?.isChargeCardEnabled,C=B.userRole.includes("charge_card_user"),N=we(B),G=ve(B),O=B.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=xe({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:O}),z=!C&&U&&l;r.useEffect(()=>{g===!1&&T!=="In-Progress"&&T!=="Completed"&&(t(Ja()),_(!0)),i===!1&&w.fetchState==="Not-Started"&&(m(!0),t(ka(s,z,U)))},[i,w.fetchState,g,T]);const Z=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(R===!1&&(Z===!1||Z&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==P.userId)){const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);a(E,{state:{pathnameStackToGoBack:V}})}else if(R&&w.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(_s({chargeCardId:s}));const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(E,{state:{pathnameStackToGoBack:V}})}}},[w.fetchState,u?.type.code,R,w.isRefreshingViewInBackground]);const I=re.getZeniOtpTokenForCardHolder(s),x=o(E=>Nn(E.userState,P.userId)),Y=()=>{u?.status?.code!=="active"&&t(ga(s,!0))};r.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&R===!1&&(setTimeout(Y,3e3),D(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const q=E=>{j(E)};if(T!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(x?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Jo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:d,handleDrawerToggle:q}),c.jsx(qo,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:x.phone,signedInUser:P,isSandboxEnv:Ft(),chargeCardDetailState:w,signedInUserToken:I,navigate:a,currentTenant:B,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?c.jsx(Qo,{windowSize:n,children:e}):null]})},qo=De(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=Ps(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const f=Vn(e,s),g=n.updateStatus,_=la(e,!1,!1,!1);let i=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(i=!0);const m=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(ws())||m,showMenuIcon:i,shippingAddress:b,vgsVaultId:st.cardVaultId,twoFAView:f,activationWaitStatus:g,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:i=>{e(Ts(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onCVVActivateSuccess:()=>{e(vs({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("onboard")===!0?ea(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(to),Qo=Ne.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Ko.containerWidth.value(e.windowSize)}%`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-DtJmjn-F.js";import{a as g}from"./sentry-DJoVhts9.js";import{h as w,u as T,g as k,i as x,j as O,n as E}from"./core-B1V19BTM.js";import{z as N,b9 as F,w as P,e as V,g as j,af as C,ba as L,at as A,au as U,n as B}from"./index-B1BV6O_s.js";import{eT as D,ge as M,tm as _,g9 as R,c3 as z,Op as G,bn as Y,rv as Z,rj as q,kZ as H,my as S,Oq as $,bE as J,cw as b,mI as K,mL as Q}from"./zeni-epic-state-Ct7fOB-u.js";import"./mui-D6ES9V4N.js";import{d as W}from"./routePaths-BaN0YLzj.js";import{M as X}from"./MobileAppDrawer-DY_LJNf1.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="0e4caf7c-992b-46dd-9f7f-e78ae05c5062",t._sentryDebugIdIdentifier="sentry-dbid-0e4caf7c-992b-46dd-9f7f-e78ae05c5062")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),p=D(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:l,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:p,navigate:c,location:l}=a,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(H({files:e}))},onDeleteFile:e=>{t(q(e))},onEditFileName:(e,n)=>{t(Z(e,n.split(".")[0]))}}})(L);function de(){const t=w(),a=T(),i=k(),{tenantEmailDomain:p}=x(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(p)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(l(!0),a(M(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-DtJmjn-F.js";import{a}from"./sentry-DJoVhts9.js";import{u as D,g as v,j as m,N as w}from"./core-B1V19BTM.js";import{L6 as A,eT as O,fA as L,o2 as _,gn as h,fz as j,f6 as U,Ld as F}from"./zeni-epic-state-Ct7fOB-u.js";import{u as $,z as f,L as g,O as k,o as z}from"./index-B1BV6O_s.js";import{n as H}from"./mui-D6ES9V4N.js";import{t as R}from"./getLocaleForTenant-BaJta4jx.js";import{g as P,Q as G}from"./QBOConnectionScreen-Bn0720kQ.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./empty-DJY9ZnQE.js";import"./pdf-lib-D3JDQVpu.js";import"./index-BWk0p_4u.js";import"./url-Dh3D7a-t.js";import"./index-Cd64f4Pj.js";import"./decodeURIComponentSafe-62zSMNJP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="a9a9fb66-2dd1-4fb1-9c31-a159376c72a5",t._sentryDebugIdIdentifier="sentry-dbid-a9a9fb66-2dd1-4fb1-9c31-a159376c72a5")}catch{}})();const Q=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-DtJmjn-F.js";import{z as n}from"./index-B1BV6O_s.js";import{g as d}from"./QBOConnectionScreen-Bn0720kQ.js";import"./sentry-DJoVhts9.js";import{g as p,N as s}from"./core-B1V19BTM.js";import"./zeni-epic-state-Ct7fOB-u.js";import"./recharts-C_sYuD8f.js";import"./mui-D6ES9V4N.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./empty-DJY9ZnQE.js";import"./pdf-lib-D3JDQVpu.js";import"./index-BWk0p_4u.js";import"./url-Dh3D7a-t.js";import"./index-Cd64f4Pj.js";import"./decodeURIComponentSafe-62zSMNJP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-CxS9lLTl.js → CustomerOnboardingRoutes-_VvrC-ga.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-DtJmjn-F.js";import{t as Me,A as Ce}from"./AddressScreen-C3jTD0QX.js";import $e from"./NotFoundScreen-98Ef_Sqs.js";import{a as g}from"./sentry-DJoVhts9.js";import{h as oe,g as se,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as qe,p as z}from"./core-B1V19BTM.js";import{s as de,A as le,z as B,a as ue,m as Qe,d as _,n as V,w as H,e as N,B as je,g as X,ap as Ke,J as Ze,aq as ke,i as te,ar as Je,as as Ie,o as He,at as We,au as Ee,av as Xe}from"./index-B1BV6O_s.js";import{bn as Ye,eT as ee,fs as et,fa as pe,f8 as me,bt as tt,o0 as at,fo as nt,bO as ot,k1 as ae,k4 as ve,LC as st,bU as it,c3 as ge,tA as fe,tl as rt,M5 as Y,tB as _e,Jv as ct,l5 as Ue,M6 as Ve,M7 as dt,M8 as lt,M9 as ut,j$ as pt,k2 as mt,tn as Be,tz as gt,bE as xe,cw as ft,tN as Te,rv as ht,rj as yt,kZ as St,gc as bt,gb as Ct,ga as kt,Ma as It,tf as Et,tO as xt,tR as Tt,tU as Ot,t_ as At,cU as Pt}from"./zeni-epic-state-Ct7fOB-u.js";import{n as he}from"./mui-D6ES9V4N.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-Bn0720kQ.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./empty-DJY9ZnQE.js";import"./pdf-lib-D3JDQVpu.js";import"./index-BWk0p_4u.js";import"./url-Dh3D7a-t.js";import"./index-Cd64f4Pj.js";import"./decodeURIComponentSafe-62zSMNJP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="452f1e0d-5c3c-4aa3-af8c-3d813c5df2e2",t._sentryDebugIdIdentifier="sentry-dbid-452f1e0d-5c3c-4aa3-af8c-3d813c5df2e2")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=Qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),M=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),A=me(c),P=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,Q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),$===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),Q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{S(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:M,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-PtDFv95_.js";import{t as Me,A as Ce}from"./Addre
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,Pe=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:f,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(At(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:I,email:x,ssn:T,nationalityCountryCode:k,dob:h,phone:U,syncToken:C,selectDocument:F,role:M,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:f,userId:m,firstName:I.firstName,lastName:I.lastName,email:x,ssn:T,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:h!=null?xe(h?.toString()):h,syncToken:C,titleAtCompany:M.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:I,companyWebsite:x,companyPhone:T,primaryContactEmail:k,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:M,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:
|
|
19
|
+
`,Pe=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:f,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(At(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:I,email:x,ssn:T,nationalityCountryCode:k,dob:h,phone:U,syncToken:C,selectDocument:F,role:M,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:f,userId:m,firstName:I.firstName,lastName:I.lastName,email:x,ssn:T,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:h!=null?xe(h?.toString()):h,syncToken:C,titleAtCompany:M.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:I,companyWebsite:x,companyPhone:T,primaryContactEmail:k,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:M,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:A,regulatedStatus:P,regulatedStatusDescription:K,transactionVolume:$,transactionVolumeDescription:q,usNexus:v,usNexusTypes:Q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:x!=""&&x!=null?ft(x):void 0,phone:T,syncToken:F,fileIds:M,incDate:w!=null?xe(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(J=>J.length===2?J:Ee(J))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:K,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:Q?.selectedOptions??[]},Z={userId:U,firstName:h.firstName,lastName:h.lastName,email:k,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Me(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Je),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:x}=re(),T=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:h}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),M=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),R=ke(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:b,realmId:G,state:j}=Dt(d.search),A=c.externalConnections?.accounting[0],P=A?.connectionType,K=A?.connectionName,$=A?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(b,G,j,$,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:K??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:$,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[b,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(x)?.companyId,Q=ge(c?.userRole??[]),l=D(y=>fe(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!M.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const J=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(h,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(X.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return J===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=he.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
height: 100vh;
|
|
22
22
|
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Xe),
|
|
23
|
+
`,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),x=me(i),T=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||f?T==="Completed"&&k===!0&&f&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):T==="Completed"&&k===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:T}):I?a.jsx(E,{to:"../../checking"}):x?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx($e,{})})]})}export{oa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-PtDFv95_.js";import{i as K,j as S,g as H,u as z,h as W,n as te,k as ca,o as Ct,p as O}from"./core-BZimyUuM.js";import{eT as N,Mq as Xe,bE as la,bq as De,ND as Pn,iT as Fn,NE as Zt,NF as Rn,iW as kt,NG as Qe,NH as Bn,i$ as jn,NI as Qt,NJ as Mn,j3 as St,NK as He,NL as Ln,cm as vt,NM as Nn,NN as Un,MK as Gn,jX as Vn,NO as Yn,bn as Ue,NP as da,Me as ie,bc as ua,k9 as ma,oa as pa,jU as ha,Mg as ce,Mf as ee,eS as fa,e$ as $n,fC as _t,NQ as zn,NR as Kn,NS as ga,NT as Be,vz as Ge,vA as Ve,vX as xe,vR as le,vE as Ye,NU as qn,NV as Zn,NW as Qn,NX as ba,NY as je,NZ as Hn,dG as Je,s3 as Ca,N_ as Wn,N$ as Xn,O0 as Jn,O1 as At,LE as It,kp as we,w3 as Et,sb as eo,O2 as to,vB as Ht,s6 as Ee,s2 as ka,O3 as ge,O4 as ao,O5 as Tt,LD as Dt,u2 as Sa,O6 as no,O7 as oo,O8 as so,O9 as xt,uf as ro,Oa as io,vD as Wt,u1 as _a,Ob as be,Oc as co,bt as ya,w7 as va,Od as lo,Oe as uo,Of as mo,Og as wt,w2 as po,Oh as ho,vC as Xt,w6 as Aa,Oi as Ce,Oj as fo,Ok as go,Ol as Ia,ke as Ea,o7 as Ta,kj as Da,o5 as xa,o4 as wa,o3 as Oa,tq as bo,fs as Co,cO as ko,cP as So,o0 as _o,fo as yo,oh as vo,FP as ut,FH as Ao,FL as Io,Om as Eo,On as To,Oo as Do,b5 as et,fg as xo,hA as wo,ge as Oo,ob as Po,jN as Fo,o8 as Ro,o6 as Bo,fa as jo,f8 as Mo}from"./zeni-epic-state-D1RAQ_Ab.js";import{z as M,a2 as ae,q as x,d as D,O as q,aV as Lo,Y as $e,v as ze,aW as Pa,f as Y,aX as No,A as Se,aY as Fa,a as _e,x as R,m as Uo,aZ as Go,a_ as Vo,V as Ra,J as Ba,c as ja,X as Yo,a$ as $o,M as zo,aN as Ma,_ as oe,b0 as La,b1 as Na,a1 as Ua,b2 as Ko,b3 as qo,aq as Zo,p as Qo,W as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as ke}from"./index-aKhhTDIh.js";import{n as Ot}from"./mui-BcLZDyi8.js";import{a as b}from"./sentry-mCXLUbmc.js";import{w as Ga}from"./withTransactionSidePanel-CCFVon-p.js";import{c as Va,t as Oe,f as de,a as Pt,v as ts}from"./routePaths-DQbleX1q.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-BY9akMo_.js";import Ne from"./NotFoundScreen-BVW1mHQl.js";import{u as Ft}from"./useInitialThreadRequest-ClxKOF2S.js";import{t as Ya}from"./analyticsHelper-DO0i_Ozz.js";import{C as as}from"./CompanyPassportScreen-BOxFkTz6.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-C07ZgQEG.js";import{F as os}from"./FeaturePreviewScreen-AUOPnl37.js";import{R as ss}from"./ReferralListScreen-DxoomfXt.js";import"./recharts-Nefi66IQ.js";import"./analytics-CVef-z80.js";import"./plaid-CooQT--5.js";import"./dnd-Ck7mLEKI.js";import"./stripe-DMRn4zHo.js";import"./lottie-D7iBAvwy.js";import"./lexical-D_s6IbSB.js";import"./pdf-CPbk6pQ4.js";import"./utils-C9yOAUzR.js";import"./TransactionDetailScreen-BOsA-UF4.js";import"./decodeURIComponentSafe-CfH0YvB4.js";import"./MobileAppDrawer-CLztF99b.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="276001d5-2ce7-47d4-9ba3-268f5b2cda9f",e._sentryDebugIdIdentifier="sentry-dbid-276001d5-2ce7-47d4-9ba3-268f5b2cda9f")}catch{}})();const rs=Ga(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),c=S(v=>N(v)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?la(r):De(),[r]),p=z(),f=W(),A=S(v=>Pn(v,h,o)),I=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Fn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),T=b.useCallback((v,B)=>{p(Zt({sortKey:v,sortOrder:B}))},[]),E=b.useCallback(v=>{p(Zt({downloadState:v}))},[]),L=b.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(m!=null){const B=Va({id:v.transactionId,type:v.transactionType},m);f(B);const X=x(g.state?.pathnameStackToGoBack,g.pathname);f(B,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&D.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Lo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:D,onTransactionClick:L,onReload:I,onBackClick:_,onColumnSortConfigChanged:T,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(T=>Rn(T)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(T=>T.tenantState.currentTenantId),i=S(T=>N(T)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??De(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(T=>{e(Qe({searchString:T}))},[]),p=b.useCallback((T,E)=>{e(Qe({sortKey:E,sortOrder:T}))},[]),f=b.useCallback(T=>{a(`./${T}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(T=>{e(Qe({downloadState:T}))},[]),I=b.useCallback((T,E)=>{},[]),_=b.useCallback((T,E)=>{e(Qe({selectedDate:T,agingDateSelectionType:E})),e(kt(T))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:D,onLoad:T=>T.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:D,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:_,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ga(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(k=>N(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?la(r):De(),[r]),h=z(),p=W(),f=S(k=>Bn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((k,v)=>{h(Qt({sortKey:k,sortOrder:v}))},[]),T=b.useCallback(k=>{h(Qt({downloadState:k}))},[]),E=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const v=Va({id:k.transactionId,type:k.transactionType},c);p(v);const B=x(m.state?.pathnameStackToGoBack,m.pathname);p(v,{state:{pathnameStackToGoBack:B}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&D.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(No,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:D,onTransactionClick:E,onReload:A,onBackClick:I,onColumnSortConfigChanged:_,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(_=>Mn(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(_=>N(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??De(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(He({searchString:_}))},[]),h=b.useCallback((_,T)=>{e(He({sortKey:T,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(He({downloadState:_}))},[]),A=b.useCallback((_,T)=>{e(He({selectedDate:_,agingDateSelectionType:T})),e(St(_))},[]),I=b.useCallback((_,T)=>{e(Ln({nodeId:_,isCollapsed:T}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:D,onLoad:_=>_.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:D,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},$a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function za(e,a){const t=Gn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Oe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Vn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?D.trackZeniAccountsCashBalancePromoClicked("Move Money"):(D.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else D.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=te(function(e){const a=Nn(e).accountsInOrder.map((n,o)=>$a(n,o)),t=Un(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:D}},za)(Fa),us=te(function(e){const a=Yn(e).accountsInOrder.map((o,r)=>$a(o,r)),t=M.getSignedInUser(),n=Ue(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:D}},za)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>N(s).company?.companyInfo.firstMonthOfFY??1),r=vt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ne,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=vt(n?.loggedInUserRoleMap),r=S(s=>N(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ne,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=Ot.div`
|
|
1
|
+
import{j as d}from"./liveblocks-DtJmjn-F.js";import{i as K,j as S,g as H,u as z,h as W,n as te,k as ca,o as Ct,p as O}from"./core-B1V19BTM.js";import{eT as N,Mq as Xe,bE as la,bq as De,ND as Pn,iT as Fn,NE as Zt,NF as Rn,iW as kt,NG as Qe,NH as Bn,i$ as jn,NI as Qt,NJ as Mn,j3 as St,NK as He,NL as Ln,cm as vt,NM as Nn,NN as Un,MK as Gn,jX as Vn,NO as Yn,bn as Ue,NP as da,Me as ie,bc as ua,k9 as ma,oa as pa,jU as ha,Mg as ce,Mf as ee,eS as fa,e$ as $n,fC as _t,NQ as zn,NR as Kn,NS as ga,NT as Be,vz as Ge,vA as Ve,vX as xe,vR as le,vE as Ye,NU as qn,NV as Zn,NW as Qn,NX as ba,NY as je,NZ as Hn,dG as Je,s3 as Ca,N_ as Wn,N$ as Xn,O0 as Jn,O1 as At,LE as It,kp as we,w3 as Et,sb as eo,O2 as to,vB as Ht,s6 as Ee,s2 as ka,O3 as ge,O4 as ao,O5 as Tt,LD as Dt,u2 as Sa,O6 as no,O7 as oo,O8 as so,O9 as xt,uf as ro,Oa as io,vD as Wt,u1 as _a,Ob as be,Oc as co,bt as ya,w7 as va,Od as lo,Oe as uo,Of as mo,Og as wt,w2 as po,Oh as ho,vC as Xt,w6 as Aa,Oi as Ce,Oj as fo,Ok as go,Ol as Ia,ke as Ea,o7 as Ta,kj as Da,o5 as xa,o4 as wa,o3 as Oa,tq as bo,fs as Co,cO as ko,cP as So,o0 as _o,fo as yo,oh as vo,FP as ut,FH as Ao,FL as Io,Om as Eo,On as To,Oo as Do,b5 as et,fg as xo,hA as wo,ge as Oo,ob as Po,jN as Fo,o8 as Ro,o6 as Bo,fa as jo,f8 as Mo}from"./zeni-epic-state-Ct7fOB-u.js";import{z as M,a2 as ae,n as x,e as D,O as q,aV as Lo,_ as $e,w as ze,aW as Pa,g as Y,aX as No,A as Se,aY as Fa,a as _e,d as R,m as Uo,aZ as Go,a_ as Vo,V as Ra,J as Ba,c as ja,Z as Yo,a$ as $o,T as zo,aN as Ma,$ as oe,b0 as La,b1 as Na,a1 as Ua,b2 as Ko,b3 as qo,aq as Zo,p as Qo,X as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as ke}from"./index-B1BV6O_s.js";import{n as Ot}from"./mui-D6ES9V4N.js";import{a as b}from"./sentry-DJoVhts9.js";import{w as Ga}from"./withTransactionSidePanel-CUAVvG-3.js";import{c as Va,t as Oe,f as de,a as Pt,v as ts}from"./routePaths-BaN0YLzj.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import Ne from"./NotFoundScreen-98Ef_Sqs.js";import{u as Ft}from"./useInitialThreadRequest-BrZkGF4L.js";import{t as Ya}from"./analyticsHelper-BkTwMm2V.js";import{C as as}from"./CompanyPassportScreen-DNxF2lkY.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-B-gQ2ZCu.js";import{F as os}from"./FeaturePreviewScreen-KfiUQgFU.js";import{R as ss}from"./ReferralListScreen-B9-Pm2jb.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./TransactionDetailScreen-idWMKJZo.js";import"./decodeURIComponentSafe-62zSMNJP.js";import"./MobileAppDrawer-DY_LJNf1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="af317b8c-2165-4d64-b55d-ec15bc0ad40e",e._sentryDebugIdIdentifier="sentry-dbid-af317b8c-2165-4d64-b55d-ec15bc0ad40e")}catch{}})();const rs=Ga(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),c=S(v=>N(v)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?la(r):De(),[r]),p=z(),f=W(),A=S(v=>Pn(v,h,o)),I=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Fn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),T=b.useCallback((v,B)=>{p(Zt({sortKey:v,sortOrder:B}))},[]),E=b.useCallback(v=>{p(Zt({downloadState:v}))},[]),L=b.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(m!=null){const B=Va({id:v.transactionId,type:v.transactionType},m);f(B);const X=x(g.state?.pathnameStackToGoBack,g.pathname);f(B,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&D.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Lo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:D,onTransactionClick:L,onReload:I,onBackClick:_,onColumnSortConfigChanged:T,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(T=>Rn(T)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(T=>T.tenantState.currentTenantId),i=S(T=>N(T)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??De(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(T=>{e(Qe({searchString:T}))},[]),p=b.useCallback((T,E)=>{e(Qe({sortKey:E,sortOrder:T}))},[]),f=b.useCallback(T=>{a(`./${T}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(T=>{e(Qe({downloadState:T}))},[]),I=b.useCallback((T,E)=>{},[]),_=b.useCallback((T,E)=>{e(Qe({selectedDate:T,agingDateSelectionType:E})),e(kt(T))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:D,onLoad:T=>T.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:D,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:_,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ga(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(k=>N(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?la(r):De(),[r]),h=z(),p=W(),f=S(k=>Bn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((k,v)=>{h(Qt({sortKey:k,sortOrder:v}))},[]),T=b.useCallback(k=>{h(Qt({downloadState:k}))},[]),E=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const v=Va({id:k.transactionId,type:k.transactionType},c);p(v);const B=x(m.state?.pathnameStackToGoBack,m.pathname);p(v,{state:{pathnameStackToGoBack:B}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&D.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(No,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:D,onTransactionClick:E,onReload:A,onBackClick:I,onColumnSortConfigChanged:_,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(_=>Mn(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(_=>N(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??De(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(He({searchString:_}))},[]),h=b.useCallback((_,T)=>{e(He({sortKey:T,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(He({downloadState:_}))},[]),A=b.useCallback((_,T)=>{e(He({selectedDate:_,agingDateSelectionType:T})),e(St(_))},[]),I=b.useCallback((_,T)=>{e(Ln({nodeId:_,isCollapsed:T}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:D,onLoad:_=>_.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:D,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},$a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function za(e,a){const t=Gn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Oe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Vn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?D.trackZeniAccountsCashBalancePromoClicked("Move Money"):(D.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else D.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=te(function(e){const a=Nn(e).accountsInOrder.map((n,o)=>$a(n,o)),t=Un(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:D}},za)(Fa),us=te(function(e){const a=Yn(e).accountsInOrder.map((o,r)=>$a(o,r)),t=M.getSignedInUser(),n=Ue(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:D}},za)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>N(s).company?.companyInfo.firstMonthOfFY??1),r=vt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ne,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=vt(n?.loggedInUserRoleMap),r=S(s=>N(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ne,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=Ot.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-DtJmjn-F.js";import{a as u}from"./sentry-DJoVhts9.js";import{u as y,j as b,n as A,g as w,N as L}from"./core-B1V19BTM.js";import{L6 as N,eT as _,fA as U,L7 as k,o2 as R,L8 as z}from"./zeni-epic-state-Ct7fOB-u.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{t as P}from"./getLocaleForTenant-BaJta4jx.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="ab1db5a0-1f88-4749-8c83-3457072bd43a",t._sentryDebugIdIdentifier="sentry-dbid-ab1db5a0-1f88-4749-8c83-3457072bd43a")}catch{}})();const Q=A(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-DtJmjn-F.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-B1V19BTM.js";import{P6 as k,Pd as J,gc as M,gb as W,ga as q,jm as K,Mf as L,rm as Q,eT as V,OE as D,jk as T,P7 as S,Pg as F,ji as j,jF as G}from"./zeni-epic-state-Ct7fOB-u.js";import{bw as X,J as R,a as N,z as U,m as O,p,d as v,B as Z,bx as Y,o as z,by as ee,n as te}from"./index-B1BV6O_s.js";import{n as H}from"./mui-D6ES9V4N.js";import"./sentry-DJoVhts9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f9396b2-2112-44ea-b8f1-c8d50f72233f",e._sentryDebugIdIdentifier="sentry-dbid-7f9396b2-2112-44ea-b8f1-c8d50f72233f")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(W(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(M(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(J(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,oe=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(j(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??A();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??A(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=N(),c=U.getSignedInUser(),b=h(u=>V(u)),g=O(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const A=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},$=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return $(e,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,ie=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(G(r))},onSaveHandler:r=>{e(j(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(F({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??E();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=N(),b=O(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-DtJmjn-F.js";import{J as l,D as f,m as c}from"./index-B1BV6O_s.js";import{D as p}from"./mui-D6ES9V4N.js";import"./sentry-DJoVhts9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="f80a1875-1e31-48de-8a1f-266d8b89633c",e._sentryDebugIdIdentifier="sentry-dbid-f80a1875-1e31-48de-8a1f-266d8b89633c")}catch{}})();const u={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{m as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DtJmjn-F.js";import{a as d}from"./sentry-DJoVhts9.js";import{h as A,u as B,g as G,i as N,j as l,N as q,n as F,o as O,p as R}from"./core-B1V19BTM.js";import{Nm as _,eT as J,ML as W,lp as Y,Jo as k,Nr as $,Me as z,kp as L,Jp as S,MQ as Q,MR as V,Mg as H,Mf as K}from"./zeni-epic-state-Ct7fOB-u.js";import{aS as U,e as X,p as Z,n as tt}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{d as b}from"./decodeURIComponentSafe-62zSMNJP.js";import{w as et}from"./withTransactionSidePanel-CUAVvG-3.js";import{f as at,c as nt}from"./routePaths-BaN0YLzj.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import"./TransactionDetailScreen-idWMKJZo.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="2caeaa62-6f33-4c8b-8ab5-98a7b91afa6e",a._sentryDebugIdIdentifier="sentry-dbid-2caeaa62-6f33-4c8b-8ab5-98a7b91afa6e")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:L(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(K("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Q()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=N(),r=b(w??""),p=b(x??""),f=rt(r,p),M=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),j=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>W(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(M.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(O,{children:s.jsx(R,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
|