@zeniai/web-app-ui 5.1.16-qa → 5.1.17-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/assets/AddressRoutes-tJ9jmKZ6.js +1 -0
  2. package/dist/assets/{AddressScreen-BHOH_WLv.js → AddressScreen-Cm8PgLwy.js} +2 -2
  3. package/dist/assets/AiCfoScreen-nijnaZNB.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-BK-ZwGIn.js → BillPayApprovalRoutes-Dvs_jl0I.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-QQCSBZkL.js → BillPayRoutes-BvKz5dx4.js} +18 -18
  6. package/dist/assets/{BusinessVerificationPageScreen-BiLuShF3.js → BusinessVerificationPageScreen-BQMr1wXT.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-CvGpaiIn.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-Cb1iYJZe.js → CompanyPassportScreen-BbrS3C3y.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-D6d-AX_j.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-CuwnnhyX.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-BfQSV3-B.js +23 -0
  12. package/dist/assets/{DashboardRoutes-CDrvRI7s.js → DashboardRoutes-CiKnHqQN.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BZchPKt2.js → DefaultTenantHome-DMfUSQKR.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-6696dMHO.js → DomesticWireDetailScreen-BCJwnf6f.js} +3 -3
  15. package/dist/assets/DrawerScreen-fXlHBgEP.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-5UgOzlB5.js → EntityDetailRoutes-CD9oFdD9.js} +1 -1
  17. package/dist/assets/ExpenseAutomationRoutes-C9TxcfIN.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-DCuTnXQ7.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-CPtSXYh7.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-Ce6dDObK.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-DbdPpJj1.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-DgVPhlgQ.js → MobileAppDrawer-5NMylEDA.js} +1 -1
  23. package/dist/assets/NotFoundScreen-ph-dOT2n.js +1 -0
  24. package/dist/assets/{NotificationRoutes-CDYFRT0v.js → NotificationRoutes-jGeqKgSU.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-BrJ09ALg.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-D3OZpQZt.js +1 -0
  27. package/dist/assets/PeopleRoutes-jp5ee-_v.js +22 -0
  28. package/dist/assets/PerformanceRoutes-DWeF4HS0.js +1 -0
  29. package/dist/assets/{Preview-ulACyGAL.js → Preview-B5oHKMPo.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-D0nezBr9.js → QBOConnectionScreen-DZdB_pbF.js} +1 -1
  31. package/dist/assets/ReferralListScreen-Ct8WhTd-.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-Bo8UUDlS.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BXgtrc7k.js → ReimbursementApprovalRuleDetailScreen-CkYM7HJl.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-qjw4T9lX.js → ReimbursementRoutes-DW8QpgNN.js} +9 -9
  35. package/dist/assets/{ReportsRoutes-CqTf40Qy.js → ReportsRoutes-BGcfvw17.js} +1 -1
  36. package/dist/assets/RewardsRoutes-BwcL9vuN.js +1 -0
  37. package/dist/assets/{ScreenRoutes-W867eoTR.js → ScreenRoutes-zjxhCaKs.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DRzTOLku.js → SettingsRoutes-BDJLQPwu.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-CPEy50bJ.js → SetupPagesScreen-CFS55UXo.js} +5 -5
  40. package/dist/assets/SignInScreen-CNAxEpfd.js +1 -0
  41. package/dist/assets/SignOutScreen-DxiUsF5m.js +9 -0
  42. package/dist/assets/TaskListScreen-BmxMWgh6.js +9 -0
  43. package/dist/assets/TaskRoutes-Dg1AOkQ_.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-DxRfHR5F.js → TransactionDetailRoutes-ycAbjzJM.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-C5vka9J3.js → TransactionDetailScreen-BcViPCVk.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-C4dv3IiR.js → TransactionListRoutes-Dkj40qqV.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-BFbJsDKt.js +37 -0
  48. package/dist/assets/{VendorsRoutes-DqnM7Xdr.js → VendorsRoutes-Dh9Ll4Ay.js} +22 -22
  49. package/dist/assets/WiseConfirmationScreen-yJF3mkpc.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-BAMALAhE.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-ChM9Q7h5.js +9 -0
  52. package/dist/assets/{accountMappingHelper-W5otorD-.js → accountMappingHelper-Q4AWrIJ8.js} +1 -1
  53. package/dist/assets/{analytics-DXqzaj7k.js → analytics-p-atCQap.js} +1 -1
  54. package/dist/assets/analyticsHelper-uyl1Q5Bm.js +1 -0
  55. package/dist/assets/{core-C9zW9aiN.js → core-85-jQOHl.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-BPYfhkXa.js → decodeURIComponentSafe-DMY7naVP.js} +1 -1
  57. package/dist/assets/{dnd-CyN5SJrk.js → dnd-aCLmWYWF.js} +1 -1
  58. package/dist/assets/{empty-LAjrKg-c.js → empty-B8YZlU8y.js} +1 -1
  59. package/dist/assets/{empty-CgUWy1ya.js → empty-BUCP1zlD.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-HAOuHOAc.js → emptyVideoElement-BzTeHcqi.js} +1 -1
  61. package/dist/assets/epic-BnLWYuZv.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BEsUCcGU.js +1 -0
  63. package/dist/assets/{index-BDBxuaUt.js → index--AtO8DLV.js} +1 -1
  64. package/dist/assets/{index-B7J5swVH.js → index-BBYM723i.js} +2 -2
  65. package/dist/assets/{index-BWbah6CI.js → index-BjSilB1q.js} +1 -1
  66. package/dist/assets/{index-1wxiPadS.js → index-CvKM_if1.js} +11410 -11406
  67. package/dist/assets/{index-DcFcyk9X.js → index-DCnezmp4.js} +1 -1
  68. package/dist/assets/{index-BKXnOOiQ.js → index-Dx_wxYK2.js} +1 -1
  69. package/dist/assets/{index-BaE1yb8B.js → index-RkQAxlvL.js} +1 -1
  70. package/dist/assets/{index-BeiF5atT.js → index-YSSSINh1.js} +1 -1
  71. package/dist/assets/{lexical-C9R0TbF2.js → lexical-BiigqH5F.js} +1 -1
  72. package/dist/assets/{liveblocks-D65YpEzb.js → liveblocks-DPIuO3ZH.js} +1 -1
  73. package/dist/assets/{lottie-CyD5A6ZF.js → lottie-Dyslb7Yt.js} +1 -1
  74. package/dist/assets/{mui-CjAqh33Z.js → mui-bZkpowbW.js} +1 -1
  75. package/dist/assets/{pathToGoBack-CydSZdwJ.js → pathToGoBack-DrUZouuw.js} +1 -1
  76. package/dist/assets/{pdf-BTv9XTca.js → pdf-DmPsD6fu.js} +4 -4
  77. package/dist/assets/{pdf-lib-0B-WwULF.js → pdf-lib-DVsRNJ0B.js} +1 -1
  78. package/dist/assets/{plaid-C7S-w4PD.js → plaid-AGYiNbMg.js} +1 -1
  79. package/dist/assets/{pusher-Cs8HqkwM.js → pusher-BnGrHB5v.js} +1 -1
  80. package/dist/assets/{react-B0ycLXHh.js → react-B2QuP8nN.js} +1 -1
  81. package/dist/assets/{react-CbPt48pi.js → react-Bq1_8StD.js} +1 -1
  82. package/dist/assets/{react-DQfJbxCg.js → react-BrihoTMQ.js} +1 -1
  83. package/dist/assets/{react-UcrcycqM.js → react-CzhAGPyA.js} +1 -1
  84. package/dist/assets/{react-BN4RYnhP.js → react-DBTwfklC.js} +1 -1
  85. package/dist/assets/{react-CRTFund5.js → react-DDzH1t0V.js} +1 -1
  86. package/dist/assets/{recharts-DATP9UFl.js → recharts-DDB6XWY-.js} +1 -1
  87. package/dist/assets/{routePaths-NM47duJ5.js → routePaths-BT8WAsMD.js} +1 -1
  88. package/dist/assets/{sentry-Cc7E6KXa.js → sentry-D2jFbVNj.js} +1 -1
  89. package/dist/assets/{url-CYTm1dtu.js → url-B4hbg5S-.js} +1 -1
  90. package/dist/assets/{url-kUZYC_m5.js → url-C3RKXM3D.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dmb4Bk7D.js → useAiCfoDashboardSuggestedQuestionsChips-wFWW3HqH.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-BpHEKjJx.js +1 -0
  93. package/dist/assets/{useDeviceId-BlRnIDLL.js → useDeviceId-CS-9EsMC.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-COJ5en-O.js → useInitialThreadRequest-BsMYIB_G.js} +1 -1
  95. package/dist/assets/{utils-Ufaf0xdt.js → utils-BK-h0w8q.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-DzuPuyV9.js → withTransactionSidePanel-CSUB_mIW.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-CSVE6Gls.js → zeni-epic-state-BMMVjv_C.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +5 -4
  100. package/dist/assets/AddressRoutes-BmUd4vYL.js +0 -1
  101. package/dist/assets/AiCfoScreen-DAFLwJG_.js +0 -22
  102. package/dist/assets/ChargeCardRoutes-CXqQvycu.js +0 -71
  103. package/dist/assets/ConnectionAuthScreen-CZDo58x5.js +0 -11
  104. package/dist/assets/CustomerOnboardingAuthScreen-CS3Xmka2.js +0 -1
  105. package/dist/assets/CustomerOnboardingRoutes-jCmBO4Mn.js +0 -23
  106. package/dist/assets/DrawerScreen-MbZXqUoq.js +0 -1
  107. package/dist/assets/ExpenseAutomationRoutes-DsR7qPoa.js +0 -25
  108. package/dist/assets/FeaturePreviewScreen-CVSV79yf.js +0 -1
  109. package/dist/assets/HubSpotOAuthCallbackScreen-BZAzKH7-.js +0 -1
  110. package/dist/assets/MagicLinkRoutes-WS_1Q0Lk.js +0 -72
  111. package/dist/assets/MagicLinkSignInScreen-Dl1MbB9d.js +0 -12
  112. package/dist/assets/NotFoundScreen-Bv_nRCjj.js +0 -1
  113. package/dist/assets/OAuthConsentScreen-BkPvVJhS.js +0 -1
  114. package/dist/assets/PandLWithForecastRoutes-Bdh8vsXv.js +0 -1
  115. package/dist/assets/PeopleRoutes-lUM8fGYE.js +0 -22
  116. package/dist/assets/PerformanceRoutes-BGffRGOA.js +0 -1
  117. package/dist/assets/ReferralListScreen-DINWTi1Q.js +0 -5
  118. package/dist/assets/ReimbursementApprovalRoutes-DB7O5cw7.js +0 -1
  119. package/dist/assets/RewardsRoutes-DIkvz1Jt.js +0 -1
  120. package/dist/assets/SignInScreen-D_nrlvPb.js +0 -1
  121. package/dist/assets/SignOutScreen-BRpLavje.js +0 -9
  122. package/dist/assets/TaskListScreen-LsHZDVjF.js +0 -9
  123. package/dist/assets/TaskRoutes-DJ1gNgLs.js +0 -9
  124. package/dist/assets/TreasuryRoutes-bHKI0_zJ.js +0 -37
  125. package/dist/assets/WiseConfirmationScreen-Cke3Uv9t.js +0 -12
  126. package/dist/assets/ZeniAccountRoutes-CLwrbfOg.js +0 -57
  127. package/dist/assets/ZeniAccountStatementScreen-CsDbnZmX.js +0 -9
  128. package/dist/assets/analyticsHelper-CjjD2OUX.js +0 -1
  129. package/dist/assets/epic-Du76qfdK.js +0 -2
  130. package/dist/assets/getLocaleForTenant-C-mTF_-1.js +0 -1
  131. package/dist/assets/useAskAiCfoHostNavButtonProps-BHe-JBXY.js +0 -1
@@ -0,0 +1,71 @@
1
+ import{j as s}from"./liveblocks-DPIuO3ZH.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Fa,s as jt,o as Rn,p as se}from"./core-85-jQOHl.js";import{eP as de,bs as He,Pe as ja,eY as Ie,eZ as Ae,e_ as Ee,fT as qe,cs as Xe,Pf as Je,Pg as lt,tv as xa,jO as Ba,Ph as La,gT as pa,z$ as ca,A1 as Ne,A2 as ut,jE as Vt,Pi as Qe,zP as ha,Pj as On,Pk as Un,zS as Va,Pl as jn,NE as Na,rH as Nt,zY as na,h2 as Vn,Pm as Ht,Pn as ea,bq as Nn,Po as Hn,fE as Ha,fD as Ma,Aw as Mn,fC as $a,Nk as $n,Pp as Mt,cl as $t,cM as Gn,ND as ya,B6 as Gt,Pq as Tt,AI as fa,Pr as zt,B7 as zn,O3 as Yn,B8 as Zn,C2 as Kn,sR as Wn,BY as qn,Ps as Xn,A0 as Ze,Pt as Jn,Pu as Qn,Pv as er,Pw as ar,Px as tr,Py as mt,Pz as nr,Ah as Yt,Aa as rr,PA as sr,fV as cr,Aq as Zt,Au as Kt,fU as or,PB as ir,AU as Wt,PC as dr,PD as lr,PE as ur,As as qt,Ad as Xt,zV as Jt,Am as Qt,Ak as en,Ao as mr,PF as an,PG as Ga,AF as ga,Kj as tn,cN as Ct,PH as Cr,PI as pr,PJ as hr,PK as fr,AC as st,A$ as gr,AX as br,Ay as yr,AZ as Sr,AP as Ir,AR as Ar,PL as nn,B5 as Ta,HI as Er,PM as kr,PN as _r,PO as Dr,PP as rn,PQ as Pr,Bs as wr,AH as sn,AB as ve,AG as vr,PR as Tr,PS as Fr,zM as xr,PT as cn,PU as on,PV as Br,zO as Lr,zN as Ft,PW as Rr,PX as Or,PY as Ur,Kf as jr,PZ as pt,P_ as Vr,wn as dn,km as Nr,gU as Hr,Bx as Mr,P$ as ln,Q0 as $r,By as Gr,Q1 as zr,de as Yr,tp as Zr,Bn as Kr,Bh as Ve,bt as Wr,bF as qr,cx as Xr,bG as Jr,Js as Qr}from"./zeni-epic-state-BMMVjv_C.js";import{z as ee,k as $e,v as oe,I as Y,B as Sa,c2 as za,cd as es,ce as as,cf as ts,p as Re,cg as ns,ch as rs,j as Ia,aN as Le,n as ye,bm as ht,ci as ss,w as Aa,i as Ya,h as ft,c as q,D as gt,a7 as Za,cj as cs,_ as un,aq as bt,by as ra,ck as ct,cl as os,Z as yt,cm as is,at as mn,a2 as ot,X as Cn,e as pn,cn as ds,co as ls,cp as us,cq as ms,cr as Cs,cs as ps,o as Ra,ct as hs,cu as fs,cv as at,O as gs,cw as bs,cx as ys,cy as Ss,cz as Is,cA as As,a9 as Es}from"./index-CvKM_if1.js";import{n as Te,D as hn,S as ks}from"./mui-bZkpowbW.js";import{a as d}from"./sentry-D2jFbVNj.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as Ge,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as Ke,m as bn,n as Ps,o as yn,p as ws,S as xt}from"./SetupPagesScreen-CFS55UXo.js";import{u as Sn}from"./useInitialThreadRequest-BsMYIB_G.js";import Ka from"./NotFoundScreen-ph-dOT2n.js";import{M as We}from"./MobileAppDrawer-5NMylEDA.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-BpHEKjJx.js";import{v as Bt}from"./utils-BK-h0w8q.js";import{d as vs}from"./recharts-DDB6XWY-.js";import{t as Ts}from"./AddressScreen-Cm8PgLwy.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./analyticsHelper-uyl1Q5Bm.js";import"./routePaths-BT8WAsMD.js";import"./BusinessVerificationPageScreen-BQMr1wXT.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]="13dd6b71-8469-417f-87f2-7e10f712d93f",e._sentryDebugIdIdentifier="sentry-dbid-13dd6b71-8469-417f-87f2-7e10f712d93f")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(K=>de(K)),f=$e(),p=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(K=>ja(K).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Y.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=g(Y.isDebitCardFeatureEnabled),F=Ie(n),L=Ae(n),C=Ee(B,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(K=>qe(K,n.companyId)),j=Xe(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(K=>Je(K)),x=S(K=>K.classListState.fetchState),i=!v&&o&&h,m=S(K=>lt(K,a,i,o)),[O,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,$=S(K=>T!=null?xa(K.userRoleState,T):void 0),G=$?.accountingClassIDs[0],V=S(K=>G!=null?Ba(K.classState,{classId:G,reportId:"class_list"}):void 0),P=R?.cardHolderUser?.userId,Z=S(K=>P!=null?xa(K.userRoleState,P):void 0),X=Z?.accountingClassIDs[0],w=S(K=>X!=null?Ba(K.classState,{classId:X,reportId:"class_list"}):void 0),U=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&U&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,U,te]),d.useEffect(()=>{O||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[O,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(U===!1||U&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const K=pe(n.tenantEmailDomain,a,r,R,l);e(K)}},[m.fetchState,l,U]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),x!=="Completed"&&x!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,x]);const ae=()=>{if(r!=null&&a!=null){t(La());const K=pe(n.tenantEmailDomain,a,r);e(K)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),J=Ea(o,h,p,E,b),Q=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:J,debitAccountInformation:Q,chargeCardDetailView:m,creditAccount:E,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:w?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,B]=ts(y);if(B==="")return;const F=n.channel(h),L=u=>{f.current(B,u)};let C;if(F?.subscribed===!0)C=F,C.bind(B,L),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(B,L)});else{if(C=F??n.subscribe(h),C.bind(B,L),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(B,L)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Wa="credit-account-balance-updated",qa="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",xs="charge-card-department-updated",Pn="charge-card-repayment-completed",wn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Bs=[_a,ka],Ls=he(function(e){const a=Qe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(On({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(B=>de(B)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Y.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(B=>Qe(B)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const B=Re(t.state?.pathnameStackToGoBack),F=B.poppedPathname??Os(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:B.newStack}})},[e,t,n.tenantEmailDomain]),y=Ge(n);if(At({events:ta(y,Bs),onEvent:B=>{switch(B){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Ka,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Os=e=>`/${e}/cards`,Us={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const L=S(w=>de(w));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(Le.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(w=>Un(w,n)),o=D.chargeCard,I=S(w=>w.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Y.isDebitCardFeatureEnabled),b=Ee(E,L),x=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),O=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:R}),$=!m&&T&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,$,T)))},[c,D.fetchState,g,I]);const G=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&(G===!1||G&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==F.userId)){const w=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);r(w,{state:{pathnameStackToGoBack:U}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const w=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(w,{state:{pathnameStackToGoBack:U}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),P=S(w=>Nt(w.userState,F.userId)),Z=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(w=>w.statusCode==="success")===!0&&v===!1&&(setTimeout(Z,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const X=w=>{B(w)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:X}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:P.phone,signedInUser:F,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:L,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{X(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Ht(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Nn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Ya.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Hn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Ns=Te.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: ${e=>`${Us.containerWidth.value(e.windowSize)}%`};
5
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
6
+ `,Hs=Te.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
+ `,Oa=gt.getLocalizedStrings().dateFormat,Ms={overlayWidth:new Aa(100,100,58)},vn=[Pn,Wa],$s=new Set(vn),Gs=he(function(e,a){const t=a.currentTenant?.companyId;return{plaidConnectionDetails:Yn(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Zn(e.depositAccountState,e.depositAccountListState)}},function(e,a){const{navigate:t,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:f,isCashbackInfoFetchStateCompleted:p,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:_,controllerEmails:c,paymentDetails:l,productInformation:v,cashbackInformation:y,paymentSourceInformation:h,creditAccountInformation:B,debitAccountInformation:F,paymentInitiatedDate:L,sourcePage:C}=a,{tenantEmailDomain:u}=r,D=()=>{e(Gt(!0));const o=Ge(r);o!=null&&o!==""&&e(fa(o,!0,!0)),e(Ne(!0))};return{onBackNavigation:()=>{if(p&&g&&_&&y!=null&&q.trackCardsPayEarlyFormClick(c,v,y,"Back",l.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:l.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:l.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:l.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:l.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:L?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:L?.format(Oa.visual.MMMDCommaYYYYformat)},h,B,F),C==="cardPaymentHistory")a.closeDrawerHandler(!0),e(zt());else{const o=ze(u);t(o)}},onUpdatePaymentAccountStatus:(o,I,A)=>{e(qn(o,I,"bill_pay","bill_pay_detail",A))},onEstablishConnectionSuccess:()=>{e(fa(r.companyId,!0))},onFetchLinkTokenClick:o=>{e(Wn("external_account",o))},onEstablishConnectionClick:o=>{e(Kn(o,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:()=>{f?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:o=>{$s.has(o)&&D()},onPusherSubscribed:D}})(Za(cs)),Pt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:t,creditAccountSpentAmount:r,productInformation:n,sourcePage:f,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isDebitCardInfoFetchStateCompleted:c,isCreditCardInfoFetchStateCompleted:l,isCashbackInfoFetchStateCompleted:v,paymentInitiatedDate:y,retryRepayment:h})=>{const B=me(),{useDynamicConfig:F}=oe(),{configValue:L}=F(Le.zeniAccountsConfig),C=$n(L),u=S(z=>Mt(z)),{creditAccount:D}=S(z=>Je(z)),o=S(z=>de(z)),I=ft(),A=Ia(),j=Ce(),E=ee.getSignedInUser(),b=$e(),[x,i]=d.useState(!1),[m,O]=d.useState(!1),{configValue:M}=F(Le.zeniCardsConfig),R=M.credit_card_auto_pay_threshold_by_company_id?.[o.companyId]??M.default_credit_card_auto_pay_threshold??_s,T=$t(b?.loggedInUserRoleMap),$=Gn(b?.loggedInUserRoleMap),G=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=S(z=>ya(z,o.companyId)),P=V.companyChargeCardInfo?.primaryFundingAccount,Z=V.allFundingAccounts.find(z=>z.id===P?.accountId),X=S(z=>qe(z,o.companyId)),w=Xe(X.controllers);d.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&j(Gt()),u.fetchState==="Completed"&&!m){const z=o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,J=u.transferFromAccounts.find(K=>K.id===z);let Q;if(f==="cardPaymentHistory"&&h){const K=h.paymentAccountId!=null?u.transferFromAccounts.find(re=>re.id===h.paymentAccountId):void 0;Q={amount:h.amount,isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Bt(),transferFrom:K??J}}else Q={amount:{amount:D.balance.amount+D.hold.amount,currencyCode:D.balance.currencyCode,currencySymbol:D.balance.currencySymbol},isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Bt(),transferFrom:J};j(Tt(Q)),O(!0)}},[u.fetchState,m,f,h,u.transferFromAccounts,o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,o.companyChargeCardInfo?.info?.isAutoPayEnabled,D.balance.amount,D.balance.currencyCode,D.balance.currencySymbol,D.hold.amount,j]);const U={isZeniCheckingEnabled:o.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Z?.accType==="depositAccount",creditCardPaymentSourceAccountName:Z?.label,creditCardPaymentSourceAccountType:Z?.accType,creditCardPaymentSourceLastFourDigits:Z?.accountLast4,creditCardPaymentSourceBalance:Z?.accountBalance?.available?.amount??0};if(d.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&j(fa(o.companyId,!0))},[V.fetchState]),d.useEffect(()=>{u.updateStatus==="Completed"&&_!=null&&v&&l&&c&&q.trackCardsPayEarlyPayNowClick(w,n,_,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:y?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:y?.format(Oa.visual.MMMDCommaYYYYformat)},U,p,g)},[u.updateStatus,_,v,l,c,y]),d.useEffect(()=>{u.fetchState==="Completed"&&_!=null&&v&&l&&c&&!x&&e&&m&&_!=null&&(q.trackCardsPayEarlyFormView(w,n,_,t,o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,D.balance.amount,U,p,g),i(!0))},[u,v,l,c,x,e,m]),E==null)throw Error("Can't access invite people page without signing in...");const te=()=>{a(!0),j(zt())},ae=Ge(o),k={events:e?ta(ae,vn):[],eventCallback:(z,J,Q)=>{Q.onEventReceived(z)},onSubscribed:z=>{z.onPusherSubscribed()}};return s.jsx(s.Fragment,{children:s.jsx(hn,{onClose:()=>{te()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Ms.overlayWidth.valuePercentage(A),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:I.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(zs,{onClick:z=>z.stopPropagation(),children:s.jsx(Gs,{...k,closeDrawerHandler:a,navigate:B,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{v&&l&&c&&_!=null&&q.trackCardsPayEarlyFormClick(w,n,_,"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},U,p,g),j(zn({companyId:o.companyId}))},onDismissClick:te,onSaveChangesToLocalStore:z=>{j(Tt(z))},currentTenant:o,hasZeniAccountsAdminAccess:T,isZeniAccountsUser:$,isZeniAccountSetupEnabled:G,productInformation:n,sourcePage:f,controllerEmails:w,autoPayThreshold:R,paymentSourceInformation:U,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:v,isCreditCardInfoFetchStateCompleted:l,isDebitCardInfoFetchStateCompleted:c,paymentInitiatedDate:y,maxInsuredAmount:C.maxInsuredAmount})})})})},zs=Te(ks)`
15
+ display: flex;
16
+ min-height: 100%;
17
+ flex-direction: column;
18
+ `,wt=e=>e!=null&&typeof e=="object"?e:null,ce=e=>typeof e=="string"?e:void 0,we=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Ua=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",tt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Ua(a.transaction_status)&&!!Ua(a.transaction_type)},vt=(e,a)=>{const t=e?.card_status;if(!Ua(t))return null;const r=e?.is_locked_by_admin;return{cardId:a,cardStatus:t,isLockedByAdmin:typeof r=="boolean"?r:void 0}},it=[An,En,kn,_n,Dn,aa,Et,Wa,kt,_t,Dt],Tn=[_a,ka],Ys=new Set([...it,...Tn]),nt=gt.getLocalizedStrings().dateFormat,Zs=he(function(e,a){const{includeCreditAccountInfo:t,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:f}=a,p=ee.getSignedInUser(),g=e.tenantState.currentTenantId,_={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:g??""},c=lt(e,r,t,f),l=sr(e,r),v=cr(e);return{chargeCardDetailView:c,chargeCardsRecurringExpensesState:l,vgsVaultId:Ya.cardVaultId,transactionAttachmentsEndpointToFetch:`${ot}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${ot}/card_transaction_attachment`,authParams:_,isSnackbarOpen:v.isSnackbarOpen,cardsEndPoint:`${mn.cardMicroServiceBaseUrl}`,signedInUserToken:c.twoFAView.token??n}},function(e,a){const{cardId:t,currentTenant:r,navigate:n,location:f,cardProviderId:p,includeCreditAccountInfo:g,setIsPaymentOpen:_,controllerEmails:c,productInformation:l,cashbackInformation:v,primaryFundingAccountDetails:y,creditAccountInformation:h,debitAccountInformation:B,isChargeCardFeatureEnabled:F}=a,{tenantEmailDomain:L}=r;return{onEventReceived:(C,u)=>{(({event:D,data:o,cardId:I,dispatch:A,subscribedEvents:j})=>{const E=wt(o);switch(D){case _a:case ka:return void A(ha(!0));case An:{const b=ce(E?.card_id);if(b==null||b!==I)return;const x=ce(E?.transaction_id),i=E?.transaction_status;return x!=null&&Ua(i)?void A(nr({transactionId:x,transactionStatus:i})):void A(Ze(I,null,null,!0))}case aa:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=vt(E,b);return x!=null?void A(mt(x)):void A(na(I,!0))}case Et:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=ce(E?.currency_code),i=ce(E?.currency_symbol),m=we(E?.balance);return x!=null&&i!=null&&m!=null?(A(tr({cardId:b,currencyCode:x,currencySymbol:i,balance:m,hold:we(E?.hold),dailyPurchaseSpends:we(E?.daily_purchase_spends),monthlyPurchaseSpends:we(E?.monthly_purchase_spends),dailyWithdrawals:we(E?.daily_withdrawals),monthlyWithdrawals:we(E?.monthly_withdrawals)})),void A(Ne(!0))):(A(na(I,!0)),void A(Ne(!0)))}case Wa:{const b=ce(E?.currency_code),x=ce(E?.currency_symbol),i=we(E?.available_amount),m=we(E?.balance_amount);return b!=null&&x!=null&&i!=null&&m!=null?void A(ar({currencyCode:b,currencySymbol:x,available:i,balance:m,hold:we(E?.hold_amount),cashback:we(E?.cashback_amount)})):void A(Ne(!0))}case En:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(er({cardId:b,transaction:x})):void A(Ze(I,null,null,!0))}case kn:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(Qn({cardId:b,declineReason:ce(E?.decline_reason),transaction:x})):void A(Ze(I,null,null,!0))}case _n:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(Jn({cardId:b,transaction:x})):void A(Ze(I,null,null,!0))}case Dn:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=ce(E?.transaction_id),i=E?.attachment_file_paths;return x!=null&&Array.isArray(i)&&i.every(m=>typeof m=="string")?void A(Xn({cardId:b,transactionId:x,attachmentFilePaths:i})):void A(Ze(I,null,null,!0))}case kt:case _t:case Dt:{const b=ce(E?.card_id);if(b==null||b!==I)return;A(na(I,!0))}}})({event:C,data:u,cardId:t,dispatch:e,subscribedEvents:Ys})},onPusherSubscribed:()=>{e(na(t,!0)),e(Ze(t,null,null,!0)),e(Ne(!0))},onReloadTransactions:()=>{e(ca(t,g,F))},onFetchChargeCardTransactionList:(C,u)=>{e(Ze(t,C,u))},onUpdateScrollYOffset:C=>{},onGetOtp:C=>{p!=null&&e($a(C,"ChargeCardHolder",t))},onResendOtp:C=>{p!=null&&e(Ma(C,"ChargeCardHolder",t))},onVerifyOtp:(C,u)=>{p!=null&&e(Ha(C,u,"ChargeCardHolder",t))},onVerifyOtpSuccess:C=>{C!=null&&ee.saveZeniOtpTokenForCardHolder(C,t)},onColorCodeChange:C=>{e(mr(t,C))},onLockChargeCard:(C,u)=>{e(en(C,t,u))},onUnlockChargeCard:C=>{e(Qt(C,t))},onCloseChargeCard:C=>{e(Jt(t,C))},onFetchChargeCardsRecurringExpenses:()=>{e(Xt([t]))},updateChargeCardName:(C,u)=>{e(qt(C,t,u))},updateChargeCardTransactionAttachments:(C,u)=>{u!=null&&e(ur({transactionId:C,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(C,u,D,o)=>{e(lr({chargeCardId:u,transactionId:C,fetchState:D,error:o}))},updateChargeCardTransactionReceiptsShowTick:(C,u,D)=>{e(dr({chargeCardId:u,transactionId:C,shouldShowTick:D}))},onChargeCardRevokeInviteClick:()=>{e(Wt(t))},updateChargeCardTransactionIsViewReceiptClicked:(C,u,D)=>{e(ir({chargeCardId:u,transactionId:C,isViewReceiptClicked:D}))},onChargeCardTransactionRowClick:(C,u)=>{const D=ye(f.state?.pathnameStackToGoBack,f.pathname);n(`../../transaction/${C}/${u}`,{state:{pathnameStackToGoBack:D}})},onBackClick:()=>{const C=Re(f.state?.pathnameStackToGoBack),u=ze(L);n(u,{state:{pathnameStackToGoBack:C.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(or())},onUpdateDebitCardPinAttempt:C=>{e(Kt(t,C)),C==="success"&&e(pa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(C,u)=>{C?e(pa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(pa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(C,u,D,o){e(Zt(C,u,D.code,o))},shouldOpenCreditCardPaymentDrawer(C){C&&v!=null&&q.trackCardsPayEarlyClick(c,l,v,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:y?.accType==="depositAccount",creditCardPaymentSourceAccountName:y?.label,creditCardPaymentSourceAccountType:y?.accType,creditCardPaymentSourceLastFourDigits:y?.accountLast4,creditCardPaymentSourceBalance:y?.accountBalance?.available?.amount??0},h,B),_(C)}}})(Za(is));function Ks(){const e=me(),a=Ce(),t=Se(),{cardId:r}=ba(),[n,f]=d.useState(!1),[p,g]=d.useState(!1),{useDynamicConfig:_}=oe(),c=ee.getSignedInUser(),l=S(H=>de(H)),v=S(H=>ja(H).firstViewAfterActivation),y=S(H=>H.classListState.fetchState),{configValue:h}=_(Le.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:B}=_(Le.zeniCardsConfig),F=B.enable_card_controls_for_company_ids,L=B.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(l.companyId),[C,u]=d.useState(!1),[D,o]=d.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:A}=I(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=I(Y.isDebitCardFeatureEnabled),E=Ee(j,l),b=ke({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:E}),{isFeatureEnabled:x}=I(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=I(Y.isCardsCommentingEnabled),m=Ae(l),O=Ie(l),M=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:A,isBookKeepingTenant:m,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:M}),T=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,G=!l.userRole.includes("charge_card_user")&&R&&$;if(r==null)throw Error("Empty card id is not valid...");const V=S(H=>ya(H,l.companyId)),{creditAccount:P,creditAccountRepayment:Z}=S(H=>Je(H)),X=ee.getZeniOtpTokenForCardHolder(r),w=S(H=>lt(H,r,G,R)),{isAiCfoAccessEnabled:U,onAskAiCfoClick:te}=In({mobileExploreReferrer:"Card Detail"});un({isDataReady:w.fetchState==="Completed"});const ae=S(H=>Qe(H)),k=w.chargeCard,z=$e(),J=He(z?.loggedInUserRoleMap),Q=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_virtual_debit_card",K=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_physical_credit_card",re=k?.type.code==="business_virtual_debit_card"||k?.type.code==="business_virtual_credit_card",De=k?.type.code==="business_virtual_debit_card",Oe=Ea(R,$,J,P,Z),W=fn(Q,w),fe=St(J,ae),Pe=Me(R,b,T,$),Ue=w.depositAccountLimitFetchState.fetchState!=="Completed"&&w.depositAccountLimitFetchState.fetchState!=="In-Progress",Fe=S(H=>qe(H,l.companyId)),xe=Xe(Fe.controllers),ne=S(H=>k?.cardCreatedByUser?.userId!=null?xa(H.userRoleState,k?.cardCreatedByUser?.userId):void 0),Da=S(H=>ne?.accountingClassIDs[0]!=null?Ba(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=S(H=>k?.cardHolderUser?.userId!=null?xa(H.userRoleState,k?.cardHolderUser?.userId):void 0),oa=S(H=>ie?.accountingClassIDs[0]!=null?Ba(H.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),le=l?.userRole,je=S(H=>ea(H,!1,b,A).revokeCardInvite),ia=bt(je.saveStatus.fetchState);if(d.useEffect(()=>{if(ia==="In-Progress"&&je.saveStatus.fetchState==="Completed"){const H=ze(l.tenantEmailDomain);e(H)}},[ia,je.saveStatus.fetchState,e,l.tenantEmailDomain]),d.useEffect(()=>{v&&n===!1&&re&&(f(!0),setTimeout(()=>{a(La()),De&&a(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[v,n,re,De]),d.useEffect(()=>{C||w.fetchState==="Completed"||w.fetchState==="In-Progress"||r==null||(u(!0),a(ca(r,G,R,!1)))},[C,w,r,a]),d.useEffect(()=>{!D&&w.fetchState==="Completed"&&w.chargeCard?.connectedAccountId!=null&&Q&&Ue&&J&&(o(!0),a(Yt({depositAccountId:w.chargeCard?.connectedAccountId})))},[D,w,a,Ue,J]),d.useEffect(()=>{ae.fetchState!=="Completed"&&ae.fetchState!=="In-Progress"&&J&&a(ha()),y!=="Completed"&&y!=="In-Progress"&&a(Vt()),w.transactionStatistics.fetchState!=="Completed"&&w.transactionStatistics.fetchState!=="In-Progress"&&a(rr({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&a(fa(l.companyId,!0))},[ae.fetchState,a,J,y,w.transactionStatistics.fetchState,V.fetchState]),d.useEffect(()=>{if(!(w.fetchState!=="Completed"||R&&P.fetchState!=="Completed"||k==null||w.transactionStatistics.fetchState!=="Completed"||Q&&J&&w.depositAccountLimitFetchState.fetchState!=="Completed")){const H=k.type.code.includes("physical"),ue=H?k.cardActivationAttemptHistory[0]?.timestamp:k.createTime;q.trackCardsCardDetailView(xe,Pe,{cardId:r,cardName:k.cardName,cardType:k.type.code.includes("credit")?"credit":"debit",cardCategory:H?"physical":"virtual",cardLimit:ra(k.limit.amount),cardLastFourDigits:k.accountLast4,cardStatus:k.status.code,cardAssignedDate:k.createTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:k.providerCardCreateTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ue?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:k.creditLimitFrequency.name,cardSpentAmount:ra(k.balance.amount),cardAvailableLimit:ra(k.available.amount),cardUtilizationPercent:k.limit.amount>0?Math.round((k.limit.amount-k.available.amount)/k.limit.amount*100):0,cardUtilizationAmount:ra(k.limit.amount-k.available.amount),totalNumberOfDeclinedTransactions:w.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:w.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:w.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:w.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:w.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:w.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:ct(k.cardCreatedByUser,!1),cardIssuedByEmail:k.cardCreatedByUser?.email,cardIssuedByUserId:k.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Da?.className},{cardholderName:ct(k.cardHolderUser,!1),cardholderEmail:k.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:k.cardHolderUser?.userId,cardholderDepartment:oa?.className},Oe,W)}},[w.fetchState,w.depositAccountLimitFetchState.fetchState,w.transactionStatistics.fetchState,P.fetchState,J]),c==null)throw Error("Can't access card detail page without signing in...");const da=Ge(l),la=J?[...it,...Tn]:it,ua={events:ta(da,la),eventCallback:(H,ue,Be)=>{Be.onEventReceived(H,ue)},onSubscribed:H=>{H.onPusherSubscribed()}},ma=()=>{if(r!=null&&k!=null){const{ownerName:H,cardName:ue,utilisation:Be,limit:Ye,frequency:N,cardColor:ge}=rt(k),be=k.cardHolderUserId===c.userId;q.trackCardsDetailPageViewed(r,H,ue,Be,Ye,N,ge,be)}};d.useEffect(()=>{if(w.fetchState==="Completed"){const H=w.chargeCard;if(H?.status.code==="inactive"||Q&&H?.isPinSet===!1||K&&v){const ue=pe(l.tenantEmailDomain,r,c,k,v);e(ue)}}},[w.fetchState]);const Ca=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:Be,cardName:Ye,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;q.trackCardsDetailPageClicked(r,Be,Ye,N,ge,be,H,et,ue)}},Xa=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:Be,cardName:Ye,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;q.trackCardsVerifyPopUpClick(r,Be,Ye,N,ge,be,H,et,ue)}},Pa=P.balance.amount+P.hold.amount,wa=l.companyChargeCardInfo?.info?.primaryFundingAccount,Ja=V.allFundingAccounts.find(H=>H.id===wa?.accountId),va=w.chargeCard!=null,Qa=w.depositAccountLimit!=null;return w.fetchState!=="Error"||va?!va&&(w.fetchState==="In-Progress"||w.fetchState==="Not-Started")||je.saveStatus.fetchState==="In-Progress"||!Qa&&Q&&J&&w.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(os,{}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:v}),w.fetchState==="Completed"?s.jsx(yt,{analytics:q,onLoad:ma}):null,p===!0?s.jsx(Pt,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:p,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:Pe,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,creditAccountSpentAmount:Pa,isDebitCardInfoFetchStateCompleted:!Q||!J||w.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!R||P.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!J||ae.fetchState==="Completed",paymentInitiatedDate:Z.initiatedRepaymentDate}):null,s.jsx(Zs,{...ua,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:Xa,onFireOnClickAnalytics:Ca,isSandboxEnv:ht(),signedInUser:c,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ne?.userRoles,cardIssuedByDepartmentName:Da?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:oa?.className,loggedInUserRole:le,isChargeCardFeatureEnabled:R,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:$,isCardControlsEnabled:L,isEarlyPayEnabled:x,controllerEmails:xe,chargeCardCashbackDetailState:ae,productInformation:Pe,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,classListFetchState:y,primaryFundingAccountDetails:Ja,currentTenant:l,cardProviderId:w.chargeCard?.cardProviderID,cardId:r,creditAccount:P,creditAccountRepayment:Z,includeCreditAccountInfo:G,signedInUserToken:X,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:U,onAskAiCfoClick:te,isCardsCommentingEnabled:i})]}):s.jsx(Ka,{})}const rt=e=>{const a=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,t=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,f=e.creditLimitFrequency.name;return{ownerName:a,cardName:t,utilisation:r,cardColor:e.cardColorCode??"",frequency:f,limit:n}},Fn=[aa,Wa,wn,ka,_a,qa,Dt,xs,kt,_t,Et],Ws=new Set(Fn),dt=vs((e,a,t,r)=>{e(ga(a,t,r,!0))},400),qs=Te.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
+ `,Xs=he(function(e,a){const t=ea(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:Cr(e),bulkActionView:pr(e),companyLegalName:a.currentTenant.companyName,admins:a.admins,searchText:t.searchText,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigateAndClearBulkSelection:t,currentTenant:r,location:n,signedInUser:f,chargeCardListState:p,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:c,isChargeCardSetupEnabled:l,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:y,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:B,controllerEmails:F,depositAccountListWithDebitCardIssued:L,primaryFundingAccountDetails:C,chargeCardSetUpViewFetchState:u,productInformation:D,cashbackInformation:o,creditAccountInformation:I,debitAccountInformation:A,updatePayNowInfoTooltip:j,isUserHasCardsAdminLevelAccess:E}=a,{tenantEmailDomain:b}=r,{cards:x}=p;return{onChargeCardRowClick:(i,m)=>{const O=bn(x,i);let M;O!=null&&((T=>{const $=T.limit.amount-T.available.amount,G=`${T.cardHolderUser?.firstName.toLowerCase()} ${T.cardHolderUser?.lastName.toLowerCase()}`,V=T.cardName,P=T.department?.className??"",Z=T.limit.amount,X=T.creditLimitFrequency.name;q.trackCardsListRowClicked(G,V,P,$,Z,X,f.userId===T.cardHolderUserId)})(O),Ke(v,y,L)&&q.trackCardsCardListRowClick(F,D,"Card Row Item","row_clicked",m+1,{cardOwner:ct(O.cardHolderUser,!1),cardName:O.cardName,cardType:O.type.code.includes("credit")?"credit":"debit",cardStatus:O.status.code,cardUtilizationAmount:ra(O.limit.amount-O.available.amount),cardUtilizationPercent:O.limit.amount>0?Math.round((O.limit.amount-O.available.amount)/O.limit.amount*100):0,cardLimit:ra(O.limit.amount)},o,I,A)),M=O?.status.code==="request_on_hold"&&f.userId===O.cardHolderUserId?yn(b):pe(b,i,f,O);const R=ye(n.state?.pathnameStackToGoBack,n.pathname);t(M,{state:{pathnameStackToGoBack:R}})},onFetchChargeCardsRecurringExpenses:i=>{e(Xt(i))},onFetchDepositAccountLimit:i=>{e(Yt({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Ar(i))},onChargeCardRevokeInviteClick:i=>{e(Wt(i))},onLockChargeCardList:(i,m)=>{e(Ir(i,m))},onUnlockChargeCardList:i=>{e(Sr(i))},onCloseChargeCardList:(i,m)=>{e(yr(i,m))},onRevokeChargeCardList:i=>{e(br(i))},updateChargeCardListSpendLimit(i,m,O){e(gr(i,m,O.code))},onLockChargeCard:(i,m)=>{e(en(E,i,m))},onUnlockChargeCard:i=>{e(Qt(E,i))},onCloseChargeCard:(i,m)=>{e(Jt(i,m))},onUpdateSpendLimit(i,m,O,M){e(Zt(i,m,O.code,M))},updateChargeCardName:(i,m)=>{e(qt(E,i,m))},onClickSetupIcon:()=>{q.trackCardsListPageClicked("settings"),Ke(v,y,L)&&o!=null&&q.trackCardsSettingsClick(F,D,o,I,A);const i=Ps(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onIssueCardClick:()=>{q.trackCardsListPageClicked("new card"),Ke(v,y,L)&&o!=null&&q.trackCardsNewCardClick(F,D,o,"New Button","card_creation_initiated","Card List",I,A);const i=Js(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onColumnSortConfigChanged:(i,m)=>{Ke(v,y,L)&&o!=null&&q.trackCardsCardListSortClick(F,D,o,"Sort Icon","sort",i,m==="ascending"?"ASC":"DESC","Cards List",I,A),e(st({uiState:{sortKey:i,sortOrder:m}}))},onSearchTextChanged:i=>{e(fr(i))},onReloadCards:()=>{e(ga(g,v&&y,_&&l,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{Ke(v,y,L)&&o!=null&&q.trackCardsCashbackOverviewClick(F,D,o,"Cashback Overview","cashback_details_viewed",I,A),t("./cashback")},onClickStatementsIcon:()=>{Ke(v,y,L)&&o!=null&&q.trackCardsStatementsClick(F,D,o,I,A),t("./statements")},onCreateNowClick:i=>{Ke(v,y,L)&&o!=null&&q.trackCardsNewCardClick(F,D,o,"Promo Banner","card_creation_initiated","Card List",I,A),t(`./new?cardType=${i}`)},onPromoCardClick:i=>{t(i==="debit"&&v&&!h||i==="credit"&&c&&!B?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,m)=>{u==="Completed"&&r.company!=null&&o!=null&&q.trackCardsPayEarlyClick(F,D,o,"Card List",i,m,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:C?.accType==="depositAccount",creditCardPaymentSourceAccountName:C?.label,creditCardPaymentSourceAccountType:C?.accType,creditCardPaymentSourceLastFourDigits:C?.accountLast4,creditCardPaymentSourceBalance:C?.accountBalance?.available?.amount??0},I,A);const O=Qs(b);t(O)},navigateToCreditCardPaymentHistoryPage:()=>{const i=ec(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:i=>{e(hr(i))},onSetBulkActionCardIds:i=>{e(an(i))},onEventReceived:i=>{Ws.has(i)&&dt(e,g,v&&y,_&&l)},onPusherSubscribed:()=>{dt(e,g,v&&y,_&&l)}}})(Za(ds));function Lt({isPaymentDrawerOpen:e}){const a=me(),t=Ce(),r=Se(),n=d.useCallback((N,ge)=>{t(an([])),a(N,ge)},[t,a]),[f,p]=d.useState(!1),[g,_]=d.useState(ee.getPayNowInfoTooltip()??!1),c=N=>{ee.savePayNowInfoTooltip(N),_(N)},[l,v]=d.useState(!1),y=ee.getSignedInUser(),h=S(N=>de(N)),[B,F]=d.useState(!1),[L,C]=d.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:D}=In({mobileExploreReferrer:"Cards"}),o=h.userRole.includes("charge_card_user"),I=!o,A=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:j,useDynamicConfig:E}=oe(),{isFeatureEnabled:b}=j(Y.isCashbackFeatureEnabled),{isFeatureEnabled:x}=j(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=j(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=j(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:O}=j(Y.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:M}=j(Y.isCardsCommentingEnabled),R=Ee(i,h),T=ke({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:R}),$=Ie(h),G=Ae(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,P=_e({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:V}),Z=gn({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G}),{configValue:X}=E(Le.zeniCardsConfig),w=$e(),U=He(w?.loggedInUserRoleMap),te=S(N=>qe(N,h.companyId)),ae=Xe(te.controllers),k=X.charge_card_cashback_rate_per_transaction!=null?X.charge_card_cashback_rate_per_transaction:.0175,z=X.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??X.default_credit_card_pay_now_threshold??Ds,J=X.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(X.enable_card_controls_for_company_ids)&&X.enable_card_controls_for_company_ids.includes(h.companyId),Q=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,K=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,De=S(N=>Mt(N)),Oe=bt(De.updateStatus),W=S(N=>ea(N,I,T&&A,P&&re)),fe=W.cards.filter(N=>N.type.code.includes("debit")).map(N=>N.connectedAccountId),Pe=[...new Set(fe)],Ue=S(N=>Qe(N)),Fe=S(N=>Ga(N,Pe)),xe=S(N=>ya(N,h.companyId)),ne=xe.companyChargeCardInfo?.primaryFundingAccount,Da=xe.allFundingAccounts.find(N=>N.id===ne?.accountId),ie=W.fetchState,oa=W.creditAccount;un({isDataReady:ie==="Completed"});const{creditAccountRepayment:le}=S(N=>Je(N)),je=S(N=>ja(N).firstViewAfterActivation),{areTenantIdsInSync:ia}=Cn(),da=St(U,Ue),la=Ea(P,re,U,oa,le),ua=It(T,A,U,Fe,W.debitCardSummary),ma=Me(P,T,A,re),Ca=W.creditAccount.balance.amount+W.creditAccount.hold.amount;if(d.useEffect(()=>{ie==="Completed"&&(ee.getPayNowInfoTooltip()==null||Ca<z*W.creditAccount.limit.amount/100)&&c(!0)},[ie,z,Ca,W.creditAccount.limit.amount]),d.useEffect(()=>{if(e!=null&&e===!0&&le.initiatedRepayments.amount===0&&le.fetchState==="Completed"||Oe==="In-Progress"&&De.updateStatus==="Completed")c(!1),p(!0);else if(le.initiatedRepayments.amount>0&&le.fetchState==="Completed"){p(!1),document.body.style.overflow="auto";const N=ze(h.tenantEmailDomain);n(N)}},[e,le.initiatedRepayments.amount,le.fetchState,Oe,De.updateStatus,n,h.tenantEmailDomain]),d.useEffect(()=>{!B&&(re||A)&&ia&&(F(!0),t(ga(I,T&&A,P&&re,!1)))},[B,I,t,ia]),d.useEffect(()=>{je&&l===!1&&(v(!0),setTimeout(()=>{t(La())},5e3))},[je,l]),d.useEffect(()=>()=>{dt.flush()},[]),d.useEffect(()=>{ie==="Completed"&&o&&W.cards.length===1&&(W.cards[0].status.code==="inactive"&&W.cards[0].type.code==="business_physical_credit_card"?n(`./${W.cards[0].id}/activate`):W.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${W.cards[0].id}`)))},[ie,o,r.state,n,W.cards]),d.useEffect(()=>{if(ie==="Completed"&&o){const N=W.cards.length,ge=W.cards.filter(be=>be.cardHolderUserId===y?.userId).filter(be=>be.status.code==="request_on_hold");ge.length>0&&N===ge.length&&n("./onboard")}},[ie,W.cards,o,n,y?.userId]),d.useEffect(()=>{ie!=="Completed"||P&&le.fetchState!=="Completed"||T&&A&&U&&Fe.fetchState!=="Completed"||q.trackCardsCardListView(ae,ma,da,la,ua)},[ie,oa,le.fetchState,Fe.fetchState,U]),y==null)throw Error("Can't access charge card list page without signing in...");const Xa=S(N=>tn(N.userState,N.userRoleState,N.userListViewState,"cardAdmin")),Pa=Ct(w?.loggedInUserRoleMap),wa=N=>{C(N)},Ja=W.creditAccount.limit,va=()=>{p(!1),n("..")},Qa=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:P,isTOSAccepted:Q,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:Pa}),H=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:T,isTOSAccepted:K,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:Pa}),ue=Qa||H,Be=Ge(h),Ye={events:ta(Be,Fn),eventCallback:(N,ge,be)=>{be.onEventReceived(N)},onSubscribed:N=>{N.onPusherSubscribed()}};return re||A?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:q,onLoad:()=>{q.trackPageLoaded(pn.Event.cardsListPage),(P&&!re||T&&!A)&&q.trackCardsPromoView(ae,{isCreditCardOffered:P,isDebitCardOffered:T,isDebitCardEnabled:A,isCreditCardEnabled:re},"Banner",T&&!A?"Debit Card":P&&!re?"Credit Card":"","Card List")}}),s.jsx(za,{showConfetti:je})]}):null,f===!0?s.jsx(Pt,{closeDrawerHandler:va,isPaymentDrawerOpen:f,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ca,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isDebitCardInfoFetchStateCompleted:!(T&&A&&U)||Fe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!P||le.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!U||Ue.fetchState==="Completed",paymentInitiatedDate:le.initiatedRepaymentDate}):null,s.jsxs(qs,{children:[s.jsx(We,{isAppContentDrawerOpen:L,handleDrawerToggle:wa}),s.jsx(Xs,{...Ye,isCashbackFeatureEnabled:b,isChargeCardFeatureEnabled:P,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:Z,updatePayNowInfoTooltip:c,showPayNowInfoTooltip:g,creditCardPayNowThreshold:z,signedInUser:y,chargeCardListState:W,location:r,admins:Xa.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:J,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:U,includeCreditAccountDebitSummaryAndCashbackInfo:I,onClickMenuIcon:()=>{wa(!0)},creditLimit:Ja,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:A,isEarlyPayEnabled:m,isChargeCardPaymentHistoryFeatureEnabled:O,cashbackRate:k,controllerEmails:ae,chargeCardCashbackDetailState:Ue,depositAccountListWithDebitCardIssued:Fe,isChargeCardTOSAccepted:Q,isDebitCardTOSAccepted:K,primaryFundingAccountDetails:Da,chargeCardSetUpViewFetchState:xe.fetchState,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isAiCfoAccessEnabled:u,onAskAiCfoClick:D,isCardsCommentingEnabled:M})]})]}):(Q||K)&&U===!0?s.jsx(Fa,{to:"../setup"}):ue?s.jsx(Fa,{to:"../promo"}):s.jsx(Sa,{fetchState:ie})}const Js=e=>`/${e}/cards/new`,Qs=e=>`/${e}/cards/payment`,ec=e=>`/${e}/cards/payment-history`,xn=[Pn,wn],ac=new Set(xn),tc=he(function(e){const a=ee.getSignedInUser(),t=de(e),r=e.tenantState.currentTenantId,n=nn(e),f={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},p=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Er(t),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:f,companyName:p,spendManagementEndPoint:`${ot}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,a){const{location:t,navigate:r}=a;return{onBackClick:()=>{const n=Re(t.state?.pathnameStackToGoBack),f=n.poppedPathname??"..";r(f,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,f)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:f}}})},onFiltersChange:n=>{e(_r({filters:n}))},onReloadPayments:()=>{e(Ta(!0))},onEventReceived:n=>{ac.has(n)&&e(Ta(!0))},onPusherSubscribed:()=>{e(Ta(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(kr({uiState:{downloadState:n}}))}}})(Za(ls));function nc(){const e=me(),a=Se(),t=Ce(),{areTenantIdsInSync:r}=Cn(),{useFeatureGate:n}=oe();if(ee.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const f=S(k=>de(k)),p=S(k=>nn(k)),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(null),F=!f.userRole.includes("charge_card_user"),L=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:C}=n(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Y.isDebitCardFeatureEnabled),D=Ee(u,f),o=ke({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:D}),I=Ie(f),A=Ae(f),j=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=_e({isCardsOnlyTenant:I,isChargeCardFeatureEnabled:C,isBookKeepingTenant:A,isDebitCardProductVisible:o,chargeCardsCreditAccountLimit:j}),b=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,x=$e(),i=He(x?.loggedInUserRoleMap),m=S(k=>ea(k,F,o&&L,E&&b)),O=d.useMemo(()=>{const k=m.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(k.map(z=>z.connectedAccountId))]},[m.cards]),M=S(k=>Qe(k)),R=S(k=>Ga(k,O)),{creditAccountRepayment:T}=S(k=>Je(k)),$=d.useMemo(()=>St(i,M),[i,M]),G=d.useMemo(()=>Ea(E,b,i,m.creditAccount,T),[E,b,i,m.creditAccount,T]),V=d.useMemo(()=>It(o,L,i,R,m.debitCardSummary),[o,L,i,R,m.debitCardSummary]),P=d.useMemo(()=>Me(E,o,L,b),[E,o,L,b]),Z=m.creditAccount.balance.amount+m.creditAccount.hold.amount,X=d.useMemo(()=>h!=null?p.repaymentHistory.find(k=>k.cardRepaymentId===h):void 0,[h,p.repaymentHistory]),w=d.useCallback(k=>{B(k),t(ga(F,o&&L,E&&b,!1)),y(!0)},[t,F,o,L,E,b]),U=d.useCallback(()=>{y(!1),B(null),document.body.style.overflow="auto"},[]);d.useEffect(()=>{g||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(_(!0),t(Ta()))},[g,t,p.fetchState]),d.useEffect(()=>{!c&&(b||L)&&r&&(l(!0),t(ga(F,!1,E&&b,!1)))},[c,b,L,r,t,F,E]);const te=Ge(f),ae={events:ta(te,xn),eventCallback:(k,z,J)=>{J.onEventReceived(k)},onSubscribed:k=>{k.onPusherSubscribed()}};return s.jsxs(s.Fragment,{children:[v?s.jsx(Pt,{closeDrawerHandler:U,isPaymentDrawerOpen:v,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Z,productInformation:P,creditAccountInformation:G,debitAccountInformation:V,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(o&&L&&i)||R.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||T.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||M.fetchState==="Completed",paymentInitiatedDate:T.initiatedRepaymentDate,retryRepayment:X}):null,s.jsx(tc,{...ae,location:a,navigate:e,accountInfoByAccountId:p.accountInfoByAccountId,onRetryPaymentClick:w})]})}const Rt=Te.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
+ `,Ot=gt.getLocalizedStrings().months;function rc(){const e=me(),a=Ce(),t=Se(),{creditAccount:r,creditAccountRepayment:n}=S(P=>Je(P)),f=`${mn.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[p,g]=d.useState(!1),[_,c]=d.useState(!1),l=S(P=>Dr(P)),{useFeatureGate:v}=oe(),y=S(P=>de(P)),{isFeatureEnabled:h}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=v(Y.isCardsCommentingEnabled),L=Sn(F?y.companyId:void 0,{clearParams:F&&l.fetchState==="Completed"}),C=Ee(B,y),u=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),D=Ie(y),o=Ae(y),I=y.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=_e({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:h,isBookKeepingTenant:o,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:I}),j=!!y.companyDebitCardInfo?.info?.isDebitCardEnabled,E=!!y.companyChargeCardInfo?.info?.isChargeCardEnabled,b=S(P=>qe(P,y.companyId)),x=Xe(b.controllers),i=S(P=>rn(P)),m=i.cards.filter(P=>P.type.code.includes("debit")).map(P=>P.connectedAccountId),O=[...new Set(m)],M=S(P=>Ga(P,O)),R=S(P=>Pr(P));d.useEffect(()=>{_||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),a(Ne()))},[p,a,r.fetchState]),d.useEffect(()=>{_||r.fetchState!=="Completed"||r.id==null||l.fetchState==="Completed"||l.fetchState==="In-Progress"||(c(!0),a(wr(r.id)))},[_,a,r.fetchState,r.id,l.fetchState]),d.useEffect(()=>{M.fetchState!=="Completed"&&M.fetchState!=="In-Progress"&&u&&j&&a(sn()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(ve()),R.fetchState!=="Completed"&&R.fetchState!=="In-Progress"&&u&&j&&a(vr()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&A&&E&&a(ut())},[M.fetchState,u,j,i.fetchState,R.fetchState,n.fetchState,A,E]),d.useEffect(()=>{if(l.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&i.fetchState==="Completed"&&(!u||!j||M.fetchState==="Completed"&&R.fetchState==="Completed")){let P="",Z="";if(l.statements.length>0){const te=l.statements[l.statements.length-1].period,[ae,k]=te.split("-"),z=l.statements[0].period,[J,Q]=z.split("-");P=`${Ot[parseInt(k)-1]} ${ae}`,Z=`${Ot[parseInt(Q)-1]} ${J}`}const X=Me(A,u,j,E),w=Ea(A,E,!0,r,n),U=It(u,j,!0,M,R);q.trackCardsCreditCardStatementsView(x,X,{numberOfStatements:l.statements.length,oldestStatementMonthYear:P,latestStatementMonthYear:Z},w,U)}},[l.fetchState,r.fetchState,n.fetchState,M.fetchState,i.fetchState,R.fetchState]);const T=()=>{const P=Re(t.state?.pathnameStackToGoBack),Z=P.poppedPathname??"..";e(Z,{state:{pathnameStackToGoBack:P.newStack}})},$=S(P=>Qe(P)),G=ee.getSignedInUser(),V={userId:G?.userId??"",sessionId:G?.zeniSessionId??"",tenantId:y.tenantId??""};if(G==null)throw Error("Can't access address page without signing in...");if(l.fetchState!=="Completed")return s.jsx(Rt,{children:s.jsx(us,{onBackClick:T})});{const P=Me(A,u,j,E);return s.jsx(Rt,{children:s.jsx(ms,{currentTenantCompanyName:y.companyName,statementListView:l,productInformation:P,onBackClick:T,authParams:V,controllerEmails:x,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:F,initialOpenThreadRequest:L,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:M,debitCardSummary:R,downloadEndPoint:f})})}}const Bn=[aa,qa],sc=new Set(Bn),cc={containerWidth:new Aa(100,58)},oc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),n=Se(),{useDynamicConfig:f}=oe(),[p,g]=d.useState(!1),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),B=d.useRef(!1),F=d.useRef(null);d.useEffect(()=>()=>{F.current!=null&&(clearTimeout(F.current),F.current=null)},[]);const[L,C]=d.useState(!1),[u,D]=d.useState(!1),o=ee.getSignedInUser();if(o==null)throw Error("Can't access onboarding card page without signing in...");const I=S(U=>de(U)),{configValue:A}=f(Le.zeniCardsConfig),j=S(U=>Tr(U)),{tenantEmailDomain:E}=I,b=S(U=>U.settingsViewState.profile.fetchState),x=S(U=>U.chargeCardListState.fetchState),i=S(U=>U.settingsViewState.profile.userId),m=S(U=>U.chargeCardConfigState.fetchState);d.useEffect(()=>{p===!1&&b!=="In-Progress"&&b!=="Completed"&&(t(Fr()),g(!0)),_===!1&&m!=="In-Progress"&&m!=="Completed"&&(t(Va()),c(!0)),l===!1&&x==="Not-Started"&&(v(!0),t(ve()))},[p,l,x,_,m]),d.useEffect(()=>{b==="Completed"&&L===!1&&i!=null&&x==="Completed"&&j.cards.length>0&&(t(xr({userId:i})),t(cn({cardId:j.cards[j.cards.length-1].id})),C(!0))},[b,L,i,x]),d.useEffect(()=>{if(!y&&j.fetchState==="Completed"&&j.cards.length===0){const U=Re(n.state?.pathnameStackToGoBack),te=U.poppedPathname??ze(E);r(te,{state:{pathnameStackToGoBack:U.newStack}})}},[j.fetchState,j.cards,y]);const O=S(U=>ja(U)),M=bt(O.updateStatus.fetchState),R=O.currentDisplayedCardId,{useFeatureGate:T}=oe(),{isFeatureEnabled:$}=T(Y.isChargeCardFeatureEnabled),G=!!I.companyChargeCardInfo?.info?.isChargeCardEnabled,V=!I.userRole.includes("charge_card_user")&&$&&G,P=S(U=>R!=null?on(U.chargeCardState,R):null),Z=()=>{R!=null&&(B.current=!0,F.current!=null&&clearTimeout(F.current),F.current=setTimeout(()=>{B.current=!1,F.current=null},5e3),t(ca(R,V,!0)),t(ve(!0)),h(!0))},X=Ge(I);At({events:ta(X,Bn),onSubscribed:()=>{t(ve(!0))},onEvent:(U,te)=>{if(!sc.has(U))return;const ae=wt(te),k=B.current;if(U===aa){const J=ce(ae?.card_id)??R;if(J!=null){const Q=vt(ae,J);if(Q!=null)return t(mt(Q)),void(J!==R||k||Z())}}if(U===qa)return void t(ve(!0));const z=ce(ae?.card_id)??R;(R==null||z===R)&&R!=null?k||Z():t(ve(!0))}}),d.useEffect(()=>{if(y&&R!=null&&P!=null&&P.status.code!=="request_on_hold"){const U=pe(I.tenantEmailDomain,R,o,P),te=ye(n.state?.pathnameStackToGoBack,n.pathname);t(Br()),P?.type.code==="business_virtual_credit_card"&&t(Na()),r(U,{state:{pathnameStackToGoBack:te},replace:!0}),B.current=!1,F.current!=null&&(clearTimeout(F.current),F.current=null)}},[y,P?.status.code]),d.useEffect(()=>{M==="In-Progress"&&O.updateStatus.fetchState==="Completed"&&setTimeout(Z,3e3)},[M,O.updateStatus.fetchState]);const w=U=>{D(U)};if(b!=="Completed"||j.cards.length===0)return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:w}),s.jsx(Cs,{})]});if(i==null)throw Error("Can't access my userId.");return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:w}),s.jsx(ic,{chargeCardListView:j,cardUserOnboardingView:O,navigate:r,currentTenant:I,myUserId:i,location:n,chargeCardCashbackRatePerTransaction:A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{w(!0)}}),e!=null?s.jsx(dc,{windowSize:a,children:e}):null]})},ic=he(function(e,{currentTenant:a,cardUserOnboardingView:t,chargeCardListView:r,myUserId:n}){const f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{cards:r.cards,showMenuIcon:p,companyLegalName:a.companyName,twoFAView:t.twoFAView,cardUserOnboardingLocalData:t.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:t.isDOBPresent,onboardingProgressStatus:t.onboardingProgressStatus}},function(e,a){const{navigate:t,cardUserOnboardingView:r,location:n,currentTenant:f}=a,{tenantEmailDomain:p}=f;return{updateCardUserOnboardingLocalData:g=>{e(Ft({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const _={...r.cardUserOnboardingLocalData,phone:g};e(Ft({localData:_}))}e($a(g,"CardUserOnboarding"))},onResendOtp:g=>{e(Ma(g,"CardUserOnboarding"))},onVerifyOtp:(g,_)=>{e(Ha(g,_,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(Lr()),g!=null&&ee.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(cn({cardId:g}))},onBackClick:()=>{const g=Re(n.state?.pathnameStackToGoBack),_=g.poppedPathname??ze(p);t(_,{state:{pathnameStackToGoBack:g.newStack}})}}})(ps),dc=Te.div`
35
+ display: flex;
36
+ flex-direction: column;
37
+ width: ${e=>`${cc.containerWidth.value(e.windowSize)}%`};
38
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
39
+ `,Ut=Te.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
+ `,lc={containerWidth:new Aa(100,58)},uc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p,useFeatureGate:g}=oe(),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),[B,F]=d.useState(!1),L=ee.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const C=S(V=>de(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=p(Le.zeniCardsConfig),D=S(V=>Rr(V,n)),{isFeatureEnabled:o}=g(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=g(Y.isDebitCardFeatureEnabled),A=Ee(I,C),j=ke({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:A}),E=Ie(C),b=Ae(C),x=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=_e({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:o,isBookKeepingTenant:b,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:x}),m=D.chargeCard,O=S(V=>V.chargeCardConfigState.fetchState);d.useEffect(()=>{_===!1&&O!=="In-Progress"&&O!=="Completed"&&(t(Va()),c(!0)),l===!1&&D.fetchState==="Not-Started"&&(v(!0),t(ca(n,!1,i)))},[l,D.fetchState,_,O]);const M=m?.type.code==="business_physical_debit_card"||m?.type.code==="business_virtual_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(y===!1&&(M===!1||M&&m.status?.code!=="active"||M&&m.status.code==="active"&&m.isPinSet||m.cardHolderUserId!==L.userId)){const V=pe(C.tenantEmailDomain,n,L,m,!0),P=ye(f.state?.pathnameStackToGoBack,f.pathname);r(V,{state:{pathnameStackToGoBack:P}})}else if(y&&D.isRefreshingViewInBackground===!1&&m?.isPinSet===!0){t(Or({chargeCardId:n}));const V=pe(C.tenantEmailDomain,n,L,m,!0),P=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(V,{state:{pathnameStackToGoBack:P}})}}},[D.fetchState,m?.type.code,y,D.isRefreshingViewInBackground]);const R=ee.getZeniOtpTokenForCardHolder(n),T=S(V=>Nt(V.userState,L.userId)),$=()=>{m?.isPinSet!==!0&&t(na(n,!0))};d.useEffect(()=>{D.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),h(!0))},[D.updateDebitCardPinAttemptFetchState.fetchState]);const G=V=>{F(V)};if(O!=="Completed"||m==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(T?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(pc,{children:[s.jsx(We,{isAppContentDrawerOpen:B,handleDrawerToggle:G}),s.jsx(mc,{cardId:n,card:m,phone:T.phone,signedInUser:L,isSandboxEnv:ht(),debitCardDetailState:D,signedInUserToken:R,navigate:r,currentTenant:C,location:f,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{G(!0)}}),e!=null?s.jsx(Cc,{windowSize:a,children:e}):null]})},mc=he(function(e,{debitCardDetailState:a,cardId:t}){const r=Ht(e,t),n=a.updateStatus,f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{showMenuIcon:p,vgsVaultId:Ya.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,debitCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:c=>{e(Kt(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onSetPinSuccess:()=>{e(Ur({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("activate")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(hs),Cc=Te.div`
48
+ display: flex;
49
+ flex-direction: column;
50
+ width: ${e=>`${lc.containerWidth.value(e.windowSize)}%`};
51
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
52
+ box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
53
+ `,pc=Te.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=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
62
+ `,hc={overlayWidth:new Aa(at[12],at[12],at[9])},fc=he(function(e,a){const t=pt(e,!1,!1),r=a.lineId,n=t.customAddress[r],f=t.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:n,customAddressStatus:f,lineId:r}},function(e,a){const{newCustomAddressId:t,lineId:r,chargeCardTypeOption:n}=a;return{onSubmitHandler:f=>{t!=null&&e(dn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const p=Ts(f);e(Nr({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:p})),e(Hr(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{a.onDismissClick(),t!=null&&e(Vr({addressId:t,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(fs),gc=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:t})=>{const r=ft(),n=Ia(),f=()=>{a()},p=S(g=>jr(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(hn,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:hc.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&f(),children:s.jsx(fc,{googleAPIKey:Ya.googleMapsAPIKey,onDismissClick:f,lineId:e,chargeCardTypeOption:t,newCustomAddressId:p})})},bc=he(function(e,a){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g}=a,_=pt(e,t&&p,r&&g);return{issueChargeCards:_,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g,cardHolderCandidates:_.userList.map(c=>c.user).filter(Boolean),allRoles:_.userList.map(c=>c.userRole),allAccountingClasses:_.allAccountingClasses,userList:_.userList}},function(e,a){return{onIssueCardClick:()=>{e(Gr())},onSaveChangesToLocalStore:t=>{e($r(t))},onDismissClick:()=>{e(ln()),a.navigate("../")},resetCustomAddressByLineID:(t,r)=>{e(dn(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}})(ys);function yc(){const e=ee.getSignedInUser(),a=me(),t=Ce(),r=gs(),[n]=jt(),f=n.get("cardType"),{useFeatureGate:p}=oe(),{isFeatureEnabled:g}=p(Y.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=p(Y.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:c}=p(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Y.isChargeCardFeatureEnabled),v=S($=>de($)),y=Ee(c,v),h=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:y}),B=Ie(v),F=Ae(v),L=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,C=_e({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:l,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:L}),[u,D]=d.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");d.useEffect(()=>{u||(D(!0),t(Mr(h&&I,C&&o,!1)))},[u,D,t]);const o=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S($=>pt($,C&&o,h&&I)),j=A.fetchState,E=A.issueCardStatus.fetchState,b=A.lastSelfIssuedDebitCardId,x=S($=>b!=null?on($.chargeCardState,b):void 0),[i,m]=d.useState(null),[O,M]=d.useState(null),R=()=>{m(null)},T=($,G)=>{m($),M(G)};return d.useEffect(()=>{if(E==="Completed"){if(b!=null&&x?.type.code==="business_virtual_debit_card"){let $;$=x?.status.code==="request_on_hold"&&e.userId===x.cardHolderUserId?yn(v.tenantEmailDomain):pe(v.tenantEmailDomain,b,e,x),a($)}else a("../");t(ln())}},[E,b]),j==="Completed"?s.jsxs(s.Fragment,{children:[i!==null&&O!==null?s.jsx(gc,{closeDrawerHandler:R,lineId:i,chargeCardTypeOption:O}):null,s.jsx(bc,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:C,isChargeCardSetupEnabled:o,isDebitCardSetupEnabled:I,navigate:a,fetchState:A.fetchState,openAddAddressDrawerHandler:T,defaultCardType:f==="creditCard"||f==="debitCard"?f:void 0})]}):j==="Error"?s.jsx(Ka,{}):s.jsx(bs,{})}const Ln=[aa,qa],Sc=new Set(Ln),Ic=Te.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
+ `,Ac=he(function(e,a){const{myPendingActivationChargeCardListState:t}=a;return{myPendingActivationChargeCardListView:t,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigate:t,currentTenant:r,location:n,signedInUser:f,myPendingActivationChargeCardListState:p}=a,{tenantEmailDomain:g}=r,{cards:_}=p;return{onChargeCardRowClick:c=>{const l=bn(_,c),v=pe(g,c,f,l),y=ye(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,l)=>{e(st({uiState:{sortKey:c,sortOrder:l}}))},onReloadCards:()=>{e(ve())},onBackClick:()=>{const c=r.userRole.includes("charge_card_user");e(st({uiState:{sortKey:c?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(Ss);function Ec(){const e=me(),a=Ce(),t=Se(),r=ft(),[n,f]=d.useState(!1),p=S(T=>zr(T)),g=S(T=>de(T)),_=S(T=>qe(T,g.companyId)),c=Xe(_.controllers),{useFeatureGate:l}=oe(),{isFeatureEnabled:v}=l(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(Y.isDebitCardFeatureEnabled),h=Ee(y,g),B=ke({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:h}),F=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,L=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,C=$e(),u=Ie(g),D=Ae(g),o=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=_e({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:v,isBookKeepingTenant:D,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:o}),A=He(C?.loggedInUserRoleMap),j=S(T=>Qe(T)),{creditAccount:E,creditAccountRepayment:b}=S(T=>Je(T)),x=S(T=>rn(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),i=[...new Set(x)],m=S(T=>Ga(T,i));d.useEffect(()=>{n||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(f(!0),a(ve()),a(Va()))},[n,a,p.fetchState]),d.useEffect(()=>{if(p.fetchState==="Completed"&&p.cards.length===1&&O!=null){const T=pe(g.tenantEmailDomain,p.cards[0].id,O,p.cards[0]);e(T,{state:{message:t.state?.message}})}},[p.fetchState,p.cards]);const O=ee.getSignedInUser();d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&I&&L&&A&&a(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&A&&a(ut()),m.fetchState!=="Completed"&&m.fetchState!=="In-Progress"&&B&&F&&A&&a(sn())},[E.fetchState,b.fetchState,a,m.fetchState,B,F,A,I,L]);const M=Ge(g);if(At({events:ta(M,Ln),onEvent:(T,$)=>{if(!Sc.has(T))return;const G=wt($);if(T===aa){const V=ce(G?.card_id);if(V!=null){const P=vt(G,V);if(P!=null)return void a(mt(P))}}a(ve(!0))},onSubscribed:()=>{a(ve(!0))}}),O==null)throw Error("Can't access address page without signing in...");const R=p.cards!=null&&p.cards.length>0;if(p.fetchState==="Completed"||R){const T=Me(I,B,F,L);return s.jsx(Ic,{children:s.jsx(Ac,{navigate:e,currentTenant:g,signedInUser:O,productInformation:T,myPendingActivationChargeCardListState:p,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:B,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:L,chargeCardCashbackDetailState:j,creditAccount:E,creditAccountRepayment:b,depositAccountListWithDebitCardIssued:m,controllerEmails:c,location:t})})}return s.jsx(Sa,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})}const kc=he(function(e,a){const{companyId:t,companyLegalName:r}=a;return{chargeCardSetupView:ya(e,t),admins:a.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,a){const{navigate:t,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:f,isChargeCardSetupEnabled:p,signedInUser:g,location:_,productInformation:c,isEarlyPayEnabled:l,controllerEmails:v,chargeCardsCreditAccountLimit:y}=a;return{onSetupButtonClick:h=>{if(g!=null&&q.trackCardsPromoPageClicked("enable cards"),n)switch(q.trackCardsEnableCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!0,"charge_cards",l,!1));break;case"debit":e(Ve(r,!0,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!0,"debit_cards",l,!0):Ve(r,!0,"charge_cards__debit_cards",l,!1))}else switch(q.trackCardsSetupCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!1,"charge_cards",l,!1));break;case"debit":e(Ve(r,!1,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!1,"debit_cards",l,!0):Ve(r,!1,"charge_cards__debit_cards",l,!1))}},onBackClick:()=>{const h=Re(_.state?.pathnameStackToGoBack);let B=h.poppedPathname;B==null&&(B=f||p?"..":"../.."),t(B,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(Na()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Kr(r))}}})(As),_c=()=>{const e=me(),{tenantEmailDomain:a}=ba(),[t]=jt(),r=t.get("cardPromoType"),n=Ce(),{useDynamicConfig:f,useFeatureGate:p}=oe(),[g,_]=d.useState(!1),{isFeatureEnabled:c}=p(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:v}=p(Y.isChargeCardFeatureEnabled),{configValue:y}=f(Le.zeniCardsConfig),h=S(ne=>de(ne)),B=S(ne=>qe(ne,h.companyId)),F=Xe(B.controllers),L=y.charge_card_cashback_rate_per_transaction!=null?y.charge_card_cashback_rate_per_transaction:.0175,C=Se(),u=ee.getSignedInUserTenant(a)?.companyId??h.companyId,D=S(ne=>ya(ne,u)),o=D.primaryFundingAccount,I=h.companyBillPayInfo?.info,A=Ie(h),j=Ae(h),E=Ee(c,h),b=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:E}),i=_e({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:b}),m=gn({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j}),O=x&&i===!1,M=I?.businessVerificationStatus?.code==="verified"&&(O||o?.accType==="depositAccount"||Yr(o?.providerVerificationStatus?.code??"")),R=ee.getSignedInUser(),T=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,G=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,P=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Z=ne=>{_(ne)},X=S(ne=>ne.chargeCardSetupViewState.fetchState);if(R==null)throw Error("Can't access Charge Card promo page without signing in...");const w=$e(),U=He(w?.loggedInUserRoleMap),te=Ct(w?.loggedInUserRoleMap),[ae,k]=d.useState(!1),[z,J]=d.useState(!1),[Q,K]=d.useState(!1);d.useEffect(()=>{ae===!1&&C.state?.message==="activation"&&k(!0)},[C.state]),d.useEffect(()=>{z||X!=="Not-Started"||u==null||(J(!0),n(fa(u,!0)))},[z,X,u,n]);const re=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:m,isTOSAccepted:$,isSetupEnabled:G,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),De=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:x,isTOSAccepted:P,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),Oe=x&&De&&m&&b>=0&&re?"debit_and_credit":x&&De?"debit":"credit",W=ws(r,Oe),fe=D?.chargeCardTermsDetails?.fetchStatus?.fetchState,Pe=d.useRef(null);d.useEffect(()=>{fe==="In-Progress"?Pe.current=W:fe!=="Error"&&fe!=="Not-Started"||(Pe.current=null)},[fe,W]);const Ue=fe!=="In-Progress"&&fe!=="Completed"||Pe.current==null?W:Pe.current;d.useEffect(()=>{W==="credit"&&(G||m===!1&&V)||W==="debit"&&V||W==="debit_and_credit"&&V&&G?e("../"):(W==="debit_and_credit"&&$===!0&&P===!0||W==="credit"&&($===!0||m===!1&&P===!0)||W==="debit"&&P===!0)&&U===!0&&e("../setup")},[M,G,V,W,$,P]),d.useEffect(()=>{Q||(n(Zr("cardAdmin")),K(!0))},[Q]);const Fe=S(ne=>tn(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),xe=Me(m,x,V,G);return(re||De)&&X==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:q,onLoad:()=>{if(q.trackPageLoaded(pn.Event.cardsPromoPage),!!m&&!G||!!x&&!V||!!m&&!!x&&!V&&!G){const ne=Dc({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:G,isCreditCardProductVisibleForExpressInterest:m,isDebitCardProductVisible:x});q.trackCardsPromoView(F,xe,"Page",ne,"Promo Page")}}}),s.jsx(za,{showConfetti:ae}),s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(kc,{signedInUser:R,location:C,showEnableCardButton:M,isCompanyBusinessVerificationAndPaymentSetUpDone:M,isChargeCardSetupEnabled:G,isDebitCardSetupEnabled:V,companyLegalName:h.companyName,adminList:Fe.users,isCheckingEnabled:T,navigate:e,companyId:u,cardPromoType:Ue,controllerEmails:F,productInformation:xe,isCreditCardProductVisible:i,isDebitCardFeatureEnabled:c,isEarlyPayEnabled:l,cashbackRate:L,chargeCardsCreditAccountLimit:b,onClickMenuIcon:()=>{Z(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(Is,{})]})},Dc=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:r})=>t&&r&&!e&&!a?"Credit & Debit Card":t&&!a?"Credit Card":r&&!e?"Debit Card":"";function Xc(){const e=Se(),a=S(X=>de(X)),{useFeatureGate:t}=oe(),{isFeatureEnabled:r}=t(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=t(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=t(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:p}=t(Y.isChargeCardPaymentHistoryFeatureEnabled),g=Ee(n,a),_=ke({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),c=Es(a,r,n),l=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,v=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,y=!!a.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!a.company?.companyDebitCardInfo.isDebitCardEnabled,B=$e(),F=He(B?.loggedInUserRoleMap),L=Ct(B?.loggedInUserRoleMap),{isFeatureEnabled:C}=t(Y.isCashbackFeatureEnabled),u=a.userRole.includes("charge_card_user"),D=!u,o=!u&&y,I=a?.userRole!=null&&Wr(a?.userRole),A=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!I)&&qr(B?.loggedInUserRoleMap),j=Xr(B?.loggedInUserRoleMap),E=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!I)&&Jr(B?.loggedInUserRoleMap),{isFeatureEnabled:b}=t(Y.isDepositAccountsFeatureEnabled),x=b&&!I&&$t(B?.loggedInUserRoleMap),i=y&&!I,m=h&&!I,O=c&&!I&&He(B?.loggedInUserRoleMap),M=Qr(B?.loggedInUserRoleMap),R=Ie(a),T=Ae(a),$=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,G=_e({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:r,isBookKeepingTenant:T,isDebitCardProductVisible:_,chargeCardsCreditAccountLimit:$}),V=a.companyChargeCardInfo?.info!=null&&sa({cardInfo:a.companyChargeCardInfo.info,isProductVisible:G,isTOSAccepted:l,isSetupEnabled:y,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),P=a.companyDebitCardInfo?.info!=null&&sa({cardInfo:a.companyDebitCardInfo.info,isProductVisible:_,isTOSAccepted:v,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),Z=V||P;return s.jsxs(Rn,{children:[F?s.jsx(se,{path:"setup",element:s.jsx(xt,{isBillPayAdminLevelAccess:A,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:x,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(se,{path:"verification",element:s.jsx(xt,{isBillPayAdminLevelAccess:A,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:x,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,productType:"charge_cards",type:"verification"})}):null,s.jsx(se,{path:"promo",element:s.jsx(_c,{})}),i||m?s.jsxs(s.Fragment,{children:[s.jsx(se,{path:"/",element:s.jsx(Lt,{isPaymentDrawerOpen:!1})}),O&&f?s.jsx(se,{path:"payment",element:s.jsx(Lt,{isPaymentDrawerOpen:!0})}):null,s.jsx(se,{path:"activate",element:s.jsx(Ec,{})}),s.jsx(se,{path:"onboard",element:s.jsx(oc,{})}),F?s.jsx(se,{path:"new",element:s.jsx(yc,{})}):null,C&&D?s.jsx(se,{path:"cashback",element:s.jsx(Rs,{})}):null,o?s.jsx(se,{path:"statements",element:s.jsx(rc,{})}):null,O&&p&&y?s.jsx(se,{path:"payment-history",element:s.jsx(nc,{})}):null,s.jsx(se,{path:":cardId/activate",element:s.jsx(js,{})}),s.jsx(se,{path:":cardId/setPin",element:s.jsx(uc,{})}),s.jsx(se,{path:":cardId/addToWallet",element:s.jsx(Fs,{})}),s.jsx(se,{path:":cardId/*",element:s.jsx(Ks,{})}),s.jsx(se,{path:"*",element:s.jsx(Ka,{})})]}):(l||v)&&F?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../setup"})}):Z?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../promo",state:e.state})}):s.jsx(se,{path:"*",element:null})]})}export{Xc as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-D65YpEzb.js";import{a as g}from"./sentry-Cc7E6KXa.js";import{h as w,u as x,g as k,i as T,j as O,n as E}from"./core-C9zW9aiN.js";import{z as C,b7 as P,x as F,c as V,e as j,af as b,b8 as A,at as L,au as M,m as U}from"./index-1wxiPadS.js";import{eP as D,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 N,lS as J,lV as Q}from"./zeni-epic-state-CSVE6Gls.js";import"./mui-CjAqh33Z.js";import{d as W}from"./routePaths-NM47duJ5.js";import{M as X}from"./MobileAppDrawer-DgVPhlgQ.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]="513bb435-7e8f-4d9b-9678-f9fa76b7d5e3",t._sentryDebugIdIdentifier="sentry-dbid-513bb435-7e8f-4d9b-9678-f9fa76b7d5e3")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=D(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:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(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:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(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=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.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,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-DPIuO3ZH.js";import{a as g}from"./sentry-D2jFbVNj.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-85-jQOHl.js";import{z as N,b7 as P,Z as F,c as V,e as j,af as C,b8 as A,at as L,au as M,n as U}from"./index-CvKM_if1.js";import{eP as h,fG as B,sg as _,fB as G,c2 as R,MJ as z,bn as q,qh as K,q5 as Y,ke as Z,lK as S,MK as H,bE as J,cv as b,lS as $,lV as Q}from"./zeni-epic-state-BMMVjv_C.js";import"./mui-bZkpowbW.js";import{d as W}from"./routePaths-BT8WAsMD.js";import{M as X}from"./MobileAppDrawer-5NMylEDA.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]="f755e44f-09dd-466c-96a1-980a4317963b",t._sentryDebugIdIdentifier="sentry-dbid-f755e44f-09dd-466c-96a1-980a4317963b")}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($({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:D}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I: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?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:D.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(H(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(K(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=k(),i=x(),{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-DPIuO3ZH.js";import{a}from"./sentry-D2jFbVNj.js";import{u as D,g as v,j as m,N as w}from"./core-85-jQOHl.js";import{Jo as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jv as F}from"./zeni-epic-state-BMMVjv_C.js";import{u as P,z as u,L as g,D as $,o as k}from"./index-CvKM_if1.js";import{n as H}from"./mui-bZkpowbW.js";import{t as z}from"./getLocaleForTenant-BEsUCcGU.js";import{g as R,Q as J}from"./QBOConnectionScreen-DZdB_pbF.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";import"./empty-BUCP1zlD.js";import"./pdf-lib-DVsRNJ0B.js";import"./index-BjSilB1q.js";import"./url-C3RKXM3D.js";import"./index-YSSSINh1.js";import"./decodeURIComponentSafe-DMY7naVP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="e44c546e-ff9e-499b-beb5-5fa29599332f",t._sentryDebugIdIdentifier="sentry-dbid-e44c546e-ff9e-499b-beb5-5fa29599332f")}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(),d=v(),{setLoading:i,clearAllLoading:b}=P(),p=a.useRef(!1),c=a.useRef(!1),{code:x,realmId:T,state:y}=R(d.search),N=x!==""&&T!==""&&y!=="",I=m(l=>A(l)),e=m(l=>O(l)),n=m(l=>l.tenantState.fetchState),r=m(l=>l.tenantState.activeTenantFetchState.fetchState),o=u.getSignedInUser(),f=u.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{i(g.CONNECTION_AUTH)},[i]),a.useEffect(()=>{p.current||o==null||f==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(i(g.TENANT_FETCHING),t(j(o.userId,f))))},[p,n,i]),a.useEffect(()=>{e.tenantId==null&&!c.current&&o!=null&&(c.current=!0,!(f==null||f!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[c,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(i(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(_(e.tenantId)),u.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"&&u.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[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-DPIuO3ZH.js";import{z as n}from"./index-CvKM_if1.js";import{g as d}from"./QBOConnectionScreen-DZdB_pbF.js";import"./sentry-D2jFbVNj.js";import{g as p,N as a}from"./core-85-jQOHl.js";import"./zeni-epic-state-BMMVjv_C.js";import"./recharts-DDB6XWY-.js";import"./mui-bZkpowbW.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";import"./empty-BUCP1zlD.js";import"./pdf-lib-DVsRNJ0B.js";import"./index-BjSilB1q.js";import"./url-C3RKXM3D.js";import"./index-YSSSINh1.js";import"./decodeURIComponentSafe-DMY7naVP.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-DPIuO3ZH.js";import{t as Ke,A as Ce}from"./AddressScreen-Cm8PgLwy.js";import $e from"./NotFoundScreen-ph-dOT2n.js";import{a as g}from"./sentry-D2jFbVNj.js";import{h as se,g as oe,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-85-jQOHl.js";import{O as de,k as le,z as B,v as ue,h as qe,I as _,n as V,Z as J,c as N,B as ve,e as Y,ap as Qe,j as Ze,aq as Ie,i as te,ar as He,as as ke,o as Je,at as We,au as Ee,av as Ye}from"./index-CvKM_if1.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 st,ji as ae,jl as we,JU as ot,bT as it,c2 as ge,su as fe,sf as rt,Ko as X,sv as _e,HM as ct,km as Ue,Kp as Ve,Kq as dt,Kr as lt,Ks as ut,jg as pt,jj as mt,sh as Be,st as gt,bE as Te,cv as ft,sH as xe,qh as ht,q5 as yt,ke as bt,fE as St,fD as Ct,fC as It,Kt as kt,s9 as Et,sI as Tt,sL as xt,sO as Ot,sU as Pt,cT as Dt}from"./zeni-epic-state-BMMVjv_C.js";import{n as he}from"./mui-bZkpowbW.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-DZdB_pbF.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";import"./empty-BUCP1zlD.js";import"./pdf-lib-DVsRNJ0B.js";import"./index-BjSilB1q.js";import"./url-C3RKXM3D.js";import"./index-YSSSINh1.js";import"./decodeURIComponentSafe-DMY7naVP.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]="b9fef31b-b44f-42f2-a2eb-72bfc45e0762",t._sentryDebugIdIdentifier="sentry-dbid-b9fef31b-b44f-42f2-a2eb-72bfc45e0762")}catch{}})();const jt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),vt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const v=pe(F,c),P=me(c),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),w=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),$===!1&&D.push("task_card"),w===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),I===!1&&D.push("zeni_accounts_promo_card"),h===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||v||P||(r(!0),o(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,v,P,i,c.tenantId,o]),g.useEffect(()=>{(v||P)&&setTimeout(()=>{b(!0)},5e3)},[v,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(v)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(ve,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ background-color: ${t=>t.theme.colors.grey4};
5
+ `,Pe=he.div`
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ min-width: calc(100% - ${ke}px);
10
+ padding-left: ${ke}px;
11
+ flex: 1;
12
+
13
+ ${t=>t.theme.breakpoints.down("md")} {
14
+ width: 100%;
15
+ padding-left: ${Je.sp0};
16
+ }
17
+
18
+ ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
+ `,De=ce(function(t,s){const{companyId:o,isAdmin:u,currentTenant:d,isOnAddressPage:r}=s,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=fe(t,o),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:f,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,s){const{companyId:o,currentTenant:u,themeState:d,navigate:r,location:p}=s,{tenantEmailDomain:b}=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(o,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:k,email:T,ssn:x,nationalityCountryCode:I,dob:h,phone:U,syncToken:C,selectDocument:F,role:K,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:f,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:x,nationalityCountryCode:I?.selectedOption!=null?Ee(I.selectedOption):void 0,phone:U,birthday:h!=null?Te(h?.toString()):h,syncToken:C,titleAtCompany:K.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:x,primaryContactEmail:I,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:K,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:v,purposeOfAccountDescription:P,regulatedStatus:D,regulatedStatusDescription:Q,transactionVolume:$,transactionVolumeDescription:M,usNexus:w,usNexusTypes:q}=e,l={companyId:o,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ft(T):void 0,phone:x,syncToken:F,fileIds:K,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(H=>H.length===2?H:Ee(H))??[],purposeOfAccount:v?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:D??"",regulatedStatusDescription:Q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:M,usNexus:w,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:h.firstName,lastName:h.lastName,email:I,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=Ae(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=Ae(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(o,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Ke(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(o,!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(we(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(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(He),W=({taxCFOCustomer:t=!1,isOnAddressPage:s=!1,appContent:o})=>{const u=se(),d=oe(),r=ie(),p=Ze(),b=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:h}=I(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=A(y=>y.onboardingCustomerViewState.fetchState),F=A(y=>y.onboardingCustomerViewState.currentStep),K=A(y=>y.onboardingCustomerViewState.uiState),c=A(y=>ee(y)),L=A(y=>y.userRoleConfigState.fetchState),j=A(y=>y.cardPaymentViewState),R=Ie(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:v}=At(d.search),P=c.externalConnections?.accounting[0],D=P?.connectionType,Q=P?.connectionName,$=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(we(["card"]),k(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,v,$,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(ot(c.tenantId,{connection_type:D??"accounting",connection_name:Q??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:$,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[S,G,v,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const w=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=A(y=>fe(y,w));g.useEffect(()=>{e||C!=="Not-Started"||w==null||(n(!0),r(rt(w,!0,!U)))},[e,C,w]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!K.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=Ie(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 H=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(h,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(Y.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(De,{navigate:u,location:d,companyId:w,currentTenant:c,isAdmin:q,isOnAddressPage:s,themeState:b,googleAPIKey:te.googleMapsAPIKey}),o!=null?a.jsx(Pe,{windowSize:p,children:o}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return H===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:y=>be(y)}),a.jsx(De,{navigate:u,location:d,companyId:w,currentTenant:c,isAdmin:q,isOnAddressPage:s,themeState:b,googleAPIKey:te.googleMapsAPIKey}),o!=null?a.jsx(Pe,{windowSize:p,children:o}):null]});return null};function Ae(t,s,o){let u=`/${t}/onboarding/address`;return u=o!=null?u.concat(`/edit/${s}/${encodeURIComponent(o)}`):u.concat(`/new/${s}`),u}const Fe=he.div`
20
+ display: flex;
21
+ height: 100vh;
22
+ background-color: ${t=>t.theme.colors.grey4};
23
+ `,je=ce(function(t,s){const{companyId:o,currentTenant:u}=s,d=fe(t,o),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,s){const{currentTenant:o,themeState:u,navigate:d,location:r}=s,{tenantEmailDomain:p}=o;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Ye),wt=()=>{const t=se(),s=ie(),o=oe(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&o.state?.message==="OnboardingThankyou"&&n(!0)},[o.state]);const i=A(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{s(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),x=A(h=>h.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||f?x==="Completed"&&I===!0&&f&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:h=>{h.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:o,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&I===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:h=>{h.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:o,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(ve,{fetchState:x}):k?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function sa(){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(wt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(vt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx($e,{})})]})}export{sa as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-D65YpEzb.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-C9zW9aiN.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-CSVE6Gls.js";import{z as j,a2 as ae,m as D,c as x,D as q,aU as Fo,Y as $e,x as ze,aV as xa,e as N,aW as Oo,k as _e,aX as Da,v as Se,I as R,h as Po,aY as Mo,aZ as Ro,U as wa,J as Fa,a as Oa,X as Bo,a_ as jo,R 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,j as Vo,V as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-1wxiPadS.js";import{n as Dt}from"./mui-CjAqh33Z.js";import{a as b}from"./sentry-Cc7E6KXa.js";import{w as ja}from"./withTransactionSidePanel-DzuPuyV9.js";import{c as Ua,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-NM47duJ5.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import Le from"./NotFoundScreen-Bv_nRCjj.js";import{u as Ft}from"./useInitialThreadRequest-COJ5en-O.js";import{t as La}from"./analyticsHelper-CjjD2OUX.js";import{C as Zo}from"./CompanyPassportScreen-Cb1iYJZe.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-Dmb4Bk7D.js";import{F as Ho}from"./FeaturePreviewScreen-CVSV79yf.js";import{R as Wo}from"./ReferralListScreen-DINWTi1Q.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./TransactionDetailScreen-C5vka9J3.js";import"./decodeURIComponentSafe-BPYfhkXa.js";import"./MobileAppDrawer-DgVPhlgQ.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]="6369a9fc-4aba-4818-8164-b8abe1f4dc3a",e._sentryDebugIdIdentifier="sentry-dbid-6369a9fc-4aba-4818-8164-b8abe1f4dc3a")}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-DPIuO3ZH.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-85-jQOHl.js";import{eP as L,KJ as Xe,bE as sa,bq as xe,LW as In,i6 as Tn,LX as Nt,LY as xn,i9 as bt,LZ as Qe,L_ as Dn,ie as wn,L$ as $t,M0 as Fn,ij as Ct,M1 as He,M2 as On,cl as St,M3 as Pn,M4 as Mn,L1 as Rn,jc as Bn,M5 as jn,bn as Ge,M6 as ra,Kx as ce,bc as ia,jq as ca,n2 as la,j9 as da,Kz as le,Ky as ee,eO as ua,eU as Un,fq as kt,M7 as Ln,M8 as Gn,M9 as ma,Ma as Re,um as Ye,un as Ve,uK as De,uE as de,ur as Ne,Mb as Yn,Mc as Vn,Md as Nn,Me as pa,Mf as Be,Mg as $n,dE as Je,qR as ha,Mh as zn,Mi as Kn,Mj as qn,Mk as yt,JW as At,jG as we,uS as vt,qZ as Zn,Ml as Qn,uo as zt,qU as Ie,qQ as fa,Mm as ge,Mn as Hn,Mo as Et,JV as It,sY as ga,Mp as Wn,Mq as Xn,Mr as Jn,Ms as Tt,t9 as eo,Mt as to,uq as Kt,sX as ba,Mu as be,Mv as ao,bt as Ca,uW as ka,Mw as no,Mx as oo,My as so,Mz as xt,uR as ro,MA as io,up as qt,uV as _a,MB as Ce,MC as co,MD as lo,ME as Sa,jv as ya,m$ as Aa,jA as va,mZ as Ea,mY as Ia,mX as Ta,sk as uo,fg as mo,cN as po,cO as ho,mU as fo,fc as go,n9 as bo,D_ as Zt,MF as Co,MG as ko,MH as _o,MI 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-BMMVjv_C.js";import{z as j,a2 as ae,n as D,c as x,D as q,aU as Fo,_ as $e,Z as ze,aV as xa,e as N,aW as Oo,k as _e,aX as Da,v as Se,I as R,h as Po,aY as Mo,aZ as Ro,W as wa,j as Fa,a as Oa,Y as Bo,a_ as jo,T 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,X as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-CvKM_if1.js";import{n as Dt}from"./mui-bZkpowbW.js";import{a as b}from"./sentry-D2jFbVNj.js";import{w as ja}from"./withTransactionSidePanel-CSUB_mIW.js";import{c as Ua,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-BT8WAsMD.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-BpHEKjJx.js";import Le from"./NotFoundScreen-ph-dOT2n.js";import{u as Ft}from"./useInitialThreadRequest-BsMYIB_G.js";import{t as La}from"./analyticsHelper-uyl1Q5Bm.js";import{C as Zo}from"./CompanyPassportScreen-BbrS3C3y.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-wFWW3HqH.js";import{F as Ho}from"./FeaturePreviewScreen-DCuTnXQ7.js";import{R as Wo}from"./ReferralListScreen-Ct8WhTd-.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";import"./TransactionDetailScreen-BcViPCVk.js";import"./decodeURIComponentSafe-DMY7naVP.js";import"./MobileAppDrawer-5NMylEDA.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]="f7610f5e-88a2-4da3-be3a-74cf0ea7915c",e._sentryDebugIdIdentifier="sentry-dbid-f7610f5e-88a2-4da3-be3a-74cf0ea7915c")}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-D65YpEzb.js";import{a as u}from"./sentry-Cc7E6KXa.js";import{u as y,j as b,n as w,g as A,N}from"./core-C9zW9aiN.js";import{Jm as U,eP as _,fo as k,Jn as L,mW as R,Jo as z}from"./zeni-epic-state-CSVE6Gls.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{t as P}from"./getLocaleForTenant-C-mTF_-1.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.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};
1
+ import{j as v}from"./liveblocks-DPIuO3ZH.js";import{a as u}from"./sentry-D2jFbVNj.js";import{u as y,j as b,n as w,g as A,N}from"./core-85-jQOHl.js";import{Jo as U,eP as _,fo as k,Jp as L,mW as R,Jq as z}from"./zeni-epic-state-BMMVjv_C.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-CvKM_if1.js";import"./mui-bZkpowbW.js";import{t as P}from"./getLocaleForTenant-BEsUCcGU.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.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]="41e106af-3673-4a62-ade2-778b7b9350fc",t._sentryDebugIdIdentifier="sentry-dbid-41e106af-3673-4a62-ade2-778b7b9350fc")}catch{}})();const q=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(q,{})}const J=["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 J)if(t.toLocaleLowerCase().includes(s))return Q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-D65YpEzb.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-C9zW9aiN.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 j}from"./zeni-epic-state-CSVE6Gls.js";import{bu as X,J as N,v as R,z as U,h as z,j as p,I as S,B as O,bv as Y,o as Z,bw as ee,m as te}from"./index-1wxiPadS.js";import{n as H}from"./mui-CjAqh33Z.js";import"./sentry-Cc7E6KXa.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]="cfe83ea6-c34d-4868-99ef-fffb716be07f",e._sentryDebugIdIdentifier="sentry-dbid-cfe83ea6-c34d-4868-99ef-fffb716be07f")}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(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-DPIuO3ZH.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-85-jQOHl.js";import{Nq as k,Nx as q,fE as W,fD as K,fC as M,iD as Y,Ky as J,q8 as L,eP as D,MY as V,iB as T,Nr as v,NA as F,iz as G,iW as j}from"./zeni-epic-state-BMMVjv_C.js";import{bu as Q,j as N,v as R,z as U,h as z,p,I as S,B as O,bv as X,o as Z,bw as ee,n as te}from"./index-CvKM_if1.js";import{n as H}from"./mui-bZkpowbW.js";import"./sentry-D2jFbVNj.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]="0e6286bb-58b1-40ae-9ddc-5a7a2eefaac6",e._sentryDebugIdIdentifier="sentry-dbid-0e6286bb-58b1-40ae-9ddc-5a7a2eefaac6")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(Y(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(M(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(Q);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-D65YpEzb.js";import{h as w,g as C,j as h,n as A,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??P();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=R(),c=U.getSignedInUser(),b=h(u=>D(u)),g=z(),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:x}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(W,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,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`
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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??P();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(X);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=R(),c=U.getSignedInUser(),b=h(u=>D(u)),g=z(),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:x}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,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
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-D65YpEzb.js";import{h as w,g as C,j as h,n as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ie=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:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(F({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??$();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function Ie({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=R(),b=z(),g=h(u=>D(u)),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:x}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(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:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,Ie 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};
18
+ `,ie=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:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(F({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??$();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function Ie({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=R(),b=z(),g=h(u=>D(u)),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:x}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(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(_,{vendorId:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,Ie as D,_ 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-DPIuO3ZH.js";import{j as f,w as l,h as c}from"./index-CvKM_if1.js";import{D as p}from"./mui-bZkpowbW.js";import"./sentry-D2jFbVNj.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]="010086a0-f754-413e-b3a7-f8e3c393f6a5",e._sentryDebugIdIdentifier="sentry-dbid-010086a0-f754-413e-b3a7-f8e3c393f6a5")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=f(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),i=c();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:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-D65YpEzb.js";import{a as c}from"./sentry-Cc7E6KXa.js";import{h as A,u as B,g as L,i as F,j as d,N as q,n as K,o as N,p as _}from"./core-C9zW9aiN.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-CSVE6Gls.js";import{aR as U,c as X,j as Z,m as tt}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{d as k}from"./decodeURIComponentSafe-BPYfhkXa.js";import{w as et}from"./withTransactionSidePanel-DzuPuyV9.js";import{f as at,c as nt}from"./routePaths-NM47duJ5.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import"./TransactionDetailScreen-C5vka9J3.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]="4ca685d6-43ac-4201-ac5c-f487246ca26e",a._sentryDebugIdIdentifier="sentry-dbid-4ca685d6-43ac-4201-ac5c-f487246ca26e")}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??C();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]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:x}=F(),r=k(j??""),p=k(x??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const P=d(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 c.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:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:C(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
1
+ import{j as s}from"./liveblocks-DPIuO3ZH.js";import{a as c}from"./sentry-D2jFbVNj.js";import{h as A,u as B,g as F,i as L,j as d,N as q,n as K,o as N,p as _}from"./core-85-jQOHl.js";import{LF as z,eP as O,L2 as R,kG as H,HE as I,LK as M,Kx as W,jG as Y,HF as S,L7 as $,L8 as V,Kz as J,Ky as Q}from"./zeni-epic-state-BMMVjv_C.js";import{aR as U,c as X,p as Z,n as tt}from"./index-CvKM_if1.js";import"./mui-bZkpowbW.js";import{d as k}from"./decodeURIComponentSafe-DMY7naVP.js";import{w as et}from"./withTransactionSidePanel-CSUB_mIW.js";import{f as at,c as nt}from"./routePaths-BT8WAsMD.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";import"./useAskAiCfoHostNavButtonProps-BpHEKjJx.js";import"./TransactionDetailScreen-BcViPCVk.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]="c4880209-29a4-4e63-8456-0c85f7a1033c",a._sentryDebugIdIdentifier="sentry-dbid-c4880209-29a4-4e63-8456-0c85f7a1033c")}catch{}})();const ot=K(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(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($()),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??C();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=F(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:x,entityNameEncoded:j}=L(),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=d(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(H(i)))},[m,u,i]);const E=d(n=>n.trendState.fetchState),P=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 c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:C(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(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};