@zeniai/web-app-ui 5.1.27-qa → 5.1.28-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-CLedmK_9.js +1 -0
- package/dist/assets/{AddressScreen-m3-Kscdf.js → AddressScreen-BJKo5r7f.js} +2 -2
- package/dist/assets/AiCfoScreen-Bm-Vubpq.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-pW0mD7wM.js → BillPayApprovalRoutes-LMU8Nagx.js} +1 -1
- package/dist/assets/{BillPayRoutes-B2Z3NvHi.js → BillPayRoutes-DKyp2ivO.js} +17 -17
- package/dist/assets/BusinessVerificationPageScreen-Dkuu_m-N.js +9 -0
- package/dist/assets/ChargeCardRoutes-Df22Da2C.js +71 -0
- package/dist/assets/CompanyPassportScreen-B8UuneCm.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DfqlH3sV.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-PRiyFj8Z.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-mFMsLrZX.js +23 -0
- package/dist/assets/{DashboardRoutes-De2_e-6I.js → DashboardRoutes-D26VZtmO.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CNCiGI3m.js → DefaultTenantHome-jPpft4Bv.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Brzn0xVZ.js +18 -0
- package/dist/assets/DrawerScreen-CJVUVenS.js +1 -0
- package/dist/assets/EntityDetailRoutes-CFa0HuiD.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-DR3-9E1G.js +25 -0
- package/dist/assets/FeaturePreviewScreen-D08E4BGf.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Cv7nYl7j.js +1 -0
- package/dist/assets/MagicLinkRoutes-Cdf8RY8v.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BJx5boQ_.js +12 -0
- package/dist/assets/{MobileAppDrawer-Cvrk0aA5.js → MobileAppDrawer-jSlYcX5x.js} +1 -1
- package/dist/assets/NotFoundScreen-CCngxdO1.js +1 -0
- package/dist/assets/NotificationRoutes-I4dsrXrB.js +1 -0
- package/dist/assets/OAuthConsentScreen-KYJm6sI7.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Cvkn1bmJ.js +1 -0
- package/dist/assets/{PeopleRoutes-CK_KnFLl.js → PeopleRoutes-BDG1tzDm.js} +5 -5
- package/dist/assets/PerformanceRoutes-DEeBkdxJ.js +1 -0
- package/dist/assets/{Preview-BcqiqhZQ.js → Preview-DObqwJc1.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B0drHqyu.js → QBOConnectionScreen-C6xEPKjx.js} +1 -1
- package/dist/assets/ReferralListScreen-BSgOGLcH.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-Bus9PTO2.js → ReimbursementApprovalRoutes-Bdwtdn_b.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DB-J-QIJ.js → ReimbursementApprovalRuleDetailScreen-BszPF81e.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CHz3b4Xh.js → ReimbursementRoutes-BSmNLKom.js} +9 -9
- package/dist/assets/{ReportsRoutes-BljUuEhi.js → ReportsRoutes-CpYXR1ng.js} +1 -1
- package/dist/assets/RewardsRoutes-5N5HkBwk.js +1 -0
- package/dist/assets/ScreenRoutes-CDXpOdhH.js +2 -0
- package/dist/assets/{SettingsRoutes-zrVjsmQ5.js → SettingsRoutes-DRKCWlpW.js} +8 -8
- package/dist/assets/{SetupPagesScreen-DV28qGiQ.js → SetupPagesScreen-CH1tyZ_v.js} +5 -5
- package/dist/assets/SignInScreen-CaIhXtTb.js +1 -0
- package/dist/assets/SignOutScreen-CPCJwE9L.js +9 -0
- package/dist/assets/TaskListScreen-8EKkpy4I.js +9 -0
- package/dist/assets/TaskRoutes-CGFpipef.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-DVmC_GO5.js → TransactionDetailRoutes-ZSU9htDU.js} +1 -1
- package/dist/assets/TransactionDetailScreen-BYdWSsJY.js +5 -0
- package/dist/assets/{TransactionListRoutes-KM7k8Agf.js → TransactionListRoutes-Ca3y3eIf.js} +1 -1
- package/dist/assets/TreasuryRoutes-DyvM5Z6X.js +37 -0
- package/dist/assets/{VendorsRoutes-CWPfBp_P.js → VendorsRoutes-B0TRU3wE.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-C2vfVJz6.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-c0RnDA1n.js → ZeniAccountRoutes-BnXSohU7.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-Dk5V9ZpY.js +9 -0
- package/dist/assets/{accountMappingHelper-spXTehHl.js → accountMappingHelper-BAqbN_Ed.js} +1 -1
- package/dist/assets/{analytics-D1kzjJGV.js → analytics-D-L0XCdy.js} +1 -1
- package/dist/assets/{analyticsHelper-DB3_ay5h.js → analyticsHelper-BlXK6n1_.js} +1 -1
- package/dist/assets/{core-Csep4njy.js → core-D1nsPBWT.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-C5ifH7fM.js → decodeURIComponentSafe-DGEbX7e2.js} +1 -1
- package/dist/assets/{dnd-Cjdb2KWD.js → dnd-BLL6L3gN.js} +1 -1
- package/dist/assets/{empty-D_3geiNL.js → empty-B_pktxPP.js} +1 -1
- package/dist/assets/{empty-DUEvEoMc.js → empty-DXjkFqhp.js} +1 -1
- package/dist/assets/{emptyVideoElement-Wm2X1tw3.js → emptyVideoElement-CAkBRDjj.js} +1 -1
- package/dist/assets/epic-D-kBcmsN.js +2 -0
- package/dist/assets/getLocaleForTenant-Cc9g-3s7.js +1 -0
- package/dist/assets/{index-CNDQ8F1I.js → index-BGF3YnQ1.js} +1 -1
- package/dist/assets/{index-BhYWNhjL.js → index-CrNNtnJe.js} +1 -1
- package/dist/assets/{index--68azm8o.js → index-D1izlEDk.js} +2 -2
- package/dist/assets/{index-Cz7ZsetT.js → index-DAHw0lmo.js} +1 -1
- package/dist/assets/{index-Bkr1b7Ol.js → index-DLjZAwV8.js} +1 -1
- package/dist/assets/{index-DgJtatP0.js → index-DOvs-gN8.js} +13431 -13630
- package/dist/assets/{index-Brq6QGrX.js → index-LMf4Uk3C.js} +1 -1
- package/dist/assets/{index-BmlRyOVO.js → index-vGD2CVuD.js} +1 -1
- package/dist/assets/{lexical-wVYu_9-d.js → lexical-BPvBMaax.js} +1 -1
- package/dist/assets/{liveblocks-DAjhbt80.js → liveblocks-DeJrMusH.js} +1 -1
- package/dist/assets/{lottie-DYZ-hqab.js → lottie-HzjylhSG.js} +1 -1
- package/dist/assets/{mui-BwrnAXoT.js → mui-Bt67K2M5.js} +1 -1
- package/dist/assets/{pathToGoBack-odCpMm49.js → pathToGoBack-Dck2KiFL.js} +1 -1
- package/dist/assets/{pdf-Cc8ZGklh.js → pdf-DvTTGpmm.js} +4 -4
- package/dist/assets/{pdf-lib-jdfyLvIR.js → pdf-lib-DPGVWluc.js} +1 -1
- package/dist/assets/{plaid-BKdRBTqL.js → plaid-bgwND0M_.js} +1 -1
- package/dist/assets/{pusher-BUjJSsoy.js → pusher-B01CU6O4.js} +1 -1
- package/dist/assets/{react-BrtFI20B.js → react--4Dbe-gx.js} +1 -1
- package/dist/assets/{react-CZYvjgmH.js → react-BtS31ROi.js} +1 -1
- package/dist/assets/{react-Dn4PiCyS.js → react-CTzE5k7y.js} +1 -1
- package/dist/assets/{react-DbE9JPRz.js → react-CWTWuauy.js} +1 -1
- package/dist/assets/{react-C4jn9LlB.js → react-Cx_QNgqL.js} +1 -1
- package/dist/assets/{react-DLx9jDCf.js → react-DA2cWlDQ.js} +1 -1
- package/dist/assets/{recharts-D7BeuhCa.js → recharts-BKv64PUA.js} +1 -1
- package/dist/assets/{routePaths-CpXTBLF_.js → routePaths-Br5thBmx.js} +1 -1
- package/dist/assets/{sentry-BchnSYMz.js → sentry-QhEvvQLf.js} +1 -1
- package/dist/assets/{url-DFsuq-eL.js → url-C7S7LArU.js} +1 -1
- package/dist/assets/{url-UFdKDvUl.js → url-Dy9x3ATl.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CWAGANr4.js → useAiCfoDashboardSuggestedQuestionsChips-CXjPblWW.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DIMAd_GF.js +1 -0
- package/dist/assets/{useDeviceId-C6SeJyTl.js → useDeviceId-DY3KEaot.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Dg2cJQuZ.js → useInitialThreadRequest-CuDTVayG.js} +1 -1
- package/dist/assets/{utils-aai5Jslk.js → utils-BUOS2Hrm.js} +1 -1
- package/dist/assets/withTransactionSidePanel--kvFKWwv.js +21 -0
- package/dist/assets/{zeni-epic-state-B_XLk_Px.js → zeni-epic-state-DZ-NC_Ba.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +6 -11
- package/dist/assets/AddressRoutes-grM9hmtH.js +0 -1
- package/dist/assets/AiCfoScreen-FswGnA2W.js +0 -22
- package/dist/assets/BusinessVerificationPageScreen-C-6S-jFq.js +0 -9
- package/dist/assets/ChargeCardRoutes-Boj3Vpg3.js +0 -71
- package/dist/assets/CompanyPassportScreen-BXvU3-bZ.js +0 -1
- package/dist/assets/ConnectionAuthScreen-ByuhDlR6.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-xEDT9ftG.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-kLBRPvaQ.js +0 -23
- package/dist/assets/DomesticWireDetailScreen-BNqpU9kr.js +0 -18
- package/dist/assets/DrawerScreen-BLYKH6HL.js +0 -1
- package/dist/assets/EntityDetailRoutes-CMTMCLDV.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-HgQuX9He.js +0 -25
- package/dist/assets/FeaturePreviewScreen--3IRWa9I.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CLi29ZpN.js +0 -1
- package/dist/assets/MagicLinkRoutes-CSv1U0vJ.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-fAlnVOPG.js +0 -12
- package/dist/assets/NotFoundScreen-DXqfpA8J.js +0 -1
- package/dist/assets/NotificationRoutes-C-WteHc_.js +0 -1
- package/dist/assets/OAuthConsentScreen-BP-A_UHq.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Boih151J.js +0 -1
- package/dist/assets/PerformanceRoutes-DYJwGDQ0.js +0 -1
- package/dist/assets/ReferralListScreen-JMU6dR_V.js +0 -5
- package/dist/assets/RewardsRoutes-gKsGO58l.js +0 -1
- package/dist/assets/ScreenRoutes-D34p2LTh.js +0 -2
- package/dist/assets/SignInScreen-9HbINlJG.js +0 -1
- package/dist/assets/SignOutScreen-BSYsTkcd.js +0 -9
- package/dist/assets/TaskListScreen-CvdASg3r.js +0 -9
- package/dist/assets/TaskRoutes-CViy4Fc0.js +0 -9
- package/dist/assets/TransactionDetailScreen-CpmzsSf7.js +0 -5
- package/dist/assets/TreasuryRoutes-CbKugAAT.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BcSzBlLu.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-B8oovtzJ.js +0 -9
- package/dist/assets/epic-DeTdbD7V.js +0 -2
- package/dist/assets/getLocaleForTenant-Ba61Gz0E.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DAyGHIvM.js +0 -1
- package/dist/assets/withTransactionSidePanel-Bh7VGJfn.js +0 -21
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DeJrMusH.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as qt,p as ne}from"./core-D1nsPBWT.js";import{eP as ce,bs as Ue,Pc as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pd as Ze,Pe as Ma,tt as ba,jO as ya,Pf as Sa,gT as oa,zZ as Je,z$ as Ga,A0 as $a,jE as mt,Pg as Ye,zN as Ct,Ph as Qt,Pi as Xt,zQ as Da,Pj as Jt,NC as _a,rF as pt,zW as za,h2 as en,Pk as ht,Pl as Ke,bq as an,Pm as tn,fE as Pa,fD as wa,Au as nn,fC as Ta,Ni as rn,Pn as ft,cl as gt,cM as sn,NB as da,B4 as on,Po as tt,AG as Fa,Pp as bt,B5 as cn,O1 as dn,B6 as ln,C0 as un,sP as mn,BW as Cn,Af as yt,A8 as pn,Pq as hn,fV as fn,Ao as St,As as It,fU as gn,Pr as bn,AS as At,Ps as yn,Pt as Sn,Pu as In,Aq as Et,Ab as kt,zT as Dt,Ak as _t,Ai as Pt,Am as An,z_ as nt,Pv as wt,Pw as va,AD as Ia,Kh as Tt,cN as Za,Px as En,Py as kn,Pz as Dn,PA as _n,AA as Va,AZ as Pn,AV as wn,Aw as Tn,AX as Fn,AN as vn,AP as xn,PB as Ft,B3 as vt,HG as Bn,PC as Ln,PD as Rn,PE as Un,PF as xt,PG as On,Bq as jn,AF as Bt,Az as ia,AE as Vn,PH as Nn,PI as Hn,zK as Mn,PJ as Lt,PK as Rt,PL as Gn,zM as $n,zL as rt,PM as zn,PN as Zn,PO as Yn,Kd as Kn,PP as Ya,PQ as Wn,wl as Ut,km as qn,gU as Qn,Bv as Xn,PR as Ot,PS as Jn,Bw as er,PT as ar,de as tr,tn as nr,Bl as rr,Bf as Re,bt as sr,bF as or,cx as ir,bG as cr,Jq as dr}from"./zeni-epic-state-DZ-NC_Ba.js";import{z as J,k as je,S as se,c as Z,B as la,c2 as xa,cd as lr,p as ve,ce as ur,cf as mr,J as ua,aN as Fe,r as fe,bm as Ka,cg as Cr,F as ma,i as Ba,h as Wa,d as Q,D as qa,ch as pr,_ as jt,aq as Qa,by as Qe,ci as Na,cj as hr,x as Xa,a7 as fr,ck as gr,at as Vt,a2 as Ha,W as Nt,f as Ht,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,cq as Er,o as Aa,cr as kr,cs as Dr,ct as Ua,v as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,cy as vr,a9 as xr}from"./index-DOvs-gN8.js";import{n as _e,D as Mt,S as Br}from"./mui-Bt67K2M5.js";import{a as c}from"./sentry-QhEvvQLf.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ve,A as Lr,h as Ja,P as Rr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Zt,p as Or,S as st}from"./SetupPagesScreen-CH1tyZ_v.js";import{u as Yt}from"./useInitialThreadRequest-CuDTVayG.js";import La from"./NotFoundScreen-CCngxdO1.js";import{M as Ge}from"./MobileAppDrawer-jSlYcX5x.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-DIMAd_GF.js";import{v as ot}from"./utils-BUOS2Hrm.js";import{t as jr}from"./AddressScreen-BJKo5r7f.js";import"./recharts-BKv64PUA.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./analyticsHelper-BlXK6n1_.js";import"./routePaths-Br5thBmx.js";import"./BusinessVerificationPageScreen-Dkuu_m-N.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]="cb327b17-fe60-4189-93b5-7af2f54d10e0",e._sentryDebugIdIdentifier="sentry-dbid-cb327b17-fe60-4189-93b5-7af2f54d10e0")}catch{}})();function Vr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Ue(C?.loggedInUserRoleMap),{useFeatureGate:g}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:O}=g(Z.isDebitCardFeatureEnabled),v=be(n),D=ye(n),p=Se(O,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,b=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),l=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:u}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y(X=>$e(X,n.companyId)),R=ze(F.controllers),{creditAccount:B,creditAccountRepayment:T}=y(X=>Ze(X)),N=y(X=>X.classListState.fetchState),d=!E&&l&&f,h=y(X=>Ma(X,t,d,l)),[P,w]=c.useState(!1),U=h.chargeCard,j=U?.cardCreatedByUser?.userId,$=y(X=>j!=null?ba(X.userRoleState,j):void 0),H=$?.accountingClassIDs[0],V=y(X=>H!=null?ya(X.classState,{classId:H,reportId:"class_list"}):void 0),A=U?.cardHolderUser?.userId,L=y(X=>A!=null?ba(X.userRoleState,A):void 0),W=L?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",q=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Y,q]),c.useEffect(()=>{P||h.fetchState==="Completed"||h.fetchState==="In-Progress"||t==null||(w(!0),a(Je(t,d,!1)))},[P,h,t,a]),c.useEffect(()=>{if(h.fetchState==="Completed"&&(Y===!1||Y&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,U,i);e(X)}},[h.fetchState,i,Y]),c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a($a()),N!=="Completed"&&N!=="In-Progress"&&a(mt())},[B.fetchState,T.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",oe=Oe(l,b,_,f),ee=Ca(l,f,m,B,T),te=Gt(x,h);return h.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(lr,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:R,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:f,productInformation:oe,creditAccountInformation:ee,debitAccountInformation:te,chargeCardDetailView:h,creditAccount:B,classListFetchState:N,creditAccountRepayment:T,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:L?.userRoles,cardHolderDepartmentName:k?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(mr);function Hr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(Z.isCardsCommentingEnabled),[g,I]=c.useState(!1),o=y(S=>Ye(S)),i=Yt(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),f=S.poppedPathname??Mr(n.tenantEmailDomain);e(f,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{g||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[g,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(ur,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),u=p.max_charge_card_activation_attempts_by_card_id,b=y(k=>Xt(k,n)),l=b.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:F}=se(),{isFeatureEnabled:R}=F(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=F(Z.isDebitCardFeatureEnabled),T=Se(B,D),N=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:T}),d=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,h=D.userRole.includes("charge_card_user"),P=be(D),w=ye(D),U=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),$=!h&&j&&d;c.useEffect(()=>{g===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),I(!0)),o===!1&&b.fetchState==="Not-Started"&&(i(!0),a(Je(n,$,j)))},[o,b.fetchState,g,_]);const H=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(E===!1&&(H===!1||H&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&b.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(Jt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[b.fetchState,l?.type.code,E,b.isRefreshingViewInBackground]);const V=J.getZeniOtpTokenForCardHolder(n),A=y(k=>pt(k.userState,v.userId)),L=()=>{l?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{b.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(L,3e3),S(!0))},[b.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const W=k=>{O(k)};if(_!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(A?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:A.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:b,signedInUserToken:V,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:u[n]!=null?u[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Zr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=en(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),g=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(an())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:g,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(nn(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(tn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Cr),Zr=_e.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: ${e=>`${Gr.containerWidth.value(e.windowSize)}%`};
|
|
5
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
+
`,Yr=_e.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
min-height: 100%;
|
|
9
|
+
width: 100%;
|
|
10
|
+
flex: 1 1 auto;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
14
|
+
`,Ea=qa.getLocalizedStrings().dateFormat,Kr={overlayWidth:new ma(100,100,58)},Wr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:dn(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:ln(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:C,isCashbackInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:I,controllerEmails:o,paymentDetails:i,productInformation:E,cashbackInformation:S,paymentSourceInformation:f,creditAccountInformation:O,debitAccountInformation:v,paymentInitiatedDate:D,sourcePage:p}=t,{tenantEmailDomain:u}=r;return{onBackNavigation:()=>{if(m&&g&&I&&S!=null&&Q.trackCardsPayEarlyFormClick(o,E,S,"Back",i.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:i.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:i.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:i.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:i.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Ea.visual.MMMDCommaYYYYformat)},f,O,v),p==="cardPaymentHistory")t.closeDrawerHandler(!0),e(bt());else{const b=Ve(u);a(b)}},onUpdatePaymentAccountStatus:(b,l,_)=>{e(Cn(b,l,"bill_pay","bill_pay_detail",_))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:b=>{e(mn("external_account",b))},onEstablishConnectionClick:b=>{e(un(b,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${u}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{C?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(pr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:C,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:I,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:i,isCashbackInfoFetchStateCompleted:E,paymentInitiatedDate:S,retryRepayment:f})=>{const O=le(),{useDynamicConfig:v}=se(),{configValue:D}=v(Fe.zeniAccountsConfig),p=rn(D),u=y(z=>ft(z)),{creditAccount:b}=y(z=>Ze(z)),l=y(z=>ce(z)),_=Wa(),F=ua(),R=ue(),B=J.getSignedInUser(),T=je(),[N,d]=c.useState(!1),[h,P]=c.useState(!1),{configValue:w}=v(Fe.zeniCardsConfig),U=w.credit_card_auto_pay_threshold_by_company_id?.[l.companyId]??w.default_credit_card_auto_pay_threshold??Lr,j=gt(T?.loggedInUserRoleMap),$=sn(T?.loggedInUserRoleMap),H=!!l.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=y(z=>da(z,l.companyId)),A=V.companyChargeCardInfo?.primaryFundingAccount,L=V.allFundingAccounts.find(z=>z.id===A?.accountId),W=y(z=>$e(z,l.companyId)),k=ze(W.controllers);c.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&R(on()),u.fetchState==="Completed"&&!h){const z=l.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=u.transferFromAccounts.find(ee=>ee.id===z);let oe;if(C==="cardPaymentHistory"&&f){const ee=f.paymentAccountId!=null?u.transferFromAccounts.find(te=>te.id===f.paymentAccountId):void 0;oe={amount:f.amount,isAutoRepayment:l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ee??x}}else oe={amount:{amount:b.balance.amount+b.hold.amount,currencyCode:b.balance.currencyCode,currencySymbol:b.balance.currencySymbol},isAutoRepayment:l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};R(tt(oe)),P(!0)}},[u.fetchState,h,C,f,u.transferFromAccounts,l.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,l.companyChargeCardInfo?.info?.isAutoPayEnabled,b.balance.amount,b.balance.currencyCode,b.balance.currencySymbol,b.hold.amount,R]);const Y={isZeniCheckingEnabled:l.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:L?.accType==="depositAccount",creditCardPaymentSourceAccountName:L?.label,creditCardPaymentSourceAccountType:L?.accType,creditCardPaymentSourceLastFourDigits:L?.accountLast4,creditCardPaymentSourceBalance:L?.accountBalance?.available?.amount??0};if(c.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&R(Fa(l.companyId,!0))},[V.fetchState]),c.useEffect(()=>{u.updateStatus==="Completed"&&I!=null&&E&&i&&o&&Q.trackCardsPayEarlyPayNowClick(k,n,I,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Ea.visual.MMMDCommaYYYYformat)},Y,m,g)},[u.updateStatus,I,E,i,o,S]),c.useEffect(()=>{u.fetchState==="Completed"&&I!=null&&E&&i&&o&&!N&&e&&h&&I!=null&&(Q.trackCardsPayEarlyFormView(k,n,I,a,l.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,b.balance.amount,Y,m,g),d(!0))},[u,E,i,o,N,e,h]),B==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),R(bt())};return s.jsx(s.Fragment,{children:s.jsx(Mt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Kr.overlayWidth.valuePercentage(F),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:_.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(qr,{onClick:z=>z.stopPropagation(),children:s.jsx(Wr,{closeDrawerHandler:t,navigate:O,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{E&&i&&o&&I!=null&&Q.trackCardsPayEarlyFormClick(k,n,I,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},Y,m,g),R(cn({companyId:l.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:z=>{R(tt(z))},currentTenant:l,hasZeniAccountsAdminAccess:j,isZeniAccountsUser:$,isZeniAccountSetupEnabled:H,productInformation:n,sourcePage:C,controllerEmails:k,autoPayThreshold:U,paymentSourceInformation:Y,creditAccountInformation:m,debitAccountInformation:g,cashbackInformation:I,isCashbackInfoFetchStateCompleted:E,isCreditCardInfoFetchStateCompleted:i,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:S,maxInsuredAmount:p.maxInsuredAmount})})})})},qr=_e(Br)`
|
|
15
|
+
display: flex;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
`,Wt="charge-card-transaction-update",Oa=qa.getLocalizedStrings().dateFormat,Qr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:C}=t,m=J.getSignedInUser(),g=e.tenantState.currentTenantId,I={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},o=Ma(e,r,a,C),i=hn(e,r),E=fn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:i,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:I,isSnackbarOpen:E.isSnackbarOpen,cardsEndPoint:`${Vt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:C,cardProviderId:m,includeCreditAccountInfo:g,setIsPaymentOpen:I,controllerEmails:o,productInformation:i,cashbackInformation:E,primaryFundingAccountDetails:S,creditAccountInformation:f,debitAccountInformation:O,isChargeCardFeatureEnabled:v}=t,{tenantEmailDomain:D}=r;return{onEventReceived:p=>{p===Wt&&(e(za(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Je(a,g,v))},onFetchChargeCardTransactionList:(p,u)=>{e(nt(a,p,u))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{m!=null&&e(Ta(p,"ChargeCardHolder",a))},onResendOtp:p=>{m!=null&&e(wa(p,"ChargeCardHolder",a))},onVerifyOtp:(p,u)=>{m!=null&&e(Pa(p,u,"ChargeCardHolder",a))},onVerifyOtpSuccess:p=>{p!=null&&J.saveZeniOtpTokenForCardHolder(p,a)},onColorCodeChange:p=>{e(An(a,p))},onLockChargeCard:(p,u)=>{e(Pt(p,a,u))},onUnlockChargeCard:p=>{e(_t(p,a))},onCloseChargeCard:p=>{e(Dt(a,p))},onFetchChargeCardsRecurringExpenses:()=>{e(kt([a]))},updateChargeCardName:(p,u)=>{e(Et(p,a,u))},updateChargeCardTransactionAttachments:(p,u)=>{u!=null&&e(In({transactionId:p,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,u,b,l)=>{e(Sn({chargeCardId:u,transactionId:p,fetchState:b,error:l}))},updateChargeCardTransactionReceiptsShowTick:(p,u,b)=>{e(yn({chargeCardId:u,transactionId:p,shouldShowTick:b}))},onChargeCardRevokeInviteClick:()=>{e(At(a))},updateChargeCardTransactionIsViewReceiptClicked:(p,u,b)=>{e(bn({chargeCardId:u,transactionId:p,isViewReceiptClicked:b}))},onChargeCardTransactionRowClick:(p,u)=>{const b=fe(C.state?.pathnameStackToGoBack,C.pathname);n(`../../transaction/${p}/${u}`,{state:{pathnameStackToGoBack:b}})},onBackClick:()=>{const p=ve(C.state?.pathnameStackToGoBack),u=Ve(D);n(u,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(gn())},onUpdateDebitCardPinAttempt:p=>{e(It(a,p)),p==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,u)=>{p?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(p,u,b,l){e(St(p,u,b.code,l))},shouldOpenCreditCardPaymentDrawer(p){p&&E!=null&&Q.trackCardsPayEarlyClick(o,i,E,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},f,O),I(p)}}})(fr(gr));function Xr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ca(),[n,C]=c.useState(!1),[m,g]=c.useState(!1),{useDynamicConfig:I}=se(),o=J.getSignedInUser(),i=y(M=>ce(M)),E=y(M=>ka(M).firstViewAfterActivation),S=y(M=>M.classListState.fetchState),{configValue:f}=I(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:O}=I(Fe.zeniCardsConfig),v=O.enable_card_controls_for_company_ids,D=O.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(v)&&v.includes(i.companyId),[p,u]=c.useState(!1),[b,l]=c.useState(!1),{useFeatureGate:_}=se(),{isFeatureEnabled:F}=_(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=_(Z.isDebitCardFeatureEnabled),B=Se(R,i),T=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:B}),{isFeatureEnabled:N}=_(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=_(Z.isCardsCommentingEnabled),h=ye(i),P=be(i),w=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:F,isBookKeepingTenant:h,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:w}),j=!!i.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!i.companyChargeCardInfo?.info?.isChargeCardEnabled,H=!i.userRole.includes("charge_card_user")&&U&&$;if(r==null)throw Error("Empty card id is not valid...");const V=y(M=>da(M,i.companyId)),{creditAccount:A,creditAccountRepayment:L}=y(M=>Ze(M)),W=J.getZeniOtpTokenForCardHolder(r),k=y(M=>Ma(M,r,H,U)),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:q}=Kt({mobileExploreReferrer:"Card Detail"});jt({isDataReady:k.fetchState==="Completed"});const z=y(M=>Ye(M)),x=k.chargeCard,oe=je(),ee=Ue(oe?.loggedInUserRoleMap),te=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",X=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=Ca(U,$,ee,A,L),K=Gt(te,k),he=Ja(ee,z),ke=Oe(U,T,j,$),Be=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Pe=y(M=>$e(M,i.companyId)),we=ze(Pe.controllers),ae=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ae?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ae?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>ie?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=i?.userRole,Le=y(M=>Ke(M,!1,T,F).revokeCardInvite),aa=Qa(Le.saveStatus.fetchState);if(c.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ve(i.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,i.tenantEmailDomain]),c.useEffect(()=>{E&&n===!1&&re&&(C(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[E,n,re,Ee]),c.useEffect(()=>{p||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(u(!0),t(Je(r,H,U,!1)))},[p,k,r,t]),c.useEffect(()=>{!b&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&te&&Be&&ee&&(l(!0),t(yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[b,k,t,Be,ee]),c.useEffect(()=>{z.fetchState!=="Completed"&&z.fetchState!=="In-Progress"&&ee&&t(Ct()),S!=="Completed"&&S!=="In-Progress"&&t(mt()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&t(pn({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&t(Fa(i.companyId,!0))},[z.fetchState,t,ee,S,k.transactionStatistics.fetchState,V.fetchState]),c.useEffect(()=>{if(!(k.fetchState!=="Completed"||U&&A.fetchState!=="Completed"||x==null||k.transactionStatistics.fetchState!=="Completed"||te&&ee&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;Q.trackCardsCardDetailView(we,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Qe(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Qe(x.balance.amount),cardAvailableLimit:Qe(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Qe(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Na(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ae?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Na(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,K)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,A.fetchState,ee]),o==null)throw Error("Can't access card detail page without signing in...");const We=i.companyId??J.getSignedInUserTenant(i.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-encrypted-${We}.${Wt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ne,frequency:qe,cardColor:G}=ja(x),De=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageViewed(r,M,me,Te,Ne,qe,G,De)}};c.useEffect(()=>{if(k.fetchState==="Completed"){const M=k.chargeCard;if(M?.status.code==="inactive"||te&&M?.isPinSet===!1||X&&E){const me=Ce(i.tenantEmailDomain,r,o,x,E);e(me)}}},[k.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ne,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsDetailPageClicked(r,Te,Ne,qe,G,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ne,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;Q.trackCardsVerifyPopUpClick(r,Te,Ne,qe,G,De,M,He,me)}},Ra=A.balance.amount+A.hold.amount,ha=i.companyChargeCardInfo?.info?.primaryFundingAccount,fa=V.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||k.fetchState==="Error"?s.jsx(La,{}):k.fetchState==="In-Progress"||k.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||te&&ee&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(hr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:E}),k.fetchState==="Completed"?s.jsx(Xa,{analytics:Q,onLoad:na}):null,m===!0?s.jsx(at,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:m,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:K,cashbackInformation:he,creditAccountSpentAmount:Ra,isDebitCardInfoFetchStateCompleted:!te||!ee||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!U||A.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ee||z.fetchState==="Completed",paymentInitiatedDate:L.initiatedRepaymentDate}):null,s.jsx(Qr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ae?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:U,isDebitCardFeatureEnabled:T,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:$,isCardControlsEnabled:D,isEarlyPayEnabled:N,controllerEmails:we,chargeCardCashbackDetailState:z,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:K,cashbackInformation:he,classListFetchState:S,primaryFundingAccountDetails:fa,currentTenant:i,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:A,creditAccountRepayment:L,includeCreditAccountInfo:H,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:f.documentAiReceiptMaxSizeLimitBytes!=null?f.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:Y,onAskAiCfoClick:q,isCardsCommentingEnabled:d})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,C=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:C,limit:n}},Jr=_e.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 1 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,es=pe(function(e,t){const a=Ke(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:En(e),bulkActionView:kn(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:C,chargeCardListState:m,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:I,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:i,isDebitCardFeatureEnabled:E,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:f,isChargeCardTOSAccepted:O,controllerEmails:v,depositAccountListWithDebitCardIssued:D,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:u,productInformation:b,cashbackInformation:l,creditAccountInformation:_,debitAccountInformation:F,updatePayNowInfoTooltip:R,isUserHasCardsAdminLevelAccess:B}=t,{tenantEmailDomain:T}=r,{cards:N}=m;return{onChargeCardRowClick:(d,h)=>{const P=zt(N,d);let w;P!=null&&((j=>{const $=j.limit.amount-j.available.amount,H=`${j.cardHolderUser?.firstName.toLowerCase()} ${j.cardHolderUser?.lastName.toLowerCase()}`,V=j.cardName,A=j.department?.className??"",L=j.limit.amount,W=j.creditLimitFrequency.name;Q.trackCardsListRowClicked(H,V,A,$,L,W,C.userId===j.cardHolderUserId)})(P),Me(E,S,D)&&Q.trackCardsCardListRowClick(v,b,"Card Row Item","row_clicked",h+1,{cardOwner:Na(P.cardHolderUser,!1),cardName:P.cardName,cardType:P.type.code.includes("credit")?"credit":"debit",cardStatus:P.status.code,cardUtilizationAmount:Qe(P.limit.amount-P.available.amount),cardUtilizationPercent:P.limit.amount>0?Math.round((P.limit.amount-P.available.amount)/P.limit.amount*100):0,cardLimit:Qe(P.limit.amount)},l,_,F)),w=P?.status.code==="request_on_hold"&&C.userId===P.cardHolderUserId?Zt(T):Ce(T,d,C,P);const U=fe(n.state?.pathnameStackToGoBack,n.pathname);a(w,{state:{pathnameStackToGoBack:U}})},onFetchChargeCardsRecurringExpenses:d=>{e(kt(d))},onFetchDepositAccountLimit:d=>{e(yt({depositAccountId:d}))},onChargeCardResendInviteClick:d=>{e(xn(d))},onChargeCardRevokeInviteClick:d=>{e(At(d))},onLockChargeCardList:(d,h)=>{e(vn(d,h))},onUnlockChargeCardList:d=>{e(Fn(d))},onCloseChargeCardList:(d,h)=>{e(Tn(d,h))},onRevokeChargeCardList:d=>{e(wn(d))},updateChargeCardListSpendLimit(d,h,P){e(Pn(d,h,P.code))},onLockChargeCard:(d,h)=>{e(Pt(B,d,h))},onUnlockChargeCard:d=>{e(_t(B,d))},onCloseChargeCard:(d,h)=>{e(Dt(d,h))},onUpdateSpendLimit(d,h,P,w){e(St(d,h,P.code,w))},updateChargeCardName:(d,h)=>{e(Et(B,d,h))},onClickSetupIcon:()=>{Q.trackCardsListPageClicked("settings"),Me(E,S,D)&&l!=null&&Q.trackCardsSettingsClick(v,b,l,_,F);const d=Ur(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},onIssueCardClick:()=>{Q.trackCardsListPageClicked("new card"),Me(E,S,D)&&l!=null&&Q.trackCardsNewCardClick(v,b,l,"New Button","card_creation_initiated","Card List",_,F);const d=as(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},onColumnSortConfigChanged:(d,h)=>{Me(E,S,D)&&l!=null&&Q.trackCardsCardListSortClick(v,b,l,"Sort Icon","sort",d,h==="ascending"?"ASC":"DESC","Cards List",_,F),e(Va({uiState:{sortKey:d,sortOrder:h}}))},onSearchTextChanged:d=>{e(_n(d))},onReloadCards:()=>{e(Ia(g,E&&S,I&&i,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(E,S,D)&&l!=null&&Q.trackCardsCashbackOverviewClick(v,b,l,"Cashback Overview","cashback_details_viewed",_,F),a("./cashback")},onClickStatementsIcon:()=>{Me(E,S,D)&&l!=null&&Q.trackCardsStatementsClick(v,b,l,_,F),a("./statements")},onCreateNowClick:d=>{Me(E,S,D)&&l!=null&&Q.trackCardsNewCardClick(v,b,l,"Promo Banner","card_creation_initiated","Card List",_,F),a(`./new?cardType=${d}`)},onPromoCardClick:d=>{a(d==="debit"&&E&&!f||d==="credit"&&o&&!O?`../promo?cardPromoType=${d}`:"./setup")},navigateToCreditCardPaymentPage:(d,h)=>{u==="Completed"&&r.company!=null&&l!=null&&Q.trackCardsPayEarlyClick(v,b,l,"Card List",d,h,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},_,F);const P=ts(T);a(P)},navigateToCreditCardPaymentHistoryPage:()=>{const d=ns(T),h=fe(n.state?.pathnameStackToGoBack,n.pathname);a(d,{state:{pathnameStackToGoBack:h}})},shouldShowPayNowInfoTooltip:R,onSetRowActionCardId:d=>{e(Dn(d))},onSetBulkActionCardIds:d=>{e(wt(d))}}})(br);function it({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=c.useCallback((G,De)=>{a(wt([])),t(G,De)},[a,t]),[C,m]=c.useState(!1),[g,I]=c.useState(J.getPayNowInfoTooltip()??!1),o=G=>{J.savePayNowInfoTooltip(G),I(G)},[i,E]=c.useState(!1),S=J.getSignedInUser(),f=y(G=>ce(G)),[O,v]=c.useState(!1),[D,p]=c.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:b}=Kt({mobileExploreReferrer:"Cards"}),l=f.userRole.includes("charge_card_user"),_=!l,F=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:R,useDynamicConfig:B}=se(),{isFeatureEnabled:T}=R(Z.isCashbackFeatureEnabled),{isFeatureEnabled:N}=R(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:d}=R(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:h}=R(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:P}=R(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:w}=R(Z.isCardsCommentingEnabled),U=Se(d,f),j=Ie({isDebitCardFeatureEnabled:d,isBankingOnlyTenant:U}),$=be(f),H=ye(f),V=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=Ae({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:N,isBookKeepingTenant:H,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:V}),L=$t({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:N,isBookKeepingTenant:H}),{configValue:W}=B(Fe.zeniCardsConfig),k=je(),Y=Ue(k?.loggedInUserRoleMap),q=y(G=>$e(G,f.companyId)),z=ze(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,oe=W.credit_card_pay_now_threshold_by_company_id?.[f.companyId]??W.default_credit_card_pay_now_threshold??Rr,ee=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(f.companyId),te=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,X=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(G=>ft(G)),xe=Qa(Ee.updateStatus),K=y(G=>Ke(G,_,j&&F,A&&re)),he=K.cards.filter(G=>G.type.code.includes("debit")).map(G=>G.connectedAccountId),ke=[...new Set(he)],Be=y(G=>Ye(G)),Pe=y(G=>va(G,ke)),we=y(G=>da(G,f.companyId)),ae=we.companyChargeCardInfo?.primaryFundingAccount,pa=we.allFundingAccounts.find(G=>G.id===ae?.accountId),ie=K.fetchState,ea=K.creditAccount;jt({isDataReady:ie==="Completed"});const{creditAccountRepayment:de}=y(G=>Ze(G)),Le=y(G=>ka(G).firstViewAfterActivation),{areTenantIdsInSync:aa}=Nt(),We=Ja(Y,Be),ta=Ca(A,re,Y,ea,de),na=et(j,F,Y,Pe,K.debitCardSummary),ra=Oe(A,j,F,re),sa=K.creditAccount.balance.amount+K.creditAccount.hold.amount;if(c.useEffect(()=>{ie==="Completed"&&(J.getPayNowInfoTooltip()==null||sa<oe*K.creditAccount.limit.amount/100)&&o(!0)},[ie,oe,sa,K.creditAccount.limit.amount]),c.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),m(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){m(!1),document.body.style.overflow="auto";const G=Ve(f.tenantEmailDomain);n(G)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,f.tenantEmailDomain]),c.useEffect(()=>{!O&&(re||F)&&aa&&(v(!0),a(Ia(_,j&&F,A&&re,!1)))},[O,_,a,aa]),c.useEffect(()=>{Le&&i===!1&&(E(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,i]),c.useEffect(()=>{ie==="Completed"&&l&&K.cards.length===1&&(K.cards[0].status.code==="inactive"&&K.cards[0].type.code==="business_physical_credit_card"?n(`./${K.cards[0].id}/activate`):K.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${K.cards[0].id}`)))},[ie,l,r.state,n,K.cards]),c.useEffect(()=>{if(ie==="Completed"&&l){const G=K.cards.length,De=K.cards.filter(He=>He.cardHolderUserId===S?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&G===De.length&&n("./onboard")}},[ie,K.cards,l,n,S?.userId]),c.useEffect(()=>{ie!=="Completed"||A&&de.fetchState!=="Completed"||j&&F&&Y&&Pe.fetchState!=="Completed"||Q.trackCardsCardListView(z,ra,We,ta,na)},[ie,ea,de.fetchState,Pe.fetchState,Y]),S==null)throw Error("Can't access charge card list page without signing in...");const Ra=y(G=>Tt(G.userState,G.userRoleState,G.userListViewState,"cardAdmin")),ha=Za(k?.loggedInUserRoleMap),fa=G=>{p(G)},M=K.creditAccount.limit,me=()=>{m(!1),n("..")},Te=f.companyChargeCardInfo?.info!=null&&Xe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:A,isTOSAccepted:te,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha}),Ne=f.companyDebitCardInfo?.info!=null&&Xe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:j,isTOSAccepted:X,isSetupEnabled:F,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha});return re||F?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{Q.trackPageLoaded(Ht.Event.cardsListPage),(A&&!re||j&&!F)&&Q.trackCardsPromoView(z,{isCreditCardOffered:A,isDebitCardOffered:j,isDebitCardEnabled:F,isCreditCardEnabled:re},"Banner",j&&!F?"Debit Card":A&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,C===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:C,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(j&&F&&Y)||Pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!A||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Y||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Jr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:fa}),s.jsx(es,{isCashbackFeatureEnabled:T,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:j,isCreditCardProductVisibleForExpressInterest:L,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:g,creditCardPayNowThreshold:oe,signedInUser:S,chargeCardListState:K,location:r,admins:Ra.users,navigateAndClearBulkSelection:n,currentTenant:f,isCardControlsEnabled:ee,companyChargeCardInfoCreditAccountLimit:f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:f.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:Y,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:F,isEarlyPayEnabled:h,isChargeCardPaymentHistoryFeatureEnabled:P,cashbackRate:x,controllerEmails:z,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:Pe,isChargeCardTOSAccepted:te,isDebitCardTOSAccepted:X,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:we.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:u,onAskAiCfoClick:b,isCardsCommentingEnabled:w})]})]}):(te||X)&&Y===!0?s.jsx(ga,{to:"../setup"}):Te||Ne?s.jsx(ga,{to:"../promo"}):s.jsx(la,{fetchState:ie})}const as=e=>`/${e}/cards/new`,ts=e=>`/${e}/cards/payment`,ns=e=>`/${e}/cards/payment-history`,rs=pe(function(e){const t=J.getSignedInUser(),a=ce(e),r=e.tenantState.currentTenantId,n=Ft(e),C={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},m=a?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Bn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:C,companyName:m,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),C=n.poppedPathname??"..";r(C,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,C)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:C}}})},onFiltersChange:n=>{e(Rn({filters:n}))},onReloadPayments:()=>{e(vt(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(Ln({uiState:{downloadState:n}}))}}})(yr);function ss(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=Nt(),{useFeatureGate:n}=se();if(J.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const C=y(q=>ce(q)),m=y(q=>Ft(q)),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(null),v=!C.userRole.includes("charge_card_user"),D=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=n(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Z.isDebitCardFeatureEnabled),b=Se(u,C),l=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:b}),_=be(C),F=ye(C),R=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:p,isBookKeepingTenant:F,isDebitCardProductVisible:l,chargeCardsCreditAccountLimit:R}),T=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,N=je(),d=Ue(N?.loggedInUserRoleMap),h=y(q=>Ke(q,v,l&&D,B&&T)),P=c.useMemo(()=>{const q=h.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(q.map(z=>z.connectedAccountId))]},[h.cards]),w=y(q=>Ye(q)),U=y(q=>va(q,P)),{creditAccountRepayment:j}=y(q=>Ze(q)),$=c.useMemo(()=>Ja(d,w),[d,w]),H=c.useMemo(()=>Ca(B,T,d,h.creditAccount,j),[B,T,d,h.creditAccount,j]),V=c.useMemo(()=>et(l,D,d,U,h.debitCardSummary),[l,D,d,U,h.debitCardSummary]),A=c.useMemo(()=>Oe(B,l,D,T),[B,l,D,T]),L=h.creditAccount.balance.amount+h.creditAccount.hold.amount,W=c.useMemo(()=>f!=null?m.repaymentHistory.find(q=>q.cardRepaymentId===f):void 0,[f,m.repaymentHistory]),k=c.useCallback(q=>{O(q),a(Ia(v,l&&D,B&&T,!1)),S(!0)},[a,v,l,D,B,T]),Y=c.useCallback(()=>{S(!1),O(null),document.body.style.overflow="auto"},[]);return c.useEffect(()=>{g||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(I(!0),a(vt()))},[g,a,m.fetchState]),c.useEffect(()=>{!o&&(T||D)&&r&&(i(!0),a(Ia(v,!1,B&&T,!1)))},[o,T,D,r,a,v,B]),s.jsxs(s.Fragment,{children:[E?s.jsx(at,{closeDrawerHandler:Y,isPaymentDrawerOpen:E,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:L,productInformation:A,creditAccountInformation:H,debitAccountInformation:V,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(l&&D&&d)||U.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!B||j.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!d||w.fetchState==="Completed",paymentInitiatedDate:j.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(rs,{location:t,navigate:e,accountInfoByAccountId:m.accountInfoByAccountId,onRetryPaymentClick:k})]})}const ct=_e.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
height: 100vh;
|
|
28
|
+
width: 100%;
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
align-items: center;
|
|
33
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
34
|
+
`,dt=qa.getLocalizedStrings().months;function os(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(A=>Ze(A)),C=`${Vt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[m,g]=c.useState(!1),[I,o]=c.useState(!1),i=y(A=>Un(A)),{useFeatureGate:E}=se(),S=y(A=>ce(A)),{isFeatureEnabled:f}=E(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=E(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:v}=E(Z.isCardsCommentingEnabled),D=Yt(v?S.companyId:void 0,{clearParams:v&&i.fetchState==="Completed"}),p=Se(O,S),u=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),b=be(S),l=ye(S),_=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:f,isBookKeepingTenant:l,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:_}),R=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,B=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,T=y(A=>$e(A,S.companyId)),N=ze(T.controllers),d=y(A=>xt(A)),h=d.cards.filter(A=>A.type.code.includes("debit")).map(A=>A.connectedAccountId),P=[...new Set(h)],w=y(A=>va(A,P)),U=y(A=>On(A));c.useEffect(()=>{I||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),t(Ga()))},[m,t,r.fetchState]),c.useEffect(()=>{I||r.fetchState!=="Completed"||r.id==null||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(o(!0),t(jn(r.id)))},[I,t,r.fetchState,r.id,i.fetchState]),c.useEffect(()=>{w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&u&&R&&t(Bt()),d.fetchState!=="Completed"&&d.fetchState!=="In-Progress"&&t(ia()),U.fetchState!=="Completed"&&U.fetchState!=="In-Progress"&&u&&R&&t(Vn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&F&&B&&t($a())},[w.fetchState,u,R,d.fetchState,U.fetchState,n.fetchState,F,B]),c.useEffect(()=>{if(i.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&d.fetchState==="Completed"&&(!u||!R||w.fetchState==="Completed"&&U.fetchState==="Completed")){let A="",L="";if(i.statements.length>0){const q=i.statements[i.statements.length-1].period,[z,x]=q.split("-"),oe=i.statements[0].period,[ee,te]=oe.split("-");A=`${dt[parseInt(x)-1]} ${z}`,L=`${dt[parseInt(te)-1]} ${ee}`}const W=Oe(F,u,R,B),k=Ca(F,B,!0,r,n),Y=et(u,R,!0,w,U);Q.trackCardsCreditCardStatementsView(N,W,{numberOfStatements:i.statements.length,oldestStatementMonthYear:A,latestStatementMonthYear:L},k,Y)}},[i.fetchState,r.fetchState,n.fetchState,w.fetchState,d.fetchState,U.fetchState]);const j=()=>{const A=ve(a.state?.pathnameStackToGoBack),L=A.poppedPathname??"..";e(L,{state:{pathnameStackToGoBack:A.newStack}})},$=y(A=>Ye(A)),H=J.getSignedInUser(),V={userId:H?.userId??"",sessionId:H?.zeniSessionId??"",tenantId:S.tenantId??""};if(H==null)throw Error("Can't access address page without signing in...");if(i.fetchState!=="Completed")return s.jsx(ct,{children:s.jsx(Sr,{onBackClick:j})});{const A=Oe(F,u,R,B);return s.jsx(ct,{children:s.jsx(Ir,{currentTenantCompanyName:S.companyName,statementListView:i,productInformation:A,onBackClick:j,authParams:V,controllerEmails:N,isChargeCardFeatureEnabled:F,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:R,isChargeCardSetupEnabled:B,isCardsCommentingEnabled:v,initialOpenThreadRequest:D,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:w,debitCardSummary:U,downloadEndPoint:C})})}}const is={containerWidth:new ma(100,58)},cs=({appContent:e})=>{const t=ua(),a=ue(),r=le(),n=ge(),{useDynamicConfig:C}=se(),[m,g]=c.useState(!1),[I,o]=c.useState(!1),[i,E]=c.useState(!1),[S,f]=c.useState(!1),[O,v]=c.useState(!1),[D,p]=c.useState(!1),u=J.getSignedInUser();if(u==null)throw Error("Can't access onboarding card page without signing in...");const b=y(L=>ce(L)),{configValue:l}=C(Fe.zeniCardsConfig),_=y(L=>Nn(L)),{tenantEmailDomain:F}=b,R=y(L=>L.settingsViewState.profile.fetchState),B=y(L=>L.chargeCardListState.fetchState),T=y(L=>L.settingsViewState.profile.userId),N=y(L=>L.chargeCardConfigState.fetchState);c.useEffect(()=>{m===!1&&R!=="In-Progress"&&R!=="Completed"&&(a(Hn()),g(!0)),I===!1&&N!=="In-Progress"&&N!=="Completed"&&(a(Da()),o(!0)),i===!1&&B==="Not-Started"&&(E(!0),a(ia()))},[m,i,B,I,N]),c.useEffect(()=>{R==="Completed"&&O===!1&&T!=null&&B==="Completed"&&_.cards.length>0&&(a(Mn({userId:T})),a(Lt({cardId:_.cards[_.cards.length-1].id})),v(!0))},[R,O,T,B]),c.useEffect(()=>{if(!S&&_.fetchState==="Completed"&&_.cards.length===0){const L=ve(n.state?.pathnameStackToGoBack),W=L.poppedPathname??Ve(F);r(W,{state:{pathnameStackToGoBack:L.newStack}})}},[_.fetchState,_.cards,S]);const d=y(L=>ka(L)),h=Qa(d.updateStatus.fetchState),P=d.currentDisplayedCardId,{useFeatureGate:w}=se(),{isFeatureEnabled:U}=w(Z.isChargeCardFeatureEnabled),j=!!b.companyChargeCardInfo?.info?.isChargeCardEnabled,$=!b.userRole.includes("charge_card_user")&&U&&j,H=y(L=>P!=null?Rt(L.chargeCardState,P):null),V=()=>{P!=null&&(a(Je(P,$,!0)),a(ia()),f(!0))};c.useEffect(()=>{if(S&&P!=null&&H!=null&&H.status.code!=="request_on_hold"){const L=Ce(b.tenantEmailDomain,P,u,H),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Gn()),H?.type.code==="business_virtual_credit_card"&&a(_a()),r(L,{state:{pathnameStackToGoBack:W},replace:!0})}},[S,H?.status.code]),c.useEffect(()=>{h==="In-Progress"&&d.updateStatus.fetchState==="Completed"&&setTimeout(V,3e3)},[h,d.updateStatus.fetchState]);const A=L=>{p(L)};if(!S&&B!=="Completed"||R!=="Completed"||_.cards.length===0)return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:A}),s.jsx(Ar,{})]});if(T==null)throw Error("Can't access my userId.");return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:A}),s.jsx(ds,{chargeCardListView:_,cardUserOnboardingView:d,navigate:r,currentTenant:b,myUserId:T,location:n,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{A(!0)}}),e!=null?s.jsx(ls,{windowSize:t,children:e}):null]})},ds=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{cards:r.cards,showMenuIcon:m,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:C}=t,{tenantEmailDomain:m}=C;return{updateCardUserOnboardingLocalData:g=>{e(rt({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const I={...r.cardUserOnboardingLocalData,phone:g};e(rt({localData:I}))}e(Ta(g,"CardUserOnboarding"))},onResendOtp:g=>{e(wa(g,"CardUserOnboarding"))},onVerifyOtp:(g,I)=>{e(Pa(g,I,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e($n()),g!=null&&J.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(Lt({cardId:g}))},onBackClick:()=>{const g=ve(n.state?.pathnameStackToGoBack),I=g.poppedPathname??Ve(m);a(I,{state:{pathnameStackToGoBack:g.newStack}})}}})(Er),ls=_e.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
width: ${e=>`${is.containerWidth.value(e.windowSize)}%`};
|
|
38
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
+
`,lt=_e.div`
|
|
40
|
+
display: flex;
|
|
41
|
+
min-height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
flex: 1 1 auto;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: center;
|
|
46
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
47
|
+
`,us={containerWidth:new ma(100,58)},ms=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m,useFeatureGate:g}=se(),[I,o]=c.useState(!1),[i,E]=c.useState(!1),[S,f]=c.useState(!1),[O,v]=c.useState(!1),D=J.getSignedInUser();if(D==null)throw Error("Can't access onboarding card page without signing in...");const p=y(V=>ce(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=m(Fe.zeniCardsConfig),b=y(V=>zn(V,n)),{isFeatureEnabled:l}=g(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=g(Z.isDebitCardFeatureEnabled),F=Se(_,p),R=Ie({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:F}),B=be(p),T=ye(p),N=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:l,isBookKeepingTenant:T,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:N}),h=b.chargeCard,P=y(V=>V.chargeCardConfigState.fetchState);c.useEffect(()=>{I===!1&&P!=="In-Progress"&&P!=="Completed"&&(a(Da()),o(!0)),i===!1&&b.fetchState==="Not-Started"&&(E(!0),a(Je(n,!1,d)))},[i,b.fetchState,I,P]);const w=h?.type.code==="business_physical_debit_card"||h?.type.code==="business_virtual_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(S===!1&&(w===!1||w&&h.status?.code!=="active"||w&&h.status.code==="active"&&h.isPinSet||h.cardHolderUserId!==D.userId)){const V=Ce(p.tenantEmailDomain,n,D,h,!0),A=fe(C.state?.pathnameStackToGoBack,C.pathname);r(V,{state:{pathnameStackToGoBack:A}})}else if(S&&b.isRefreshingViewInBackground===!1&&h?.isPinSet===!0){a(Zn({chargeCardId:n}));const V=Ce(p.tenantEmailDomain,n,D,h,!0),A=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(V,{state:{pathnameStackToGoBack:A}})}}},[b.fetchState,h?.type.code,S,b.isRefreshingViewInBackground]);const U=J.getZeniOtpTokenForCardHolder(n),j=y(V=>pt(V.userState,D.userId)),$=()=>{h?.isPinSet!==!0&&a(za(n,!0))};c.useEffect(()=>{b.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),f(!0))},[b.updateDebitCardPinAttemptFetchState.fetchState]);const H=V=>{v(V)};if(P!=="Completed"||h==null)return s.jsx(la,{fetchState:"In-Progress"});if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hs,{children:[s.jsx(Ge,{isAppContentDrawerOpen:O,handleDrawerToggle:H}),s.jsx(Cs,{cardId:n,card:h,phone:j.phone,signedInUser:D,isSandboxEnv:Ka(),debitCardDetailState:b,signedInUserToken:U,navigate:r,currentTenant:p,location:C,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{H(!0)}}),e!=null?s.jsx(ps,{windowSize:t,children:e}):null]})},Cs=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=ht(e,a),n=t.updateStatus,C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{showMenuIcon:m,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,debitCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(It(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Yn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(kr),ps=_e.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
width: ${e=>`${us.containerWidth.value(e.windowSize)}%`};
|
|
51
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
+
box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
+
`,hs=_e.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
min-height: 100%;
|
|
56
|
+
width: 100%;
|
|
57
|
+
flex: 1 1 auto;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
61
|
+
box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
+
`,fs={overlayWidth:new ma(Ua[12],Ua[12],Ua[9])},gs=pe(function(e,t){const a=Ya(e,!1,!1),r=t.lineId,n=a.customAddress[r],C=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:C,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:C=>{a!=null&&e(Ut(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const m=jr(C);e(qn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:m})),e(Qn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Wn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(Dr),bs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=ua(),C=()=>{t()},m=y(g=>Kn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(Mt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:fs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,I)=>(I==="backdropClick"||I==="escapeKeyDown")&&C(),children:s.jsx(gs,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:C,lineId:e,chargeCardTypeOption:a,newCustomAddressId:m})})},ys=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g}=t,I=Ya(e,a&&m,r&&g);return{issueChargeCards:I,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:g,cardHolderCandidates:I.userList.map(o=>o.user).filter(Boolean),allRoles:I.userList.map(o=>o.userRole),allAccountingClasses:I.allAccountingClasses,userList:I.userList}},function(e,t){return{onIssueCardClick:()=>{e(er())},onSaveChangesToLocalStore:a=>{e(Jn(a))},onDismissClick:()=>{e(Ot()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Ut(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(wr);function Ss(){const e=J.getSignedInUser(),t=le(),a=ue(),r=_r(),[n]=ut(),C=n.get("cardType"),{useFeatureGate:m}=se(),{isFeatureEnabled:g}=m(Z.isIssuePhysicalCardEnabled),{isFeatureEnabled:I}=m(Z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=m(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(Z.isChargeCardFeatureEnabled),E=y($=>ce($)),S=Se(o,E),f=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:S}),O=be(E),v=ye(E),D=E.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ae({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:i,isBookKeepingTenant:v,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:D}),[u,b]=c.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");c.useEffect(()=>{u||(b(!0),a(Xn(f&&_,p&&l,!1)))},[u,b,a]);const l=!!E.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!E.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y($=>Ya($,p&&l,f&&_)),R=F.fetchState,B=F.issueCardStatus.fetchState,T=F.lastSelfIssuedDebitCardId,N=y($=>T!=null?Rt($.chargeCardState,T):void 0),[d,h]=c.useState(null),[P,w]=c.useState(null),U=()=>{h(null)},j=($,H)=>{h($),w(H)};return c.useEffect(()=>{if(B==="Completed"){if(T!=null&&N?.type.code==="business_virtual_debit_card"){let $;$=N?.status.code==="request_on_hold"&&e.userId===N.cardHolderUserId?Zt(E.tenantEmailDomain):Ce(E.tenantEmailDomain,T,e,N),t($)}else t("../");a(Ot())}},[B,T]),R==="Completed"?s.jsxs(s.Fragment,{children:[d!==null&&P!==null?s.jsx(bs,{closeDrawerHandler:U,lineId:d,chargeCardTypeOption:P}):null,s.jsx(ys,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:I,isDebitCardFeatureEnabled:f,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:l,isDebitCardSetupEnabled:_,navigate:t,fetchState:F.fetchState,openAddAddressDrawerHandler:j,defaultCardType:C==="creditCard"||C==="debitCard"?C:void 0})]}):R==="Error"?s.jsx(La,{}):s.jsx(Pr,{})}const Is=_e.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
height: 100vh;
|
|
65
|
+
width: 100%;
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
align-items: center;
|
|
70
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
71
|
+
`,As=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:C,myPendingActivationChargeCardListState:m}=t,{tenantEmailDomain:g}=r,{cards:I}=m;return{onChargeCardRowClick:o=>{const i=zt(I,o),E=Ce(g,o,C,i),S=fe(n.state?.pathnameStackToGoBack,n.pathname);a(E,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(o,i)=>{e(Va({uiState:{sortKey:o,sortOrder:i}}))},onReloadCards:()=>{e(ia())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Va({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(Tr);function Es(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,C]=c.useState(!1),m=y(w=>ar(w)),g=y(w=>ce(w)),I=y(w=>$e(w,g.companyId)),o=ze(I.controllers),{useFeatureGate:i}=se(),{isFeatureEnabled:E}=i(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=i(Z.isDebitCardFeatureEnabled),f=Se(S,g),O=Ie({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:f}),v=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,D=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,p=je(),u=be(g),b=ye(g),l=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Ae({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:E,isBookKeepingTenant:b,isDebitCardProductVisible:O,chargeCardsCreditAccountLimit:l}),F=Ue(p?.loggedInUserRoleMap),R=y(w=>Ye(w)),{creditAccount:B,creditAccountRepayment:T}=y(w=>Ze(w)),N=y(w=>xt(w)).cards.filter(w=>w.type.code.includes("debit")).map(w=>w.connectedAccountId),d=[...new Set(N)],h=y(w=>va(w,d));c.useEffect(()=>{n||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(C(!0),t(ia()),t(Da()))},[n,t,m.fetchState]),c.useEffect(()=>{if(m.fetchState==="Completed"&&m.cards.length===1&&P!=null){const w=Ce(g.tenantEmailDomain,m.cards[0].id,P,m.cards[0]);e(w,{state:{message:a.state?.message}})}},[m.fetchState,m.cards]);const P=J.getSignedInUser();if(c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&_&&D&&F&&t(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&F&&t($a()),h.fetchState!=="Completed"&&h.fetchState!=="In-Progress"&&O&&v&&F&&t(Bt())},[B.fetchState,T.fetchState,t,h.fetchState,O,v,F,_,D]),P==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return s.jsx(la,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const w=Oe(_,O,v,D);return s.jsx(Is,{children:s.jsx(As,{navigate:e,currentTenant:g,signedInUser:P,productInformation:w,myPendingActivationChargeCardListState:m,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:O,isDebitCardSetupEnabled:v,isChargeCardSetupEnabled:D,chargeCardCashbackDetailState:R,creditAccount:B,creditAccountRepayment:T,depositAccountListWithDebitCardIssued:h,controllerEmails:o,location:a})})}}const ks=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:C,isChargeCardSetupEnabled:m,signedInUser:g,location:I,productInformation:o,isEarlyPayEnabled:i,controllerEmails:E,chargeCardsCreditAccountLimit:S}=t;return{onSetupButtonClick:f=>{if(g!=null&&Q.trackCardsPromoPageClicked("enable cards"),n)switch(Q.trackCardsEnableCardsClick(E,o,"Cards Promo"),f){case"credit":e(Re(r,!0,"charge_cards",i,!1));break;case"debit":e(Re(r,!0,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Re(r,!0,"debit_cards",i,!0):Re(r,!0,"charge_cards__debit_cards",i,!1))}else switch(Q.trackCardsSetupCardsClick(E,o,"Cards Promo"),f){case"credit":e(Re(r,!1,"charge_cards",i,!1));break;case"debit":e(Re(r,!1,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Re(r,!1,"debit_cards",i,!0):Re(r,!1,"charge_cards__debit_cards",i,!1))}},onBackClick:()=>{const f=ve(I.state?.pathnameStackToGoBack);let O=f.poppedPathname;O==null&&(O=C||m?"..":"../.."),a(O,{state:{pathnameStackToGoBack:f.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(rr(r))}}})(vr),Ds=()=>{const e=le(),{tenantEmailDomain:t}=ca(),[a]=ut(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:C,useFeatureGate:m}=se(),[g,I]=c.useState(!1),{isFeatureEnabled:o}=m(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:E}=m(Z.isChargeCardFeatureEnabled),{configValue:S}=C(Fe.zeniCardsConfig),f=y(ae=>ce(ae)),O=y(ae=>$e(ae,f.companyId)),v=ze(O.controllers),D=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,p=ge(),u=J.getSignedInUserTenant(t)?.companyId??f.companyId,b=y(ae=>da(ae,u)),l=b.primaryFundingAccount,_=f.companyBillPayInfo?.info,F=be(f),R=ye(f),B=Se(o,f),T=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,N=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:B}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:E,isBookKeepingTenant:R,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:T}),h=$t({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:E,isBookKeepingTenant:R}),P=N&&d===!1,w=_?.businessVerificationStatus?.code==="verified"&&(P||l?.accType==="depositAccount"||tr(l?.providerVerificationStatus?.code??"")),U=J.getSignedInUser(),j=!!f.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,H=!!f.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!f.company?.companyDebitCardInfo.isDebitCardEnabled,A=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,L=ae=>{I(ae)},W=y(ae=>ae.chargeCardSetupViewState.fetchState);if(U==null)throw Error("Can't access Charge Card promo page without signing in...");const k=je(),Y=Ue(k?.loggedInUserRoleMap),q=Za(k?.loggedInUserRoleMap),[z,x]=c.useState(!1),[oe,ee]=c.useState(!1),[te,X]=c.useState(!1);c.useEffect(()=>{z===!1&&p.state?.message==="activation"&&x(!0)},[p.state]),c.useEffect(()=>{oe||W!=="Not-Started"||u==null||(ee(!0),n(Fa(u,!0)))},[oe,W,u,n]);const re=f.companyChargeCardInfo?.info!=null&&Xe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:h,isTOSAccepted:$,isSetupEnabled:H,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),Ee=f.companyDebitCardInfo?.info!=null&&Xe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:N,isTOSAccepted:A,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),xe=N&&Ee&&h&&T>=0&&re?"debit_and_credit":N&&Ee?"debit":"credit",K=Or(r,xe),he=b?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=c.useRef(null);c.useEffect(()=>{he==="In-Progress"?ke.current=K:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,K]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?K:ke.current;c.useEffect(()=>{K==="credit"&&(H||h===!1&&V)||K==="debit"&&V||K==="debit_and_credit"&&V&&H?e("../"):(K==="debit_and_credit"&&$===!0&&A===!0||K==="credit"&&($===!0||h===!1&&A===!0)||K==="debit"&&A===!0)&&Y===!0&&e("../setup")},[w,H,V,K,$,A]),c.useEffect(()=>{te||(n(nr("cardAdmin")),X(!0))},[te]);const Pe=y(ae=>Tt(ae.userState,ae.userRoleState,ae.userListViewState,"cardAdmin")),we=Oe(h,N,V,H);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:Q,onLoad:()=>{if(Q.trackPageLoaded(Ht.Event.cardsPromoPage),!!h&&!H||!!N&&!V||!!h&&!!N&&!V&&!H){const ae=_s({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:H,isCreditCardProductVisibleForExpressInterest:h,isDebitCardProductVisible:N});Q.trackCardsPromoView(v,we,"Page",ae,"Promo Page")}}}),s.jsx(xa,{showConfetti:z}),s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:L}),s.jsx(ks,{signedInUser:U,location:p,showEnableCardButton:w,isCompanyBusinessVerificationAndPaymentSetUpDone:w,isChargeCardSetupEnabled:H,isDebitCardSetupEnabled:V,companyLegalName:f.companyName,adminList:Pe.users,isCheckingEnabled:j,navigate:e,companyId:u,cardPromoType:Be,controllerEmails:v,productInformation:we,isCreditCardProductVisible:d,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:i,cashbackRate:D,chargeCardsCreditAccountLimit:T,onClickMenuIcon:()=>{L(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ge,{isAppContentDrawerOpen:g,handleDrawerToggle:L}),s.jsx(Fr,{})]})},_s=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Qs(){const e=ge(),t=y(W=>ce(W)),{useFeatureGate:a}=se(),{isFeatureEnabled:r}=a(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=a(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:m}=a(Z.isChargeCardPaymentHistoryFeatureEnabled),g=Se(n,t),I=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),o=xr(t,r,n),i=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,E=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,O=je(),v=Ue(O?.loggedInUserRoleMap),D=Za(O?.loggedInUserRoleMap),{isFeatureEnabled:p}=a(Z.isCashbackFeatureEnabled),u=t.userRole.includes("charge_card_user"),b=!u,l=!u&&S,_=t?.userRole!=null&&sr(t?.userRole),F=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!_)&&or(O?.loggedInUserRoleMap),R=ir(O?.loggedInUserRoleMap),B=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!_)&&cr(O?.loggedInUserRoleMap),{isFeatureEnabled:T}=a(Z.isDepositAccountsFeatureEnabled),N=T&&!_&>(O?.loggedInUserRoleMap),d=S&&!_,h=f&&!_,P=o&&!_&&Ue(O?.loggedInUserRoleMap),w=dr(O?.loggedInUserRoleMap),U=be(t),j=ye(t),$=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:r,isBookKeepingTenant:j,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:$}),V=t.companyChargeCardInfo?.info!=null&&Xe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:H,isTOSAccepted:i,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:v,isUserHasCardsAccess:D}),A=t.companyDebitCardInfo?.info!=null&&Xe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:I,isTOSAccepted:E,isSetupEnabled:f,isUserHasCardsAdminLevelAccess:v,isUserHasCardsAccess:D}),L=V||A;return s.jsxs(qt,{children:[v?s.jsx(ne,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:F,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:N,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:R,productType:"charge_cards",type:"setup"})}):null,v?s.jsx(ne,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:F,isUserHasOnlyBillPayAccess:R,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:N,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:w,productType:"charge_cards",type:"verification"})}):null,s.jsx(ne,{path:"promo",element:s.jsx(Ds,{})}),d||h?s.jsxs(s.Fragment,{children:[s.jsx(ne,{path:"/",element:s.jsx(it,{isPaymentDrawerOpen:!1})}),P&&C?s.jsx(ne,{path:"payment",element:s.jsx(it,{isPaymentDrawerOpen:!0})}):null,s.jsx(ne,{path:"activate",element:s.jsx(Es,{})}),s.jsx(ne,{path:"onboard",element:s.jsx(cs,{})}),v?s.jsx(ne,{path:"new",element:s.jsx(Ss,{})}):null,p&&b?s.jsx(ne,{path:"cashback",element:s.jsx(Hr,{})}):null,l?s.jsx(ne,{path:"statements",element:s.jsx(os,{})}):null,P&&m&&S?s.jsx(ne,{path:"payment-history",element:s.jsx(ss,{})}):null,s.jsx(ne,{path:":cardId/activate",element:s.jsx($r,{})}),s.jsx(ne,{path:":cardId/setPin",element:s.jsx(ms,{})}),s.jsx(ne,{path:":cardId/addToWallet",element:s.jsx(Vr,{})}),s.jsx(ne,{path:":cardId/*",element:s.jsx(Xr,{})}),s.jsx(ne,{path:"*",element:s.jsx(La,{})})]}):(i||E)&&v?s.jsx(ne,{path:"*",element:s.jsx(ga,{to:"../setup"})}):L?s.jsx(ne,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(ne,{path:"*",element:null})]})}export{Qs as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-DeJrMusH.js";import{a as g}from"./sentry-QhEvvQLf.js";import{h as w,u as x,g as k,i as T,j as O,n as E}from"./core-D1nsPBWT.js";import{z as N,b7 as P,x as F,d as V,f as j,af as C,b8 as A,at as L,au as M,r as U}from"./index-DOvs-gN8.js";import{eP as h,fG as B,se as _,fB as G,c2 as R,MH as z,bn as q,qf as H,q3 as Y,ke as K,lK as S,MI as Z,bE as $,cv as D,lS as J,lV as Q}from"./zeni-epic-state-DZ-NC_Ba.js";import"./mui-Bt67K2M5.js";import{d as W}from"./routePaths-Br5thBmx.js";import{M as X}from"./MobileAppDrawer-jSlYcX5x.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]="595a7e38-df11-44cf-95f5-2e5316855004",t._sentryDebugIdIdentifier="sentry-dbid-595a7e38-df11-44cf-95f5-2e5316855004")}catch{}})();const ee=E(function(t){const a=G(t),i=N.getSignedInUser(),l=h(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(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:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;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=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({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:b}=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:M(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?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:b.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(Z(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(K({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>h(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(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(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as C}from"./liveblocks-DeJrMusH.js";import{a}from"./sentry-QhEvvQLf.js";import{u as D,g as v,j as u,N as w}from"./core-D1nsPBWT.js";import{Jm as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jt as F}from"./zeni-epic-state-DZ-NC_Ba.js";import{u as P,z as c,L as g,D as $,o as k}from"./index-DOvs-gN8.js";import{n as H}from"./mui-Bt67K2M5.js";import{t as z}from"./getLocaleForTenant-Cc9g-3s7.js";import{g as R,Q as J}from"./QBOConnectionScreen-C6xEPKjx.js";import"./recharts-BKv64PUA.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./utils-BUOS2Hrm.js";import"./empty-DXjkFqhp.js";import"./pdf-lib-DPGVWluc.js";import"./index-LMf4Uk3C.js";import"./url-Dy9x3ATl.js";import"./index-BGF3YnQ1.js";import"./decodeURIComponentSafe-DGEbX7e2.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]="d9735e6d-9385-4cb9-a9a7-880f042883c1",t._sentryDebugIdIdentifier="sentry-dbid-d9735e6d-9385-4cb9-a9a7-880f042883c1")}catch{}})();const W=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
background-color: ${t=>t.theme.colors.background};
|
|
10
|
+
box-shadow: ${t=>`0px 2px ${k.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
+
`;function pe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:x}=P(),p=a.useRef(!1),f=a.useRef(!1),{code:b,realmId:T,state:y}=R(i.search),N=b!==""&&T!==""&&y!=="",I=u(l=>A(l)),e=u(l=>O(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=c.getSignedInUser(),m=c.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{p.current||o==null||m==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(j(o.userId,m))))},[p,n,d]),a.useEffect(()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[f,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(_(e.tenantId)),c.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),$.updateAppLocaleID(z(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&c.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||x()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(W,{children:C.jsx(J,{})}):C.jsx(w,{to:"/",replace:!0})}export{pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-DeJrMusH.js";import{z as n}from"./index-DOvs-gN8.js";import{g as d}from"./QBOConnectionScreen-C6xEPKjx.js";import"./sentry-QhEvvQLf.js";import{g as p,N as a}from"./core-D1nsPBWT.js";import"./zeni-epic-state-DZ-NC_Ba.js";import"./recharts-BKv64PUA.js";import"./mui-Bt67K2M5.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./utils-BUOS2Hrm.js";import"./empty-DXjkFqhp.js";import"./pdf-lib-DPGVWluc.js";import"./index-LMf4Uk3C.js";import"./url-Dy9x3ATl.js";import"./index-BGF3YnQ1.js";import"./decodeURIComponentSafe-DGEbX7e2.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]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DeJrMusH.js";import{t as $e,A as Ce}from"./AddressScreen-BJKo5r7f.js";import Ke from"./NotFoundScreen-CCngxdO1.js";import{a as g}from"./sentry-QhEvvQLf.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as Me,p as z}from"./core-D1nsPBWT.js";import{v as de,k as le,z as B,S as ue,h as qe,c as _,r as V,x as H,d as N,B as we,f as Y,ap as Qe,J as Ze,aq as ke,i as te,ar as Je,as as Ie,o as He,at as We,au as Ee,av as Ye}from"./index-DOvs-gN8.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mU as at,fc as nt,bO as ot,ji as ae,jl as ve,JS as st,bT as it,c2 as ge,ss as he,sd as rt,Km as X,st as _e,HK as ct,km as Ue,Kn as Ve,Ko as dt,Kp as lt,Kq as ut,jg as pt,jj as mt,sf as Be,sr as gt,bE as Te,cv as ht,sF as xe,qf as ft,q3 as yt,ke as St,fE as bt,fD as Ct,fC as kt,Kr as It,s7 as Et,sG as Tt,sJ as xt,sM as Ot,sS as Pt,cT as Dt}from"./zeni-epic-state-DZ-NC_Ba.js";import{n as fe}from"./mui-Bt67K2M5.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-C6xEPKjx.js";import"./recharts-BKv64PUA.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./utils-BUOS2Hrm.js";import"./empty-DXjkFqhp.js";import"./pdf-lib-DPGVWluc.js";import"./index-LMf4Uk3C.js";import"./url-Dy9x3ATl.js";import"./index-BGF3YnQ1.js";import"./decodeURIComponentSafe-DGEbX7e2.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]="9eb5ec7c-1a74-4e4b-a902-8040a99c92db",t._sentryDebugIdIdentifier="sentry-dbid-9eb5ec7c-1a74-4e4b-a902-8040a99c92db")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
+
`,Pe=fe.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
min-width: calc(100% - ${Ie}px);
|
|
10
|
+
padding-left: ${Ie}px;
|
|
11
|
+
flex: 1;
|
|
12
|
+
|
|
13
|
+
${t=>t.theme.breakpoints.down("md")} {
|
|
14
|
+
width: 100%;
|
|
15
|
+
padding-left: ${He.sp0};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
+
`,De=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:T,ssn:x,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:T,ssn:x,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:T,companyPhone:x,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:R,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:D,regulatedStatusDescription:Q,transactionVolume:K,transactionVolumeDescription:M,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:T!=""&&T!=null?ht(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(J=>J.length===2?J:Ee(J))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:D??"",regulatedStatusDescription:Q,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:M,usNexus:v,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=Ae(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=Ae(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(X({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Je),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=A(y=>y.onboardingCustomerViewState.fetchState),F=A(y=>y.onboardingCustomerViewState.currentStep),$=A(y=>y.onboardingCustomerViewState.uiState),c=A(y=>ee(y)),L=A(y=>y.userRoleConfigState.fetchState),j=A(y=>y.cardPaymentViewState),G=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:R,state:w}=At(d.search),P=c.externalConnections?.accounting[0],D=P?.connectionType,Q=P?.connectionName,K=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(b,R,w,K,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:D??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:R,connection_id:K,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,K),u(d.pathname))},[b,R,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=A(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const J=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Ge?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return J===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function Ae(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
height: 100vh;
|
|
22
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
+
`,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=A(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),T=me(i),x=A(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?x==="Completed"&&k===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&k===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):I?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Me,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Ke,{})})]})}export{oa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-DAjhbt80.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-Csep4njy.js";import{eQ as L,KT as Xe,bE as sa,bq as xe,M4 as In,i7 as Tn,M5 as Nt,M6 as xn,ia as bt,M7 as Qe,M8 as Dn,ig as wn,M9 as $t,Ma as Fn,ik as Ct,Mb as He,Mc as On,cl as St,Md as Pn,Me as Mn,Lb as Rn,jd as Bn,Mf as jn,bn as Ge,Mg as ra,KH as ce,bc as ia,jr as ca,n3 as la,ja as da,KJ as le,KI as ee,eP as ua,eV as Un,fr as kt,Mh as Ln,Mi as Gn,Mj as ma,Mk as Re,uw as Ye,ux as Ve,uU as De,uO as de,uB as Ne,Ml as Yn,Mm as Vn,Mn as Nn,Mo as pa,Mp as Be,Mq as $n,dE as Je,qZ as ha,Mr as zn,Ms as Kn,Mt as qn,Mu as yt,K4 as At,jH as we,v0 as vt,r5 as Zn,Mv as Qn,uy as zt,r0 as Ie,qY as fa,Mw as ge,Mx as Hn,My as Et,K3 as It,sZ as ga,Mz as Wn,MA as Xn,MB as Jn,MC as Tt,ta as eo,MD as to,uA as Kt,sY as ba,ME as be,MF as ao,bt as Ca,v4 as ka,MG as no,MH as oo,MI as so,MJ as xt,u$ as ro,MK as io,uz as qt,v3 as _a,ML as Ce,MM as co,MN as lo,MO as Sa,jw as ya,n0 as Aa,jB as va,m_ as Ea,mZ as Ia,mY as Ta,sl as uo,fh as mo,cN as po,cO as ho,mV as fo,fd as go,na as bo,E8 as Zt,MP as Co,MQ as ko,MR as _o,MS as So,b5 as et,f5 as yo,gS as Ao,fH as vo,n4 as Eo,j3 as Io,n1 as To,m$ as xo,e$ as Do,eZ as wo}from"./zeni-epic-state-B_XLk_Px.js";import{z as j,a2 as ae,v as D,d as x,D as q,aU as Fo,_ as $e,A as ze,aV as xa,f as N,aW as Oo,S as _e,aX as Da,n as Se,c as R,h as Po,aY as Mo,aZ as Ro,W as wa,m as Fa,a as Oa,Z as Bo,a_ as jo,U as Uo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Lo,b2 as Go,aq as Yo,r as Vo,Y as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-DgJtatP0.js";import{n as Dt}from"./mui-BwrnAXoT.js";import{a as b}from"./sentry-BchnSYMz.js";import{w as ja}from"./withTransactionSidePanel-Bh7VGJfn.js";import{c as Ua,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-CpXTBLF_.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-DAyGHIvM.js";import Le from"./NotFoundScreen-DXqfpA8J.js";import{u as Ft}from"./useInitialThreadRequest-Dg2cJQuZ.js";import{t as La}from"./analyticsHelper-DB3_ay5h.js";import{C as Zo}from"./CompanyPassportScreen-BXvU3-bZ.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-CWAGANr4.js";import{F as Ho}from"./FeaturePreviewScreen--3IRWa9I.js";import{R as Wo}from"./ReferralListScreen-JMU6dR_V.js";import"./recharts-D7BeuhCa.js";import"./analytics-D1kzjJGV.js";import"./plaid-BKdRBTqL.js";import"./dnd-Cjdb2KWD.js";import"./stripe-DMRn4zHo.js";import"./lottie-DYZ-hqab.js";import"./lexical-wVYu_9-d.js";import"./pdf-Cc8ZGklh.js";import"./utils-aai5Jslk.js";import"./TransactionDetailScreen-CpmzsSf7.js";import"./decodeURIComponentSafe-C5ifH7fM.js";import"./MobileAppDrawer-Cvrk0aA5.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]="52fae53a-3fee-44b3-81dc-9844d62f9533",e._sentryDebugIdIdentifier="sentry-dbid-52fae53a-3fee-44b3-81dc-9844d62f9533")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>L(y)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),U=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=Ua({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:U,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>L(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>L(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=Ua({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),U=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>L(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-DeJrMusH.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-D1nsPBWT.js";import{eP as L,KH as Xe,bE as sa,bq as xe,LU as In,i6 as Tn,LV as Nt,LW as xn,i9 as bt,LX as Qe,LY as Dn,ie as wn,LZ as $t,L_ as Fn,ij as Ct,L$ as He,M0 as On,cl as St,M1 as Pn,M2 as Mn,K$ as Rn,jc as Bn,M3 as jn,bn as Ge,M4 as ra,Kv as ce,bc as ia,jq as ca,n2 as la,j9 as da,Kx as le,Kw as ee,eO as ua,eU as Un,fq as kt,M5 as Ln,M6 as Gn,M7 as ma,M8 as Re,uk as Ye,ul as Ve,uI as De,uC as de,up as Ne,M9 as Yn,Ma as Vn,Mb as Nn,Mc as pa,Md as Be,Me as $n,dE as Je,qP as ha,Mf as zn,Mg as Kn,Mh as qn,Mi as yt,JU as At,jG as we,uQ as vt,qX as Zn,Mj as Qn,um as zt,qS as Ie,qO as fa,Mk as ge,Ml as Hn,Mm as Et,JT as It,sW as ga,Mn as Wn,Mo as Xn,Mp as Jn,Mq as Tt,t7 as eo,Mr as to,uo as Kt,sV as ba,Ms as be,Mt as ao,bt as Ca,uU as ka,Mu as no,Mv as oo,Mw as so,Mx as xt,uP as ro,My as io,un as qt,uT as _a,Mz as Ce,MA as co,MB as lo,MC as Sa,jv as ya,m$ as Aa,jA as va,mZ as Ea,mY as Ia,mX as Ta,si as uo,fg as mo,cN as po,cO as ho,mU as fo,fc as go,n9 as bo,DY as Zt,MD as Co,ME as ko,MF as _o,MG as So,b5 as et,f4 as yo,gR as Ao,fG as vo,n3 as Eo,j2 as Io,n0 as To,m_ as xo,e_ as Do,eY as wo}from"./zeni-epic-state-DZ-NC_Ba.js";import{z as j,a2 as ae,r as D,d as x,D as q,aU as Fo,_ as $e,x as ze,aV as xa,f as N,aW as Oo,k as _e,aX as Da,S as Se,c as R,h as Po,aY as Mo,aZ as Ro,U as wa,J as Fa,a as Oa,Y as Bo,a_ as jo,Q as Uo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Lo,b2 as Go,aq as Yo,p as Vo,W as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-DOvs-gN8.js";import{n as Dt}from"./mui-Bt67K2M5.js";import{a as b}from"./sentry-QhEvvQLf.js";import{w as ja}from"./withTransactionSidePanel--kvFKWwv.js";import{c as Ua,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-Br5thBmx.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-DIMAd_GF.js";import Le from"./NotFoundScreen-CCngxdO1.js";import{u as Ft}from"./useInitialThreadRequest-CuDTVayG.js";import{t as La}from"./analyticsHelper-BlXK6n1_.js";import{C as Zo}from"./CompanyPassportScreen-B8UuneCm.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-CXjPblWW.js";import{F as Ho}from"./FeaturePreviewScreen-D08E4BGf.js";import{R as Wo}from"./ReferralListScreen-BSgOGLcH.js";import"./recharts-BKv64PUA.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./utils-BUOS2Hrm.js";import"./TransactionDetailScreen-BYdWSsJY.js";import"./decodeURIComponentSafe-DGEbX7e2.js";import"./MobileAppDrawer-jSlYcX5x.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]="18432294-b876-449a-bc51-e1cbea797803",e._sentryDebugIdIdentifier="sentry-dbid-18432294-b876-449a-bc51-e1cbea797803")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>L(y)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),U=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=Ua({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:U,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>L(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>L(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=Ua({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),U=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>L(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.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-DeJrMusH.js";import{a as u}from"./sentry-QhEvvQLf.js";import{u as y,j as b,n as w,g as A,N}from"./core-D1nsPBWT.js";import{Jm as U,eP as _,fo as k,Jn as L,mW as R,Jo as z}from"./zeni-epic-state-DZ-NC_Ba.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-DOvs-gN8.js";import"./mui-Bt67K2M5.js";import{t as P}from"./getLocaleForTenant-Cc9g-3s7.js";import"./recharts-BKv64PUA.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./utils-BUOS2Hrm.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]="9356f07c-2473-4edf-97be-06ac737bd8f1",t._sentryDebugIdIdentifier="sentry-dbid-9356f07c-2473-4edf-97be-06ac737bd8f1")}catch{}})();const J=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(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(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"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(J,{})}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};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-DeJrMusH.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-D1nsPBWT.js";import{No as k,Nv as _,fE as q,fD as J,fC as K,iD as M,Kw as L,q6 as Q,eP as D,MW as V,iB as T,Np as v,Ny as F,iz as G,iW as N}from"./zeni-epic-state-DZ-NC_Ba.js";import{bu as X,J as j,S as R,z as U,h as z,p,c as S,B as O,bv as Y,o as Z,bw as ee,r as te}from"./index-DOvs-gN8.js";import{n as H}from"./mui-Bt67K2M5.js";import"./sentry-QhEvvQLf.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]="465d5b69-e662-4fd0-b925-29bd39b83ecb",e._sentryDebugIdIdentifier="sentry-dbid-465d5b69-e662-4fd0-b925-29bd39b83ecb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function W({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??P();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:d}=B(),c=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>D(u)),g=z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.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(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(W,{vendorId:c,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,de=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=V(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:c}=d;return{onFetchBankName:r=>{e(N(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:d}=B(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=z(),g=h(u=>D(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(W,{vendorId:c,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,W as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-DeJrMusH.js";import{J as l,F as c,h as f}from"./index-DOvs-gN8.js";import{D as p}from"./mui-Bt67K2M5.js";import"./sentry-QhEvvQLf.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]="54186247-c913-4a96-a75f-fbb572e355c8",e._sentryDebugIdIdentifier="sentry-dbid-54186247-c913-4a96-a75f-fbb572e355c8")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DeJrMusH.js";import{a as d}from"./sentry-QhEvvQLf.js";import{h as A,u as B,g as L,i as F,j as c,N as q,n as K,o as N,p as _}from"./core-D1nsPBWT.js";import{LD as H,eP as O,L0 as R,kG as M,HC as I,LI as W,Kv as Y,jG as $,HD as S,L5 as z,L6 as V,Kx as J,Kw as Q}from"./zeni-epic-state-DZ-NC_Ba.js";import{aR as U,d as X,p as Z,r as tt}from"./index-DOvs-gN8.js";import"./mui-Bt67K2M5.js";import{d as k}from"./decodeURIComponentSafe-DGEbX7e2.js";import{w as et}from"./withTransactionSidePanel--kvFKWwv.js";import{f as at,c as nt}from"./routePaths-Br5thBmx.js";import"./recharts-BKv64PUA.js";import"./analytics-D-L0XCdy.js";import"./plaid-bgwND0M_.js";import"./dnd-BLL6L3gN.js";import"./stripe-DMRn4zHo.js";import"./lottie-HzjylhSG.js";import"./lexical-BPvBMaax.js";import"./pdf-DvTTGpmm.js";import"./utils-BUOS2Hrm.js";import"./useAskAiCfoHostNavButtonProps-DIMAd_GF.js";import"./TransactionDetailScreen-BYdWSsJY.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]="28e6060c-434c-40b4-9c4a-7d295e0b25f6",a._sentryDebugIdIdentifier="sentry-dbid-28e6060c-434c-40b4-9c4a-7d295e0b25f6")}catch{}})();const ot=K(function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(z()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=L(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=F(),r=k(x??""),p=k(j??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=c(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const P=c(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:b(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
|