@zeniai/web-app-ui 5.1.77-dev → 5.1.77-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 (64) hide show
  1. package/dist/assets/{AddressRoutes-DgtM3nxS.js → AddressRoutes-DVAWy_gb.js} +1 -1
  2. package/dist/assets/{AddressScreen-BNnoxI42.js → AddressScreen-DjHFWXZd.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CfF5p-2L.js → AiCfoScreen-Coov-9Lq.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DZPEV8jE.js → BillPayApprovalRoutes-5yoLyMdf.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-Cj3rPF7j.js → BillPayRoutes-BJdksoIS.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen--z9oIuUu.js → BusinessVerificationPageScreen-CxMuID_0.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-DNag4rPx.js → CardsAiCfoScreen-7MbovH-h.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BD5wy1XM.js → ChargeCardRoutes-ZORkbkMi.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-bzkzFMdg.js → CompanyPassportScreen-3LH__AFc.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-Dfi17Hh2.js → ConnectionAuthScreen-E5uYsUYy.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-DClXD2_x.js → CustomerOnboardingAuthScreen-Bkbz75T7.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-Cv0uxL5k.js → CustomerOnboardingRoutes-CGaSQM6e.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-Dveel7PM.js → DashboardRoutes-Ckr_4PFZ.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-BtVpxYc1.js → DefaultTenantHome-D9TcJdht.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-lYOXV3jg.js → DomesticWireDetailScreen-DZ8naknM.js} +1 -1
  16. package/dist/assets/{DrawerScreen-Bn7fJuoP.js → DrawerScreen-enq1kex3.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-DG2HbUDs.js → EntityDetailRoutes-1jh84Y19.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-C_cBFDYx.js → ExpenseAutomationRoutes-CCWIfo0Y.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-WDFKDhR6.js → FeaturePreviewScreen-9qGkTofX.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-dpBPyj0d.js → HubSpotOAuthCallbackScreen-DV60QBAP.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-D0IIGCiK.js → MagicLinkRoutes-ZrciaOYE.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-YW9ZqePv.js → MagicLinkSignInScreen-Bx2G9lAV.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-eFjjhgJh.js → MobileAppDrawer-CmiSBVZw.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-6qASDiQT.js → NotFoundScreen-BTmOJXuO.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-CMH_9nag.js → NotificationRoutes-DMjWy9uH.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-CJxsBNoU.js → OAuthConsentScreen-g04Ja_FY.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-DFI-6LXP.js → PandLWithForecastRoutes-CQW3cuEJ.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-CQe5mT0Q.js → PeopleRoutes-C4dcMrZ_.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-C2kO5CvR.js → PerformanceRoutes-C70AcB2c.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-VPR245Vs.js → QBOConnectionScreen-CXuCwnVv.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DuTA8ZNx.js → ReferralListScreen-CAuT5MkH.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-DKDcC83F.js → ReimbursementApprovalRoutes-D7K2CtZa.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C7g9vUNM.js → ReimbursementApprovalRuleDetailScreen-Co6mqX7V.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DT6ULuDS.js → ReimbursementRoutes-Dc6yhpRS.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-UEATkQRA.js → ReportsRoutes-0B9PMrKM.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-CDs_o_bR.js → RewardsRoutes-BIy5lqI9.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-7YrD1RCk.js → ScreenRoutes-S4iuOC-S.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-BILGacxq.js → SettingsRoutes-Bo4skXXS.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-BMNyy9c9.js → SetupPagesScreen-C5uQEz7K.js} +1 -1
  40. package/dist/assets/{SignInScreen-CmRE9PCe.js → SignInScreen-DNgt_9L_.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DRSiKmWQ.js → SignOutScreen-CnFKE_oa.js} +1 -1
  42. package/dist/assets/{TaskListScreen-svrYmHZ7.js → TaskListScreen-DF5lH-3k.js} +1 -1
  43. package/dist/assets/{TaskRoutes-Dn0uto0H.js → TaskRoutes-8GtswDRs.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-CB__3R_j.js → TransactionDetailRoutes-BaHmdvMt.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-DxYq4JVW.js → TransactionDetailScreen-D6QDGxGu.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-0JWLB9MV.js → TransactionListRoutes-Bhdw74c5.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-C7KBazk5.js → TreasuryRoutes-Tn0wVhtU.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-vdMn6WBc.js → VendorsRoutes-COmvFuAL.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-DLbtxnuL.js → WiseConfirmationScreen-BSHHYeUX.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-C9zOReRG.js → ZeniAccountRoutes-CteciRDO.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-DW7NA-BZ.js → ZeniAccountStatementScreen-WWIAEGl-.js} +1 -1
  52. package/dist/assets/{analyticsHelper-D_xPTvv0.js → analyticsHelper-Bq2cX6hw.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-DOJkec7u.js → getLocaleForTenant-B4Of7eQD.js} +1 -1
  54. package/dist/assets/{index-BTYYfZaH.js → index-BkGSE7D5.js} +5 -5
  55. package/dist/assets/{routePaths-DxhKVAQu.js → routePaths-DlT4djwo.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BWYRRRl-.js → useAiCfoDashboardSuggestedQuestionsChips-BOfvB1qP.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-CBG7z3tT.js → useAskAiCfoHostNavButtonProps-BNRHSSlT.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-DO-traME.js → useCashManagementBanner-BqwuaRBx.js} +1 -1
  59. package/dist/assets/{useChargeCardPusherEvents-C5IaHrcj.js → useChargeCardPusherEvents-ek7O5vue.js} +1 -1
  60. package/dist/assets/{useEmailConnectResultRefresh-BOI-L6Xh.js → useEmailConnectResultRefresh-C_KtOMfR.js} +1 -1
  61. package/dist/assets/{useInitialThreadRequest-BoQP-jON.js → useInitialThreadRequest-tlPkIpCr.js} +1 -1
  62. package/dist/assets/{withTransactionSidePanel-IQKxlXVX.js → withTransactionSidePanel-D-rC67hx.js} +1 -1
  63. package/dist/index.html +1 -1
  64. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CsaY8yYO.js";import{h as W,u as me,g as H,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as E}from"./core-BoNEfvLs.js";import{eX as V,QL as ce,c6 as de,EH as je,kJ as dt,EU as se,ET as ie,QM as ut,bn as ue,gq as Fe,QN as pt,N8 as bt,ky as De,N9 as Re,Na as gt,jt as ht,Q2 as ft,jI as St,Ev as It,uc as Rt,jA as yt,Ff as Ue,QO as Le,QP as At,QQ as vt,QR as kt,QS as Ct,QT as Et,E$ as ye,jO as wt,Qb as xt,EV as Bt,EF as Tt,QU as jt,EE as Ft,QV as Dt,EN as Ae,F3 as Ut,F2 as Lt,E_ as Pt,QW as Pe,Ke as $t,bq as Mt,EQ as _t,Fx as Nt,QX as Ot,QY as Qt,Fb as zt,F8 as ve,Px as Gt,EC as Zt,QZ as $e,FZ as ke,G5 as Ht,Q_ as Vt,Q$ as G,R0 as Wt,R1 as Me,R2 as Kt,R3 as _e,R4 as Ne,Fn as oe,bu as qt,bK as pe,cG as be,fE as Oe,fC as Qe,R5 as Jt,fz as Yt,PK as Xt,R6 as en,R7 as ze,PO as tn,Qw as nn,R8 as an,QK as sn,G2 as Ce,G1 as on,R9 as rn,Ra as ln,Rb as mn,Rc as cn,Rd as dn,Qh as un,FU as pn,FY as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LY as Rn,cQ as yn,cT as An,cS as vn,cz as kn}from"./zeni-epic-state-DcOrwCh7.js";import{A as Ge,Z as Ze,Q as X,e as v,z as M,c0 as He,J as ee,f as k,aL as Ee,o as F,at as J,H as Cn,a as Ve,c1 as En,v as Z,$ as We,c2 as wn,I as te,c3 as xn,Y as Bn,D as Tn,y as ge,h as Ke,a8 as jn,bo as Fn,a3 as Dn,m as qe,c4 as Un,i as Ln}from"./index-BTYYfZaH.js";import{n as N,S as Pn}from"./mui-CblpH0Ha.js";import re from"./NotFoundScreen-6qASDiQT.js";import{S as we}from"./SetupPagesScreen-BMNyy9c9.js";import{F as Je}from"./FeaturePreviewScreen-WDFKDhR6.js";import{a as f}from"./sentry-BUYxAJ0R.js";import{u as he}from"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import{u as Ye}from"./useInitialThreadRequest-BoQP-jON.js";import{D as $n}from"./DrawerScreen-Bn7fJuoP.js";import{M as Xe}from"./MobileAppDrawer-eFjjhgJh.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DKDcC83F.js";import{FallBackRoute as _n}from"./ScreenRoutes-7YrD1RCk.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./analyticsHelper-D_xPTvv0.js";import"./routePaths-DxhKVAQu.js";import"./BusinessVerificationPageScreen--z9oIuUu.js";import"./ReimbursementApprovalRuleDetailScreen-C7g9vUNM.js";import"./getLocaleForTenant-DOJkec7u.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]="e7d8beff-8eda-4333-a3e1-d50cd7e6fae3",e._sentryDebugIdIdentifier="sentry-dbid-e7d8beff-8eda-4333-a3e1-d50cd7e6fae3")}catch{}})();const et=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ve.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ue(d),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:de(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ie(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ye(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ye("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Le()),e(At());const i=et(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Ue(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}})(En);function xe(){const e=W(),t=me(),n=H(),{reimbursementId:r}=Y(),d=Ge(),c=Ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=he({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),C=M.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ce(p,r)),L=Ye(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=de(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(je(!1,b,y,r)))});const $=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(C==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(z=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&z.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
1
+ import{j as s}from"./liveblocks-CsaY8yYO.js";import{h as W,u as me,g as H,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as E}from"./core-BoNEfvLs.js";import{eX as V,QL as ce,c6 as de,EH as je,kJ as dt,EU as se,ET as ie,QM as ut,bn as ue,gq as Fe,QN as pt,N8 as bt,ky as De,N9 as Re,Na as gt,jt as ht,Q2 as ft,jI as St,Ev as It,uc as Rt,jA as yt,Ff as Ue,QO as Le,QP as At,QQ as vt,QR as kt,QS as Ct,QT as Et,E$ as ye,jO as wt,Qb as xt,EV as Bt,EF as Tt,QU as jt,EE as Ft,QV as Dt,EN as Ae,F3 as Ut,F2 as Lt,E_ as Pt,QW as Pe,Ke as $t,bq as Mt,EQ as _t,Fx as Nt,QX as Ot,QY as Qt,Fb as zt,F8 as ve,Px as Gt,EC as Zt,QZ as $e,FZ as ke,G5 as Ht,Q_ as Vt,Q$ as G,R0 as Wt,R1 as Me,R2 as Kt,R3 as _e,R4 as Ne,Fn as oe,bu as qt,bK as pe,cG as be,fE as Oe,fC as Qe,R5 as Jt,fz as Yt,PK as Xt,R6 as en,R7 as ze,PO as tn,Qw as nn,R8 as an,QK as sn,G2 as Ce,G1 as on,R9 as rn,Ra as ln,Rb as mn,Rc as cn,Rd as dn,Qh as un,FU as pn,FY as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LY as Rn,cQ as yn,cT as An,cS as vn,cz as kn}from"./zeni-epic-state-DcOrwCh7.js";import{A as Ge,Z as Ze,Q as X,e as v,z as M,c0 as He,J as ee,f as k,aL as Ee,o as F,at as J,H as Cn,a as Ve,c1 as En,v as Z,$ as We,c2 as wn,I as te,c3 as xn,Y as Bn,D as Tn,y as ge,h as Ke,a8 as jn,bo as Fn,a3 as Dn,m as qe,c4 as Un,i as Ln}from"./index-BkGSE7D5.js";import{n as N,S as Pn}from"./mui-CblpH0Ha.js";import re from"./NotFoundScreen-BTmOJXuO.js";import{S as we}from"./SetupPagesScreen-C5uQEz7K.js";import{F as Je}from"./FeaturePreviewScreen-9qGkTofX.js";import{a as f}from"./sentry-BUYxAJ0R.js";import{u as he}from"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import{u as Ye}from"./useInitialThreadRequest-tlPkIpCr.js";import{D as $n}from"./DrawerScreen-enq1kex3.js";import{M as Xe}from"./MobileAppDrawer-CmiSBVZw.js";import{R as Mn}from"./ReimbursementApprovalRoutes-D7K2CtZa.js";import{FallBackRoute as _n}from"./ScreenRoutes-S4iuOC-S.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./analyticsHelper-Bq2cX6hw.js";import"./routePaths-DlT4djwo.js";import"./BusinessVerificationPageScreen-CxMuID_0.js";import"./ReimbursementApprovalRuleDetailScreen-Co6mqX7V.js";import"./getLocaleForTenant-B4Of7eQD.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]="e7d8beff-8eda-4333-a3e1-d50cd7e6fae3",e._sentryDebugIdIdentifier="sentry-dbid-e7d8beff-8eda-4333-a3e1-d50cd7e6fae3")}catch{}})();const et=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ve.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ue(d),m=r.plaidConnectionDetails,o=Fe(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ce(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:de(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ie(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ye(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ye("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(se({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Le()),e(At());const i=et(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Ue(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}})(En);function xe(){const e=W(),t=me(),n=H(),{reimbursementId:r}=Y(),d=Ge(),c=Ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=he({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),C=M.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ce(p,r)),L=Ye(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=de(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(je(!1,b,y,r)))});const $=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(C==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(z=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&z.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Ee,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ie(p,a,!0,r,C?.userId))},updateInvoiceUploadFetchState:p=>{t(se({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-CsaY8yYO.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BoNEfvLs.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as J,rH as A,km as Re,jq as Me,vc as K,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as Q,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Qe,fC as We}from"./zeni-epic-state-DcOrwCh7.js";import{U as Xe,V as Ze,W as Je,X as Ke,Z as ea,Q as ee,e as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,J as ra,f as P,h as ia,a0 as la,v as se,a1 as ca,a2 as da,a3 as pa}from"./index-BTYYfZaH.js";import"./mui-CblpH0Ha.js";import fa from"./NotFoundScreen-6qASDiQT.js";import{F as ma}from"./FeaturePreviewScreen-WDFKDhR6.js";import{a as _}from"./sentry-BUYxAJ0R.js";import{u as ua}from"./useInitialThreadRequest-BoQP-jON.js";import{t as W,a as X,b as _a}from"./routePaths-DxhKVAQu.js";import{M as ha}from"./MobileAppDrawer-eFjjhgJh.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="08ad8127-a9bf-46a9-89ba-02c51f6650f9",e._sentryDebugIdIdentifier="sentry-dbid-08ad8127-a9bf-46a9-89ba-02c51f6650f9")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled:J(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>J(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Ze(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=We(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-CsaY8yYO.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BoNEfvLs.js";import{eX as v,fT as w,Mp as Te,ky as Z,qS as J,rH as A,km as Re,jq as Me,vc as K,rM as Oe,bs as Ae,Mq as Fe,bn as ke,wl as De,Mr as Ee,Ms as je,v4 as Pe,Mt as Y,Mu as ve,Mv as Le,Mw as Be,Mx as Ve,My as I,Mz as F,MA as k,MB as q,MC as D,MD as E,dK as Ue,w1 as xe,vR as N,vS as $,w7 as ze,vW as Q,wd as Ge,ME as He,MF as Ye,MG as qe,MH as Ne,MI as $e,fE as Qe,fC as We}from"./zeni-epic-state-DcOrwCh7.js";import{U as Xe,V as Ze,W as Je,X as Ke,Z as ea,Q as ee,e as j,z as ae,Y as aa,I as sa,c as ta,_ as oa,$ as na,J as ra,f as P,h as ia,a0 as la,v as se,a1 as ca,a2 as da,a3 as pa}from"./index-BkGSE7D5.js";import"./mui-CblpH0Ha.js";import fa from"./NotFoundScreen-BTmOJXuO.js";import{F as ma}from"./FeaturePreviewScreen-9qGkTofX.js";import{a as _}from"./sentry-BUYxAJ0R.js";import{u as ua}from"./useInitialThreadRequest-tlPkIpCr.js";import{t as W,a as X,b as _a}from"./routePaths-DlT4djwo.js";import{M as ha}from"./MobileAppDrawer-CmiSBVZw.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="08ad8127-a9bf-46a9-89ba-02c51f6650f9",e._sentryDebugIdIdentifier="sentry-dbid-08ad8127-a9bf-46a9-89ba-02c51f6650f9")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(qe()),e(Ne()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Z(e),isAccountingProjectsEnabled:J(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(q({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>Z(n)),M=d(n=>J(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Ze(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=We(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-CsaY8yYO.js";import{Q as j,z as w,aR as y,J as E,f as p,h as F,d7 as P,e as T}from"./index-BTYYfZaH.js";import"./mui-CblpH0Ha.js";import m from"./NotFoundScreen-6qASDiQT.js";import{a as u}from"./sentry-BUYxAJ0R.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as f}from"./core-BoNEfvLs.js";import{eX as z,TD as C,PX as G,TE as v,vI as X,fK as Y,TF as J,vG as K}from"./zeni-epic-state-DcOrwCh7.js";import{R as x}from"./ReferralListScreen-DuTA8ZNx.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import"./MobileAppDrawer-eFjjhgJh.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]="a2f34c47-1650-4482-b036-92ac5b1cc031",a._sentryDebugIdIdentifier="sentry-dbid-a2f34c47-1650-4482-b036-92ac5b1cc031")}catch{}})();const O=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(K())},onUpdateInviteFormLocalData:s=>{a(J({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),Q=()=>{const a=L(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),I=G(k);u.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(X()),s(!0))},[]),u.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(Y(!0)))},[l.fetchState,a]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(O,{navigate:c,location:D,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function fa(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(f,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(f,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(f,{path:"refer/*",element:t?e.jsx(Q,{}):e.jsx(m,{})}),e.jsx(f,{path:"*",element:e.jsx(m,{})})]})}export{fa as default};
1
+ import{j as e}from"./liveblocks-CsaY8yYO.js";import{Q as j,z as w,aR as y,J as E,f as p,h as F,d7 as P,e as T}from"./index-BkGSE7D5.js";import"./mui-CblpH0Ha.js";import m from"./NotFoundScreen-BTmOJXuO.js";import{a as u}from"./sentry-BUYxAJ0R.js";import{u as L,j as b,h as R,g as V,n as A,o as U,p as f}from"./core-BoNEfvLs.js";import{eX as z,TD as C,PX as G,TE as v,vI as X,fK as Y,TF as J,vG as K}from"./zeni-epic-state-DcOrwCh7.js";import{R as x}from"./ReferralListScreen-CAuT5MkH.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import"./MobileAppDrawer-CmiSBVZw.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]="a2f34c47-1650-4482-b036-92ac5b1cc031",a._sentryDebugIdIdentifier="sentry-dbid-a2f34c47-1650-4482-b036-92ac5b1cc031")}catch{}})();const O=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(K())},onUpdateInviteFormLocalData:s=>{a(J({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),Q=()=>{const a=L(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=R(),D=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),I=G(k);u.useEffect(()=>{a(v()),r?.rewardsLastViewedTime==null&&i===!1&&(a(X()),s(!0))},[]),u.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(Y(!0)))},[l.fetchState,a]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(O,{navigate:c,location:D,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function fa(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(f,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(f,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(f,{path:"refer/*",element:t?e.jsx(Q,{}):e.jsx(m,{})}),e.jsx(f,{path:"*",element:e.jsx(m,{})})]})}export{fa as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Dveel7PM.js","assets/sentry-BUYxAJ0R.js","assets/core-BoNEfvLs.js","assets/zeni-epic-state-DcOrwCh7.js","assets/index-BTYYfZaH.js","assets/mui-CblpH0Ha.js","assets/analytics-ChMmdjNV.js","assets/utils-D-CJm-xs.js","assets/withTransactionSidePanel-IQKxlXVX.js","assets/useAskAiCfoHostNavButtonProps-CBG7z3tT.js","assets/TransactionDetailScreen-DxYq4JVW.js","assets/decodeURIComponentSafe-v7XwPgPo.js","assets/routePaths-DxhKVAQu.js","assets/NotFoundScreen-6qASDiQT.js","assets/useInitialThreadRequest-BoQP-jON.js","assets/analyticsHelper-D_xPTvv0.js","assets/CompanyPassportScreen-bzkzFMdg.js","assets/MobileAppDrawer-eFjjhgJh.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BWYRRRl-.js","assets/FeaturePreviewScreen-WDFKDhR6.js","assets/ReferralListScreen-DuTA8ZNx.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-Cj3rPF7j.js","assets/AddressScreen-BNnoxI42.js","assets/DomesticWireDetailScreen-lYOXV3jg.js","assets/DrawerScreen-Bn7fJuoP.js","assets/SetupPagesScreen-BMNyy9c9.js","assets/BusinessVerificationPageScreen--z9oIuUu.js","assets/BillPayApprovalRoutes-DZPEV8jE.js","assets/ReimbursementApprovalRuleDetailScreen-C7g9vUNM.js","assets/getLocaleForTenant-DOJkec7u.js","assets/ReimbursementRoutes-DT6ULuDS.js","assets/ReimbursementApprovalRoutes-DKDcC83F.js","assets/TransactionListRoutes-0JWLB9MV.js","assets/ZeniAccountStatementScreen-DW7NA-BZ.js","assets/SettingsRoutes-BILGacxq.js","assets/accountMappingHelper-talErUKy.js","assets/useEmailConnectResultRefresh-BOI-L6Xh.js","assets/QBOConnectionScreen-VPR245Vs.js","assets/empty-b5TFvQkm.js","assets/index-HOeFcz85.js","assets/url-SyvMap6d.js","assets/index-DM4yT559.js","assets/ReportsRoutes-UEATkQRA.js","assets/ChargeCardRoutes-BD5wy1XM.js","assets/useChargeCardPusherEvents-C5IaHrcj.js","assets/PeopleRoutes-CQe5mT0Q.js","assets/ExpenseAutomationRoutes-C_cBFDYx.js","assets/TreasuryRoutes-C7KBazk5.js","assets/useCashManagementBanner-DO-traME.js","assets/VendorsRoutes-vdMn6WBc.js","assets/pathToGoBack-j1V7r3Mn.js","assets/ZeniAccountRoutes-C9zOReRG.js","assets/AddressRoutes-DgtM3nxS.js","assets/PandLWithForecastRoutes-DFI-6LXP.js","assets/CustomerOnboardingRoutes-Cv0uxL5k.js","assets/TransactionDetailRoutes-CB__3R_j.js","assets/EntityDetailRoutes-DG2HbUDs.js","assets/NotificationRoutes-CMH_9nag.js","assets/PerformanceRoutes-C2kO5CvR.js","assets/RewardsRoutes-CDs_o_bR.js","assets/TaskRoutes-Dn0uto0H.js","assets/TaskListScreen-svrYmHZ7.js","assets/AiCfoScreen-CfF5p-2L.js","assets/CardsAiCfoScreen-DNag4rPx.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as as,eX as rs,fE as is,fC as os,gl as ls,fr as cs,cU as Ae,cA as ds,fU as us,cs as ms,bE as _s,bo as Es,fZ as ps,v as As,LX as hs,bs as gs,LY as xs,bK as Is,fW as Ts,bJ as js,bt as Rs,co as Us,LZ as bs,L_ as Ds,cQ as ys,cT as fs,cS as Cs,cz as Hs,cG as vs,oa as he,fA as ge,gv as Os,g1 as xe,gs as Ie,gt as Te,g2 as Ps}from"./zeni-epic-state-DcOrwCh7.js";import{j as e}from"./liveblocks-CsaY8yYO.js";import{a as v}from"./sentry-BUYxAJ0R.js";import{u as Fs,h as Ls,i as ks,g as Bs,j as G,l as je,N as c,o as Vs,p as a}from"./core-BoNEfvLs.js";import{m as Ss,u as Ns,z as b,Q as ws,c as Zs,d as Ms,e as B,i as zs,I as Gs,L as F,a as Re,t as _,P as $s,f as K,l}from"./index-BTYYfZaH.js";import"./mui-CblpH0Ha.js";import{f as Ue}from"./analyticsHelper-D_xPTvv0.js";import{t as Ys}from"./getLocaleForTenant-DOJkec7u.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="d12ddbae-3599-4eef-a3a2-1b0cda60a666",r._sentryDebugIdIdentifier="sentry-dbid-d12ddbae-3599-4eef-a3a2-1b0cda60a666")}catch{}})();const Ws={dashboard:()=>n(()=>import("./DashboardRoutes-Dveel7PM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-Cj3rPF7j.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-DT6ULuDS.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-0JWLB9MV.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-BILGacxq.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-UEATkQRA.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BD5wy1XM.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>n(()=>import("./PeopleRoutes-CQe5mT0Q.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-C_cBFDYx.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-C7KBazk5.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-vdMn6WBc.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-C9zOReRG.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-UEATkQRA.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Xs=l(()=>n(()=>import("./AddressRoutes-DgtM3nxS.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-CQe5mT0Q.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-DFI-6LXP.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-Cv0uxL5k.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-vdMn6WBc.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-CB__3R_j.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),be=l(()=>n(()=>import("./EntityDetailRoutes-DG2HbUDs.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),tn=l(()=>n(()=>import("./DashboardRoutes-Dveel7PM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>n(()=>import("./BillPayRoutes-Cj3rPF7j.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),an=l(()=>n(()=>import("./SettingsRoutes-BILGacxq.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>n(()=>import("./ReimbursementRoutes-DT6ULuDS.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-C9zOReRG.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-C7KBazk5.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-0JWLB9MV.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-BD5wy1XM.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-CMH_9nag.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),un=l(()=>n(()=>import("./PerformanceRoutes-C2kO5CvR.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mn=l(()=>n(()=>import("./ExpenseAutomationRoutes-C_cBFDYx.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-CDs_o_bR.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),En=l(()=>n(()=>import("./TaskRoutes-Dn0uto0H.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-CfF5p-2L.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>n(()=>import("./CardsAiCfoScreen-DNag4rPx.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>n(()=>import("./NotFoundScreen-6qASDiQT.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),An=l(()=>n(()=>import("./TaskListScreen-svrYmHZ7.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:r}){const j=Fs(),V=Ls(),{tenantEmailDomain:o}=ks(),S=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Ns(),f=b.getSignedInUserTenant(o)?.tenantId,I=b.getSignedInUser(),se=as(I),$=Bs(),[w,He]=v.useState(!1),i=G(t=>rs(t)),{useFeatureGate:L}=ws(),M=Zs(),ne=Ms(),{isFeatureEnabled:ve}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Oe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Pe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),R=G(t=>t.tenantState.fetchState),T=G(t=>t.tenantState.activeTenantFetchState.fetchState),E=T==="Completed"||R==="Completed"?is(te,i):void 0,Q=T==="Completed"||R==="Completed"?os(i):void 0,Fe=zs(i,Pe,te),{isFeatureEnabled:Le}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=L(B.isAiCfoFileUploadEnabled),Y=G(t=>ls(t));if(o!=null){const t=b.getSignedInUserTenant(o);I!=null&&t!=null&&Ue(I,i,S)}const z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),p=Gs(),ke=i.company==null||p?.loggedInUserRoleMap!=null&&Ae(p.loggedInUserRole),Be=ds(p?.loggedInUserRoleMap),re=v.useRef(!0),ie=je("/:tenantEmailDomain/onboarding/*")!==null,J=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(t=>z.tenantId!=null?us(t,z.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&f!=null){const t=J.params.selectedPeriod;if(t!=null){const U=t.split("-");if(U.length===2){const d=ms(Number(U[0])),s=Number(U[1]),u=_s(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();u.isAfter(Z,"month")===!1?j(ps(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,f]),v.useEffect(()=>{w||(He(!0),C(F.TENANT_FETCHING)),re.current?re.current=!1:!As(ae,z)&&b.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s){if(ge(U?.userId,U?.zeniSessionId,t.tenantId),d(Os(!0)),d(xe(t.tenantId)),t.tenantId!=null&&_.clearTenant(t.tenantId),t.tenantId!=null){const u=b.getSignedInUserTenantWithId(t.tenantId);s&&Re.updateAppLocaleID(Ys(s)),u?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}t.userId!=null?K.identify(t.userId,{tenant_id:t.tenantId}):K.resetUserIdentity()}(z,I,j,Ve))},[z,ae,I,j,b]),v.useEffect(()=>{b.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&u?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(W&&ss){k(xe(s));const q=b.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(u?.userId,u?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)))}else W&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),W&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)));if(W){K.identify(u.userId,{tenant_id:s});const q=s==null||s!=null&&(U==="Completed"||U==="Error");t==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ps(u.userId,s,u.zeniSessionId))),q&&(t==="Not-Started"||t==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(he(u.userId,u.zeniSessionId)))}}(R,T,i,f,I,C,j))},[f,T]),v.useEffect(()=>{b.isSignedIn()&&R==="Completed"&&Y.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),b.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),I!=null&&Ue(I,i,S,void 0,Y.tenantsBaseInOrder))},[Y,R,i,I]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):T==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?_.markAllTenantsFetchCompleted():R==="Error"&&_.markAllTenantsFetchFailed())},[T,R,f,w]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&T==="Completed"&&w&&(oe.current=!0,function(t=qs,U=3e3){setTimeout(()=>{const d=s=>{if(s>=t.length)return;const u=t[s],Z=Ws[u];Z!=null?Z().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&gs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_user"),we=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&Ae(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,ce=Fe&&!H,Ze=xs(p?.loggedInUserRoleMap),Me=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ue=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,me=ue&&Is(p?.loggedInUserRoleMap),_e=ve&&!H,ze=i.company!=null&&Ts(i.company),Ge=Oe&&ze===!0&&!H,$e=le&&js(p?.loggedInUserRoleMap),Ye=ce&&Rs(p?.loggedInUserRoleMap),We=_e&&Us(p?.loggedInUserRoleMap),qe=bs(p?.loggedInUserRoleMap),Qe=Ds(p?.loggedInUserRoleMap),A=ys(p?.loggedInUserRoleMap),h=fs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),g=Hs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),Ee=le&&g,pe=ue&&x,Je=_e&&A,Ke=Ge&&h,m=ce&&Xe,es=i.excludedResources?.resources?.find(t=>t.resource==="/invites")!=null||Be===!0||Ze===!0||qe===!0||Qe===!0;return b.isSignedIn()?f==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&R!=="In-Progress"&&j(he(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(de===!0||se&&!ie)&&Me===!1&&E===!1&&Q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||de!==!1||ie||se?w&&i?.userRole&&E!=null&&Q!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx($s,{}),children:[e.jsx(a,{path:"/",element:e.jsx(hn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(tn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Qs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"people/*",element:es||P?e.jsx(Js,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(a,{path:"transaction/*",element:P&&H===!1||Ne||we?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"transactions/*",element:P&&H===!1?e.jsx(ln,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"customer/*",element:P&&H===!1?e.jsx(be,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,isUserHasTreasuryAccess:h,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"vendor/*",element:P&&H===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"tasks",element:e.jsx(An,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(En,{})}),e.jsx(a,{path:"address/*",element:$e||me||We||Ye?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"checking/*",element:Je?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:Ke?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:ne===!0?e.jsx(un,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:ne===!0&&H===!1?e.jsx(mn,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(a,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(De,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(De,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"settings/*",element:Le?e.jsx(an,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(pn,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const hn=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):S?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):V?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:o,isTenantBankingOnly:S,showChargeCardRoute:C,tenantEmailDomain:O})=>S===!0||r?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):C?e.jsx(jn,{tenantEmailDomain:O}):j?e.jsx(xn,{tenantEmailDomain:O}):V?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(y,{}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),jn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),Ce=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{D as FallBackRoute,Nn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Ckr_4PFZ.js","assets/sentry-BUYxAJ0R.js","assets/core-BoNEfvLs.js","assets/zeni-epic-state-DcOrwCh7.js","assets/index-BkGSE7D5.js","assets/mui-CblpH0Ha.js","assets/analytics-ChMmdjNV.js","assets/utils-D-CJm-xs.js","assets/withTransactionSidePanel-D-rC67hx.js","assets/useAskAiCfoHostNavButtonProps-BNRHSSlT.js","assets/TransactionDetailScreen-D6QDGxGu.js","assets/decodeURIComponentSafe-v7XwPgPo.js","assets/routePaths-DlT4djwo.js","assets/NotFoundScreen-BTmOJXuO.js","assets/useInitialThreadRequest-tlPkIpCr.js","assets/analyticsHelper-Bq2cX6hw.js","assets/CompanyPassportScreen-3LH__AFc.js","assets/MobileAppDrawer-CmiSBVZw.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BOfvB1qP.js","assets/FeaturePreviewScreen-9qGkTofX.js","assets/ReferralListScreen-CAuT5MkH.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-BJdksoIS.js","assets/AddressScreen-DjHFWXZd.js","assets/DomesticWireDetailScreen-DZ8naknM.js","assets/DrawerScreen-enq1kex3.js","assets/SetupPagesScreen-C5uQEz7K.js","assets/BusinessVerificationPageScreen-CxMuID_0.js","assets/BillPayApprovalRoutes-5yoLyMdf.js","assets/ReimbursementApprovalRuleDetailScreen-Co6mqX7V.js","assets/getLocaleForTenant-B4Of7eQD.js","assets/ReimbursementRoutes-Dc6yhpRS.js","assets/ReimbursementApprovalRoutes-D7K2CtZa.js","assets/TransactionListRoutes-Bhdw74c5.js","assets/ZeniAccountStatementScreen-WWIAEGl-.js","assets/SettingsRoutes-Bo4skXXS.js","assets/accountMappingHelper-talErUKy.js","assets/useEmailConnectResultRefresh-C_KtOMfR.js","assets/QBOConnectionScreen-CXuCwnVv.js","assets/empty-b5TFvQkm.js","assets/index-HOeFcz85.js","assets/url-SyvMap6d.js","assets/index-DM4yT559.js","assets/ReportsRoutes-0B9PMrKM.js","assets/ChargeCardRoutes-ZORkbkMi.js","assets/useChargeCardPusherEvents-ek7O5vue.js","assets/PeopleRoutes-C4dcMrZ_.js","assets/ExpenseAutomationRoutes-CCWIfo0Y.js","assets/TreasuryRoutes-Tn0wVhtU.js","assets/useCashManagementBanner-BqwuaRBx.js","assets/VendorsRoutes-COmvFuAL.js","assets/pathToGoBack-j1V7r3Mn.js","assets/ZeniAccountRoutes-CteciRDO.js","assets/AddressRoutes-DVAWy_gb.js","assets/PandLWithForecastRoutes-CQW3cuEJ.js","assets/CustomerOnboardingRoutes-CGaSQM6e.js","assets/TransactionDetailRoutes-BaHmdvMt.js","assets/EntityDetailRoutes-1jh84Y19.js","assets/NotificationRoutes-DMjWy9uH.js","assets/PerformanceRoutes-C70AcB2c.js","assets/RewardsRoutes-BIy5lqI9.js","assets/TaskRoutes-8GtswDRs.js","assets/TaskListScreen-DF5lH-3k.js","assets/AiCfoScreen-Coov-9Lq.js","assets/CardsAiCfoScreen-7MbovH-h.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as as,eX as rs,fE as is,fC as os,gl as ls,fr as cs,cU as Ae,cA as ds,fU as us,cs as ms,bE as _s,bo as Es,fZ as ps,v as As,LX as hs,bs as gs,LY as xs,bK as Is,fW as Ts,bJ as js,bt as Rs,co as Us,LZ as bs,L_ as Ds,cQ as ys,cT as fs,cS as Cs,cz as Hs,cG as vs,oa as he,fA as ge,gv as Os,g1 as xe,gs as Ie,gt as Te,g2 as Ps}from"./zeni-epic-state-DcOrwCh7.js";import{j as e}from"./liveblocks-CsaY8yYO.js";import{a as v}from"./sentry-BUYxAJ0R.js";import{u as Fs,h as Ls,i as ks,g as Bs,j as G,l as je,N as c,o as Vs,p as a}from"./core-BoNEfvLs.js";import{m as Ss,u as Ns,z as b,Q as ws,c as Zs,d as Ms,e as B,i as zs,I as Gs,L as F,a as Re,t as _,P as $s,f as K,l}from"./index-BkGSE7D5.js";import"./mui-CblpH0Ha.js";import{f as Ue}from"./analyticsHelper-Bq2cX6hw.js";import{t as Ys}from"./getLocaleForTenant-B4Of7eQD.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new r.Error().stack;j&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[j]="d12ddbae-3599-4eef-a3a2-1b0cda60a666",r._sentryDebugIdIdentifier="sentry-dbid-d12ddbae-3599-4eef-a3a2-1b0cda60a666")}catch{}})();const Ws={dashboard:()=>n(()=>import("./DashboardRoutes-Ckr_4PFZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-BJdksoIS.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-Dc6yhpRS.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-Bhdw74c5.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-Bo4skXXS.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-0B9PMrKM.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-ZORkbkMi.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>n(()=>import("./PeopleRoutes-C4dcMrZ_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CCWIfo0Y.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-Tn0wVhtU.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-COmvFuAL.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-CteciRDO.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=r=>{"requestIdleCallback"in window?requestIdleCallback(r):setTimeout(r,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-0B9PMrKM.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Xs=l(()=>n(()=>import("./AddressRoutes-DVAWy_gb.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Js=l(()=>n(()=>import("./PeopleRoutes-C4dcMrZ_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),Ks=l(()=>n(()=>import("./PandLWithForecastRoutes-CQW3cuEJ.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),en=l(()=>n(()=>import("./CustomerOnboardingRoutes-CGaSQM6e.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),sn=l(()=>n(()=>import("./VendorsRoutes-COmvFuAL.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),nn=l(()=>n(()=>import("./TransactionDetailRoutes-BaHmdvMt.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),be=l(()=>n(()=>import("./EntityDetailRoutes-1jh84Y19.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),tn=l(()=>n(()=>import("./DashboardRoutes-Ckr_4PFZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>n(()=>import("./BillPayRoutes-BJdksoIS.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),an=l(()=>n(()=>import("./SettingsRoutes-Bo4skXXS.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>n(()=>import("./ReimbursementRoutes-Dc6yhpRS.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),rn=l(()=>n(()=>import("./ZeniAccountRoutes-CteciRDO.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),on=l(()=>n(()=>import("./TreasuryRoutes-Tn0wVhtU.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ln=l(()=>n(()=>import("./TransactionListRoutes-Bhdw74c5.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),cn=l(()=>n(()=>import("./ChargeCardRoutes-ZORkbkMi.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),dn=l(()=>n(()=>import("./NotificationRoutes-DMjWy9uH.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),un=l(()=>n(()=>import("./PerformanceRoutes-C70AcB2c.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),mn=l(()=>n(()=>import("./ExpenseAutomationRoutes-CCWIfo0Y.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_n=l(()=>n(()=>import("./RewardsRoutes-BIy5lqI9.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),En=l(()=>n(()=>import("./TaskRoutes-8GtswDRs.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),pn=l(()=>n(()=>import("./AiCfoScreen-Coov-9Lq.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>n(()=>import("./CardsAiCfoScreen-7MbovH-h.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>n(()=>import("./NotFoundScreen-BTmOJXuO.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),An=l(()=>n(()=>import("./TaskListScreen-DF5lH-3k.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Nn({setTenantEmailDomain:r}){const j=Fs(),V=Ls(),{tenantEmailDomain:o}=ks(),S=Ss().mode,{setLoading:C,clearAllLoading:O,clearLoading:N}=Ns(),f=b.getSignedInUserTenant(o)?.tenantId,I=b.getSignedInUser(),se=as(I),$=Bs(),[w,He]=v.useState(!1),i=G(t=>rs(t)),{useFeatureGate:L}=ws(),M=Zs(),ne=Ms(),{isFeatureEnabled:ve}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Oe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Pe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),R=G(t=>t.tenantState.fetchState),T=G(t=>t.tenantState.activeTenantFetchState.fetchState),E=T==="Completed"||R==="Completed"?is(te,i):void 0,Q=T==="Completed"||R==="Completed"?os(i):void 0,Fe=zs(i,Pe,te),{isFeatureEnabled:Le}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=L(B.isAiCfoFileUploadEnabled),Y=G(t=>ls(t));if(o!=null){const t=b.getSignedInUserTenant(o);I!=null&&t!=null&&Ue(I,i,S)}const z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ae=cs(),p=Gs(),ke=i.company==null||p?.loggedInUserRoleMap!=null&&Ae(p.loggedInUserRole),Be=ds(p?.loggedInUserRoleMap),re=v.useRef(!0),ie=je("/:tenantEmailDomain/onboarding/*")!==null,J=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ve=G(t=>z.tenantId!=null?us(t,z.tenantId):void 0);v.useEffect(()=>{C(F.TENANT_FETCHING),r(o)},[o]),v.useEffect(()=>{if(J!=null&&f!=null){const t=J.params.selectedPeriod;if(t!=null){const U=t.split("-");if(U.length===2){const d=ms(Number(U[0])),s=Number(U[1]),u=_s(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();u.isAfter(Z,"month")===!1?j(ps(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,f]),v.useEffect(()=>{w||(He(!0),C(F.TENANT_FETCHING)),re.current?re.current=!1:!As(ae,z)&&b.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s){if(ge(U?.userId,U?.zeniSessionId,t.tenantId),d(Os(!0)),d(xe(t.tenantId)),t.tenantId!=null&&_.clearTenant(t.tenantId),t.tenantId!=null){const u=b.getSignedInUserTenantWithId(t.tenantId);s&&Re.updateAppLocaleID(Ys(s)),u?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(u?.tenantEmailDomain)}t.userId!=null?K.identify(t.userId,{tenant_id:t.tenantId}):K.resetUserIdentity()}(z,I,j,Ve))},[z,ae,I,j,b]),v.useEffect(()=>{b.isSignedIn()&&(C(F.TENANT_FETCHING),function(t,U,d,s,u,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&u?.zeniSessionId!=null,ss=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(W&&ss){k(xe(s));const q=b.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(q?.tenantEmailDomain),ge(u?.userId,u?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)))}else W&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(u.userId,s))),W&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Te(u.userId,s)));if(W){K.identify(u.userId,{tenant_id:s});const q=s==null||s!=null&&(U==="Completed"||U==="Error");t==="Completed"||U!=="Not-Started"&&U!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ps(u.userId,s,u.zeniSessionId))),q&&(t==="Not-Started"||t==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(he(u.userId,u.zeniSessionId)))}}(R,T,i,f,I,C,j))},[f,T]),v.useEffect(()=>{b.isSignedIn()&&R==="Completed"&&Y.tenantsBaseInOrder.length>0&&(N(F.TENANT_FETCHING),b.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),I!=null&&Ue(I,i,S,void 0,Y.tenantsBaseInOrder))},[Y,R,i,I]),v.useEffect(()=>{T==="In-Progress"&&C(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):T==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),N(F.TENANT_FETCHING),N(F.TENANT_SWITCHING))),R!=="Completed"&&R!=="Error"||(R==="Completed"?_.markAllTenantsFetchCompleted():R==="Error"&&_.markAllTenantsFetchFailed())},[T,R,f,w]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&T==="Completed"&&w&&(oe.current=!0,function(t=qs,U=3e3){setTimeout(()=>{const d=s=>{if(s>=t.length)return;const u=t[s],Z=Ws[u];Z!=null?Z().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},U)}())},[T,w]);const H=i?.userRole!=null&&gs(i?.userRole),{isFeatureEnabled:Se}=L(B.isReferralFeatureEnabled),Ne=i?.userRole!=null&&i.userRole.includes("charge_card_user"),we=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),P=i?.userRole!=null&&Ae(i.userRole),le=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!H,ce=Fe&&!H,Ze=xs(p?.loggedInUserRoleMap),Me=i.externalConnections?.accounting[0]?.isValid,de=i.company?.companyOnboardingInfo.isOnboardingCompleted,ue=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!H,me=ue&&Is(p?.loggedInUserRoleMap),_e=ve&&!H,ze=i.company!=null&&Ts(i.company),Ge=Oe&&ze===!0&&!H,$e=le&&js(p?.loggedInUserRoleMap),Ye=ce&&Rs(p?.loggedInUserRoleMap),We=_e&&Us(p?.loggedInUserRoleMap),qe=bs(p?.loggedInUserRoleMap),Qe=Ds(p?.loggedInUserRoleMap),A=ys(p?.loggedInUserRoleMap),h=fs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),g=Hs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),Ee=le&&g,pe=ue&&x,Je=_e&&A,Ke=Ge&&h,m=ce&&Xe,es=i.excludedResources?.resources?.find(t=>t.resource==="/invites")!=null||Be===!0||Ze===!0||qe===!0||Qe===!0;return b.isSignedIn()?f==null?R==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&R!=="In-Progress"&&j(he(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||R==="Completed"?(de===!0||se&&!ie)&&Me===!1&&E===!1&&Q===!1?(r(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!w||de!==!1||ie||se?w&&i?.userRole&&E!=null&&Q!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Vs,{children:e.jsxs(a,{element:e.jsx($s,{}),children:[e.jsx(a,{path:"/",element:e.jsx(hn,{isDashboardAccess:P,isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(tn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(Qs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"people/*",element:es||P?e.jsx(Js,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(Ks,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(en,{})}),e.jsx(a,{path:"transaction/*",element:P&&H===!1||Ne||we?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"transactions/*",element:P&&H===!1?e.jsx(ln,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"customer/*",element:P&&H===!1?e.jsx(be,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,isUserHasTreasuryAccess:h,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"vendor/*",element:P&&H===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"tasks",element:e.jsx(An,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(En,{})}),e.jsx(a,{path:"address/*",element:$e||me||We||Ye?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"checking/*",element:Je?e.jsx(rn,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:Ke?e.jsx(on,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:ne===!0?e.jsx(un,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:ne===!0&&H===!1?e.jsx(mn,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(a,{path:"notifications/*",element:e.jsx(dn,{})}),e.jsx(a,{path:"vendors/*",element:ke?e.jsx(sn,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(De,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(De,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(ye,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(ye,{}):e.jsx(D,{isUserHasZeniAccountsAccess:A,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:h,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:o})}),e.jsx(a,{path:"settings/*",element:Le?e.jsx(an,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(fe,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Se?e.jsx(_n,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(pn,{isFileUploadEnabled:X}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(r(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),r(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const hn=({isDashboardAccess:r,isUserHasZeniAccountsAccess:j,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,isTenantCardsOnly:O,showChargeCardRoute:N})=>C===!0&&j?e.jsx(c,{to:"checking"}):O===!0&&N?e.jsx(c,{to:"cards"}):r?e.jsx(c,{to:"dashboard"}):j?e.jsx(c,{to:"checking"}):S?e.jsx(c,{to:"treasury"}):N?e.jsx(c,{to:"cards"}):V?e.jsx(c,{to:"bills"}):o?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:r,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:o,isTenantBankingOnly:S,showChargeCardRoute:C,tenantEmailDomain:O})=>S===!0||r?e.jsx(Tn,{tenantEmailDomain:O}):o?e.jsx(In,{tenantEmailDomain:O}):C?e.jsx(jn,{tenantEmailDomain:O}):j?e.jsx(xn,{tenantEmailDomain:O}):V?e.jsx(gn,{tenantEmailDomain:O}):e.jsx(y,{}),gn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/reimbursements`}),xn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/bills`}),In=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/treasury`}),Tn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/checking`}),jn=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/cards`}),Ce=({tenantEmailDomain:r})=>e.jsx(c,{to:`/${r}/dashboard`});export{D as FallBackRoute,Nn as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-CsaY8yYO.js";import{a as d}from"./sentry-BUYxAJ0R.js";import{h as z,g as Q,u as O,j as b,s as ce,n as $,i as G,o as W,p as k}from"./core-BoNEfvLs.js";import{bn as Pe,eX as D,gq as De,n0 as le,Og as Me,hG as he,O7 as Ue,qS as Te,ky as fe,mY as _e,hI as Fe,O9 as Oe,O8 as Re,Qy as Be,zj as Ve,EM as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as Qe,cM as $e,M7 as Ge,Qz as He,M8 as Ze,xL as Ke,QA as qe,Hb as Ye,Es as Je,Ej as be,Eg as Xe,xP as Se,Em as ye,Ep as Ce,Ev as te,uc as ae,xO as We,ka as Y,kd as Ie,QB as en,le as nn,y2 as tn,M$ as an,N0 as on,k8 as sn,QC as cn,kb as ln,rk as rn,MW as dn,MX as un,ro as pn,hr as gn,Mg as X,hj as re,hg as mn,ho as hn,Mh as fn,x$ as bn,QD as Sn,QE as yn,EJ as Cn,fC as Ee,fE as xe,QF as In,ge as En,Mq as xn,x_ as de,gj as ue,gi as An,xZ as vn,gh as kn,gg as wn,QG as jn,fH as Ae,QH as Pn,QI as Dn,y5 as Mn,xY as pe,QJ as Un,fY as Tn,xV as _n,bZ as Fn,c5 as On,c4 as Rn,b_ as Bn,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-DcOrwCh7.js";import{Q as J,e as F,z as P,af as ve,bS as $n,f as H,h as Gn,bD as Hn,I as Z,y as oe,bT as Zn,i as ke,bU as Kn,aq as qn,n as we,bV as Yn,bW as Jn,bX as Xn,Y as Wn,bY as et,v as nt,bZ as tt}from"./index-BTYYfZaH.js";import{n as B}from"./mui-CblpH0Ha.js";import{M as R}from"./MobileAppDrawer-eFjjhgJh.js";import{a as K,g as q,m as at}from"./accountMappingHelper-talErUKy.js";import{t as ot,A as st}from"./AddressScreen-BNnoxI42.js";import N from"./NotFoundScreen-6qASDiQT.js";import{g as it}from"./analyticsHelper-D_xPTvv0.js";import{B as ct}from"./BusinessVerificationPageScreen--z9oIuUu.js";import{C as lt}from"./CompanyPassportScreen-bzkzFMdg.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-BOI-L6Xh.js";import{q as ge}from"./QBOConnectionScreen-VPR245Vs.js";import{B as ut}from"./BillPayApprovalRoutes-DZPEV8jE.js";import{R as pt}from"./ReimbursementApprovalRoutes-DKDcC83F.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./routePaths-DxhKVAQu.js";import"./empty-b5TFvQkm.js";import"./pdf-lib-DMbxzmyG.js";import"./index-HOeFcz85.js";import"./url-SyvMap6d.js";import"./index-DM4yT559.js";import"./decodeURIComponentSafe-v7XwPgPo.js";import"./ReimbursementApprovalRuleDetailScreen-C7g9vUNM.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]="91e20577-a9bf-4b57-bdba-c109e17acf77",e._sentryDebugIdIdentifier="sentry-dbid-91e20577-a9bf-4b57-bdba-c109e17acf77")}catch{}})();const gt=B.div`
1
+ import{j as o}from"./liveblocks-CsaY8yYO.js";import{a as d}from"./sentry-BUYxAJ0R.js";import{h as z,g as Q,u as O,j as b,s as ce,n as $,i as G,o as W,p as k}from"./core-BoNEfvLs.js";import{bn as Pe,eX as D,gq as De,n0 as le,Og as Me,hG as he,O7 as Ue,qS as Te,ky as fe,mY as _e,hI as Fe,O9 as Oe,O8 as Re,Qy as Be,zj as Ve,EM as ze,Q7 as Le,Qg as Ne,c6 as ne,cL as Qe,cM as $e,M7 as Ge,Qz as He,M8 as Ze,xL as Ke,QA as qe,Hb as Ye,Es as Je,Ej as be,Eg as Xe,xP as Se,Em as ye,Ep as Ce,Ev as te,uc as ae,xO as We,ka as Y,kd as Ie,QB as en,le as nn,y2 as tn,M$ as an,N0 as on,k8 as sn,QC as cn,kb as ln,rk as rn,MW as dn,MX as un,ro as pn,hr as gn,Mg as X,hj as re,hg as mn,ho as hn,Mh as fn,x$ as bn,QD as Sn,QE as yn,EJ as Cn,fC as Ee,fE as xe,QF as In,ge as En,Mq as xn,x_ as de,gj as ue,gi as An,xZ as vn,gh as kn,gg as wn,QG as jn,fH as Ae,QH as Pn,QI as Dn,y5 as Mn,xY as pe,QJ as Un,fY as Tn,xV as _n,bZ as Fn,c5 as On,c4 as Rn,b_ as Bn,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-DcOrwCh7.js";import{Q as J,e as F,z as P,af as ve,bS as $n,f as H,h as Gn,bD as Hn,I as Z,y as oe,bT as Zn,i as ke,bU as Kn,aq as qn,n as we,bV as Yn,bW as Jn,bX as Xn,Y as Wn,bY as et,v as nt,bZ as tt}from"./index-BkGSE7D5.js";import{n as B}from"./mui-CblpH0Ha.js";import{M as R}from"./MobileAppDrawer-CmiSBVZw.js";import{a as K,g as q,m as at}from"./accountMappingHelper-talErUKy.js";import{t as ot,A as st}from"./AddressScreen-DjHFWXZd.js";import N from"./NotFoundScreen-BTmOJXuO.js";import{g as it}from"./analyticsHelper-Bq2cX6hw.js";import{B as ct}from"./BusinessVerificationPageScreen-CxMuID_0.js";import{C as lt}from"./CompanyPassportScreen-3LH__AFc.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-C_KtOMfR.js";import{q as ge}from"./QBOConnectionScreen-CXuCwnVv.js";import{B as ut}from"./BillPayApprovalRoutes-5yoLyMdf.js";import{R as pt}from"./ReimbursementApprovalRoutes-D7K2CtZa.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./routePaths-DlT4djwo.js";import"./empty-b5TFvQkm.js";import"./pdf-lib-DMbxzmyG.js";import"./index-HOeFcz85.js";import"./url-SyvMap6d.js";import"./index-DM4yT559.js";import"./decodeURIComponentSafe-v7XwPgPo.js";import"./ReimbursementApprovalRuleDetailScreen-Co6mqX7V.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]="91e20577-a9bf-4b57-bdba-c109e17acf77",e._sentryDebugIdIdentifier="sentry-dbid-91e20577-a9bf-4b57-bdba-c109e17acf77")}catch{}})();const gt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CsaY8yYO.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as B,n as W,t as en}from"./core-BoNEfvLs.js";import{bJ as nn,co as Ce,PX as ye,eX as V,cA as tn,zz as Q,zj as an,Q7 as sn,Qa as on,rD as te,rr as ae,l6 as ie,tK as L,Qc as Ie,gi as $e,gh as Ge,gg as We,Qd as cn,zI as rn,Es as Ae,Ej as ke,Eg as _e,D_ as X,Em as ve,Ep as Ee,Ev as Pe,uc as Te,gx as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qe as fn,C_ as le,DC as gn,Qf as Sn,bK as bn,FL as pe,EM as hn,Qg as Cn,Qh as In,FP as An,FT as kn,tD as _n,Kh as vn,Go as he,Ho as me,Qi as En,Qj as Pn,Qk as Tn,Ql as He,Qm as wn,MK as Dn,Pk as Un,MZ as On,Qn as Ke,E2 as Fn,M_ as Vn,E6 as xn,Qo as Oe,GK as qe,le as Bn,ru as Xe,tM as jn,bE as Re,tY as ze,cy as Rn,Qp as Je,fX as zn,G6 as Ln,Ga as Nn,Qq as Mn,Gr as Le,Qr as Zn,Qs as Qn,Qt as $n,Qu as Gn,gq as Wn,AT as Hn,Qv as Kn,AY as qn,AX as Xn}from"./zeni-epic-state-DcOrwCh7.js";import{I as se,Q as oe,e as q,m as we,aR as J,bD as Ye,z as U,J as ce,f as O,y as De,h as $,bE as Jn,at as re,bF as x,bG as Yn,bH as et,af as Be,bI as nt,v as Ne,au as Me,Z as tt,D as at,bJ as it,bK as st,bL as ot,a8 as ct}from"./index-BTYYfZaH.js";import{a as h}from"./sentry-BUYxAJ0R.js";import{n as Fe,D as rt,S as ut}from"./mui-CblpH0Ha.js";import{M as fe}from"./MobileAppDrawer-eFjjhgJh.js";import z from"./NotFoundScreen-6qASDiQT.js";import{a as Ze}from"./analyticsHelper-D_xPTvv0.js";import{d as Qe}from"./routePaths-DxhKVAQu.js";import{B as Ue}from"./BusinessVerificationPageScreen--z9oIuUu.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="8daa82f3-efc6-4fd1-b70b-8803a585e670",e._sentryDebugIdIdentifier="sentry-dbid-8daa82f3-efc6-4fd1-b70b-8803a585e670")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-CsaY8yYO.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as B,n as W,t as en}from"./core-BoNEfvLs.js";import{bJ as nn,co as Ce,PX as ye,eX as V,cA as tn,zz as Q,zj as an,Q7 as sn,Qa as on,rD as te,rr as ae,l6 as ie,tK as L,Qc as Ie,gi as $e,gh as Ge,gg as We,Qd as cn,zI as rn,Es as Ae,Ej as ke,Eg as _e,D_ as X,Em as ve,Ep as Ee,Ev as Pe,uc as Te,gx as un,cv as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qe as fn,C_ as le,DC as gn,Qf as Sn,bK as bn,FL as pe,EM as hn,Qg as Cn,Qh as In,FP as An,FT as kn,tD as _n,Kh as vn,Go as he,Ho as me,Qi as En,Qj as Pn,Qk as Tn,Ql as He,Qm as wn,MK as Dn,Pk as Un,MZ as On,Qn as Ke,E2 as Fn,M_ as Vn,E6 as xn,Qo as Oe,GK as qe,le as Bn,ru as Xe,tM as jn,bE as Re,tY as ze,cy as Rn,Qp as Je,fX as zn,G6 as Ln,Ga as Nn,Qq as Mn,Gr as Le,Qr as Zn,Qs as Qn,Qt as $n,Qu as Gn,gq as Wn,AT as Hn,Qv as Kn,AY as qn,AX as Xn}from"./zeni-epic-state-DcOrwCh7.js";import{I as se,Q as oe,e as q,m as we,aR as J,bD as Ye,z as U,J as ce,f as O,y as De,h as $,bE as Jn,at as re,bF as x,bG as Yn,bH as et,af as Be,bI as nt,v as Ne,au as Me,Z as tt,D as at,bJ as it,bK as st,bL as ot,a8 as ct}from"./index-BkGSE7D5.js";import{a as h}from"./sentry-BUYxAJ0R.js";import{n as Fe,D as rt,S as ut}from"./mui-CblpH0Ha.js";import{M as fe}from"./MobileAppDrawer-CmiSBVZw.js";import z from"./NotFoundScreen-BTmOJXuO.js";import{a as Ze}from"./analyticsHelper-Bq2cX6hw.js";import{d as Qe}from"./routePaths-DlT4djwo.js";import{B as Ue}from"./BusinessVerificationPageScreen-CxMuID_0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="8daa82f3-efc6-4fd1-b70b-8803a585e670",e._sentryDebugIdIdentifier="sentry-dbid-8daa82f3-efc6-4fd1-b70b-8803a585e670")}catch{}})();const dt=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-CsaY8yYO.js";import{a as u,b as M,q as T}from"./sentry-BUYxAJ0R.js";import{u as A,h as z,j as l,g as D,N as j,n as O}from"./core-BoNEfvLs.js";import{u as P,z as s,m as F,f as E,a as B,g as _,h as N,j as V,k as W,G as X,n as v}from"./index-BTYYfZaH.js";import{eX as Y,LW as $,LX as q,fA as G,g1 as J,M0 as H,gp as K,cY as Q,M1 as b,M2 as R,M3 as Z,bY as y}from"./zeni-epic-state-DcOrwCh7.js";import"./mui-CblpH0Ha.js";import{u as ee}from"./useDeviceId-LzGT5z98.js";import{f as te}from"./analyticsHelper-D_xPTvv0.js";import{t as ne}from"./getLocaleForTenant-DOJkec7u.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.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]="6aa4f04a-9ef1-4e86-978a-1b2f79c6406a",t._sentryDebugIdIdentifier="sentry-dbid-6aa4f04a-9ef1-4e86-978a-1b2f79c6406a")}catch{}})();const ae=O(function(t,a){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}=a;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}},function(t,a){const{location:d,navigate:g}=a;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,i)=>{T({message:`OAuth error from provider ${i} with error ${n}`,level:"error",tags:{authProvider:i,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,i)=>{const c=i==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:i,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:i}=a;i!=null&&(s.saveMagicLinkEmail(n),t(R(n,i)))},clearSignInError:()=>{t(b())}}})(X),ie=M.memo(ae);function ve({setTenantEmailDomain:t}){const a=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const i=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>Y(e)),I=l(e=>$(e)),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[h.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),a(J(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),a(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,a]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ie,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:i??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(V,{onClose:()=>a(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-CsaY8yYO.js";import{a as u,b as M,q as T}from"./sentry-BUYxAJ0R.js";import{u as A,h as z,j as l,g as D,N as j,n as O}from"./core-BoNEfvLs.js";import{u as P,z as s,m as F,f as E,a as B,g as _,h as N,j as V,k as W,G as X,n as v}from"./index-BkGSE7D5.js";import{eX as Y,LW as $,LX as q,fA as G,g1 as J,M0 as H,gp as K,cY as Q,M1 as b,M2 as R,M3 as Z,bY as y}from"./zeni-epic-state-DcOrwCh7.js";import"./mui-CblpH0Ha.js";import{u as ee}from"./useDeviceId-LzGT5z98.js";import{f as te}from"./analyticsHelper-Bq2cX6hw.js";import{t as ne}from"./getLocaleForTenant-B4Of7eQD.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.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]="6aa4f04a-9ef1-4e86-978a-1b2f79c6406a",t._sentryDebugIdIdentifier="sentry-dbid-6aa4f04a-9ef1-4e86-978a-1b2f79c6406a")}catch{}})();const ae=O(function(t,a){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}=a;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:i,magicLinkExpiredEmail:c}},function(t,a){const{location:d,navigate:g}=a;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,i)=>{T({message:`OAuth error from provider ${i} with error ${n}`,level:"error",tags:{authProvider:i,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,i)=>{const c=i==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:i,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:i}=a;i!=null&&(s.saveMagicLinkEmail(n),t(R(n,i)))},clearSignInError:()=>{t(b())}}})(X),ie=M.memo(ae);function ve({setTenantEmailDomain:t}){const a=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const i=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>Y(e)),I=l(e=>$(e)),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[h.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),a(J(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),a(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,a]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ie,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:i??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(V,{onClose:()=>a(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CsaY8yYO.js";import{a as f}from"./sentry-BUYxAJ0R.js";import{u,g as m,h as g,N as p}from"./core-BoNEfvLs.js";import{z as a,y,t as h,f as c,h as b}from"./index-BTYYfZaH.js";import{gu as x,gv as I,Mi as v}from"./zeni-epic-state-DcOrwCh7.js";import{n as w}from"./mui-CblpH0Ha.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.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]="145ff16f-008d-44cb-8cfb-028e405ff036",e._sentryDebugIdIdentifier="sentry-dbid-145ff16f-008d-44cb-8cfb-028e405ff036")}catch{}})();function q(){const e=u(),t=m(),i=g(),n=f.useRef(!1),d=a.isSignedIn(),r=t.state?.message==="logout",o=r||d;return f.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{a.clearAll(),e(x()),e(I(!1)),v(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(j,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const j=w.div`
1
+ import{j as s}from"./liveblocks-CsaY8yYO.js";import{a as f}from"./sentry-BUYxAJ0R.js";import{u,g as m,h as g,N as p}from"./core-BoNEfvLs.js";import{z as a,y,t as h,f as c,h as b}from"./index-BkGSE7D5.js";import{gu as x,gv as I,Mi as v}from"./zeni-epic-state-DcOrwCh7.js";import{n as w}from"./mui-CblpH0Ha.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.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]="145ff16f-008d-44cb-8cfb-028e405ff036",e._sentryDebugIdIdentifier="sentry-dbid-145ff16f-008d-44cb-8cfb-028e405ff036")}catch{}})();function q(){const e=u(),t=m(),i=g(),n=f.useRef(!1),d=a.isSignedIn(),r=t.state?.message==="logout",o=r||d;return f.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{a.clearAll(),e(x()),e(I(!1)),v(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(j,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const j=w.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-CsaY8yYO.js";import{a as b}from"./sentry-BUYxAJ0R.js";import{h as v,u as z,g as K,j as G,i as J,n as _}from"./core-BoNEfvLs.js";import{z as R,Q as M,e as p,$ as O,J as Q,f as V,h as W,da as Z,v as g,s as q}from"./index-BTYYfZaH.js";import{eX as H,TK as F,J3 as I,TL as x,TG as X,Ir as y,TM as Y,Iz as E,HV as aa,J4 as S,TN as B,fz as ea,IW as ta,I$ as sa,IO as oa,IM as w,J0 as na,IJ as ia,TO as la,TP as ra,TQ as ka,TR as ca,TS as T,ej as ua,TT as da,TU as pa}from"./zeni-epic-state-DcOrwCh7.js";import{n as Ta}from"./mui-CblpH0Ha.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import{M as ga}from"./MobileAppDrawer-eFjjhgJh.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.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]="3e281e39-b228-4be2-962a-b7c52923cf4e",e._sentryDebugIdIdentifier="sentry-dbid-3e281e39-b228-4be2-962a-b7c52923cf4e")}catch{}})();const fa=Ta.div`
1
+ import{j as d}from"./liveblocks-CsaY8yYO.js";import{a as b}from"./sentry-BUYxAJ0R.js";import{h as v,u as z,g as K,j as G,i as J,n as _}from"./core-BoNEfvLs.js";import{z as R,Q as M,e as p,$ as O,J as Q,f as V,h as W,da as Z,v as g,s as q}from"./index-BkGSE7D5.js";import{eX as H,TK as F,J3 as I,TL as x,TG as X,Ir as y,TM as Y,Iz as E,HV as aa,J4 as S,TN as B,fz as ea,IW as ta,I$ as sa,IO as oa,IM as w,J0 as na,IJ as ia,TO as la,TP as ra,TQ as ka,TR as ca,TS as T,ej as ua,TT as da,TU as pa}from"./zeni-epic-state-DcOrwCh7.js";import{n as Ta}from"./mui-CblpH0Ha.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import{M as ga}from"./MobileAppDrawer-CmiSBVZw.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.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]="3e281e39-b228-4be2-962a-b7c52923cf4e",e._sentryDebugIdIdentifier="sentry-dbid-3e281e39-b228-4be2-962a-b7c52923cf4e")}catch{}})();const fa=Ta.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-CsaY8yYO.js";import se from"./NotFoundScreen-6qASDiQT.js";import{a as l}from"./sentry-BUYxAJ0R.js";import{h as M,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as le,p as g}from"./core-BoNEfvLs.js";import{I6 as Z,I9 as ce,I3 as de,eX as H,TG as J,In as Q,I0 as pe,IT as ue,IM as ke,TH as K,TI as V,HY as me,HV as ge,rD as fe,rr as he,l6 as Ie,Ih as Se,TJ as Te,Iy as be,Iv as Ee,Ic as Ge,Is as Ce,Ir as De}from"./zeni-epic-state-DcOrwCh7.js";import{z as C,d8 as xe,A as ye,Q as je,e as b,s as W,v as w,J as ve,f as z,h as we,d9 as Re,n as A,at as Fe}from"./index-BTYYfZaH.js";import{n as Be}from"./mui-CblpH0Ha.js";import{u as Pe}from"./useInitialThreadRequest-BoQP-jON.js";import{M as Ue}from"./MobileAppDrawer-eFjjhgJh.js";import Le from"./TaskListScreen-svrYmHZ7.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./useAskAiCfoHostNavButtonProps-CBG7z3tT.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]="995b98a7-a614-4634-891a-387a0d26b138",e._sentryDebugIdIdentifier="sentry-dbid-995b98a7-a614-4634-891a-387a0d26b138")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),c=l.useCallback(()=>{t(Z())},[t]),k=l.useCallback((o,h,I)=>{t(ce({name:o,content:h,cannedResponseId:I}))},[t]),a=l.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:c,onSave:k})}let _,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=H(e),c=r.taskGroupId??u,k=c!=null?V(e.taskGroupState,c):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:c!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>V(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:c}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??c))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Q(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),c=f(i=>H(i)),k=Pe(c?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=l.useState(!1),[p,X]=l.useState(!1),[F,Y]=l.useState(!1),[B,ee]=l.useState(!1),[P,y]=l.useState(!1),T=l.useRef(!1),G=f(i=>i.taskListState.updateTasksFetchState.fetchState),U=f(i=>J(i)),L=f(i=>i.taskGroupViewState.fetchState);l.useEffect(()=>{p||(X(!0),t(Q(!1,r)))},[p,t]),l.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),l.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=l.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);l.useEffect(()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=c;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,G,c,s,e]);const $=f(i=>K(i,r)),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=c,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:c,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=Be.div`
1
+ import{j as n}from"./liveblocks-CsaY8yYO.js";import se from"./NotFoundScreen-BTmOJXuO.js";import{a as l}from"./sentry-BUYxAJ0R.js";import{h as M,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as le,p as g}from"./core-BoNEfvLs.js";import{I6 as Z,I9 as ce,I3 as de,eX as H,TG as J,In as Q,I0 as pe,IT as ue,IM as ke,TH as K,TI as V,HY as me,HV as ge,rD as fe,rr as he,l6 as Ie,Ih as Se,TJ as Te,Iy as be,Iv as Ee,Ic as Ge,Is as Ce,Ir as De}from"./zeni-epic-state-DcOrwCh7.js";import{z as C,d8 as xe,A as ye,Q as je,e as b,s as W,v as w,J as ve,f as z,h as we,d9 as Re,n as A,at as Fe}from"./index-BkGSE7D5.js";import{n as Be}from"./mui-CblpH0Ha.js";import{u as Pe}from"./useInitialThreadRequest-tlPkIpCr.js";import{M as Ue}from"./MobileAppDrawer-CmiSBVZw.js";import Le from"./TaskListScreen-DF5lH-3k.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./useAskAiCfoHostNavButtonProps-BNRHSSlT.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]="995b98a7-a614-4634-891a-387a0d26b138",e._sentryDebugIdIdentifier="sentry-dbid-995b98a7-a614-4634-891a-387a0d26b138")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),c=l.useCallback(()=>{t(Z())},[t]),k=l.useCallback((o,h,I)=>{t(ce({name:o,content:h,cannedResponseId:I}))},[t]),a=l.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:c,onSave:k})}let _,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=H(e),c=r.taskGroupId??u,k=c!=null?V(e.taskGroupState,c):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:c!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>V(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:c}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??c))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Q(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),c=f(i=>H(i)),k=Pe(c?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=l.useState(!1),[p,X]=l.useState(!1),[F,Y]=l.useState(!1),[B,ee]=l.useState(!1),[P,y]=l.useState(!1),T=l.useRef(!1),G=f(i=>i.taskListState.updateTasksFetchState.fetchState),U=f(i=>J(i)),L=f(i=>i.taskGroupViewState.fetchState);l.useEffect(()=>{p||(X(!0),t(Q(!1,r)))},[p,t]),l.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),l.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=l.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);l.useEffect(()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=c;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,G,c,s,e]);const $=f(i=>K(i,r)),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=c,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:c,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-CsaY8yYO.js";import i from"./NotFoundScreen-6qASDiQT.js";import{T as r}from"./TransactionDetailScreen-DxYq4JVW.js";import"./sentry-BUYxAJ0R.js";import{o as s,p as o}from"./core-BoNEfvLs.js";import"./zeni-epic-state-DcOrwCh7.js";import"./recharts-NoTYHO1X.js";import"./index-BTYYfZaH.js";import"./mui-CblpH0Ha.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import"./decodeURIComponentSafe-v7XwPgPo.js";import"./routePaths-DxhKVAQu.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-CsaY8yYO.js";import i from"./NotFoundScreen-BTmOJXuO.js";import{T as r}from"./TransactionDetailScreen-D6QDGxGu.js";import"./sentry-BUYxAJ0R.js";import{o as s,p as o}from"./core-BoNEfvLs.js";import"./zeni-epic-state-DcOrwCh7.js";import"./recharts-NoTYHO1X.js";import"./index-BkGSE7D5.js";import"./mui-CblpH0Ha.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import"./decodeURIComponentSafe-v7XwPgPo.js";import"./routePaths-DlT4djwo.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as x}from"./liveblocks-CsaY8yYO.js";import{a as i}from"./sentry-BUYxAJ0R.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-BoNEfvLs.js";import{nP as he,eX as Q,gq as Ze,Og as et,n0 as tt,mK as at,bn as nt,cU as Ee,bs as ve,rb as W,Nf as H,Oh as Ie,Oi as oe,NF as De,kJ as Ce,Oj as ke,NK as se,NL as ce,ly as Ae,Ka as ie,N9 as M,kD as Oe,kB as Ue,kN as ot,nC as st,Ok as ct,Ol as it,vp as Y,kI as xe,Jv as we,cZ as rt,c_ as lt,Om as dt,N8 as ut,On as mt,vl as pt,Oo as ft,Op as ht,Oq as yt,Or as St,Os as gt,kM as Tt,Ot as bt,Ou as Et,Na as vt,Ov as It,Ow as Dt,Ox as Ct,Jp as kt,Jf as At,JE as Ot,kO as Ut,Kb as ye,nH as xt}from"./zeni-epic-state-DcOrwCh7.js";import{Q as J,e as w,z as _e,aR as Pe,m as wt,Z as _t,aS as Pt,D as Ft,s as ae,I as Vt,aT as Bt,v as ne,$ as Nt,aU as Rt,f as Fe,aV as Lt,at as zt,a3 as te}from"./index-BTYYfZaH.js";import{n as Gt,S as jt,D as $t}from"./mui-CblpH0Ha.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import{d as Ve}from"./decodeURIComponentSafe-v7XwPgPo.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-DxhKVAQu.js";import{u as Ht}from"./utils-D-CJm-xs.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3a24396a-5271-46dc-ad61-d5b79b251212",t._sentryDebugIdIdentifier="sentry-dbid-3a24396a-5271-46dc-ad61-d5b79b251212")}catch{}})();function Jt(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Kt(t,e){const s=function(){const r=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,U=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),v=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?v[m]??null:null,j=i.useCallback(h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const L of u)if($.has(L.accountId)&&X[L.accountId]==null&&K?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[I]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),v(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),v(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=q(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
1
+ import{j as x}from"./liveblocks-CsaY8yYO.js";import{a as i}from"./sentry-BUYxAJ0R.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-BoNEfvLs.js";import{nP as he,eX as Q,gq as Ze,Og as et,n0 as tt,mK as at,bn as nt,cU as Ee,bs as ve,rb as W,Nf as H,Oh as Ie,Oi as oe,NF as De,kJ as Ce,Oj as ke,NK as se,NL as ce,ly as Ae,Ka as ie,N9 as M,kD as Oe,kB as Ue,kN as ot,nC as st,Ok as ct,Ol as it,vp as Y,kI as xe,Jv as we,cZ as rt,c_ as lt,Om as dt,N8 as ut,On as mt,vl as pt,Oo as ft,Op as ht,Oq as yt,Or as St,Os as gt,kM as Tt,Ot as bt,Ou as Et,Na as vt,Ov as It,Ow as Dt,Ox as Ct,Jp as kt,Jf as At,JE as Ot,kO as Ut,Kb as ye,nH as xt}from"./zeni-epic-state-DcOrwCh7.js";import{Q as J,e as w,z as _e,aR as Pe,m as wt,Z as _t,aS as Pt,D as Ft,s as ae,I as Vt,aT as Bt,v as ne,$ as Nt,aU as Rt,f as Fe,aV as Lt,at as zt,a3 as te}from"./index-BkGSE7D5.js";import{n as Gt,S as jt,D as $t}from"./mui-CblpH0Ha.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import{d as Ve}from"./decodeURIComponentSafe-v7XwPgPo.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-DlT4djwo.js";import{u as Ht}from"./utils-D-CJm-xs.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3a24396a-5271-46dc-ad61-d5b79b251212",t._sentryDebugIdIdentifier="sentry-dbid-3a24396a-5271-46dc-ad61-d5b79b251212")}catch{}})();function Jt(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Kt(t,e){const s=function(){const r=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,U=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),v=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?v[m]??null:null,j=i.useCallback(h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const L of u)if($.has(L.accountId)&&X[L.accountId]==null&&K?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[I]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),v(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),v(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=q(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CsaY8yYO.js";import{h as Q,g as H,u as X,i as U,j as S,N as z,n as Z,o as ve,p as j}from"./core-BoNEfvLs.js";import{eX as K,qS as W,jX as u,RG as ee,K1 as De,bo as le,RH as be,ky as te,NH as ae,RI as ue,RJ as Pe,bE as Y,JZ as ye,RK as Ee,RL as me,RM as je,K0 as Ae,RN as xe,RO as pe,RP as Me,RQ as ge,RR as Le,RS as Ce,RT as fe,Ld as Be}from"./zeni-epic-state-DcOrwCh7.js";import{a as de,Q as ne,e as q,f as G,cp as ce,v as V,s as oe,Y as Fe,d as Oe}from"./index-BTYYfZaH.js";import"./mui-CblpH0Ha.js";import{a as g}from"./sentry-BUYxAJ0R.js";import{w as se}from"./withTransactionSidePanel-IQKxlXVX.js";import{p as ie,c as re}from"./routePaths-DxhKVAQu.js";import{v as Re}from"./utils-D-CJm-xs.js";import{d as b}from"./decodeURIComponentSafe-v7XwPgPo.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DW7NA-BZ.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import"./TransactionDetailScreen-DxYq4JVW.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="98e644de-189e-4e90-9a13-b9dbf763a822",a._sentryDebugIdIdentifier="sentry-dbid-98e644de-189e-4e90-9a13-b9dbf763a822")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ne(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),N=se(function({...a}){const e=Q(),t=H(),n=X(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=U(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=S(r=>W(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}},[o,y,h,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=Z(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Ve(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=Z(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Xe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=U(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(v=>K(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=S(v=>W(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,h,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=H().state?.referrer,e=S(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[S(n=>K(n)).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
1
+ import{j as s}from"./liveblocks-CsaY8yYO.js";import{h as Q,g as H,u as X,i as U,j as S,N as z,n as Z,o as ve,p as j}from"./core-BoNEfvLs.js";import{eX as K,qS as W,jX as u,RG as ee,K1 as De,bo as le,RH as be,ky as te,NH as ae,RI as ue,RJ as Pe,bE as Y,JZ as ye,RK as Ee,RL as me,RM as je,K0 as Ae,RN as xe,RO as pe,RP as Me,RQ as ge,RR as Le,RS as Ce,RT as fe,Ld as Be}from"./zeni-epic-state-DcOrwCh7.js";import{a as de,Q as ne,e as q,f as G,cp as ce,v as V,s as oe,Y as Fe,d as Oe}from"./index-BkGSE7D5.js";import"./mui-CblpH0Ha.js";import{a as g}from"./sentry-BUYxAJ0R.js";import{w as se}from"./withTransactionSidePanel-D-rC67hx.js";import{p as ie,c as re}from"./routePaths-DlT4djwo.js";import{v as Re}from"./utils-D-CJm-xs.js";import{d as b}from"./decodeURIComponentSafe-v7XwPgPo.js";import{Z as Ge}from"./ZeniAccountStatementScreen-WWIAEGl-.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import"./TransactionDetailScreen-D6QDGxGu.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="98e644de-189e-4e90-9a13-b9dbf763a822",a._sentryDebugIdIdentifier="sentry-dbid-98e644de-189e-4e90-9a13-b9dbf763a822")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ne(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),N=se(function({...a}){const e=Q(),t=H(),n=X(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=U(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=S(r=>W(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}},[o,y,h,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=Z(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Ve(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=Z(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Xe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=U(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(v=>K(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=S(v=>W(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,h,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=H().state?.referrer,e=S(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[S(n=>K(n)).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-CsaY8yYO.js";import{h as U,g as B,u as P,i as O,j as y,N as L,n as N,o as we,p as k}from"./core-BoNEfvLs.js";import{cp as G,eX as D,Qp as R,Go as ae,fX as q,G6 as ne,Qr as Ie,Gr as ke,Qn as be,Qo as se,QE as je,Ev as Ee,uc as Ae,Qt as ve,GK as De,Qq as re,cT as Z,ys as oe,fC as Fe,fE as Le,RD as Ue,RE as Be,G7 as Pe,RF as Re,G8 as Me,Gh as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as $e,fW as ze,bt as Qe,LY as qe,cn as Ze}from"./zeni-epic-state-DcOrwCh7.js";import{I as _,aq as He,z as E,J as $,f as b,ci as Ke,cj as Je,ck as Q,Z as H,m as We,Y as Xe,$ as Ye,Q as ie,e as A,D as et,y as tt,cl as at,at as K,v as nt,cm as st,s as J,cn as rt,F as X,co as ot,i as it}from"./index-BTYYfZaH.js";import{D as ct,n as M,S as lt}from"./mui-CblpH0Ha.js";import ut from"./NotFoundScreen-6qASDiQT.js";import{S as Y}from"./SetupPagesScreen-BMNyy9c9.js";import{a as p}from"./sentry-BUYxAJ0R.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-CBG7z3tT.js";import{u as pt}from"./useInitialThreadRequest-BoQP-jON.js";import{u as mt}from"./useCashManagementBanner-DO-traME.js";import{M as ce}from"./MobileAppDrawer-eFjjhgJh.js";import{F as ft}from"./FeaturePreviewScreen-WDFKDhR6.js";import{a as ee}from"./analyticsHelper-D_xPTvv0.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./routePaths-DxhKVAQu.js";import"./BusinessVerificationPageScreen--z9oIuUu.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]="ec6644a1-2266-42bd-83c7-b4780d13d710",t._sentryDebugIdIdentifier="sentry-dbid-ec6644a1-2266-42bd-83c7-b4780d13d710")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ke);function gt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
1
+ import{j as e}from"./liveblocks-CsaY8yYO.js";import{h as U,g as B,u as P,i as O,j as y,N as L,n as N,o as we,p as k}from"./core-BoNEfvLs.js";import{cp as G,eX as D,Qp as R,Go as ae,fX as q,G6 as ne,Qr as Ie,Gr as ke,Qn as be,Qo as se,QE as je,Ev as Ee,uc as Ae,Qt as ve,GK as De,Qq as re,cT as Z,ys as oe,fC as Fe,fE as Le,RD as Ue,RE as Be,G7 as Pe,RF as Re,G8 as Me,Gh as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as $e,fW as ze,bt as Qe,LY as qe,cn as Ze}from"./zeni-epic-state-DcOrwCh7.js";import{I as _,aq as He,z as E,J as $,f as b,ci as Ke,cj as Je,ck as Q,Z as H,m as We,Y as Xe,$ as Ye,Q as ie,e as A,D as et,y as tt,cl as at,at as K,v as nt,cm as st,s as J,cn as rt,F as X,co as ot,i as it}from"./index-BkGSE7D5.js";import{D as ct,n as M,S as lt}from"./mui-CblpH0Ha.js";import ut from"./NotFoundScreen-BTmOJXuO.js";import{S as Y}from"./SetupPagesScreen-C5uQEz7K.js";import{a as p}from"./sentry-BUYxAJ0R.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-BNRHSSlT.js";import{u as pt}from"./useInitialThreadRequest-tlPkIpCr.js";import{u as mt}from"./useCashManagementBanner-BqwuaRBx.js";import{M as ce}from"./MobileAppDrawer-CmiSBVZw.js";import{F as ft}from"./FeaturePreviewScreen-9qGkTofX.js";import{a as ee}from"./analyticsHelper-Bq2cX6hw.js";import"./recharts-NoTYHO1X.js";import"./analytics-ChMmdjNV.js";import"./plaid-74upgTWR.js";import"./dnd-DvJtEb2B.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbDVmnvZ.js";import"./lexical-D_KbwLmW.js";import"./pdf-D2egRSjc.js";import"./utils-D-CJm-xs.js";import"./routePaths-DlT4djwo.js";import"./BusinessVerificationPageScreen-CxMuID_0.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]="ec6644a1-2266-42bd-83c7-b4780d13d710",t._sentryDebugIdIdentifier="sentry-dbid-ec6644a1-2266-42bd-83c7-b4780d13d710")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ke);function gt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;