@zeniai/web-app-ui 5.3.45-qa → 5.3.46-qa
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/{AccountMappingScreen-EqyOLk0W.js → AccountMappingScreen-BT617fFT.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-B_Hxuz1x.js → ActualMatchingMatchDetailScreen-B8f2yDaP.js} +1 -1
- package/dist/assets/AddressRoutes-kiur36N3.js +1 -0
- package/dist/assets/AddressScreen-5ZLJ7_Lf.js +9 -0
- package/dist/assets/{AiCfoScreen-DgiomMQs.js → AiCfoScreen-CW5K1JhC.js} +1 -1
- package/dist/assets/{AppDrawer-C9JSspSl.js → AppDrawer-D5UtqVeE.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CtPNwVvl.js → BillPayApprovalRoutes-DwyJret-.js} +1 -1
- package/dist/assets/{BillPayRoutes-Duz6Vx7D.js → BillPayRoutes-DFm7lkFc.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BAWcvg1q.js → BusinessVerificationPageScreen-BL6H7JF-.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-C-_PDYQc.js +14 -0
- package/dist/assets/{ChargeCardRoutes-B08xwpTq.js → ChargeCardRoutes-Brg8E0b9.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-CbwVCSdf.js → CompanyPassportScreen-CEuR94fF.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BcoTZa8L.js → ConnectionAuthScreen-uvgGU2za.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-C-d3MNce.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BP006ys9.js → CustomerOnboardingRoutes-BffNdH_l.js} +3 -3
- package/dist/assets/{DashboardRoutes-DKsy8kjy.js → DashboardRoutes-CdQzvjb3.js} +1 -1
- package/dist/assets/{DefaultTenantHome-h9sstg-6.js → DefaultTenantHome-Bve2xDaJ.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DdrkO-LG.js → DomesticWireDetailScreen-Dj3JCDGh.js} +3 -3
- package/dist/assets/DrawerScreen-CxKP-6Rf.js +1 -0
- package/dist/assets/{EntityDetailRoutes-TJfEMlzp.js → EntityDetailRoutes-CRL6OrqO.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-FRK8lYq7.js → ExpenseAutomationRoutes-BYSJ88to.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-R_rh5xYj.js → FeaturePreviewScreen-LeLfD5pA.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-Bf48Zrcv.js → HubSpotOAuthCallbackScreen-DAHGdPOy.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-CMirleoY.js → InboxNotificationsProvider-gj6fT2eX.js} +1 -1
- package/dist/assets/{InvoicingRoutes-D9DMbY6F.js → InvoicingRoutes-CvkWcLdT.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DVS2kuyq.js → MagicLinkRoutes-CC75kCuL.js} +6 -6
- package/dist/assets/MagicLinkSignInScreen-CWvMyhrQ.js +12 -0
- package/dist/assets/{MobileAppDrawer-DEm85bH8.js → MobileAppDrawer-DExJFFmi.js} +1 -1
- package/dist/assets/NotFoundScreen-sryCVGSu.js +1 -0
- package/dist/assets/{NotificationRoutes-DlVY8cS0.js → NotificationRoutes-njgUFBoj.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-0eyA85wD.js → OAuthConsentScreen-BCgV9bma.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-Ciu8QGi3.js → PandLWithForecastRoutes-CZ27RjQE.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-DSvOcNW8.js → PaymentLinkScreen-BrTP8y76.js} +1 -1
- package/dist/assets/{PeopleRoutes-B29gnv2-.js → PeopleRoutes-CulbMsz3.js} +9 -9
- package/dist/assets/{PerformanceRoutes-C-oSemZm.js → PerformanceRoutes-BYcI02aB.js} +1 -1
- package/dist/assets/{Preview-DPyEVqHc.js → Preview-j2_daqeV.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CUhLSYvc.js → QBOConnectionScreen-CbxnK800.js} +23 -23
- package/dist/assets/{ReimbursementApprovalRoutes-CS9p1qcB.js → ReimbursementApprovalRoutes-DeN7vJtz.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CJnxkFoz.js → ReimbursementApprovalRuleDetailScreen-DTKS2oJ9.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DaGg2TTR.js → ReimbursementRoutes-_NvdZWfU.js} +1 -1
- package/dist/assets/{ReportsRoutes-BsvYUCIx.js → ReportsRoutes-BAGPRsE0.js} +1 -1
- package/dist/assets/RewardsRoutes-BUOCW-CT.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CJ28c5Wc.js → ScheduleDetailsPrepaidExpensesScreen-B5q5sAGy.js} +4 -4
- package/dist/assets/{ScreenRoutes-Lei7nnrR.js → ScreenRoutes-BHHy1uXx.js} +2 -2
- package/dist/assets/{SettingsRoutes-DJiPiJIZ.js → SettingsRoutes-BtUbt9zq.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BzPNt5Xb.js → SetupPagesScreen-D0fdMGb4.js} +1 -1
- package/dist/assets/SignInScreen-5_sPhLr0.js +1 -0
- package/dist/assets/SignOutScreen-DrcdcbqC.js +9 -0
- package/dist/assets/TaskListScreen-OEgAVE9M.js +9 -0
- package/dist/assets/{TaskRoutes-BAifN0A-.js → TaskRoutes-DpYRDMWP.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-eA90CTkf.js +1 -0
- package/dist/assets/{TransactionDetailScreen-C32uKUIF.js → TransactionDetailScreen-CjwF3ORf.js} +2 -2
- package/dist/assets/{TransactionListRoutes-Ebou9bMl.js → TransactionListRoutes-2fGCqEq5.js} +1 -1
- package/dist/assets/{TreasuryRoutes-Bq4RVae3.js → TreasuryRoutes-CuPpvoic.js} +5 -5
- package/dist/assets/{VendorsRoutes-dtzf2p8G.js → VendorsRoutes-B_Yg40bd.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-Dzz50WS2.js → WiseConfirmationScreen-ChaM_jYJ.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-C2FWt_0o.js → ZeniAccountRoutes-CfMUrMqe.js} +1 -1
- package/dist/assets/ZeniAccountStatementScreen-BgdXcTdx.js +9 -0
- package/dist/assets/{accountMappingHelper-B5wpHG39.js → accountMappingHelper-DWzrp9Pr.js} +1 -1
- package/dist/assets/{analytics-5LJ4BXQX.js → analytics-wktvfErl.js} +1 -1
- package/dist/assets/{analyticsHelper-k_Sp-PwA.js → analyticsHelper-DcvdGte-.js} +1 -1
- package/dist/assets/{core-BI5oX4mx.js → core-D6EV-11Y.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B7oIXSPO.js → decodeURIComponentSafe-MQV5aj_5.js} +1 -1
- package/dist/assets/{dnd-D6wtGmk9.js → dnd-CkchuQYc.js} +1 -1
- package/dist/assets/{empty-D1y42ZwI.js → empty-DQLKD1Hp.js} +1 -1
- package/dist/assets/{empty-PW7BYANj.js → empty-PZV8n_Ql.js} +1 -1
- package/dist/assets/{emptyVideoElement-DRIlZkGm.js → emptyVideoElement-CnlqukSR.js} +1 -1
- package/dist/assets/{epic-BgEnH7Qf.js → epic-CVdAQuh9.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-CqPrLTRM.js → expenseAutomationHelper-DEOPVtcg.js} +1 -1
- package/dist/assets/{getLocaleForTenant-Cv6I-eSM.js → getLocaleForTenant-C3wVeXiS.js} +1 -1
- package/dist/assets/{index-BT5wSX8Z.js → index-8ioAZPP6.js} +1 -1
- package/dist/assets/{index-BgSgl7o0.js → index-B5kf_qFj.js} +1 -1
- package/dist/assets/{index-Cnd56s5E.js → index-BlnK23AJ.js} +1 -1
- package/dist/assets/{index-ChUBWLsO.js → index-CBlRXIxp.js} +1 -1
- package/dist/assets/{index-C8KisrNI.js → index-CKDPlCKN.js} +2 -2
- package/dist/assets/{index-C2L5Bzwa.js → index-DvW7BRlL.js} +13249 -13249
- package/dist/assets/{index-Cf-PV9pR.js → index-EnAqWoDC.js} +1 -1
- package/dist/assets/{index-COJM8F4x.js → index-qI_nnuux.js} +1 -1
- package/dist/assets/{lexical-BLu7UAko.js → lexical-C6tQwGBF.js} +1 -1
- package/dist/assets/{liveblocks-CW9yScMF.js → liveblocks-DKqwsBQp.js} +1 -1
- package/dist/assets/{lottie-lQbJqTc2.js → lottie-BwhdO6jl.js} +1 -1
- package/dist/assets/{mui-KP5Ep0NX.js → mui-qouWiIWk.js} +1 -1
- package/dist/assets/{pathToGoBack-Ddmf68xx.js → pathToGoBack-DMRqTTJ7.js} +1 -1
- package/dist/assets/{pdf-DflcYtDk.js → pdf-DcGn_mX8.js} +4 -4
- package/dist/assets/{pdf-lib-iL5hUpKl.js → pdf-lib-DndwkHl6.js} +1 -1
- package/dist/assets/{plaid-BrgJMdej.js → plaid-deRHM6gT.js} +1 -1
- package/dist/assets/{pusher-CN7UYIVv.js → pusher-BmM2v3Ys.js} +1 -1
- package/dist/assets/{react-C3b5GjIN.js → react-1c5WrJsc.js} +1 -1
- package/dist/assets/{react-D7C_-SWb.js → react-D6U1M1pt.js} +1 -1
- package/dist/assets/{react-Ow08-_5J.js → react-DFunsRdI.js} +1 -1
- package/dist/assets/{react-XJ6XyB9N.js → react-DZ82GBCj.js} +1 -1
- package/dist/assets/{react-C3_gvmu5.js → react-DiQLb4cq.js} +1 -1
- package/dist/assets/{react-BvzziK5i.js → react-QkGRtVkE.js} +1 -1
- package/dist/assets/{recharts-DRl2ZsSW.js → recharts-C9zWmt1W.js} +1 -1
- package/dist/assets/{routePaths-BrIEdo8u.js → routePaths-GYFjoelZ.js} +1 -1
- package/dist/assets/{sentry-C_uJQK1a.js → sentry-CxSdF_rC.js} +1 -1
- package/dist/assets/{stripSplatSuffix-CSXpdRK5.js → stripSplatSuffix-CYVrHv_0.js} +1 -1
- package/dist/assets/{url-Csr3E4Sb.js → url-BSgCM0lM.js} +1 -1
- package/dist/assets/{url-0wqXxJRo.js → url-Ej5v3O6d.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-C-OzIN8B.js → useActualMatchingMatchDetail-BkDnJbPg.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CZodBcrZ.js → useAiCfoDashboardSuggestedQuestionsChips-D_Ro-9Tt.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DV4bjx-y.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-B3svLsmE.js → useChargeCardPusherEvents-1X1JYShz.js} +1 -1
- package/dist/assets/{useDeviceId-CAlK1w38.js → useDeviceId-RToKfM0O.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-CIZ_wxDt.js → useEmailConnectResultRefresh-dVylO6qh.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BNsRpSRE.js → useInitialThreadRequest-BwX5Js6P.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-Bhr2JI_X.js → useTaskManagerAccess-daSMnBbA.js} +1 -1
- package/dist/assets/{utils-BzQpFQvw.js → utils-D8aAQJhF.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-mkP2Wc9X.js → withTransactionSidePanel-CPG02lKM.js} +1 -1
- package/dist/assets/{zeni-epic-state-CIizsNeB.js → zeni-epic-state-CZbm731W.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-ByQnL6Ep.js +0 -1
- package/dist/assets/AddressScreen-C2qj6tYr.js +0 -9
- package/dist/assets/CardsAiCfoScreen-BdTJBLec.js +0 -14
- package/dist/assets/CustomerOnboardingAuthScreen-BpGFH1t5.js +0 -1
- package/dist/assets/DrawerScreen-KSeYe6Xi.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CmaiVv9M.js +0 -12
- package/dist/assets/NotFoundScreen-CS6UgwGr.js +0 -1
- package/dist/assets/RewardsRoutes-BeNSEmB_.js +0 -1
- package/dist/assets/SignInScreen-OFMK0Fhv.js +0 -1
- package/dist/assets/SignOutScreen-Duww-LZM.js +0 -9
- package/dist/assets/TaskListScreen-Dy6L1Gr_.js +0 -9
- package/dist/assets/TransactionDetailRoutes-KEbThb3n.js +0 -1
- package/dist/assets/ZeniAccountStatementScreen-CJtdjYJW.js +0 -9
- package/dist/assets/useAskAiCfoHostNavButtonProps-4TGjNsPg.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-CW9yScMF.js";import{u as me,j as d,h as de,g as he,i as Ne,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-BI5oX4mx.js";import{fS as Pt,$J as is,g2 as wt,bt as Te,$K as ds,$L as ls,fH as fn,$M as Pn,fQ as wn,$N as vn,$O as Tn,$P as Fn,$Q as xn,fR as Ln,g1 as Bn,$R as Rn,$S as us,fX as ms,fW as Cs,$T as ps,JW as On,g4 as ia,$U as hs,$V as fs,fJ as gs,fI as bs,gh as ze,fZ as Un,fY as jn,$W as Ss,f_ as ys,Js as Is,Jr as ks,Jv as Es,Jx as As,ga as Ds,fE as Mn,$X as _s,$Y as Ps,gf as Nn,$Z as ws,gg as yt,JD as vs,JA as Ts,fF as fe,$_ as qa,dZ as Fe,di as xe,d_ as Le,g_ as da,cB as la,$$ as ua,a00 as vt,CR as Ga,m7 as Ka,a01 as za,Ka as ka,g5 as qe,Kc as Tt,lZ as Vn,a02 as ma,J_ as _a,a03 as Fs,a04 as xs,K1 as Ja,a05 as Ls,YV as Qa,g0 as Hn,K7 as ba,iq as Bs,a06 as $n,fT as Ca,br as Rs,a07 as Os,gG as Xa,gF as et,KG as Us,gE as at,a08 as Gn,cu as Kn,da as js,YU as wa,Lf as zn,a09 as gn,KR as Pa,a0a as Yn,Lg as Ms,Zi as Ns,Lh as Vs,Mm as Hs,C5 as $s,Mg as Gs,a0b as Ks,Kb as oa,a0c as zs,a0d as Ys,a0e as Zs,a0f as Ws,a0g as qs,a0h as Ft,a0i as Js,Kr as Zn,Kk as Qs,a0j as Xs,h0 as eo,a0k as Wn,KA as qn,KE as Jn,g$ as ao,a0l as to,L1 as Qn,a0m as no,a0n as ro,a0o as so,KC as Xn,Kn as er,K4 as ar,Kw as tr,Ku as nr,Ky as oo,a0p as rr,a0q as co,gc as io,gd as lo,ge as uo,a0r as tt,g6 as sr,dc as xt,a0s as mo,a0t as Co,a0u as po,a0v as ho,KM as It,L8 as fo,L4 as go,KI as bo,L6 as So,KY as yo,K_ as Io,a0w as or,Le as $a,S5 as ko,a0x as Eo,a0y as Ao,a0z as Do,a0A as cr,a0B as _o,LB as Po,KQ as ir,KL as Me,KP as wo,a0C as vo,a0D as To,JX as Fo,a0E as dr,f$ as lr,a0F as xo,JZ as Lo,JY as bn,a0G as Bo,a0H as Ro,a0I as Oo,Vd as Uo,a0J as Lt,a0K as jo,FY as ur,mH as Mo,ie as No,LG as Vo,a0L as mr,fN as Ho,fO as $o,a0M as Go,dO as Ko,g3 as zo,Lw as Yo,Lq as We,bq as Zo,bJ as Wo,cG as qo,bK as Jo,U4 as Qo}from"./zeni-epic-state-CIizsNeB.js";import{U as Be,df as Cr,a4 as we,dg as pr,dh as hr,di as Xo,G as ea,as as Bt,dj as ec,dk as ac,a as fr,f as gr,ar as br,p as ke,N as le,d as Z,j as ya,dl as Sr,dm as tc,dn as nc,z as te,a7 as va,d4 as nt,dp as rc,dq as sc,dr as oc,a1 as Ta,bi as Qe,bE as Rt,ds as cc,ab as Fa,Z as rt,c as Ot,k as ae,w as st,dt as ic,bQ as Sa,du as kt,dv as dc,a8 as Ut,dw as lc,ae as yr,av as Et,dx as uc,aq as Ir,K as kr,S as Er,dy as mc,dz as Cc,dA as pc,dB as hc,dC as fc,dD as gc,dE as bc,I as Ya,dF as Sc,dG as yc,m as ht,E as Ic,dH as kc,dI as Ec,dJ as Ac,ai as Dc,dK as _c,dL as Pc,h as wc}from"./index-C2L5Bzwa.js";import{n as Ve,D as Ar,S as vc}from"./mui-KP5Ep0NX.js";import{a as r}from"./sentry-C_uJQK1a.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-4TGjNsPg.js";import{M as Ee}from"./MobileAppDrawer-DEm85bH8.js";import{d as jt}from"./recharts-DRl2ZsSW.js";import{g as _e,a as La,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as Tc,i as Mt,P as Fc,j as Nt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Lc,S as Sn}from"./SetupPagesScreen-BzPNt5Xb.js";import{u as vr}from"./useInitialThreadRequest-BNsRpSRE.js";import ot from"./NotFoundScreen-CS6UgwGr.js";import{u as Vt}from"./useChargeCardPusherEvents-B3svLsmE.js";import{n as yn}from"./utils-BzQpFQvw.js";import{t as Bc}from"./AddressScreen-C2qj6tYr.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./useTaskManagerAccess-Bhr2JI_X.js";import"./BusinessVerificationPageScreen-BAWcvg1q.js";import"./routePaths-BrIEdo8u.js";import"./analyticsHelper-k_Sp-PwA.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]="bc39d26c-3f4f-4b3c-a288-953ef3d3282d",e._sentryDebugIdIdentifier="sentry-dbid-bc39d26c-3f4f-4b3c-a288-953ef3d3282d")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),T=d((O=>vn(O.cardPolicyState))),B=d((O=>Tn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Ln(O.cardPolicyState))),L=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Bn())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),M=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(Tr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:T,suggestedBlockMerchants:B,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,T,B,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),H=D.fetchState,v=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??v;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,v]),K=r.useCallback((()=>{e(v)}),[e,v]),W=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),N=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),V=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(H);r.useEffect((()=>{const O=Q.current;Q.current=H,H==="Completed"&&O!=="Completed"&&M!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(v))}),[t,H,M,e,v]);const c=H==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:L==="In-Progress",onVendorSearchTextChange:z,submitState:H,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:W,onSubmit:I,onUploadDocument:N,onRemoveDocument:V})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Mc}}}=ea.getLocalizedStrings(),Nc=e=>Un(e,!1),Vc=e=>jn(e.name,!1);function Hc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Ne(),s=me(),g=Be(),b=Te(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),T=d((c=>Pn(c.cardPolicyState))),B=d((c=>wn(c.cardPolicyState))),S=d((c=>vn(c.cardPolicyState))),l=d((c=>Tn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),L=d((c=>xn(c.cardPolicyState))),k=d((c=>Ln(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),M=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:M!=null?Is(M):void 0),[p.templateId,p.formDraft,M,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||M!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,M]),r.useEffect((()=>{T!=="Completed"&&T!=="In-Progress"&&s(Bn())}),[s,T]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>B.map(Nc)),[B]),i=r.useMemo((()=>k.map(Vc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(Tr)),[D.cards]);Bt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:L})}),[E,f,R,i,y,S,l,C,L]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),H=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{H.cancel()}),[H]);const v=r.useCallback((c=>{H(c)}),[H]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",W=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),N=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),V=r.useRef(P);r.useEffect((()=>{const c=V.current;V.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??Mc.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&T==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:v,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:W,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:N})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:W,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Lr(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:$c,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=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:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((v=>{h(v)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"}),B=d((v=>_s(v))),S=d((v=>Rn(v.createCardPolicyState))),l=d((v=>Ps(v.createCardPolicyState))),C=d((v=>l==null?[]:Nn(v.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),L=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((v=>ws(v.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((v=>{t(yt({chatSessionId:l,id:v.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const v=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:v}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=B.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(vs())}),[t,D]);const M=B.archiveFetchState.fetchState,E=ya(M);r.useEffect((()=>{E==="In-Progress"&&M==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[M,t,E]);const y=r.useMemo((()=>B.templates.map(zc)),[B.templates]);Bt({isDataReady:B.fetchState.fetchState==="Completed"});const R=y.length>0||L>0,i=(function(v){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:W}=v,I=de(),N=he(),{tenantEmailDomain:V}=Ne(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>Mn(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:He}=Lr("card_policy"),Ae=r.useMemo((()=>xr(X,He,3)),[X,He]),[ge,re]=r.useState(""),be=q&&O&&V!=null&&!Q,ue=r.useCallback((J=>{if(V==null)return;const fa=ke(N.state?.pathnameStackToGoBack,N.pathname);I(`/${V}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[N.pathname,N.state,I,V]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),ve=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:$c,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:W,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:ve,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,W,se,De,Ce,ve,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const v=we(a.state?.pathnameStackToGoBack),P=v.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:v.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((v=>{n!=null&&e(`/${n}/cards/policy/${v}/edit`)}),[e,n]),z=r.useCallback((v=>{t(Ts(v))}),[t]),H=B.fetchState.fetchState;return!R&&H!=="Completed"&&H!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:T})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:L,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:T})]})}function Zc(){const e=de(),{cardId:a}=Ne(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Be(),b=Te(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:T}=h(Z.isDebitCardFeatureEnabled),B=Fe(s),S=xe(s),l=Le(T,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),M=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>vt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),H=z?.accountingClassIDs[0],v=d((X=>H!=null?Ka(X.classState,{classId:H,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),W=K?.accountingClassIDs[0],I=d((X=>W!=null?Ka(X.classState,{classId:W,reportId:"class_list"}):void 0)),N=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",V=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&N&&(u(!0),setTimeout((()=>{n(za()),V&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,N,V]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,N]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(Tt()),R!=="Completed"&&R!=="In-Progress"&&n(Vn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,L,_,p),q=La(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(va,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:L,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:v?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",$t="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Wc="charge-card-department-updated",Mr="charge-card-repayment-completed",Nr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,Ba],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((T=>fe(T))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(Z.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((T=>ma(T))),m=vr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const T=we(n.state?.pathnameStackToGoBack),B=T.poppedPathname??Xc(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:T.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,qc),onEvent:T=>{switch(T){case Ra:case Ba:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,L=d((I=>xs(I,s))),k=L.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:M}=D(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(Z.isDebitCardFeatureEnabled),y=Le(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&L.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,L.fetchState,h,_]);const H=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(L.fetchState==="Completed"){if(F===!1&&(H===!1||H&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==B.userId)){const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:N}})}else if(F&&L.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Ls({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:N}})}}}),[L.fetchState,k?.type.code,F,L.isRefreshingViewInBackground]);const v=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Hn(I.userState,B.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{L.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[L.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const W=I=>{T(I)};if(_!=="Completed"||k==null)return o.jsx(va,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:W}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:L,signedInUserToken:v,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Bs(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=$n(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ve.div`
|
|
1
|
+
import{j as o}from"./liveblocks-DKqwsBQp.js";import{u as me,j as d,h as de,g as he,i as Ne,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-D6EV-11Y.js";import{fS as Pt,$J as is,g2 as wt,bt as Te,$K as ds,$L as ls,fH as fn,$M as Pn,fQ as wn,$N as vn,$O as Tn,$P as Fn,$Q as xn,fR as Ln,g1 as Bn,$R as Rn,$S as us,fX as ms,fW as Cs,$T as ps,JW as On,g4 as ia,$U as hs,$V as fs,fJ as gs,fI as bs,gh as ze,fZ as Un,fY as jn,$W as Ss,f_ as ys,Js as Is,Jr as ks,Jv as Es,Jx as As,ga as Ds,fE as Mn,$X as _s,$Y as Ps,gf as Nn,$Z as ws,gg as yt,JD as vs,JA as Ts,fF as fe,$_ as qa,dZ as Fe,di as xe,d_ as Le,g_ as da,cB as la,$$ as ua,a00 as vt,CR as Ga,m7 as Ka,a01 as za,Ka as ka,g5 as qe,Kc as Tt,lZ as Vn,a02 as ma,J_ as _a,a03 as Fs,a04 as xs,K1 as Ja,a05 as Ls,YV as Qa,g0 as Hn,K7 as ba,iq as Bs,a06 as $n,fT as Ca,br as Rs,a07 as Os,gG as Xa,gF as et,KG as Us,gE as at,a08 as Gn,cu as Kn,da as js,YU as wa,Lf as zn,a09 as gn,KR as Pa,a0a as Yn,Lg as Ms,Zi as Ns,Lh as Vs,Mm as Hs,C5 as $s,Mg as Gs,a0b as Ks,Kb as oa,a0c as zs,a0d as Ys,a0e as Zs,a0f as Ws,a0g as qs,a0h as Ft,a0i as Js,Kr as Zn,Kk as Qs,a0j as Xs,h0 as eo,a0k as Wn,KA as qn,KE as Jn,g$ as ao,a0l as to,L1 as Qn,a0m as no,a0n as ro,a0o as so,KC as Xn,Kn as er,K4 as ar,Kw as tr,Ku as nr,Ky as oo,a0p as rr,a0q as co,gc as io,gd as lo,ge as uo,a0r as tt,g6 as sr,dc as xt,a0s as mo,a0t as Co,a0u as po,a0v as ho,KM as It,L8 as fo,L4 as go,KI as bo,L6 as So,KY as yo,K_ as Io,a0w as or,Le as $a,S5 as ko,a0x as Eo,a0y as Ao,a0z as Do,a0A as cr,a0B as _o,LB as Po,KQ as ir,KL as Me,KP as wo,a0C as vo,a0D as To,JX as Fo,a0E as dr,f$ as lr,a0F as xo,JZ as Lo,JY as bn,a0G as Bo,a0H as Ro,a0I as Oo,Vd as Uo,a0J as Lt,a0K as jo,FY as ur,mH as Mo,ie as No,LG as Vo,a0L as mr,fN as Ho,fO as $o,a0M as Go,dO as Ko,g3 as zo,Lw as Yo,Lq as We,bq as Zo,bJ as Wo,cG as qo,bK as Jo,U4 as Qo}from"./zeni-epic-state-CZbm731W.js";import{U as Be,df as Cr,a4 as we,dg as pr,dh as hr,di as Xo,G as ea,as as Bt,dj as ec,dk as ac,a as fr,f as gr,ar as br,p as ke,N as le,d as Z,k as ya,dl as Sr,dm as tc,dn as nc,z as te,a7 as va,d4 as nt,dp as rc,dq as sc,dr as oc,a1 as Ta,bi as Qe,bE as Rt,ds as cc,ab as Fa,Z as rt,E as Ot,l as ae,w as st,dt as ic,bQ as Sa,du as kt,dv as dc,a8 as Ut,dw as lc,ae as yr,av as Et,dx as uc,aq as Ir,O as kr,T as Er,dy as mc,dz as Cc,dA as pc,dB as hc,dC as fc,dD as gc,dE as bc,I as Ya,dF as Sc,dG as yc,m as ht,c as Ic,dH as kc,dI as Ec,dJ as Ac,ai as Dc,dK as _c,dL as Pc,j as wc}from"./index-DvW7BRlL.js";import{n as Ve,D as Ar,S as vc}from"./mui-qouWiIWk.js";import{a as r}from"./sentry-CxSdF_rC.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import{M as Ee}from"./MobileAppDrawer-DExJFFmi.js";import{d as jt}from"./recharts-C9zWmt1W.js";import{g as _e,a as La,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as Tc,i as Mt,P as Fc,j as Nt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Lc,S as Sn}from"./SetupPagesScreen-D0fdMGb4.js";import{u as vr}from"./useInitialThreadRequest-BwX5Js6P.js";import ot from"./NotFoundScreen-sryCVGSu.js";import{u as Vt}from"./useChargeCardPusherEvents-1X1JYShz.js";import{n as yn}from"./utils-D8aAQJhF.js";import{t as Bc}from"./AddressScreen-5ZLJ7_Lf.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.js";import"./BusinessVerificationPageScreen-BL6H7JF-.js";import"./routePaths-GYFjoelZ.js";import"./analyticsHelper-DcvdGte-.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]="89989add-4603-4796-92d8-3fb835681f3e",e._sentryDebugIdIdentifier="sentry-dbid-89989add-4603-4796-92d8-3fb835681f3e")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),T=d((O=>vn(O.cardPolicyState))),B=d((O=>Tn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Ln(O.cardPolicyState))),L=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Bn())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),M=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(Tr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:T,suggestedBlockMerchants:B,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,T,B,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),H=D.fetchState,v=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??v;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,v]),K=r.useCallback((()=>{e(v)}),[e,v]),W=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),N=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),V=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(H);r.useEffect((()=>{const O=Q.current;Q.current=H,H==="Completed"&&O!=="Completed"&&M!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(v))}),[t,H,M,e,v]);const c=H==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:L==="In-Progress",onVendorSearchTextChange:z,submitState:H,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:W,onSubmit:I,onUploadDocument:N,onRemoveDocument:V})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Mc}}}=ea.getLocalizedStrings(),Nc=e=>Un(e,!1),Vc=e=>jn(e.name,!1);function Hc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Ne(),s=me(),g=Be(),b=Te(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),T=d((c=>Pn(c.cardPolicyState))),B=d((c=>wn(c.cardPolicyState))),S=d((c=>vn(c.cardPolicyState))),l=d((c=>Tn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),L=d((c=>xn(c.cardPolicyState))),k=d((c=>Ln(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),M=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:M!=null?Is(M):void 0),[p.templateId,p.formDraft,M,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||M!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,M]),r.useEffect((()=>{T!=="Completed"&&T!=="In-Progress"&&s(Bn())}),[s,T]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>B.map(Nc)),[B]),i=r.useMemo((()=>k.map(Vc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(Tr)),[D.cards]);Bt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:L})}),[E,f,R,i,y,S,l,C,L]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),H=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{H.cancel()}),[H]);const v=r.useCallback((c=>{H(c)}),[H]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",W=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),N=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),V=r.useRef(P);r.useEffect((()=>{const c=V.current;V.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??Mc.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&T==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:v,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:W,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:N})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:W,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Lr(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:$c,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=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:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((v=>{h(v)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"}),B=d((v=>_s(v))),S=d((v=>Rn(v.createCardPolicyState))),l=d((v=>Ps(v.createCardPolicyState))),C=d((v=>l==null?[]:Nn(v.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),L=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((v=>ws(v.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((v=>{t(yt({chatSessionId:l,id:v.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const v=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:v}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=B.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(vs())}),[t,D]);const M=B.archiveFetchState.fetchState,E=ya(M);r.useEffect((()=>{E==="In-Progress"&&M==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[M,t,E]);const y=r.useMemo((()=>B.templates.map(zc)),[B.templates]);Bt({isDataReady:B.fetchState.fetchState==="Completed"});const R=y.length>0||L>0,i=(function(v){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:W}=v,I=de(),N=he(),{tenantEmailDomain:V}=Ne(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>Mn(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:He}=Lr("card_policy"),Ae=r.useMemo((()=>xr(X,He,3)),[X,He]),[ge,re]=r.useState(""),be=q&&O&&V!=null&&!Q,ue=r.useCallback((J=>{if(V==null)return;const fa=ke(N.state?.pathnameStackToGoBack,N.pathname);I(`/${V}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[N.pathname,N.state,I,V]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),ve=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:$c,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:W,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:ve,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,W,se,De,Ce,ve,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const v=we(a.state?.pathnameStackToGoBack),P=v.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:v.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((v=>{n!=null&&e(`/${n}/cards/policy/${v}/edit`)}),[e,n]),z=r.useCallback((v=>{t(Ts(v))}),[t]),H=B.fetchState.fetchState;return!R&&H!=="Completed"&&H!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:T})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:L,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:T})]})}function Zc(){const e=de(),{cardId:a}=Ne(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Be(),b=Te(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:T}=h(Z.isDebitCardFeatureEnabled),B=Fe(s),S=xe(s),l=Le(T,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),M=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>vt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),H=z?.accountingClassIDs[0],v=d((X=>H!=null?Ka(X.classState,{classId:H,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),W=K?.accountingClassIDs[0],I=d((X=>W!=null?Ka(X.classState,{classId:W,reportId:"class_list"}):void 0)),N=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",V=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&N&&(u(!0),setTimeout((()=>{n(za()),V&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,N,V]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,N]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(Tt()),R!=="Completed"&&R!=="In-Progress"&&n(Vn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,L,_,p),q=La(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(va,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:L,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:v?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",$t="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Wc="charge-card-department-updated",Mr="charge-card-repayment-completed",Nr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,Ba],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((T=>fe(T))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(Z.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((T=>ma(T))),m=vr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const T=we(n.state?.pathnameStackToGoBack),B=T.poppedPathname??Xc(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:T.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,qc),onEvent:T=>{switch(T){case Ra:case Ba:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,L=d((I=>xs(I,s))),k=L.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:M}=D(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(Z.isDebitCardFeatureEnabled),y=Le(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&L.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,L.fetchState,h,_]);const H=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(L.fetchState==="Completed"){if(F===!1&&(H===!1||H&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==B.userId)){const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:N}})}else if(F&&L.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Ls({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:N}})}}}),[L.fetchState,k?.type.code,F,L.isRefreshingViewInBackground]);const v=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Hn(I.userState,B.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{L.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[L.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const W=I=>{T(I)};if(_!=="Completed"||k==null)return o.jsx(va,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:W}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:L,signedInUserToken:v,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Bs(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=$n(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ve.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${ei.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-DKqwsBQp.js";import{a as g}from"./sentry-CxSdF_rC.js";import{h as w,u as T,g as x,i as k,j as O,l as E}from"./core-D6EV-11Y.js";import{z as C,br as F,a8 as P,l as V,T as j,q as b,bs as A,ae as L,aG as U,p as B}from"./index-DvW7BRlL.js";import{fF as N,gI as M,Bw as _,gD as z,c8 as G,Y2 as R,bn as Y,uT as H,uH as q,mz as Z,o8 as S,Y3 as $,bE as J,cE as D,oj as K,ot as Q}from"./zeni-epic-state-CZbm731W.js";import"./mui-qouWiIWk.js";import{d as W}from"./routePaths-GYFjoelZ.js";import{M as X}from"./MobileAppDrawer-DExJFFmi.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]="471514c3-536d-4b32-b7ae-15cf3e22f503",t._sentryDebugIdIdentifier="sentry-dbid-471514c3-536d-4b32-b7ae-15cf3e22f503")}catch{}})();const ee=E((function(t){const a=z(t),i=C.getSignedInUser(),p=N(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=G(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=R(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:`${L.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?D(u):void 0,meetingLink:y!=""&&y!=null?D(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(Z({files:e}))},onDeleteFile:e=>{t(q(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}}))(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:p}=k(),[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=>N(s))),d=r.companyId??C.getSignedInUserTenant(p)?.companyId;if(C.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,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-
|
|
1
|
+
import{j as I}from"./liveblocks-DKqwsBQp.js";import{a as o}from"./sentry-CxSdF_rC.js";import{u as P,h as R,g as H,j as C,N as w}from"./core-D6EV-11Y.js";import{TJ as q,fF as z,gl as G,pS as J,gM as A,gk as M,gi as Q,U7 as V,gh as O}from"./zeni-epic-state-CZbm731W.js";import{u as B,z as E,L as D,G as K,I as W}from"./index-DvW7BRlL.js";import{n as X}from"./mui-qouWiIWk.js";import{P as h,a as _}from"./AccountMappingScreen-BT617fFT.js";import{t as Y}from"./getLocaleForTenant-C3wVeXiS.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-CbxnK800.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./MobileAppDrawer-DExJFFmi.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.js";import"./accountMappingHelper-DWzrp9Pr.js";import"./empty-DQLKD1Hp.js";import"./pdf-lib-DndwkHl6.js";import"./index-8ioAZPP6.js";import"./url-Ej5v3O6d.js";import"./index-EnAqWoDC.js";import"./decodeURIComponentSafe-MQV5aj_5.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]="88bcfe96-a2a9-4293-97cb-93a7171719ee",t._sentryDebugIdIdentifier="sentry-dbid-88bcfe96-a2a9-4293-97cb-93a7171719ee")}catch{}})();const te=X.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-DKqwsBQp.js";import{z as m}from"./index-DvW7BRlL.js";import{g as n}from"./QBOConnectionScreen-CbxnK800.js";import"./sentry-CxSdF_rC.js";import{g as p,N as a}from"./core-D6EV-11Y.js";import"./zeni-epic-state-CZbm731W.js";import"./recharts-C9zWmt1W.js";import"./mui-qouWiIWk.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./empty-DQLKD1Hp.js";import"./pdf-lib-DndwkHl6.js";import"./index-8ioAZPP6.js";import"./url-Ej5v3O6d.js";import"./index-EnAqWoDC.js";import"./decodeURIComponentSafe-MQV5aj_5.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]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-BP006ys9.js → CustomerOnboardingRoutes-BffNdH_l.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DKqwsBQp.js";import{t as wn,A as $e}from"./AddressScreen-5ZLJ7_Lf.js";import An from"./NotFoundScreen-sryCVGSu.js";import{a as d,t as Me}from"./sentry-CxSdF_rC.js";import{h as _e,g as xe,u as se,i as Ee,j as T,N as Q,q as Pn,l as cn,n as Dn,o as H}from"./core-D6EV-11Y.js";import{fF as Y,d_ as Te,dZ as we,bq as Bn,T_ as jn,bR as Fn,pQ as Vn,Bg as Un,Bj as Ln,Vl as Rn,Vm as Nn,lu as Oe,lx as dn,UB as Gn,b$ as $n,c8 as fe,BK as Ae,Bv as Mn,Vn as me,BL as un,S8 as Qn,mH as ln,di as pn,Vo as Kn,Vp as zn,uA as qn,Uo as Ce,hV as Hn,Un as be,hS as Zn,G8 as Jn,uE as Wn,hK as Xn,hN as Qe,Vq as mn,Vr as Yn,LV as et,Vs as nt,LZ as tt,Bm as at,Vt as ot,Vu as st,ls as rt,lv as it,BX as ct,Bx as gn,BJ as dt,bE as Ke,cE as ut,BW as ze,uT as lt,uH as pt,mz as mt,gG as gt,gF as ft,gE as yt,Vv as ht,Bp as Ct,BY as bt,B$ as St,C2 as It,C8 as kt,dj as Ot}from"./zeni-epic-state-CZbm731W.js";import{z,N as Pe,d as W,g as vt,p as q,a8 as re,l as g,aE as _t,ai as fn,a1 as xt,c as yn,U as hn,k as X,Z as ge,T as ve,aF as Et,I as qe,x as He,ae as Tt,aG as Ze,aH as wt,aI as At}from"./index-DvW7BRlL.js";import{n as De}from"./mui-qouWiIWk.js";import{g as Pt,h as Dt,q as ie}from"./QBOConnectionScreen-CbxnK800.js";import{u as Bt,a as jt}from"./useEmailConnectResultRefresh-dVylO6qh.js";import{u as Ft}from"./useChargeCardPusherEvents-1X1JYShz.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./empty-DQLKD1Hp.js";import"./pdf-lib-DndwkHl6.js";import"./index-8ioAZPP6.js";import"./url-Ej5v3O6d.js";import"./index-EnAqWoDC.js";import"./decodeURIComponentSafe-MQV5aj_5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="ebd7cd27-f850-4969-9c86-9e835be11868",e._sentryDebugIdIdentifier="sentry-dbid-ebd7cd27-f850-4969-9c86-9e835be11868")}catch{}})();const Je=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Vt=()=>{const e=_e(),l=xe(),i=se(),[a,p]=d.useState(!1),[u,c]=d.useState(!1),{tenantEmailDomain:v}=Ee(),n=z.getSignedInUser(),{useFeatureGate:t}=Pe(),{isFeatureEnabled:C}=t(W.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(W.isArAgingFeatureEnabled),{isFeatureEnabled:A}=t(W.isReferralFeatureEnabled),{isFeatureEnabled:w}=t(W.isDebitCardFeatureEnabled),k=vt(),O=T((S=>Y(S))),P=T((S=>S.onboardingCustomerViewState.fetchState)),_=O.excludedResources,F=O.companyId??z.getSignedInUserTenant(v)?.companyId;if(n==null)throw Error("Can't access onboarding flow without signing in...");const m=Te(w,O),b=we(O),D=[],U=_?.resources?.find((S=>S.resource==="/reports/top_expenses"))==null,h=_?.resources?.find((S=>S.resource==="/reports/task_card"))==null,r=O?.userRole!=null&&Bn(O?.userRole),x=_?.resources?.find((S=>S.resource==="/bills"))==null&&!r,E=_?.resources?.find((S=>S.resource==="/reimbursements"))==null;U===!1&&D.push("top_expenses"),h===!1&&D.push("task_card"),x===!1&&D.push("bill_pay_card","bill_pay_promo_card"),E===!1&&D.push("reimbursement_card","reimbursement_promo_card"),D.push("zeni_accounts_promo_card","treasury_promo_card"),A===!1&&D.push("rewards_card");const f=T((S=>{const V=[];C===!1&&V.push("accounts_payable_aging"),o===!1&&V.push("accounts_receivable_aging"),V.push("zeni_accounts_promo_card","treasury_promo_card"),A===!1&&V.push("rewards_card"),k===!1&&V.push("expense_automation_card");const Z=jn(S,V);return Fn(Z.reportsInOrder.map(($=>({fetchState:$.fetchState,error:$.error})))).fetchState}));d.useEffect((()=>{P!=="Completed"||a||m||b||(p(!0),i(Vn(n.userId,F,O.tenantId,!0,!1,D)))}),[a,P,m,b,n,O.tenantId,i]);const B=d.useRef(!1),N=d.useCallback((()=>{const S={pathnameStackToGoBack:q(l.state?.pathnameStackToGoBack,l.pathname),message:"activation"};e(m?"../../checking":b?"../../cards":"../../dashboard",{state:S})}),[e,l,m,b]),G=d.useCallback((()=>{B.current||(B.current=!0,N())}),[N]);if(d.useEffect((()=>{const S=setTimeout((()=>c(!0)),3e3);return()=>clearTimeout(S)}),[]),d.useEffect((()=>{const S=setTimeout(G,6e3);return()=>clearTimeout(S)}),[G]),d.useEffect((()=>{m||b||!u||f!=="Completed"&&f!=="Error"||G()}),[u,f,m,b,G]),P!=="Completed")return s.jsx(Q,{to:"../"});const R=O.company?.companyOnboardingInfo?.onboardingInfo,ee={timeSinceQuoteSign:R?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:R?.onboardingToQuoteSignMinutes??0,isKybDone:Je(R?.businessVerified?.status),isKycDone:Je(R?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:R?.accountingConnectionCreationMode??""};return s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:g,onLoad:S=>S.trackOnboardingDashboardActivation(ee)}),s.jsx(_t,{show:!0,onComplete:G})]})},Se=["reading_books","finance_graph","reconciliation","cfo_foundation"],Ie=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],We=(e,l)=>{const i=new Map(e.map((a=>[a.key,a])));return l.map((a=>{return p=i.get(a)?.status,p==="starting"||p==="building"?p:"idle";var p}))},Xe=(e,l)=>{if(e.length===0)return!1;const i=new Map(e.map((a=>[a.key,a])));return l.every((a=>i.get(a)?.status==="ready"))},Ye=De.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -23,8 +23,8 @@ import{j as s}from"./liveblocks-CW9yScMF.js";import{t as wn,A as $e}from"./Addre
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
26
|
-
`,nn=cn((function(e,l){const{companyId:i,isAdmin:a,currentTenant:p,isOnAddressPage:u}=l,c=z.getSignedInUser(),v=p.tenantId,n={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:v??""},t=Y(e),C=Ae(e,i),o=mn(e),A=fe(p?.userRole??[])&&C.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",w=Yn(e.userRoleConfigState);return{onboardingCustomerView:C,analytics:g,isRefreshingViewInBackground:!1,isDisabled:A,companyTitles:w.companyTitles,connectedAccountProvider:t.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Tt.fileMicroServiceBaseUrl,authParams:n},signedInUser:z.getSignedInUser(),currentTenant:t,isAdmin:a,isOnAddressPage:u,cardPaymentView:o,isCardPaymentPopupOpen:!1,stripeKey:ge.stripeKey}}),(function(e,l){const{companyId:i,currentTenant:a,themeState:p,navigate:u,location:c}=l,{tenantEmailDomain:v}=a;return{onFetchLinkTokenClick:(n,t)=>{e(kt(n,t))},onEstablishConnectionClick:(n,t)=>{e(It(n,t))},onUpdatePaymentAccountStatus:(n,t,C)=>{e(St(n,t,C))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(bt(!1,n,t))},onEstablishConnectionSuccess:()=>{e(Ct(i,!0,!1))},handleOnConnectClick:()=>{g.trackOnboardingConnectQBO(),ie.handleClick()},updateQBOPopupState:n=>{e(me({isQBOPopupOpen:n}))},onCompanyOfficerUpdated:n=>{const t=n.map((C=>{const{officerType:o,userId:A,name:w,email:k,ssn:O,nationalityCountryCode:P,dob:_,phone:F,syncToken:m,selectDocument:b,role:D,ownership:U,isSelectedForVerification:h,userVerificationStatus:r,fileIds:E,isPhoneVerified:x}=C;let f;return b.selectDocumentType==="driverLicense"?f="driving_license":b.selectDocumentType==="passport"?f="passport":b.selectDocumentType==="stateId"?f="id_document":b.selectDocumentType==="ssnCard"&&(f="social_security_card"),{officerType:o,userId:A,firstName:w.firstName,lastName:w.lastName,email:k,ssn:O,nationalityCountryCode:P?.selectedOption!=null?Ze(P.selectedOption):void 0,phone:F,birthday:_!=null?Ke(_?.toString()):_,syncToken:m,titleAtCompany:D.selectedOption,ownershipInCompany:U,documentTypeSelectedForVerification:f,isSelectedForVerification:h,userVerificationStatus:r,fileIds:E,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:x}}));e(ze({officers:t}))},onGetOtp:(n,t)=>{e(yt(n,"CustomerOnboarding")),t!=null&&e(ht({officerType:t,phone:n}))},onResendOtp:n=>{e(ft(n,"CustomerOnboarding"))},onVerifyOtp:(n,t)=>{g.trackOnboardingPhoneVerified(),e(gt(n,t,"CustomerOnboarding"))},updateFilesEntity:n=>{e(mt({files:n}))},onDeleteFile:n=>{e(pt(n))},onEditFileName:(n,t)=>{e(lt(n,t.split(".")[0]))},onCompanyDetailsChanged:n=>{const{companyDescription:t,companyIndustry:C,companyIndustryType:o,companyLegalName:A,companyTaxId:w,companyWebsite:k,companyPhone:O,primaryContactEmail:P,primaryContactName:_,primaryContactUserId:F,primaryContactSyncToken:m,syncToken:b,fileIds:D,typeOfIncorporation:U,stateOfIncorporation:h,incDate:r,companySourceOfFunds:E,companySourceOfFundsDescription:x,companySubIndustry:f,countriesOfOperations:B,purposeOfAccount:N,purposeOfAccountDescription:G,regulatedStatus:R,regulatedStatusDescription:ee,transactionVolume:S,transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$}=n,M={companyId:i,companyDescription:t,companyIndustry:C.selectedOption,companyIndustryType:o?.selectedOption??"",companyLegalName:A,taxIdOrEIN:w,website:k!=""&&k!=null?ut(k):void 0,phone:O,syncToken:b,fileIds:D,incDate:r!=null?Ke(r?.toString()):r,typeOfIncorporation:U?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:x,companySubIndustry:f?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((L=>L.length===2?L:Ze(L)))??[],purposeOfAccount:N?.selectedOption??"",purposeOfAccountDescription:G,regulatedStatus:R??"",regulatedStatusDescription:ee,transactionVolume:S?.selectedOption??"",transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$?.selectedOptions??[]},ce={userId:F,firstName:_.firstName,lastName:_.lastName,email:P,syncToken:m};e(ze({companyDetails:M,primaryContactDetails:ce}))},onAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onRegisteredAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onUpdateCustomerView:(n,t,C)=>{e(dt(i,!1,t,C,n))},onAddressEditHandler:n=>{if(n!=null){const t=wn(n);e(ln({addressType:"subscription_billing_address",addressToCreate:t}))}},onSkipSetupClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);e(gn(i,!1,!1)),u("./activation",{state:{pathnameStackToGoBack:n}})},onUpdateStep:n=>{e(un({step:n}))},onUpdateSubStep:n=>{e(ct({subStep:n}))},onZeniLogoClick:()=>{p.toggle()},handleLogOutClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);u("/signout",{replace:!0,state:{pathnameStackToGoBack:n,message:"logout"}})},handleCockpitClick:()=>{g.trackOnboardingFlowExited("cockpit"),window.open("/cockpit")},handleReferralsClick:()=>{u(`/${v}/rewards`)},handleCreateCardSetupIntent:n=>{e(dn(n))},handleConfirmCardSetupIntent:n=>{e(it(n))},updateCardPaymentModalState:n=>{e(me({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,C)=>{e(rt(n,t,C))},handleFetchPaymentSources:()=>{e(Oe())},resetCardPaymentViewState:()=>{e(st())},handleResetCardPaymentErrorStatuses:()=>{e(ot())},redirectToProductSuitePage:()=>{g.trackOnboardingFlowExited("product_suite");const n=q(c.state?.pathnameStackToGoBack,c.pathname);u(`/${v}/onboarding/thankyou`,{state:{pathnameStackToGoBack:n,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(g.trackOnboardingAiFinanceTeamAcknowledged(),e(at(i)))},onIdentityDocumentUploadedForAutofill:n=>{if(i==null)return;const t=nt(n.documentType);t!=null&&(g.trackOnboardingDocumentUploaded("kyc",t),e(tt({target:"onboarding",companyId:i,officerType:n.officerType,fileId:n.fileId,documentType:t})))},onCompanyDocumentUploadedForAutofill:n=>{i!=null&&(g.trackOnboardingDocumentUploaded("kyb",n.documentType),e(et({target:"onboarding",companyId:i,fileId:n.fileId,documentType:n.documentType})))}}}))(xt),le=({taxCFOCustomer:e=!1,isOnAddressPage:l=!1,appContent:i})=>{const a=fn(),p=_e(),u=Ee(),c=se(),v=Et(),n=yn(),[t,C]=d.useState(!1),[o,A]=d.useState(!1),[w,k]=d.useState(!1),{tenantEmailDomain:O}=xe(),P=hn(),{useFeatureGate:_}=Pe(),{isFeatureEnabled:F}=_(W.isDebitCardFeatureEnabled),m=Pn("/:tenantEmailDomain/onboarding")!==null&&u.search?.includes("code"),b=T((y=>y.onboardingCustomerViewState.fetchState)),D=T((y=>y.onboardingCustomerViewState.currentStep)),U=T((y=>y.onboardingCustomerViewState.uiState)),h=T((y=>Y(y))),r=T((y=>y.userRoleConfigState.fetchState)),E=T((y=>y.cardPaymentViewState)),x=X(E.addCardPaymentSourceStatus.fetchState),f=E.addCardPaymentSourceStatus.fetchState,{code:B,realmId:N,state:G}=Pt(u.search),R=h.externalConnections?.accounting[0],ee=R?.connectionType,S=R?.connectionName,V=R?.connectionId??"",Z=z.getSignedInUser()?.userId??"",$=d.useRef({realmId:"",connectionId:""});d.useEffect((()=>{o||(A(!0),c(Oe()))}),[o,c]),d.useEffect((()=>{w||(dn(["card"]),k(!0))}),[w]),d.useEffect((()=>{x==="In-Progress"&&f==="Completed"&&c(Oe())}),[x,f]),d.useEffect((()=>{Dt(B,N,G,V,Z)===!0&&h.externalConnections?.saveConnectionState!=="In-Progress"&&b==="Completed"&&(c(Gn(h.tenantId,{connection_type:ee??"accounting",connection_name:S??"quickbooks_online",authorization_code:B,realm_id:N,connection_id:V,user_id:Z},$n(window.location.origin+"/onboarding/auth"))),$.current={realmId:N,connectionId:V},g.trackOnboardingSaveQBOConnection(N,V),p(u.pathname))}),[B,N,G,u.pathname,b]),d.useEffect((()=>{ie.isInitiated===!1&&b==="Completed"&&ie.init("/onboarding/auth",h.tenantEmailDomain)}),[b]);const M=h.companyId??z.getSignedInUserTenant(O)?.companyId,ce=fe(h?.userRole??[]),L=T((y=>Ae(y,M)));d.useEffect((()=>{t||b!=="Not-Started"||M==null||(C(!0),c(Mn(M,!0,!m)))}),[t,b,M]);const ne=h.externalConnections?.saveConnectionState,Be=X(ne);d.useEffect((()=>{Be==="In-Progress"&&(ne==="Completed"||ne==="Error")&&U.isQBOPopupOpen&&D==="connect_ledger"&&(ne==="Completed"?g.trackOnboardingQBOConnectionSuccess($.current.realmId,$.current.connectionId):g.trackOnboardingQBOConnectionFailed($.current.realmId,$.current.connectionId,h.externalConnections?.saveOAuthConnectionError?.message??""),c(me({isQBOPopupOpen:!1})))}),[ne,Be,U.isQBOPopupOpen,D,g,c]),d.useEffect((()=>{b==="Completed"&&m&&(c(un({step:"connect_ledger"})),c(me({isQBOPopupOpen:!0})))}),[m,b]),d.useEffect((()=>{r==="Not-Started"&&c(Qn(!0))}),[r,c]);const Cn=X(L.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&L.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Cn==null&&c(ln({addressType:"company_registered_address",addressToCreate:L.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[L.companyDetailsLocalData?.addressStatus?.addressToCreate,L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const bn=L.isInterimEmailSent,je=z.getSignedInUser();if(je==null)throw Error("Can't access onboarding flow without signing in...");const Sn=Te(F,h),In=we(h),Fe=h.company?.companyOnboardingInfo.isOnboardingCompleted,Ve=y=>y.trackPageLoaded(ve.Event.onboardingPage),ye=h.productSettings.isOtherProductsEnabled,kn=ye===!0&&!pn(h),On=h.productSettings.isTreasuryEnabled,Ue=Ut({tenantEmailDomain:O??"",signedInUserEmail:je.userEmail??"",companyId:M}),Le=(({companyId:y})=>{const K=se(),de=T((j=>j.onboardingCustomerViewState?.aiAgentsActivation)),te=T((j=>Y(j).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),he=d.useCallback((()=>{K(Un())}),[K]);d.useEffect((()=>{he()}),[he]);const Re=d.useCallback((()=>{y==null||y===""||te||K(Ln(y))}),[y,te,K]),vn=d.useMemo((()=>{if(y==null||y==="")return[];const j=`private-encrypted-${y}`;return[`${j}.ledger-ingestion.counts-updated`,`${j}.ai-agents-activation.phase-changed`]}),[y]),_n=d.useCallback(((j,ae)=>{if(ae==null||typeof ae!="object")return;const I=ae;if(j!=="ledger-ingestion.counts-updated"){if(j==="ai-agents-activation.phase-changed"){const ue=typeof I.phase_key=="string"?I.phase_key:typeof I.key=="string"?I.key:"",J=typeof I.status=="string"?I.status:"idle";if(ue==="")return;K(Nn({key:ue,status:J==="starting"||J==="building"||J==="ready"?J:"idle",startedAt:typeof I.started_at=="string"?I.started_at:void 0,completedAt:typeof I.completed_at=="string"?I.completed_at:void 0}))}}else K(Rn({customerCount:typeof I.customer_count=="number"?I.customer_count:void 0,glAccountCount:typeof I.gl_account_count=="number"?I.gl_account_count:void 0,targetTransactionCount:typeof I.target_transaction_count=="number"?I.target_transaction_count:void 0,transactionCount:typeof I.transaction_count=="number"?I.transaction_count:void 0,vendorCount:typeof I.vendor_count=="number"?I.vendor_count:void 0}))}),[K]);return Ft({events:vn,onEvent:_n,onSubscribed:he}),d.useMemo((()=>{const j=de?.phases??[],ae=We(j,Se),I=We(j,Ie),ue=Xe(j,Se),J=Xe(j,Ie),Ne=j.some((Tn=>Tn.status!=="idle")),oe=!te&&!Ne,Ge=te&&!Ne,En=Ge?Se.map((()=>"building")):ae,xn=Ge?Ie.map((()=>"building")):I;return{ledgerRowStatuses:oe?void 0:En,backgroundRowStatuses:oe?void 0:xn,showLedgerReadyInLabel:oe?void 0:ue,showBackgroundReadyInLabel:oe?void 0:J,forceContinueEnabled:!oe||void 0,counts:de?.counts,onContinueClicked:Re}}),[de?.phases,de?.counts,te,Re])})({companyId:M});if(Fe===!0){if(!ye)return On?s.jsx(Q,{to:"../../treasury"}):Sn?s.jsx(Q,{to:"../../checking"}):In?s.jsx(Q,{to:"../../cards"}):s.jsx(Q,{to:"../../dashboard"});const y=L.updateStatus.fetchState==="In-Progress";if(ye&&!y)return e?s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:K=>Ve(K)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):s.jsx(Q,{to:"../../onboarding/thankyou"})}else if(Fe===!1&&P?.loggedInUserRoleMap!=null)return bn===!0&&kn?s.jsx(Q,{to:"../../onboarding/thankyou"}):s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:y=>Ve(y)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ke="external_integrations",Ut=({tenantEmailDomain:e,signedInUserEmail:l,companyId:i})=>{const a=se(),{pendingAutoFocusTabId:p}=Bt(),{plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v}=jt({companyId:i}),n=T((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=T((r=>Y(r))),C=T((r=>r.tenantState.fetchState)),o=T((r=>Kn(r,i))),A=T((r=>zn(r,ke))),w=d.useMemo((()=>new Set(A.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[A]),k=t.tenantId,O=fe(t.userRole??[]);d.useEffect((()=>{a(qn(ke))}),[a]);const P=o.externalConnections?.saveAPIKeyConnectionState,_=o.externalConnections?.saveAPIKeyConnectionError?.message,F=X(P);d.useEffect((()=>{F==="In-Progress"&&(P==="Completed"?g.trackIntegrationConnected("chargebee","Onboarding","revenue"):P==="Error"&&g.trackIntegrationConnectFailed("chargebee","Onboarding","revenue",_??""))}),[P,F,_]);const m=o.externalConnections?.saveOAuthConnectionState,b=o.externalConnections?.saveOAuthConnectionError?.message,D=X(m);d.useEffect((()=>{D==="In-Progress"&&(m==="Completed"?g.trackIntegrationConnected("hubspot","Onboarding","revenue"):m==="Error"&&g.trackIntegrationConnectFailed("hubspot","Onboarding","revenue",b??""))}),[m,D,b]);const U=o.externalConnections?.saveConnectorCredentialsStateBySlug,h=X(U);return d.useEffect((()=>{const r=U??{},E=h??{},x=o.externalConnections?.saveConnectorCredentialsErrorBySlug??{};Object.keys(r).forEach((f=>{if(E[f]!=="In-Progress")return;let B;try{B=Ce(f)}catch{return}r[f]==="Completed"?g.trackIntegrationConnected(B,"Onboarding","payments"):r[f]==="Error"&&g.trackIntegrationConnectFailed(B,"Onboarding","payments",x[f]?.message??"")}))}),[U,h,o]),d.useMemo((()=>({isAdmin:O,analytics:g,referrer:"Onboarding",integrationsView:o,isLoading:C==="In-Progress",notifyMeRegisteredSlugs:w,autoFocusTabId:p??void 0,saveChargeBeeState:o.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:o.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:o.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:o.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:o.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(o.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,E])=>[r,E?.message]))),deleteConnectionState:o.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:o.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{g.trackIntegrationConnectClicked("gmail","Onboarding","email"),a(Qe(k,"gmail",tn()))},onConnectOutlook:()=>{g.trackIntegrationConnectClicked("outlook","Onboarding","email"),a(Qe(k,"outlook",tn()))},onConnectHubSpot:(r,E)=>{const x=o.externalConnections?.revenue?.find((B=>B.connectionName==="hubspot"))?.connectionId;if(x==null)return;g.trackIntegrationCredentialsSubmitted("hubspot","Onboarding","revenue");const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:E,connection_id:x,redirect_uri:f,tenant_id:k})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(f)}`},onDisconnect:(r,E)=>{const x=[...o.externalConnections?.accounting??[],...o.externalConnections?.payments??[],...o.externalConnections?.revenue??[]].find((B=>B.connectionId===r))?.connectionName;let f;try{f=x!=null?Ce(x):void 0}catch{f=void 0}f!=null&&g.trackIntegrationDisconnected(f,"Onboarding",E),a(Xn(k,r,be(E)))},onNotifyMe:r=>{g.trackIntegrationsNotifyMeClicked("Onboarding",r),a(Wn(ke,r,l))},onReconnectQBO:()=>{ie.init("/onboarding/auth",e),ie.handleClick()},onRefreshClick:()=>{o.integrations.refreshQBO.fetchState!=="In-Progress"&&a(Jn())},onSaveChargeBeeCredentials:(r,E)=>{const x=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;x!=null&&(g.trackIntegrationCredentialsSubmitted("chargebee","Onboarding","revenue"),a(Zn(k,x,be("revenue"),Ce("chargebee"),{api_key:r,site:E})))},onSaveConnectorCredentials:r=>{g.trackIntegrationCredentialsSubmitted(r.connectionName,"Onboarding","payments"),a(Hn(k,be("payments"),r))},plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v,plaidConnectionDetails:n})),[O,o,C,w,p,k,l,e,a,u,c,v,n])};function tn(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function an(e,l,i){let a=`/${e}/onboarding/address`;return a=i!=null?a.concat(`/edit/${l}/${encodeURIComponent(i)}`):a.concat(`/new/${l}`),a}const on=De.div`
|
|
26
|
+
`,nn=cn((function(e,l){const{companyId:i,isAdmin:a,currentTenant:p,isOnAddressPage:u}=l,c=z.getSignedInUser(),v=p.tenantId,n={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:v??""},t=Y(e),C=Ae(e,i),o=mn(e),A=fe(p?.userRole??[])&&C.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",w=Yn(e.userRoleConfigState);return{onboardingCustomerView:C,analytics:g,isRefreshingViewInBackground:!1,isDisabled:A,companyTitles:w.companyTitles,connectedAccountProvider:t.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Tt.fileMicroServiceBaseUrl,authParams:n},signedInUser:z.getSignedInUser(),currentTenant:t,isAdmin:a,isOnAddressPage:u,cardPaymentView:o,isCardPaymentPopupOpen:!1,stripeKey:ge.stripeKey}}),(function(e,l){const{companyId:i,currentTenant:a,themeState:p,navigate:u,location:c}=l,{tenantEmailDomain:v}=a;return{onFetchLinkTokenClick:(n,t)=>{e(kt(n,t))},onEstablishConnectionClick:(n,t)=>{e(It(n,t))},onUpdatePaymentAccountStatus:(n,t,C)=>{e(St(n,t,C))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(bt(!1,n,t))},onEstablishConnectionSuccess:()=>{e(Ct(i,!0,!1))},handleOnConnectClick:()=>{g.trackOnboardingConnectQBO(),ie.handleClick()},updateQBOPopupState:n=>{e(me({isQBOPopupOpen:n}))},onCompanyOfficerUpdated:n=>{const t=n.map((C=>{const{officerType:o,userId:A,name:w,email:k,ssn:O,nationalityCountryCode:P,dob:_,phone:F,syncToken:m,selectDocument:b,role:D,ownership:U,isSelectedForVerification:h,userVerificationStatus:r,fileIds:x,isPhoneVerified:E}=C;let f;return b.selectDocumentType==="driverLicense"?f="driving_license":b.selectDocumentType==="passport"?f="passport":b.selectDocumentType==="stateId"?f="id_document":b.selectDocumentType==="ssnCard"&&(f="social_security_card"),{officerType:o,userId:A,firstName:w.firstName,lastName:w.lastName,email:k,ssn:O,nationalityCountryCode:P?.selectedOption!=null?Ze(P.selectedOption):void 0,phone:F,birthday:_!=null?Ke(_?.toString()):_,syncToken:m,titleAtCompany:D.selectedOption,ownershipInCompany:U,documentTypeSelectedForVerification:f,isSelectedForVerification:h,userVerificationStatus:r,fileIds:x,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:E}}));e(ze({officers:t}))},onGetOtp:(n,t)=>{e(yt(n,"CustomerOnboarding")),t!=null&&e(ht({officerType:t,phone:n}))},onResendOtp:n=>{e(ft(n,"CustomerOnboarding"))},onVerifyOtp:(n,t)=>{g.trackOnboardingPhoneVerified(),e(gt(n,t,"CustomerOnboarding"))},updateFilesEntity:n=>{e(mt({files:n}))},onDeleteFile:n=>{e(pt(n))},onEditFileName:(n,t)=>{e(lt(n,t.split(".")[0]))},onCompanyDetailsChanged:n=>{const{companyDescription:t,companyIndustry:C,companyIndustryType:o,companyLegalName:A,companyTaxId:w,companyWebsite:k,companyPhone:O,primaryContactEmail:P,primaryContactName:_,primaryContactUserId:F,primaryContactSyncToken:m,syncToken:b,fileIds:D,typeOfIncorporation:U,stateOfIncorporation:h,incDate:r,companySourceOfFunds:x,companySourceOfFundsDescription:E,companySubIndustry:f,countriesOfOperations:B,purposeOfAccount:N,purposeOfAccountDescription:G,regulatedStatus:R,regulatedStatusDescription:ee,transactionVolume:S,transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$}=n,M={companyId:i,companyDescription:t,companyIndustry:C.selectedOption,companyIndustryType:o?.selectedOption??"",companyLegalName:A,taxIdOrEIN:w,website:k!=""&&k!=null?ut(k):void 0,phone:O,syncToken:b,fileIds:D,incDate:r!=null?Ke(r?.toString()):r,typeOfIncorporation:U?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:E,companySubIndustry:f?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((L=>L.length===2?L:Ze(L)))??[],purposeOfAccount:N?.selectedOption??"",purposeOfAccountDescription:G,regulatedStatus:R??"",regulatedStatusDescription:ee,transactionVolume:S?.selectedOption??"",transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$?.selectedOptions??[]},ce={userId:F,firstName:_.firstName,lastName:_.lastName,email:P,syncToken:m};e(ze({companyDetails:M,primaryContactDetails:ce}))},onAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onRegisteredAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onUpdateCustomerView:(n,t,C)=>{e(dt(i,!1,t,C,n))},onAddressEditHandler:n=>{if(n!=null){const t=wn(n);e(ln({addressType:"subscription_billing_address",addressToCreate:t}))}},onSkipSetupClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);e(gn(i,!1,!1)),u("./activation",{state:{pathnameStackToGoBack:n}})},onUpdateStep:n=>{e(un({step:n}))},onUpdateSubStep:n=>{e(ct({subStep:n}))},onZeniLogoClick:()=>{p.toggle()},handleLogOutClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);u("/signout",{replace:!0,state:{pathnameStackToGoBack:n,message:"logout"}})},handleCockpitClick:()=>{g.trackOnboardingFlowExited("cockpit"),window.open("/cockpit")},handleReferralsClick:()=>{u(`/${v}/rewards`)},handleCreateCardSetupIntent:n=>{e(dn(n))},handleConfirmCardSetupIntent:n=>{e(it(n))},updateCardPaymentModalState:n=>{e(me({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,C)=>{e(rt(n,t,C))},handleFetchPaymentSources:()=>{e(Oe())},resetCardPaymentViewState:()=>{e(st())},handleResetCardPaymentErrorStatuses:()=>{e(ot())},redirectToProductSuitePage:()=>{g.trackOnboardingFlowExited("product_suite");const n=q(c.state?.pathnameStackToGoBack,c.pathname);u(`/${v}/onboarding/thankyou`,{state:{pathnameStackToGoBack:n,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(g.trackOnboardingAiFinanceTeamAcknowledged(),e(at(i)))},onIdentityDocumentUploadedForAutofill:n=>{if(i==null)return;const t=nt(n.documentType);t!=null&&(g.trackOnboardingDocumentUploaded("kyc",t),e(tt({target:"onboarding",companyId:i,officerType:n.officerType,fileId:n.fileId,documentType:t})))},onCompanyDocumentUploadedForAutofill:n=>{i!=null&&(g.trackOnboardingDocumentUploaded("kyb",n.documentType),e(et({target:"onboarding",companyId:i,fileId:n.fileId,documentType:n.documentType})))}}}))(Et),le=({taxCFOCustomer:e=!1,isOnAddressPage:l=!1,appContent:i})=>{const a=fn(),p=_e(),u=xe(),c=se(),v=xt(),n=yn(),[t,C]=d.useState(!1),[o,A]=d.useState(!1),[w,k]=d.useState(!1),{tenantEmailDomain:O}=Ee(),P=hn(),{useFeatureGate:_}=Pe(),{isFeatureEnabled:F}=_(W.isDebitCardFeatureEnabled),m=Pn("/:tenantEmailDomain/onboarding")!==null&&u.search?.includes("code"),b=T((y=>y.onboardingCustomerViewState.fetchState)),D=T((y=>y.onboardingCustomerViewState.currentStep)),U=T((y=>y.onboardingCustomerViewState.uiState)),h=T((y=>Y(y))),r=T((y=>y.userRoleConfigState.fetchState)),x=T((y=>y.cardPaymentViewState)),E=X(x.addCardPaymentSourceStatus.fetchState),f=x.addCardPaymentSourceStatus.fetchState,{code:B,realmId:N,state:G}=Pt(u.search),R=h.externalConnections?.accounting[0],ee=R?.connectionType,S=R?.connectionName,V=R?.connectionId??"",Z=z.getSignedInUser()?.userId??"",$=d.useRef({realmId:"",connectionId:""});d.useEffect((()=>{o||(A(!0),c(Oe()))}),[o,c]),d.useEffect((()=>{w||(dn(["card"]),k(!0))}),[w]),d.useEffect((()=>{E==="In-Progress"&&f==="Completed"&&c(Oe())}),[E,f]),d.useEffect((()=>{Dt(B,N,G,V,Z)===!0&&h.externalConnections?.saveConnectionState!=="In-Progress"&&b==="Completed"&&(c(Gn(h.tenantId,{connection_type:ee??"accounting",connection_name:S??"quickbooks_online",authorization_code:B,realm_id:N,connection_id:V,user_id:Z},$n(window.location.origin+"/onboarding/auth"))),$.current={realmId:N,connectionId:V},g.trackOnboardingSaveQBOConnection(N,V),p(u.pathname))}),[B,N,G,u.pathname,b]),d.useEffect((()=>{ie.isInitiated===!1&&b==="Completed"&&ie.init("/onboarding/auth",h.tenantEmailDomain)}),[b]);const M=h.companyId??z.getSignedInUserTenant(O)?.companyId,ce=fe(h?.userRole??[]),L=T((y=>Ae(y,M)));d.useEffect((()=>{t||b!=="Not-Started"||M==null||(C(!0),c(Mn(M,!0,!m)))}),[t,b,M]);const ne=h.externalConnections?.saveConnectionState,Be=X(ne);d.useEffect((()=>{Be==="In-Progress"&&(ne==="Completed"||ne==="Error")&&U.isQBOPopupOpen&&D==="connect_ledger"&&(ne==="Completed"?g.trackOnboardingQBOConnectionSuccess($.current.realmId,$.current.connectionId):g.trackOnboardingQBOConnectionFailed($.current.realmId,$.current.connectionId,h.externalConnections?.saveOAuthConnectionError?.message??""),c(me({isQBOPopupOpen:!1})))}),[ne,Be,U.isQBOPopupOpen,D,g,c]),d.useEffect((()=>{b==="Completed"&&m&&(c(un({step:"connect_ledger"})),c(me({isQBOPopupOpen:!0})))}),[m,b]),d.useEffect((()=>{r==="Not-Started"&&c(Qn(!0))}),[r,c]);const Cn=X(L.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&L.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Cn==null&&c(ln({addressType:"company_registered_address",addressToCreate:L.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[L.companyDetailsLocalData?.addressStatus?.addressToCreate,L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const bn=L.isInterimEmailSent,je=z.getSignedInUser();if(je==null)throw Error("Can't access onboarding flow without signing in...");const Sn=Te(F,h),In=we(h),Fe=h.company?.companyOnboardingInfo.isOnboardingCompleted,Ve=y=>y.trackPageLoaded(ve.Event.onboardingPage),ye=h.productSettings.isOtherProductsEnabled,kn=ye===!0&&!pn(h),On=h.productSettings.isTreasuryEnabled,Ue=Ut({tenantEmailDomain:O??"",signedInUserEmail:je.userEmail??"",companyId:M}),Le=(({companyId:y})=>{const K=se(),de=T((j=>j.onboardingCustomerViewState?.aiAgentsActivation)),te=T((j=>Y(j).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),he=d.useCallback((()=>{K(Un())}),[K]);d.useEffect((()=>{he()}),[he]);const Re=d.useCallback((()=>{y==null||y===""||te||K(Ln(y))}),[y,te,K]),vn=d.useMemo((()=>{if(y==null||y==="")return[];const j=`private-encrypted-${y}`;return[`${j}.ledger-ingestion.counts-updated`,`${j}.ai-agents-activation.phase-changed`]}),[y]),_n=d.useCallback(((j,ae)=>{if(ae==null||typeof ae!="object")return;const I=ae;if(j!=="ledger-ingestion.counts-updated"){if(j==="ai-agents-activation.phase-changed"){const ue=typeof I.phase_key=="string"?I.phase_key:typeof I.key=="string"?I.key:"",J=typeof I.status=="string"?I.status:"idle";if(ue==="")return;K(Nn({key:ue,status:J==="starting"||J==="building"||J==="ready"?J:"idle",startedAt:typeof I.started_at=="string"?I.started_at:void 0,completedAt:typeof I.completed_at=="string"?I.completed_at:void 0}))}}else K(Rn({customerCount:typeof I.customer_count=="number"?I.customer_count:void 0,glAccountCount:typeof I.gl_account_count=="number"?I.gl_account_count:void 0,targetTransactionCount:typeof I.target_transaction_count=="number"?I.target_transaction_count:void 0,transactionCount:typeof I.transaction_count=="number"?I.transaction_count:void 0,vendorCount:typeof I.vendor_count=="number"?I.vendor_count:void 0}))}),[K]);return Ft({events:vn,onEvent:_n,onSubscribed:he}),d.useMemo((()=>{const j=de?.phases??[],ae=We(j,Se),I=We(j,Ie),ue=Xe(j,Se),J=Xe(j,Ie),Ne=j.some((Tn=>Tn.status!=="idle")),oe=!te&&!Ne,Ge=te&&!Ne,xn=Ge?Se.map((()=>"building")):ae,En=Ge?Ie.map((()=>"building")):I;return{ledgerRowStatuses:oe?void 0:xn,backgroundRowStatuses:oe?void 0:En,showLedgerReadyInLabel:oe?void 0:ue,showBackgroundReadyInLabel:oe?void 0:J,forceContinueEnabled:!oe||void 0,counts:de?.counts,onContinueClicked:Re}}),[de?.phases,de?.counts,te,Re])})({companyId:M});if(Fe===!0){if(!ye)return On?s.jsx(Q,{to:"../../treasury"}):Sn?s.jsx(Q,{to:"../../checking"}):In?s.jsx(Q,{to:"../../cards"}):s.jsx(Q,{to:"../../dashboard"});const y=L.updateStatus.fetchState==="In-Progress";if(ye&&!y)return e?s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:K=>Ve(K)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):s.jsx(Q,{to:"../../onboarding/thankyou"})}else if(Fe===!1&&P?.loggedInUserRoleMap!=null)return bn===!0&&kn?s.jsx(Q,{to:"../../onboarding/thankyou"}):s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:y=>Ve(y)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ke="external_integrations",Ut=({tenantEmailDomain:e,signedInUserEmail:l,companyId:i})=>{const a=se(),{pendingAutoFocusTabId:p}=Bt(),{plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v}=jt({companyId:i}),n=T((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=T((r=>Y(r))),C=T((r=>r.tenantState.fetchState)),o=T((r=>Kn(r,i))),A=T((r=>zn(r,ke))),w=d.useMemo((()=>new Set(A.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[A]),k=t.tenantId,O=fe(t.userRole??[]);d.useEffect((()=>{a(qn(ke))}),[a]);const P=o.externalConnections?.saveAPIKeyConnectionState,_=o.externalConnections?.saveAPIKeyConnectionError?.message,F=X(P);d.useEffect((()=>{F==="In-Progress"&&(P==="Completed"?g.trackIntegrationConnected("chargebee","Onboarding","revenue"):P==="Error"&&g.trackIntegrationConnectFailed("chargebee","Onboarding","revenue",_??""))}),[P,F,_]);const m=o.externalConnections?.saveOAuthConnectionState,b=o.externalConnections?.saveOAuthConnectionError?.message,D=X(m);d.useEffect((()=>{D==="In-Progress"&&(m==="Completed"?g.trackIntegrationConnected("hubspot","Onboarding","revenue"):m==="Error"&&g.trackIntegrationConnectFailed("hubspot","Onboarding","revenue",b??""))}),[m,D,b]);const U=o.externalConnections?.saveConnectorCredentialsStateBySlug,h=X(U);return d.useEffect((()=>{const r=U??{},x=h??{},E=o.externalConnections?.saveConnectorCredentialsErrorBySlug??{};Object.keys(r).forEach((f=>{if(x[f]!=="In-Progress")return;let B;try{B=Ce(f)}catch{return}r[f]==="Completed"?g.trackIntegrationConnected(B,"Onboarding","payments"):r[f]==="Error"&&g.trackIntegrationConnectFailed(B,"Onboarding","payments",E[f]?.message??"")}))}),[U,h,o]),d.useMemo((()=>({isAdmin:O,analytics:g,referrer:"Onboarding",integrationsView:o,isLoading:C==="In-Progress",notifyMeRegisteredSlugs:w,autoFocusTabId:p??void 0,saveChargeBeeState:o.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:o.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:o.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:o.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:o.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(o.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,x])=>[r,x?.message]))),deleteConnectionState:o.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:o.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{g.trackIntegrationConnectClicked("gmail","Onboarding","email"),a(Qe(k,"gmail",tn()))},onConnectOutlook:()=>{g.trackIntegrationConnectClicked("outlook","Onboarding","email"),a(Qe(k,"outlook",tn()))},onConnectHubSpot:(r,x)=>{const E=o.externalConnections?.revenue?.find((B=>B.connectionName==="hubspot"))?.connectionId;if(E==null)return;g.trackIntegrationCredentialsSubmitted("hubspot","Onboarding","revenue");const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:x,connection_id:E,redirect_uri:f,tenant_id:k})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(f)}`},onDisconnect:(r,x)=>{const E=[...o.externalConnections?.accounting??[],...o.externalConnections?.payments??[],...o.externalConnections?.revenue??[]].find((B=>B.connectionId===r))?.connectionName;let f;try{f=E!=null?Ce(E):void 0}catch{f=void 0}f!=null&&g.trackIntegrationDisconnected(f,"Onboarding",x),a(Xn(k,r,be(x)))},onNotifyMe:r=>{g.trackIntegrationsNotifyMeClicked("Onboarding",r),a(Wn(ke,r,l))},onReconnectQBO:()=>{ie.init("/onboarding/auth",e),ie.handleClick()},onRefreshClick:()=>{o.integrations.refreshQBO.fetchState!=="In-Progress"&&a(Jn())},onSaveChargeBeeCredentials:(r,x)=>{const E=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;E!=null&&(g.trackIntegrationCredentialsSubmitted("chargebee","Onboarding","revenue"),a(Zn(k,E,be("revenue"),Ce("chargebee"),{api_key:r,site:x})))},onSaveConnectorCredentials:r=>{g.trackIntegrationCredentialsSubmitted(r.connectionName,"Onboarding","payments"),a(Hn(k,be("payments"),r))},plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v,plaidConnectionDetails:n})),[O,o,C,w,p,k,l,e,a,u,c,v,n])};function tn(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function an(e,l,i){let a=`/${e}/onboarding/address`;return a=i!=null?a.concat(`/edit/${l}/${encodeURIComponent(i)}`):a.concat(`/new/${l}`),a}const on=De.div`
|
|
27
27
|
display: flex;
|
|
28
28
|
height: 100vh;
|
|
29
29
|
background-color: ${e=>e.theme.colors.grey4};
|
|
30
|
-
`,sn=cn((function(e,l){const{companyId:i,currentTenant:a}=l,p=Ae(e,i),u=mn(e);return{hasVerifiedBankAccount:(p.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(u.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:fe(a?.userRole??[])&&p.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:z.getSignedInUser(),currentTenant:a}}),(function(e,l){const{currentTenant:i,themeState:a,navigate:p,location:u}=l,{tenantEmailDomain:c}=i;return{onZeniLogoClick:()=>{a.toggle()},handleLogOutClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p("/signout",{replace:!0,state:{pathnameStackToGoBack:v,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{p(`/${c}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p(`/${c}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:v,message:"UpdatePaymentAddressDetail"}})}}}))(At),Lt=()=>{const e=fn(),l=_e(),i=se(),a=
|
|
30
|
+
`,sn=cn((function(e,l){const{companyId:i,currentTenant:a}=l,p=Ae(e,i),u=mn(e);return{hasVerifiedBankAccount:(p.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(u.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:fe(a?.userRole??[])&&p.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:z.getSignedInUser(),currentTenant:a}}),(function(e,l){const{currentTenant:i,themeState:a,navigate:p,location:u}=l,{tenantEmailDomain:c}=i;return{onZeniLogoClick:()=>{a.toggle()},handleLogOutClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p("/signout",{replace:!0,state:{pathnameStackToGoBack:v,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{p(`/${c}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p(`/${c}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:v,message:"UpdatePaymentAddressDetail"}})}}}))(At),Lt=()=>{const e=fn(),l=_e(),i=se(),a=xe(),p=yn(),{useFeatureGate:u}=Pe(),{isFeatureEnabled:c}=u(W.isDebitCardFeatureEnabled),{tenantEmailDomain:v}=Ee(),n=hn(),[t,C]=d.useState(!1);d.useEffect((()=>{t===!1&&a.state?.message==="OnboardingThankyou"&&C(!0)}),[a.state]);const o=T((m=>Y(m))),A=o.productSettings.isOtherProductsEnabled,w=A===!0&&!pn(o);d.useEffect((()=>{i(gn(k,!1,!w))}),[]);const k=o.companyId??z.getSignedInUserTenant(v)?.companyId;if(n.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const O=Te(c,o),P=we(o),_=T((m=>m.onboardingCustomerViewState.updateStatus.fetchState)),F=o.company?.companyOnboardingInfo.isOnboardingCompleted;if(F!==!0||w)return _==="Completed"&&F===!0&&w&&n?.loggedInUserRoleMap!=null?s.jsxs(on,{children:[s.jsx(re,{analytics:g,onLoad:m=>{m.trackPageLoaded(ve.Event.onboardingLandingPage,"Onboarding",Ot(o.productSettings))}}),s.jsx(sn,{navigate:l,showUpdatePaymentDetailButton:A,location:a,companyId:k,currentTenant:o,themeState:p,isVisitingFirstTime:t,meetingUrl:e("onboarding_overview")})]}):_==="Completed"&&F===!1&&n?.loggedInUserRoleMap!=null?s.jsxs(on,{children:[s.jsx(re,{analytics:g,onLoad:m=>{m.trackPageLoaded(ve.Event.onboardingInterimPage)}}),s.jsx(sn,{navigate:l,showUpdatePaymentDetailButton:A,location:a,companyId:k,currentTenant:o,themeState:p,isVisitingFirstTime:t,meetingUrl:e("onboarding_overview")})]}):s.jsx(wt,{});{const m={pathnameStackToGoBack:a.state?.pathnameStackToGoBack,message:"activation"};return O?s.jsx(Q,{to:"../../checking",state:m,replace:!0}):P?s.jsx(Q,{to:"../../cards",state:m,replace:!0}):s.jsx(Q,{to:"../../dashboard",state:m,replace:!0})}};function rn(){return typeof Me=="function"?Me():void 0}let pe=0;function Rt(){d.useEffect((()=>{if(!ge.sentryDsn?.trim())return;let e,l=!1,i=0;const a=()=>{e!==void 0&&(clearInterval(e),e=void 0)},p=()=>{const u=rn();return u!==void 0&&(u.flush(),!0)};return pe+=1,p()||(e=setInterval((()=>{i+=1,(l||p()||i>=10)&&a()}),1e3)),()=>{l=!0,a(),pe-=1,queueMicrotask((()=>{pe===0&&(function(){const u=rn();if(u===void 0)return;const c=()=>{if(pe===0)try{u.startBuffering()}catch{}};u.stop().then(c,c)})()}))}}),[])}function pa(){return Rt(),s.jsxs(Dn,{children:[s.jsx(H,{path:"/",element:s.jsx(le,{})}),s.jsx(H,{path:"/billing/edit",element:s.jsx(le,{taxCFOCustomer:!0})}),s.jsx(H,{path:"/thankyou",element:s.jsx(Lt,{})}),s.jsx(H,{path:"/activation",element:s.jsx(Vt,{})}),s.jsx(H,{path:"/address/edit/:addressType/:addressId",element:s.jsx(le,{isOnAddressPage:!0,appContent:s.jsx($e,{})})}),s.jsx(H,{path:"/address/new/:addressType",element:s.jsx(le,{isOnAddressPage:!0,appContent:s.jsx($e,{})})}),s.jsx(H,{path:"*",element:s.jsx(An,{})})]})}export{pa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CW9yScMF.js";import{i as q,j as _,g as Z,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-BI5oX4mx.js";import{fF as L,VH as Ze,bE as sa,br as Ee,X2 as An,ka as vn,X3 as Xt,X4 as In,kd as gt,X5 as Qe,X6 as En,ki as Tn,X7 as Yt,X8 as xn,km as bt,X9 as He,Xa as Dn,Xb as wn,V$ as Pn,lo as On,Xc as Fn,bn as Je,Xd as ra,WF as ue,bc as ia,lC as ca,ll as la,WH as me,WG as ae,fE as da,ga as jn,gq as Ct,Xe as Rn,Xf as Bn,Xg as ua,Xh as Oe,DR as Me,DS as Ue,Ee as Te,E8 as pe,DW as Le,Xi as Mn,b$ as Ve,Xj as Un,Xk as Ln,Xl as ma,Xm as Fe,Xn as Vn,ei as et,A2 as pa,Xo as Xn,Xp as ha,Xq as Yn,Xr as Gn,Xs as Nn,Xt as St,UD as kt,u6 as xe,l$ as De,Eo as yt,A9 as $n,Ag as zn,Xu as Kn,Xv as qn,DT as Gt,Xw as Qn,A5 as ve,A0 as fa,Xx as be,Xy as Nt,Xz as Hn,XA as At,UC as vt,Cd as ga,XB as Wn,XC as ba,XD as Zn,XE as Jn,XF as eo,XG as It,Cs as to,Cz as ao,XH as no,XI as oo,DV as $t,XJ as so,Cb as Ca,XK as Ce,XL as zt,XM as ro,bq as _a,Et as Sa,XN as io,XO as ka,XP as co,XQ as lo,XR as uo,XS as Et,El as mo,En as po,XT as ho,XU as fo,DU as Kt,XV as go,Er as ya,XW as _e,XX as qt,XY as bo,XZ as Co,X_ as Aa,lQ as va,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BA as _o,dc as So,pQ as ko,T_ as yo,q5 as Ao,X$ as vo,Y0 as Io,Y1 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-CIizsNeB.js";import{z as V,av as oe,p as j,k as T,G as Q,bb as Bo,as as Xe,a8 as Ye,bc as wa,S as N,bd as Mo,be as Pa,c as Uo,bf as Lo,bg as Vo,a as Oa,a1 as Fa,f as ja,ar as Xo,bh as Yo,ao as Go,N as we,bi as Ra,x as ce,bj as Ba,bk as Ma,au as Ua,bl as No,ai as Ge,U as Ne,d as X,bm as $o,q as zo,j as Ko,a4 as qo,aq as Qo,bn as Ho,bo as Wo,bp as Zo,bq as Ie}from"./index-C2L5Bzwa.js";import{n as xt}from"./mui-KP5Ep0NX.js";import{a as b}from"./sentry-C_uJQK1a.js";import{w as La}from"./withTransactionSidePanel-mkP2Wc9X.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-BrIEdo8u.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-4TGjNsPg.js";import Be from"./NotFoundScreen-CS6UgwGr.js";import{u as Pt}from"./useInitialThreadRequest-BNsRpSRE.js";import{t as Xa}from"./analyticsHelper-k_Sp-PwA.js";import{C as es}from"./CompanyPassportScreen-CbwVCSdf.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-CZodBcrZ.js";import{F as as}from"./FeaturePreviewScreen-R_rh5xYj.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.js";import"./TransactionDetailScreen-C32uKUIF.js";import"./decodeURIComponentSafe-B7oIXSPO.js";import"./expenseAutomationHelper-CqPrLTRM.js";import"./stripSplatSuffix-CSXpdRK5.js";import"./MobileAppDrawer-DEm85bH8.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./useTaskManagerAccess-Bhr2JI_X.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]="47387ef9-e809-459a-8518-82fa4cb9b56b",e._sentryDebugIdIdentifier="sentry-dbid-47387ef9-e809-459a-8518-82fa4cb9b56b")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=Z(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>An(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(vn(o,u))}),[u]),A=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Xt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Xt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:A,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),A=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=Z(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),A=b.useCallback(((D,E)=>{u(Yt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Yt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:A,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((A=>xn(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((A=>L(A))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((A=>{e(He({searchString:A}))}),[]),u=b.useCallback(((A,S)=>{e(He({sortKey:S,sortOrder:A}))}),[]),C=b.useCallback((A=>{a(`./${A}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((A=>{e(He({downloadState:A}))}),[]),k=b.useCallback(((A,S)=>{e(He({selectedDate:A,agingDateSelectionType:S})),e(bt(A))}),[]),I=b.useCallback(((A,S)=>{e(Dn({nodeId:A,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:A=>A.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ga(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ya(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ga)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ga)(Pa);function ls(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-DKqwsBQp.js";import{i as q,j as _,g as Z,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-D6EV-11Y.js";import{fF as L,VH as Ze,bE as sa,br as Ee,X2 as An,ka as vn,X3 as Xt,X4 as In,kd as gt,X5 as Qe,X6 as En,ki as Tn,X7 as Yt,X8 as xn,km as bt,X9 as He,Xa as Dn,Xb as wn,V$ as Pn,lo as On,Xc as Fn,bn as Je,Xd as ra,WF as ue,bc as ia,lC as ca,ll as la,WH as me,WG as ae,fE as da,ga as jn,gq as Ct,Xe as Rn,Xf as Bn,Xg as ua,Xh as Oe,DR as Me,DS as Ue,Ee as Te,E8 as pe,DW as Le,Xi as Mn,b$ as Ve,Xj as Un,Xk as Ln,Xl as ma,Xm as Fe,Xn as Vn,ei as et,A2 as pa,Xo as Xn,Xp as ha,Xq as Yn,Xr as Gn,Xs as Nn,Xt as St,UD as kt,u6 as xe,l$ as De,Eo as yt,A9 as $n,Ag as zn,Xu as Kn,Xv as qn,DT as Gt,Xw as Qn,A5 as ve,A0 as fa,Xx as be,Xy as Nt,Xz as Hn,XA as At,UC as vt,Cd as ga,XB as Wn,XC as ba,XD as Zn,XE as Jn,XF as eo,XG as It,Cs as to,Cz as ao,XH as no,XI as oo,DV as $t,XJ as so,Cb as Ca,XK as Ce,XL as zt,XM as ro,bq as _a,Et as Sa,XN as io,XO as ka,XP as co,XQ as lo,XR as uo,XS as Et,El as mo,En as po,XT as ho,XU as fo,DU as Kt,XV as go,Er as ya,XW as _e,XX as qt,XY as bo,XZ as Co,X_ as Aa,lQ as va,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BA as _o,dc as So,pQ as ko,T_ as yo,q5 as Ao,X$ as vo,Y0 as Io,Y1 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-CZbm731W.js";import{z as V,av as oe,p as j,l as T,G as Q,bb as Bo,as as Xe,a8 as Ye,bc as wa,T as N,bd as Mo,be as Pa,E as Uo,bf as Lo,bg as Vo,a as Oa,a1 as Fa,f as ja,ar as Xo,bh as Yo,ao as Go,N as we,bi as Ra,y as ce,bj as Ba,bk as Ma,au as Ua,bl as No,ai as Ge,U as Ne,d as X,bm as $o,g as zo,k as Ko,a4 as qo,aq as Qo,bn as Ho,bo as Wo,bp as Zo,bq as Ie}from"./index-DvW7BRlL.js";import{n as xt}from"./mui-qouWiIWk.js";import{a as b}from"./sentry-CxSdF_rC.js";import{w as La}from"./withTransactionSidePanel-CPG02lKM.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-GYFjoelZ.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import Be from"./NotFoundScreen-sryCVGSu.js";import{u as Pt}from"./useInitialThreadRequest-BwX5Js6P.js";import{t as Xa}from"./analyticsHelper-DcvdGte-.js";import{C as es}from"./CompanyPassportScreen-CEuR94fF.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-D_Ro-9Tt.js";import{F as as}from"./FeaturePreviewScreen-LeLfD5pA.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./TransactionDetailScreen-CjwF3ORf.js";import"./decodeURIComponentSafe-MQV5aj_5.js";import"./expenseAutomationHelper-DEOPVtcg.js";import"./stripSplatSuffix-CYVrHv_0.js";import"./MobileAppDrawer-DExJFFmi.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.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]="22582b0d-f1a3-475e-8203-e8304bef176a",e._sentryDebugIdIdentifier="sentry-dbid-22582b0d-f1a3-475e-8203-e8304bef176a")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=Z(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>An(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(vn(o,u))}),[u]),A=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Xt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Xt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:A,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),A=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=Z(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),A=b.useCallback(((D,E)=>{u(Yt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Yt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:A,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((A=>xn(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((A=>L(A))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((A=>{e(He({searchString:A}))}),[]),u=b.useCallback(((A,S)=>{e(He({sortKey:S,sortOrder:A}))}),[]),C=b.useCallback((A=>{a(`./${A}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((A=>{e(He({downloadState:A}))}),[]),k=b.useCallback(((A,S)=>{e(He({selectedDate:A,agingDateSelectionType:S})),e(bt(A))}),[]),I=b.useCallback(((A,S)=>{e(Dn({nodeId:A,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:A=>A.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ga(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ya(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ga)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ga)(Pa);function ls(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.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-DKqwsBQp.js";import{a as u}from"./sentry-CxSdF_rC.js";import{u as y,j as p,l as w,g as A,N as L}from"./core-D6EV-11Y.js";import{TJ as N,fF as _,gl as U,TK as k,pS as R,TL as z}from"./zeni-epic-state-CZbm731W.js";import{u as j,z as f,L as C,t as I,G as O,b as $}from"./index-DvW7BRlL.js";import"./mui-qouWiIWk.js";import{t as P}from"./getLocaleForTenant-C3wVeXiS.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.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]="93b3b57e-ba53-412d-b9e0-47eb1fb35df7",t._sentryDebugIdIdentifier="sentry-dbid-93b3b57e-ba53-412d-b9e0-47eb1fb35df7")}catch{}})();const G=w((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=A(),m=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let b="";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 T=E(r.pathname);if(T!=null)c=`../${o.tenantEmailDomain}/${T}`,b="comingFromV2UrlPath",T==="ai-cfo/explore"&&(d=m.get("question")?.replace(/^["']|["']$/g,"")??null,e=m.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,x)=>l||i.split("/").find((D=>D===x))!=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}`,b="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 F=$(c,m);return v.jsx(L,{to:F,replace:!0,state:{...r.state,origin:"",message:b,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),m=u.useRef(null),b=p((e=>N(e))),n=p((e=>e.tenantState.fetchState)),i=p((e=>e.tenantState.error)),a=p((e=>e.tenantState.activeTenantFetchState.fetchState)),c=p((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;m.current!==e&&(m.current=e,h.current=!1,r.current=!1,s(C.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(C.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"&&b.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(b.tenantsCoreDetailsInOrder),o())}),[b.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}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"],q={"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 q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-DdrkO-LG.js → DomesticWireDetailScreen-Dj3JCDGh.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-DKqwsBQp.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-D6EV-11Y.js";import{YH as k,YO as _,gG as W,gF as K,gE as L,kP as M,WG as q,uK as J,fF as B,Ye as D,kN as F,YI as S,YR as G,kL as T,l6 as j}from"./zeni-epic-state-CZbm731W.js";import{bM as Q,a1 as N,N as R,z as O,E as U,a4 as p,d as v,a7 as Y,bN as X,I as H,bO as ee,p as te}from"./index-DvW7BRlL.js";import{n as Z}from"./mui-qouWiIWk.js";import"./sentry-CxSdF_rC.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]="4808b840-7c5a-4bce-9718-55db2a5a674f",e._sentryDebugIdIdentifier="sentry-dbid-4808b840-7c5a-4bce-9718-55db2a5a674f")}catch{}})();const ae=E(null,(function(e,t){return{onSaveVendor:a=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(J(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(K(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(W(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}}))(Q);function z({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-CW9yScMF.js";import{h as w,g as C,j as h,l as A,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,oe=
|
|
9
|
+
`,oe=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:a,location:n,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(T(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(n.state?.pathnameStackToGoBack),r=s.poppedPathname??P();a(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(G({data:r}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(X);function fe({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),d=e??s,{useFeatureGate:c}=R(),i=O.getSignedInUser(),b=h((u=>B(u))),g=U(),I=p(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:x}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Y,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ne,{windowSize:o,children:[l.jsx(z,{vendorId:d,billId:r}),l.jsx(oe,{location:n,navigate:a,billId:r,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t},me=(e,t,a)=>{let n=`/${e}/bill/${encodeURIComponent(t)}`;return a=="draft"&&(n+="/edit"),n},he=e=>`/${e}/bills`,ke=(e,t)=>{let a=`/${e}/bill`;return a=t!=null?a.concat(`/${t}/edit`):a.concat("/new"),a},A=(e,t,a,n)=>{let o=`/${e}/bill`;return o+=a!=null?`/${a}/edit/vendor`:"/new/vendor",o+=n!=null?`/${n}/edit/${t}`:`/create/${t}`,o};function Se(e,t,a){return A(e,"ach",t,a)}function ve(e,t,a){return A(e,"domestic",t,a)}function ge(e,t,a){return A(e,"international",t,a)}const se=(e,t,a)=>{let n=`/${e}/bill/`;return n=a!=null?n.concat(`${encodeURIComponent(a)}/${t}/`):n.concat(`new/${t}/`),n},ce=Z.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100vh;
|
|
12
12
|
width: 100%;
|
|
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-CW9yScMF.js";import{h as w,g as C,j as h,l as A,
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
17
|
box-shadow: ${e=>`0px 2px ${H.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,
|
|
18
|
+
`,re=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:a,navigate:n,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:d}=r;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(T(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:i}=c;e(G({data:i}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),i=c.poppedPathname??$();n(i,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")n("./add-address");else{const i=se(d,c,a),b=te(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),i=c.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),d=e??s,c=O.getSignedInUser(),{useFeatureGate:i}=R(),b=U(),g=h((u=>B(u))),I=p(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:x}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(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(Y,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${H.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(z,{vendorId:d,billId:r}),l.jsx(re,{location:n,navigate:a,billId:r,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{fe as A,Ie as D,z 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-DKqwsBQp.js";import{a1 as c,ab as l,E as f}from"./index-DvW7BRlL.js";import{D as p}from"./mui-qouWiIWk.js";import"./sentry-CxSdF_rC.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]="c06e3c71-2cdd-4b4c-9d6d-3f270023e5b2",e._sentryDebugIdIdentifier="sentry-dbid-c06e3c71-2cdd-4b4c-9d6d-3f270023e5b2")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:d}=e,n=c(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),a=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:d,children:t})}export{h as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DKqwsBQp.js";import{a as d}from"./sentry-CxSdF_rC.js";import{h as B,u as F,g as G,i as A,j as l,N as q,l as $,n as N,o as _}from"./core-D6EV-11Y.js";import{WK as O,fF as H,W0 as M,m$ as R,S1 as k,WP as Y,WF as z,l$ as K,S2 as S,W5 as V,W6 as J,WH as L,WG as Q}from"./zeni-epic-state-CZbm731W.js";import{b8 as U,l as X,a4 as Z,p as tt}from"./index-DvW7BRlL.js";import"./mui-qouWiIWk.js";import{d as b}from"./decodeURIComponentSafe-MQV5aj_5.js";import{w as et}from"./withTransactionSidePanel-CPG02lKM.js";import{f as at,c as nt}from"./routePaths-GYFjoelZ.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import"./TransactionDetailScreen-CjwF3ORf.js";import"./useInitialThreadRequest-BwX5Js6P.js";import"./expenseAutomationHelper-DEOPVtcg.js";import"./stripSplatSuffix-CYVrHv_0.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]="2583f9a8-63e4-41e0-a1ed-bfb37a47ab36",a._sentryDebugIdIdentifier="sentry-dbid-2583f9a8-63e4-41e0-a1ed-bfb37a47ab36")}catch{}})();const ot=$((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:K(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(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(J()),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=B(),o=F(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:W,entityNameEncoded:w}=A(),r=b(W??""),p=b(w??""),f=rt(r,p),x=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>O(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=l((n=>H(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(R(i)))}),[m,f,i]);const P=l((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??g,v=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,P]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(x.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 jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-FRK8lYq7.js → ExpenseAutomationRoutes-BYSJ88to.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-DKqwsBQp.js";import{u as he,h as nt,g as be,j as F,i as Ue,t as qn,l as Jn,n as Wn,o as He,N as Yn}from"./core-D6EV-11Y.js";import{fF as ke,a0S as Hn,q0 as _e,U0 as Kn,zX as Zn,a0T as Qn,a0U as Xn,a0V as es,a0W as gt,a0X as Ze,gh as bt,a0Y as oa,eW as ts,g0 as as,a0Z as ca,a0_ as Qe,qT as ns,uN as ss,gS as os,gQ as cs,a0$ as is,r4 as ls,rd as rs,qb as ds,qp as xa,gP as re,gR as us,a10 as ms,qL as wa,re as ps,qm as hs,qh as Ss,uT as gs,gO as Me,a11 as tt,C5 as Ra,Mm as Da,a12 as Fa,Fo as _a,a13 as Cs,eZ as fs,e$ as Is,sP as Tt,WL as ia,WN as ks,m2 as bs,WO as Ts,m9 as Ps,dl as ys,Do as Pt,a14 as vs,a15 as Es,fm as yt,sD as la,WF as As,a16 as xs,a17 as ws,mb as Rs,a18 as Ds,R2 as Fs,ma as _s,l$ as Ms,qE as Ma,rj as at,tp as Oa,tL as Os,TS as Ua,ri as ra,rl as Ba,rn as Us,bE as Bs,ny as Vs,nv as js,rm as Xe,rk as pe,a19 as zs,rE as da,a1a as Ls,a1b as $s,sH as Gs,sI as Ns,WB as qs,VH as Js,a0k as Ws,a1c as Ys,WH as ua,WG as Ke,a1d as ma,mq as Hs,a1e as Ks,a1f as Zs,a1g as Qs,a1h as Xs,qz as eo,a1i as to,a1j as ao,a1k as no,ru as so,md as oo,m4 as co,a1l as io,mc as pa,WY as lo,a1m as ro,a1n as uo,uo as mo,t$ as po,t_ as Ct,a1o as ho,a1p as So,a1q as go,a1r as Co,nJ as fo,br as Io,nE as ha,nq as ko,a1s as bo,g$ as To,nB as Po,sR as yo,sT as vo,sA as Eo,VK as Ao,VL as xo,ES as wo,ER as Ro,F6 as Do,a1t as Sa,sG as Fo,a1u as _o,rU as Mo,r_ as Oo,s9 as Uo,rX as Bo,a1v as Vo,s8 as jo,sM as zo,a1w as Lo,sZ as $o,su as Go,t2 as No,sz as qo,rF as Jo,a1x as Wo,qX as Yo,qv as Ho,qC as ga,rp as Ko,a1y as Zo,a1z as Qo,a1A as Xo,a1B as ec,a1C as tc,a1D as ac,t6 as nc,a1E as sc,a1F as oc,a1G as Ca,uz as cc,tS as ic,tH as fa,tF as lc,a1H as rc,tu as dc,t9 as uc,tI as mc,a1I as pc,a1J as hc,tf as Sc,a1K as gc,ta as Cc,te as fc,tc as Ic,tO as kc}from"./zeni-epic-state-CZbm731W.js";import Va from"./NotFoundScreen-sryCVGSu.js";import{a as s,R as ja}from"./sentry-CxSdF_rC.js";import{n as Te,S as bc}from"./mui-qouWiIWk.js";import{N as Be,d as H,l as Q,p as te,aq as za,as as La,dQ as Tc,dR as Pc,z as st,dS as yc,dT as vc,dU as Ec,ae as Oe,dV as Ac,dW as Ia,ba as ka,dX as xc,a7 as $a,dY as wc,k as et,a as Rc,dZ as Dc,d_ as Fc,c as _c,U as Mc,d$ as Oc,e0 as Uc,e1 as Bc,b4 as Vc,br as jc,ab as zc,b5 as Lc,b6 as $c,G as Gc,w as Nc,e2 as qc,av as ba,e3 as Jc}from"./index-DvW7BRlL.js";import{u as Ga}from"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import{g as Ta,b as Wc,c as Yc,h as Hc,a as Kc,i as Zc,r as Qc,C as Xc}from"./TransactionDetailScreen-CjwF3ORf.js";import{u as ei}from"./useActualMatchingMatchDetail-BkDnJbPg.js";import{d as ti}from"./decodeURIComponentSafe-MQV5aj_5.js";import{m as Na,a as qa}from"./expenseAutomationHelper-DEOPVtcg.js";import{u as Ja,a as Wa,w as ai}from"./withTransactionSidePanel-CPG02lKM.js";import{b as ni,S as si,a as oi,J as ci}from"./ScheduleDetailsPrepaidExpensesScreen-B5q5sAGy.js";import{s as Pa,i as Ya,h as ii,v as li,c as ri}from"./routePaths-GYFjoelZ.js";import{a as ft}from"./accountMappingHelper-DWzrp9Pr.js";import{D as di}from"./DrawerScreen-CxKP-6Rf.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./useInitialThreadRequest-BwX5Js6P.js";import"./stripSplatSuffix-CYVrHv_0.js";import"./pathToGoBack-DMRqTTJ7.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="cb2c278e-92be-4a19-a2d4-d5e597b6a2c6",t._sentryDebugIdIdentifier="sentry-dbid-cb2c278e-92be-4a19-a2d4-d5e597b6a2c6")}catch{}})();const ui=()=>{const t=he(),n=nt(),S=be(),g=F((h=>ke(h))),{useFeatureGate:d}=Be(),{isFeatureEnabled:i}=d(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=d(H.aiAuditScorePercentage),A=F((h=>h.expenseAutomationViewState.selectedPeriodByTenantId)),l=F((h=>Hn(h,g.tenantId))),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=Ga({mobileExploreReferrer:"Month-End Close Overview"}),k=s.useCallback(((h,T,z=!1)=>{t(_e({tenantId:T,period:{month:h.month,year:h.year},refreshViewInBackground:z}))}),[]),C=s.useCallback((h=>{const T=S.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(h.month,h.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),t(Kn(g.tenantId,h))}),[g.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),I=A[g.tenantId],m=s.useCallback((()=>{const h=S.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(I.month,I.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,h??null),k(I,g.tenantId,!0)}),[k,I,g.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),_=te(S.state?.pathnameStackToGoBack,S.pathname),x=s.useCallback((()=>{if(l.monthEndCloseChecks!=null&&I!=null){const h=l.monthEndCloseChecks.monthEndCloseCheckList.find((T=>T.progress<100));if(h!=null)return void n(`./${h.id}/${I.month}-${I.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}});n(`./month_end_insights/${I.month}-${I.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,I]),{areTenantIdsInSync:p}=za();return La({isDataReady:l.fetchState==="Completed"}),s.useEffect((()=>{I!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&p&&k(I,g.tenantId)}),[k,I,l.fetchState,g.tenantId,p]),s.useEffect((()=>{I!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&p&&t(Zn(I))}),[I,l.monthClosePerformanceTrendFetchStatus.fetchState,p]),s.useEffect((()=>{const h=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&m()}),3e5);return()=>clearInterval(h)}),[l.fetchState]),s.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const h=S.state?.referrer;Q.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,h??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),f.jsx(mi,{children:f.jsx(Tc,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:h=>{n(`./${h}/${I.month}-${I.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:C,handleReviewButtonClick:x,onBackClick:()=>{n("../../dashboard")},onReload:m,isAiCfoAccessEnabled:b,onAskAiCfoClick:R,aiAuditScorePercentageEnabled:r})})},mi=Te.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|