@zeniai/web-app-ui 5.1.51-dev → 5.1.51-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 (62) hide show
  1. package/dist/assets/{AddressRoutes-Ce-3Jhw7.js → AddressRoutes-gPXkxz7s.js} +1 -1
  2. package/dist/assets/{AddressScreen-BUUFD2sw.js → AddressScreen-DHENiPsE.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BNnlPT55.js → AiCfoScreen-BDeqJ8PX.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CInNrMhS.js → BillPayApprovalRoutes-re8xxMBE.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DRVXy7kE.js → BillPayRoutes-BKu8tYXF.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-Cz8yHsjg.js → BusinessVerificationPageScreen-7ydI8UR9.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-CaiLWTLU.js → CardsAiCfoScreen-QyowC-mN.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BneUma9C.js → ChargeCardRoutes-BbZEL-b5.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-DWoq6mXR.js → CompanyPassportScreen-AZhDXSZE.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-CT8-mjmO.js → ConnectionAuthScreen-DDij7-L5.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-Bvb-H6kB.js → CustomerOnboardingAuthScreen-DO3NyaR6.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-evT_peP3.js → CustomerOnboardingRoutes-COHKYeEq.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-BWyE-0Hc.js → DashboardRoutes-B1cE2wJc.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-DHX37VDX.js → DefaultTenantHome-DivCz85L.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-CiuugoEE.js → DomesticWireDetailScreen-Bx2DINVR.js} +1 -1
  16. package/dist/assets/{DrawerScreen-DzI09EaZ.js → DrawerScreen-BtLrlXnn.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-C5vKBtdx.js → EntityDetailRoutes-CTo7No6n.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-QRseaMBK.js → ExpenseAutomationRoutes-pmgLYKV-.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-LQn2_3HO.js → FeaturePreviewScreen-9NvuDbvP.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BeylWL-h.js → HubSpotOAuthCallbackScreen-BrjX8V0E.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-BSczbLrK.js → MagicLinkRoutes-Dn4g326h.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-Dd8yoUFv.js → MagicLinkSignInScreen-CTkVv0M2.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-Dos6aPiF.js → MobileAppDrawer-CjoW3Rax.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-DhKhgQXf.js → NotFoundScreen-FcrdBNP0.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-Di4tIjQV.js → NotificationRoutes-DE-Z8DSv.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-BAC_yIQg.js → OAuthConsentScreen-Swpq9wju.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-C8hCBik3.js → PandLWithForecastRoutes-C3Yczwgv.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-9gxadS-C.js → PeopleRoutes-ZidIbEdd.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-CATOeT7z.js → PerformanceRoutes-VzYGFOXy.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-D9SI3hOs.js → QBOConnectionScreen-B8QVReQm.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-CYFKfVX3.js → ReferralListScreen-Cnd7u4T9.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-BzPo26FL.js → ReimbursementApprovalRoutes-DOhkjING.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Dq4iE7Qu.js → ReimbursementApprovalRuleDetailScreen-BgYFphfr.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DQ5VSfjH.js → ReimbursementRoutes-BeD0lwna.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-Bx4klC09.js → ReportsRoutes-CPI-jy1F.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-Cd5tFxOd.js → RewardsRoutes-Vdol6ACr.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-BRlfVBVN.js → ScreenRoutes-B24ySlpK.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-Cl1dDHc6.js → SettingsRoutes-D7qVKl5_.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-CV2uB6tM.js → SetupPagesScreen-DtddTp_T.js} +1 -1
  40. package/dist/assets/{SignInScreen-BovmFV_F.js → SignInScreen-u3NwSgsj.js} +1 -1
  41. package/dist/assets/{SignOutScreen-BG35SYwp.js → SignOutScreen-Djs9TXWR.js} +1 -1
  42. package/dist/assets/{TaskListScreen-D3R7s1AA.js → TaskListScreen-DMgU1v4z.js} +1 -1
  43. package/dist/assets/{TaskRoutes-B4YKOfNB.js → TaskRoutes-Cmtr7KFm.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-DYnfzuyZ.js → TransactionDetailRoutes-CjrDVjtT.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-DCUgWZCw.js → TransactionDetailScreen-ABqf1zzA.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-D69NliNs.js → TransactionListRoutes-uZihQK3F.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-D9fs3Ecf.js → TreasuryRoutes-ZtY_hGM6.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-B5vPHlE6.js → VendorsRoutes-DcUkIEvd.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-BXGKMLxP.js → WiseConfirmationScreen-DYcjQlfc.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-FlMIOWJK.js → ZeniAccountRoutes-Cbm2k-08.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-BM5LaChl.js → ZeniAccountStatementScreen-Ciuw5n7i.js} +1 -1
  52. package/dist/assets/{analyticsHelper-DvY5NpaM.js → analyticsHelper-CvGdvadP.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-Cwvzl8db.js → getLocaleForTenant-CAvD8CfA.js} +1 -1
  54. package/dist/assets/{index-CKi6vsOO.js → index-W83PhAZh.js} +5 -5
  55. package/dist/assets/{routePaths-DnD95y3h.js → routePaths-stnXzrYV.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CjSpjUTS.js → useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-vLqybwHr.js → useAskAiCfoHostNavButtonProps-DAlpTVgV.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-CrBaeOUK.js → useCashManagementBanner-D8slgHwh.js} +1 -1
  59. package/dist/assets/{useInitialThreadRequest-BqamPVgS.js → useInitialThreadRequest-BDAn-AM4.js} +1 -1
  60. package/dist/assets/{withTransactionSidePanel-Ak3Soyd6.js → withTransactionSidePanel-B9fglQqM.js} +1 -1
  61. package/dist/index.html +1 -1
  62. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DvKPzrwo.js";import{h as V,u as re,g as H,i as Y,j as E,N as _,n as J,l as mt,o as ct,p as C}from"./core-CQnSJ9vO.js";import{eW as Z,Qh as le,c7 as me,Ej as Be,kD as dt,Ew as ne,Ev as ae,Qi as ut,bn as ce,go as Te,Qj as pt,ME as bt,ks as je,MF as Se,MG as gt,jn as ht,Px as ft,jC as St,E7 as It,t_ as yt,ju as Rt,ET as De,Qk as Fe,Ql as At,Qm as kt,Qn as vt,Qo as Ct,Qp as Et,ED as Ie,jI as wt,PG as xt,Ex as Bt,Eh as Tt,Qq as jt,Eg as Dt,Qr as Ft,Ep as ye,EH as Ut,EG as Lt,EC as Pt,Qs as Ue,JS as $t,bo as Mt,Es as _t,Fc as Qt,Qt as Nt,Qu as Ot,EP as Gt,EM as Re,P0 as zt,Ee as Ht,Qv as Le,FB as Ae,FJ as Zt,Qw as Wt,Qx as G,Qy as Vt,Qz as Pe,QA as Jt,QB as $e,QC as Me,E$ as se,bu as qt,bK as de,cH as ue,fe as _e,fc as Qe,QD as Kt,f9 as Yt,Pd as Xt,QE as en,QF as Ne,Ph as tn,P$ as nn,QG as an,Qg as sn,FG as ke,FF as on,QH as rn,QI as ln,QJ as mn,QK as cn,QL as dn,PM as un,Fw as pn,FA as bn,bt as gn,bJ as hn,cB as fn,cp as Sn,bs as In,LA as yn,cR as Rn,cT as An,cS as kn,cA as vn}from"./zeni-epic-state-DKeO4Z0C.js";import{W as Oe,K as Ge,H as X,x as k,z as $,bY as ze,w as ee,c as v,aH as ve,o as D,at as K,C as Cn,D as He,bZ as En,r as z,_ as Ze,b_ as wn,j as te,b$ as xn,Y as Bn,A as Tn,B as pe,e as We,a7 as jn,bk as Dn,a2 as Fn,m as Ve,c0 as Un,a9 as Ln}from"./index-CKi6vsOO.js";import{n as Q,S as Pn}from"./mui-sKCdI-e6.js";import ie from"./NotFoundScreen-DhKhgQXf.js";import{S as Ce}from"./SetupPagesScreen-CV2uB6tM.js";import{F as Je}from"./FeaturePreviewScreen-LQn2_3HO.js";import{a as f}from"./sentry-Be8twC83.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import{u as qe}from"./useInitialThreadRequest-BqamPVgS.js";import{D as $n}from"./DrawerScreen-DzI09EaZ.js";import{M as Ke}from"./MobileAppDrawer-Dos6aPiF.js";import{R as Mn}from"./ReimbursementApprovalRoutes-BzPo26FL.js";import{FallBackRoute as _n}from"./ScreenRoutes-BRlfVBVN.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./analyticsHelper-DvY5NpaM.js";import"./routePaths-DnD95y3h.js";import"./BusinessVerificationPageScreen-Cz8yHsjg.js";import"./ReimbursementApprovalRuleDetailScreen-Dq4iE7Qu.js";import"./getLocaleForTenant-Cwvzl8db.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]="899c3e72-a19e-44ae-bc74-5dd4af178ccf",e._sentryDebugIdIdentifier="sentry-dbid-899c3e72-a19e-44ae-bc74-5dd4af178ccf")}catch{}})();const Ye=e=>`/${e}/reimbursements`,Qn=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:L}}}=He.getLocalizedStrings(),Nn=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${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:`${K.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:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!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(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(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(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ye(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=V(),t=re(),n=H(),{reimbursementId:r}=Y(),d=Oe(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(ze,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Qn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=Q.div`
1
+ import{j as s}from"./liveblocks-DvKPzrwo.js";import{h as V,u as re,g as H,i as Y,j as E,N as _,n as J,l as mt,o as ct,p as C}from"./core-CQnSJ9vO.js";import{eW as Z,Qh as le,c7 as me,Ej as Be,kD as dt,Ew as ne,Ev as ae,Qi as ut,bn as ce,go as Te,Qj as pt,ME as bt,ks as je,MF as Se,MG as gt,jn as ht,Px as ft,jC as St,E7 as It,t_ as yt,ju as Rt,ET as De,Qk as Fe,Ql as At,Qm as kt,Qn as vt,Qo as Ct,Qp as Et,ED as Ie,jI as wt,PG as xt,Ex as Bt,Eh as Tt,Qq as jt,Eg as Dt,Qr as Ft,Ep as ye,EH as Ut,EG as Lt,EC as Pt,Qs as Ue,JS as $t,bo as Mt,Es as _t,Fc as Qt,Qt as Nt,Qu as Ot,EP as Gt,EM as Re,P0 as zt,Ee as Ht,Qv as Le,FB as Ae,FJ as Zt,Qw as Wt,Qx as G,Qy as Vt,Qz as Pe,QA as Jt,QB as $e,QC as Me,E$ as se,bu as qt,bK as de,cH as ue,fe as _e,fc as Qe,QD as Kt,f9 as Yt,Pd as Xt,QE as en,QF as Ne,Ph as tn,P$ as nn,QG as an,Qg as sn,FG as ke,FF as on,QH as rn,QI as ln,QJ as mn,QK as cn,QL as dn,PM as un,Fw as pn,FA as bn,bt as gn,bJ as hn,cB as fn,cp as Sn,bs as In,LA as yn,cR as Rn,cT as An,cS as kn,cA as vn}from"./zeni-epic-state-DKeO4Z0C.js";import{W as Oe,K as Ge,H as X,x as k,z as $,bY as ze,w as ee,c as v,aH as ve,o as D,at as K,C as Cn,D as He,bZ as En,r as z,_ as Ze,b_ as wn,j as te,b$ as xn,Y as Bn,A as Tn,B as pe,e as We,a7 as jn,bk as Dn,a2 as Fn,m as Ve,c0 as Un,a9 as Ln}from"./index-W83PhAZh.js";import{n as Q,S as Pn}from"./mui-sKCdI-e6.js";import ie from"./NotFoundScreen-FcrdBNP0.js";import{S as Ce}from"./SetupPagesScreen-DtddTp_T.js";import{F as Je}from"./FeaturePreviewScreen-9NvuDbvP.js";import{a as f}from"./sentry-Be8twC83.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{u as qe}from"./useInitialThreadRequest-BDAn-AM4.js";import{D as $n}from"./DrawerScreen-BtLrlXnn.js";import{M as Ke}from"./MobileAppDrawer-CjoW3Rax.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DOhkjING.js";import{FallBackRoute as _n}from"./ScreenRoutes-B24ySlpK.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./analyticsHelper-CvGdvadP.js";import"./routePaths-stnXzrYV.js";import"./BusinessVerificationPageScreen-7ydI8UR9.js";import"./ReimbursementApprovalRuleDetailScreen-BgYFphfr.js";import"./getLocaleForTenant-CAvD8CfA.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]="899c3e72-a19e-44ae-bc74-5dd4af178ccf",e._sentryDebugIdIdentifier="sentry-dbid-899c3e72-a19e-44ae-bc74-5dd4af178ccf")}catch{}})();const Ye=e=>`/${e}/reimbursements`,Qn=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:L}}}=He.getLocalizedStrings(),Nn=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${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:`${K.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:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!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(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(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(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ye(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=V(),t=re(),n=H(),{reimbursementId:r}=Y(),d=Oe(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(ze,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Qn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=Q.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-DvKPzrwo.js";import{g as H,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-CQnSJ9vO.js";import{eW as v,ft as I,M1 as Te,ks as K,qN as W,rC as k,kg as Re,jk as Me,uZ as X,rH as Oe,bt as ke,M2 as Ae,bn as Fe,w6 as De,M3 as je,M4 as Ee,uR as Pe,M5 as Y,M6 as ve,M7 as Le,M8 as Be,M9 as Ue,Ma as w,Mb as A,Mc as F,Md as N,Me as D,Mf as j,dJ as Ve,vO as xe,vC as $,vD as q,vU as ze,vH as Z,v_ as He,Mg as Ge,Mh as Ye,Mi as Ne,Mj as $e,Mk as qe,fe as Ze,fc as Je}from"./zeni-epic-state-DKeO4Z0C.js";import{R as Qe,U as Ke,V as We,X as Xe,K as ea,H as ee,x as E,z as ae,Y as aa,j as sa,a as ta,Z as oa,_ as na,w as ra,c as P,e as ia,$ as la,r as se,a0 as ca,a1 as da,a2 as pa}from"./index-CKi6vsOO.js";import"./mui-sKCdI-e6.js";import fa from"./NotFoundScreen-DhKhgQXf.js";import{F as ma}from"./FeaturePreviewScreen-LQn2_3HO.js";import{a as _}from"./sentry-Be8twC83.js";import{u as ua}from"./useInitialThreadRequest-BqamPVgS.js";import{t as J,a as Q,b as _a}from"./routePaths-DnD95y3h.js";import{M as ha}from"./MobileAppDrawer-Dos6aPiF.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="80524c67-b951-4978-a2cf-c030d5e80e51",e._sentryDebugIdIdentifier="sentry-dbid-80524c67-b951-4978-a2cf-c030d5e80e51")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=we(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=I(e),r=Ae(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:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(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(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(He(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(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(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({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(Z(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($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(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=Ve(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 J(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(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?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?J(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(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({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(j({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(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({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(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("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(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=H(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.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),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>K(n)),M=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,L,C,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(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&ke(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=H(),z=Qe(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,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(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Je(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-DvKPzrwo.js";import{g as H,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-CQnSJ9vO.js";import{eW as v,ft as I,M1 as Te,ks as K,qN as W,rC as k,kg as Re,jk as Me,uZ as X,rH as Oe,bt as ke,M2 as Ae,bn as Fe,w6 as De,M3 as je,M4 as Ee,uR as Pe,M5 as Y,M6 as ve,M7 as Le,M8 as Be,M9 as Ue,Ma as w,Mb as A,Mc as F,Md as N,Me as D,Mf as j,dJ as Ve,vO as xe,vC as $,vD as q,vU as ze,vH as Z,v_ as He,Mg as Ge,Mh as Ye,Mi as Ne,Mj as $e,Mk as qe,fe as Ze,fc as Je}from"./zeni-epic-state-DKeO4Z0C.js";import{R as Qe,U as Ke,V as We,X as Xe,K as ea,H as ee,x as E,z as ae,Y as aa,j as sa,a as ta,Z as oa,_ as na,w as ra,c as P,e as ia,$ as la,r as se,a0 as ca,a1 as da,a2 as pa}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import fa from"./NotFoundScreen-FcrdBNP0.js";import{F as ma}from"./FeaturePreviewScreen-9NvuDbvP.js";import{a as _}from"./sentry-Be8twC83.js";import{u as ua}from"./useInitialThreadRequest-BDAn-AM4.js";import{t as J,a as Q,b as _a}from"./routePaths-stnXzrYV.js";import{M as ha}from"./MobileAppDrawer-CjoW3Rax.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="80524c67-b951-4978-a2cf-c030d5e80e51",e._sentryDebugIdIdentifier="sentry-dbid-80524c67-b951-4978-a2cf-c030d5e80e51")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=we(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=I(e),r=Ae(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:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(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(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(He(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(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(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({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(Z(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($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(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=Ve(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 J(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(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?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?J(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(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({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(j({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(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({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(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("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(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=H(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.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),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>K(n)),M=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,L,C,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(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&ke(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=H(),z=Qe(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,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(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Je(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-DvKPzrwo.js";import{H as w,z as j,aN as y,w as I,c as p,e as F,d5 as P,x as T}from"./index-CKi6vsOO.js";import"./mui-sKCdI-e6.js";import m from"./NotFoundScreen-DhKhgQXf.js";import{a as d}from"./sentry-Be8twC83.js";import{u as L,j as b,h as V,g as A,n as R,o as U,p as u}from"./core-CQnSJ9vO.js";import{eW as z,Ta as C,Pq as Y,Tb as v,vt as q,fk as G,Tc as H,vr as O}from"./zeni-epic-state-DKeO4Z0C.js";import{R as x}from"./ReferralListScreen-CYFKfVX3.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import"./MobileAppDrawer-Dos6aPiF.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]="e3d2dd7e-46d1-4edf-b5b4-6ad095456329",e._sentryDebugIdIdentifier="sentry-dbid-e3d2dd7e-46d1-4edf-b5b4-6ad095456329")}catch{}})();const W=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(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)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=w(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),k=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),N=Y(D);d.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(q()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(m,{})}),a.jsx(u,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
1
+ import{j as a}from"./liveblocks-DvKPzrwo.js";import{H as w,z as j,aN as y,w as I,c as p,e as F,d5 as P,x as T}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import m from"./NotFoundScreen-FcrdBNP0.js";import{a as d}from"./sentry-Be8twC83.js";import{u as L,j as b,h as V,g as A,n as R,o as U,p as u}from"./core-CQnSJ9vO.js";import{eW as z,Ta as C,Pq as Y,Tb as v,vt as q,fk as G,Tc as H,vr as O}from"./zeni-epic-state-DKeO4Z0C.js";import{R as x}from"./ReferralListScreen-Cnd7u4T9.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import"./MobileAppDrawer-CjoW3Rax.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]="e3d2dd7e-46d1-4edf-b5b4-6ad095456329",e._sentryDebugIdIdentifier="sentry-dbid-e3d2dd7e-46d1-4edf-b5b4-6ad095456329")}catch{}})();const W=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(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)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=w(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),k=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),N=Y(D);d.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(q()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(m,{})}),a.jsx(u,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BWyE-0Hc.js","assets/sentry-Be8twC83.js","assets/core-CQnSJ9vO.js","assets/zeni-epic-state-DKeO4Z0C.js","assets/index-CKi6vsOO.js","assets/mui-sKCdI-e6.js","assets/analytics-DoyQ8ezf.js","assets/utils-BcJ2NV01.js","assets/withTransactionSidePanel-Ak3Soyd6.js","assets/useAskAiCfoHostNavButtonProps-vLqybwHr.js","assets/TransactionDetailScreen-DCUgWZCw.js","assets/decodeURIComponentSafe-BprI0TcI.js","assets/routePaths-DnD95y3h.js","assets/NotFoundScreen-DhKhgQXf.js","assets/useInitialThreadRequest-BqamPVgS.js","assets/analyticsHelper-DvY5NpaM.js","assets/CompanyPassportScreen-DWoq6mXR.js","assets/MobileAppDrawer-Dos6aPiF.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CjSpjUTS.js","assets/FeaturePreviewScreen-LQn2_3HO.js","assets/ReferralListScreen-CYFKfVX3.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DRVXy7kE.js","assets/AddressScreen-BUUFD2sw.js","assets/DomesticWireDetailScreen-CiuugoEE.js","assets/DrawerScreen-DzI09EaZ.js","assets/SetupPagesScreen-CV2uB6tM.js","assets/BusinessVerificationPageScreen-Cz8yHsjg.js","assets/BillPayApprovalRoutes-CInNrMhS.js","assets/ReimbursementApprovalRuleDetailScreen-Dq4iE7Qu.js","assets/getLocaleForTenant-Cwvzl8db.js","assets/ReimbursementRoutes-DQ5VSfjH.js","assets/ReimbursementApprovalRoutes-BzPo26FL.js","assets/TransactionListRoutes-D69NliNs.js","assets/ZeniAccountStatementScreen-BM5LaChl.js","assets/SettingsRoutes-Cl1dDHc6.js","assets/accountMappingHelper-DDqSB3xQ.js","assets/QBOConnectionScreen-D9SI3hOs.js","assets/empty-DjW_4H8B.js","assets/index-BtlQ6O6E.js","assets/url-CuDHWvgT.js","assets/index-DgHQU_66.js","assets/ReportsRoutes-Bx4klC09.js","assets/ChargeCardRoutes-BneUma9C.js","assets/PeopleRoutes-9gxadS-C.js","assets/ExpenseAutomationRoutes-QRseaMBK.js","assets/TreasuryRoutes-D9fs3Ecf.js","assets/useCashManagementBanner-CrBaeOUK.js","assets/VendorsRoutes-B5vPHlE6.js","assets/pathToGoBack-DDBtlyQ4.js","assets/ZeniAccountRoutes-FlMIOWJK.js","assets/AddressRoutes-Ce-3Jhw7.js","assets/PandLWithForecastRoutes-C8hCBik3.js","assets/CustomerOnboardingRoutes-evT_peP3.js","assets/TransactionDetailRoutes-DYnfzuyZ.js","assets/EntityDetailRoutes-C5vKBtdx.js","assets/NotificationRoutes-Di4tIjQV.js","assets/PerformanceRoutes-CATOeT7z.js","assets/RewardsRoutes-Cd5tFxOd.js","assets/TaskRoutes-B4YKOfNB.js","assets/TaskListScreen-D3R7s1AA.js","assets/AiCfoScreen-BNnlPT55.js","assets/CardsAiCfoScreen-CaiLWTLU.js"])))=>i.map(i=>d[i]);
2
- import{_ as a,bn as ls,eW as cs,fe as ds,fc as ms,fd as us,gj as _s,f1 as Es,cU as Ae,cB as ps,fu as As,ct as xs,bE as gs,bq as Is,fz as Ts,v as js,Lz as hs,bt as Us,LA as bs,bK as Hs,fw as Rs,bJ as Ds,bs as ys,cp as fs,LB as Cs,LC as vs,cR as Os,cT as Ps,cS as Fs,cA as Ls,cH as Bs,o5 as xe,fa as ge,gt as ks,fD as Ie,gq as Te,gr as je,fE as Vs}from"./zeni-epic-state-DKeO4Z0C.js";import{j as e}from"./liveblocks-DvKPzrwo.js";import{a as v}from"./sentry-Be8twC83.js";import{u as Ss,h as Ns,i as Ms,g as Zs,j as G,l as he,N as c,o as ws,p as t}from"./core-CQnSJ9vO.js";import{m as zs,u as Gs,z as H,H as $s,a as qs,n as Ws,x as L,j as Ys,L as B,D as Ue,t as _,P as Js,c as se,l}from"./index-CKi6vsOO.js";import"./mui-sKCdI-e6.js";import{f as be}from"./analyticsHelper-DvY5NpaM.js";import{t as Ks}from"./getLocaleForTenant-Cwvzl8db.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="4ab867c1-c6b9-4e19-a61e-1c540c8daab2",i._sentryDebugIdIdentifier="sentry-dbid-4ab867c1-c6b9-4e19-a61e-1c540c8daab2")}catch{}})();const Qs={dashboard:()=>a(()=>import("./DashboardRoutes-BWyE-0Hc.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:()=>a(()=>import("./BillPayRoutes-DRVXy7kE.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:()=>a(()=>import("./ReimbursementRoutes-DQ5VSfjH.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:()=>a(()=>import("./TransactionListRoutes-D69NliNs.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-Cl1dDHc6.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-Bx4klC09.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BneUma9C.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21])),people:()=>a(()=>import("./PeopleRoutes-9gxadS-C.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-QRseaMBK.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-D9fs3Ecf.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-B5vPHlE6.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-FlMIOWJK.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},ea=l(()=>a(()=>import("./ReportsRoutes-Bx4klC09.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),sa=l(()=>a(()=>import("./AddressRoutes-Ce-3Jhw7.js"),__vite__mapDeps([51,1,2,3,23,4,5,6,7,13,21]))),aa=l(()=>a(()=>import("./PeopleRoutes-9gxadS-C.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),na=l(()=>a(()=>import("./PandLWithForecastRoutes-C8hCBik3.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),ta=l(()=>a(()=>import("./CustomerOnboardingRoutes-evT_peP3.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),ia=l(()=>a(()=>import("./VendorsRoutes-B5vPHlE6.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21]))),ra=l(()=>a(()=>import("./TransactionDetailRoutes-DYnfzuyZ.js"),__vite__mapDeps([54,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-C5vKBtdx.js"),__vite__mapDeps([55,1,2,3,4,5,6,7,11,8,9,10,12,21]))),oa=l(()=>a(()=>import("./DashboardRoutes-BWyE-0Hc.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]))),Re=l(()=>a(()=>import("./BillPayRoutes-DRVXy7kE.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]))),la=l(()=>a(()=>import("./SettingsRoutes-Cl1dDHc6.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),De=l(()=>a(()=>import("./ReimbursementRoutes-DQ5VSfjH.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]))),ca=l(()=>a(()=>import("./ZeniAccountRoutes-FlMIOWJK.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))),da=l(()=>a(()=>import("./TreasuryRoutes-D9fs3Ecf.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21]))),ma=l(()=>a(()=>import("./TransactionListRoutes-D69NliNs.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ua=l(()=>a(()=>import("./ChargeCardRoutes-BneUma9C.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21]))),_a=l(()=>a(()=>import("./NotificationRoutes-Di4tIjQV.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,21]))),Ea=l(()=>a(()=>import("./PerformanceRoutes-CATOeT7z.js"),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,17,21]))),pa=l(()=>a(()=>import("./ExpenseAutomationRoutes-QRseaMBK.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),Aa=l(()=>a(()=>import("./RewardsRoutes-Cd5tFxOd.js"),__vite__mapDeps([58,1,2,3,4,5,6,7,13,20,9,17,21]))),xa=l(()=>a(()=>import("./TaskRoutes-B4YKOfNB.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,14,17,60,9,21]))),ga=l(()=>a(()=>import("./AiCfoScreen-BNnlPT55.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,18,49,21]))),ye=l(()=>a(()=>import("./CardsAiCfoScreen-CaiLWTLU.js"),__vite__mapDeps([62,1,2,3,7,4,5,6,21]))),D=l(()=>a(()=>import("./NotFoundScreen-DhKhgQXf.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ia=l(()=>a(()=>import("./TaskListScreen-D3R7s1AA.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,9,17,21])));function wa({setTenantEmailDomain:i}){const U=Ss(),V=Ns(),{tenantEmailDomain:o}=Ms(),S=zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),y=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),K=ls(j),$=Zs(),[N,Ce]=v.useState(!1),r=G(n=>cs(n)),{useFeatureGate:P}=$s(),w=qs(),ve=Ws(),{isFeatureEnabled:Oe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Pe}=P(L.isExpenseAutomationEnabledV2),Fe=Pe||Oe&&K,{isFeatureEnabled:Le}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Be}=P(L.isTreasuryEnabled),{isFeatureEnabled:ke}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=P(L.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),p=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||h==="Completed"?ds(ne,r):void 0,q=p==="Completed"||h==="Completed"?ms(r):void 0,Ve=p==="Completed"||h==="Completed"?us(r):void 0,Se=ke||ne||!!Ve||!!q||!!u,{isFeatureEnabled:Ne}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=P(L.isAiCfoFileUploadEnabled),W=G(n=>_s(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&be(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},te=Es(),E=Ys(),Me=r.company==null||E?.loggedInUserRoleMap!=null&&Ae(E.loggedInUserRole),Ze=ps(E?.loggedInUserRoleMap),ie=v.useRef(!0),re=he("/:tenantEmailDomain/onboarding/*")!==null,X=he("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),we=G(n=>z.tenantId!=null?As(n,z.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&y!=null){const n=X.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=xs(Number(b[0])),s=Number(b[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,Ue.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(Ts(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,y]),v.useEffect(()=>{N||(Ce(!0),f(B.TENANT_FETCHING)),ie.current?ie.current=!1:!js(te,z)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s){if(ge(b?.userId,b?.zeniSessionId,n.tenantId),d(ks(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Ue.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?se.identify(n.userId,{tenant_id:n.tenantId}):se.resetUserIdentity()}(z,j,U,we))},[z,te,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,is=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,os=d!=null&&d.externalConnections==null;if(Y&&is){k(Ie(s));const J=H.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(m.userId,s)))}else Y&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),Y&&os&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(m.userId,s)));if(Y){se.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(Vs(m.userId,s,m.zeniSessionId))),J&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,p,r,y,j,f,U))},[y,p]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),j!=null&&be(j,r,S,void 0,W.tenantsBaseInOrder))},[W,h,r,j]),v.useEffect(()=>{p==="In-Progress"&&f(B.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[p,h,y,N]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&p==="Completed"&&N&&(oe.current=!0,function(n=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Qs[m];M!=null?M().then(()=>ae(()=>d(s+1))).catch(()=>ae(()=>d(s+1))):d(s+1)};ae(()=>d(0))},b)}())},[p,N]);const C=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:ze}=P(L.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,ce=Se&&!C,qe=bs(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,ue=me&&Hs(E?.loggedInUserRoleMap),_e=Le&&!C,Ye=r.company!=null&&Rs(r.company),Je=Be&&Ye===!0&&!C,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ce&&ys(E?.loggedInUserRoleMap),Xe=_e&&fs(E?.loggedInUserRoleMap),es=Cs(E?.loggedInUserRoleMap),ss=vs(E?.loggedInUserRoleMap),A=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),I=Ls(E?.loggedInUserRoleMap),T=Bs(E?.loggedInUserRoleMap),Ee=le&&I,pe=me&&T,as=_e&&A,ns=Je&&x,ee=ce&&g,ts=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||qe===!0||es===!0||ss===!0;return H.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||h==="Completed"?(de===!0||K&&!re)&&We===!1&&u===!1&&q===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||de!==!1||re||K?N&&r?.userRole&&u!=null&&q!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(ws,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Ta,{isDashboardAccess:F,isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:q})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(oa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(ea,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ts||F?e.jsx(aa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(na,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(ta,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||Ge||$e?e.jsx(ra,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(ma,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ia,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xa,{})}),e.jsx(t,{path:"address/*",element:Ke||ue||Xe||Qe?e.jsx(sa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:as?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:ns?e.jsx(da,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ve?e.jsx(Ea,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:Fe&&C===!1?e.jsx(pa,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_a,{})}),e.jsx(t,{path:"vendors/*",element:Me?e.jsx(ia,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Ne?e.jsx(la,{hasAdminLevelAccess:ue}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:ee?e.jsx(ua,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(Aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(ga,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Ta=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ba,{tenantEmailDomain:O}):S?e.jsx(Ua,{tenantEmailDomain:O}):U?e.jsx(Ha,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(ja,{tenantEmailDomain:O}):e.jsx(D,{}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ba=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),fe=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wa as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-B1cE2wJc.js","assets/sentry-Be8twC83.js","assets/core-CQnSJ9vO.js","assets/zeni-epic-state-DKeO4Z0C.js","assets/index-W83PhAZh.js","assets/mui-sKCdI-e6.js","assets/analytics-DoyQ8ezf.js","assets/utils-BcJ2NV01.js","assets/withTransactionSidePanel-B9fglQqM.js","assets/useAskAiCfoHostNavButtonProps-DAlpTVgV.js","assets/TransactionDetailScreen-ABqf1zzA.js","assets/decodeURIComponentSafe-BprI0TcI.js","assets/routePaths-stnXzrYV.js","assets/NotFoundScreen-FcrdBNP0.js","assets/useInitialThreadRequest-BDAn-AM4.js","assets/analyticsHelper-CvGdvadP.js","assets/CompanyPassportScreen-AZhDXSZE.js","assets/MobileAppDrawer-CjoW3Rax.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js","assets/FeaturePreviewScreen-9NvuDbvP.js","assets/ReferralListScreen-Cnd7u4T9.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-BKu8tYXF.js","assets/AddressScreen-DHENiPsE.js","assets/DomesticWireDetailScreen-Bx2DINVR.js","assets/DrawerScreen-BtLrlXnn.js","assets/SetupPagesScreen-DtddTp_T.js","assets/BusinessVerificationPageScreen-7ydI8UR9.js","assets/BillPayApprovalRoutes-re8xxMBE.js","assets/ReimbursementApprovalRuleDetailScreen-BgYFphfr.js","assets/getLocaleForTenant-CAvD8CfA.js","assets/ReimbursementRoutes-BeD0lwna.js","assets/ReimbursementApprovalRoutes-DOhkjING.js","assets/TransactionListRoutes-uZihQK3F.js","assets/ZeniAccountStatementScreen-Ciuw5n7i.js","assets/SettingsRoutes-D7qVKl5_.js","assets/accountMappingHelper-DDqSB3xQ.js","assets/QBOConnectionScreen-B8QVReQm.js","assets/empty-DjW_4H8B.js","assets/index-BtlQ6O6E.js","assets/url-CuDHWvgT.js","assets/index-DgHQU_66.js","assets/ReportsRoutes-CPI-jy1F.js","assets/ChargeCardRoutes-BbZEL-b5.js","assets/PeopleRoutes-ZidIbEdd.js","assets/ExpenseAutomationRoutes-pmgLYKV-.js","assets/TreasuryRoutes-ZtY_hGM6.js","assets/useCashManagementBanner-D8slgHwh.js","assets/VendorsRoutes-DcUkIEvd.js","assets/pathToGoBack-DDBtlyQ4.js","assets/ZeniAccountRoutes-Cbm2k-08.js","assets/AddressRoutes-gPXkxz7s.js","assets/PandLWithForecastRoutes-C3Yczwgv.js","assets/CustomerOnboardingRoutes-COHKYeEq.js","assets/TransactionDetailRoutes-CjrDVjtT.js","assets/EntityDetailRoutes-CTo7No6n.js","assets/NotificationRoutes-DE-Z8DSv.js","assets/PerformanceRoutes-VzYGFOXy.js","assets/RewardsRoutes-Vdol6ACr.js","assets/TaskRoutes-Cmtr7KFm.js","assets/TaskListScreen-DMgU1v4z.js","assets/AiCfoScreen-BDeqJ8PX.js","assets/CardsAiCfoScreen-QyowC-mN.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bn as ls,eW as cs,fe as ds,fc as ms,fd as us,gj as _s,f1 as Es,cU as Ae,cB as ps,fu as As,ct as xs,bE as gs,bq as Is,fz as Ts,v as js,Lz as hs,bt as Us,LA as bs,bK as Hs,fw as Rs,bJ as Ds,bs as ys,cp as fs,LB as Cs,LC as vs,cR as Os,cT as Ps,cS as Fs,cA as Ls,cH as Bs,o5 as xe,fa as ge,gt as ks,fD as Ie,gq as Te,gr as je,fE as Vs}from"./zeni-epic-state-DKeO4Z0C.js";import{j as e}from"./liveblocks-DvKPzrwo.js";import{a as v}from"./sentry-Be8twC83.js";import{u as Ss,h as Ns,i as Ms,g as Zs,j as G,l as he,N as c,o as ws,p as t}from"./core-CQnSJ9vO.js";import{m as zs,u as Gs,z as H,H as $s,a as qs,n as Ws,x as L,j as Ys,L as B,D as Ue,t as _,P as Js,c as se,l}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import{f as be}from"./analyticsHelper-CvGdvadP.js";import{t as Ks}from"./getLocaleForTenant-CAvD8CfA.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="4ab867c1-c6b9-4e19-a61e-1c540c8daab2",i._sentryDebugIdIdentifier="sentry-dbid-4ab867c1-c6b9-4e19-a61e-1c540c8daab2")}catch{}})();const Qs={dashboard:()=>a(()=>import("./DashboardRoutes-B1cE2wJc.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:()=>a(()=>import("./BillPayRoutes-BKu8tYXF.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:()=>a(()=>import("./ReimbursementRoutes-BeD0lwna.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:()=>a(()=>import("./TransactionListRoutes-uZihQK3F.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-D7qVKl5_.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-CPI-jy1F.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BbZEL-b5.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21])),people:()=>a(()=>import("./PeopleRoutes-ZidIbEdd.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-pmgLYKV-.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-ZtY_hGM6.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-DcUkIEvd.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-Cbm2k-08.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},ea=l(()=>a(()=>import("./ReportsRoutes-CPI-jy1F.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),sa=l(()=>a(()=>import("./AddressRoutes-gPXkxz7s.js"),__vite__mapDeps([51,1,2,3,23,4,5,6,7,13,21]))),aa=l(()=>a(()=>import("./PeopleRoutes-ZidIbEdd.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),na=l(()=>a(()=>import("./PandLWithForecastRoutes-C3Yczwgv.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),ta=l(()=>a(()=>import("./CustomerOnboardingRoutes-COHKYeEq.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),ia=l(()=>a(()=>import("./VendorsRoutes-DcUkIEvd.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21]))),ra=l(()=>a(()=>import("./TransactionDetailRoutes-CjrDVjtT.js"),__vite__mapDeps([54,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-CTo7No6n.js"),__vite__mapDeps([55,1,2,3,4,5,6,7,11,8,9,10,12,21]))),oa=l(()=>a(()=>import("./DashboardRoutes-B1cE2wJc.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]))),Re=l(()=>a(()=>import("./BillPayRoutes-BKu8tYXF.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]))),la=l(()=>a(()=>import("./SettingsRoutes-D7qVKl5_.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),De=l(()=>a(()=>import("./ReimbursementRoutes-BeD0lwna.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]))),ca=l(()=>a(()=>import("./ZeniAccountRoutes-Cbm2k-08.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))),da=l(()=>a(()=>import("./TreasuryRoutes-ZtY_hGM6.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21]))),ma=l(()=>a(()=>import("./TransactionListRoutes-uZihQK3F.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ua=l(()=>a(()=>import("./ChargeCardRoutes-BbZEL-b5.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21]))),_a=l(()=>a(()=>import("./NotificationRoutes-DE-Z8DSv.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,21]))),Ea=l(()=>a(()=>import("./PerformanceRoutes-VzYGFOXy.js"),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,17,21]))),pa=l(()=>a(()=>import("./ExpenseAutomationRoutes-pmgLYKV-.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),Aa=l(()=>a(()=>import("./RewardsRoutes-Vdol6ACr.js"),__vite__mapDeps([58,1,2,3,4,5,6,7,13,20,9,17,21]))),xa=l(()=>a(()=>import("./TaskRoutes-Cmtr7KFm.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,14,17,60,9,21]))),ga=l(()=>a(()=>import("./AiCfoScreen-BDeqJ8PX.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,18,49,21]))),ye=l(()=>a(()=>import("./CardsAiCfoScreen-QyowC-mN.js"),__vite__mapDeps([62,1,2,3,7,4,5,6,21]))),D=l(()=>a(()=>import("./NotFoundScreen-FcrdBNP0.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ia=l(()=>a(()=>import("./TaskListScreen-DMgU1v4z.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,9,17,21])));function wa({setTenantEmailDomain:i}){const U=Ss(),V=Ns(),{tenantEmailDomain:o}=Ms(),S=zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),y=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),K=ls(j),$=Zs(),[N,Ce]=v.useState(!1),r=G(n=>cs(n)),{useFeatureGate:P}=$s(),w=qs(),ve=Ws(),{isFeatureEnabled:Oe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Pe}=P(L.isExpenseAutomationEnabledV2),Fe=Pe||Oe&&K,{isFeatureEnabled:Le}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Be}=P(L.isTreasuryEnabled),{isFeatureEnabled:ke}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=P(L.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),p=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||h==="Completed"?ds(ne,r):void 0,q=p==="Completed"||h==="Completed"?ms(r):void 0,Ve=p==="Completed"||h==="Completed"?us(r):void 0,Se=ke||ne||!!Ve||!!q||!!u,{isFeatureEnabled:Ne}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=P(L.isAiCfoFileUploadEnabled),W=G(n=>_s(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&be(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},te=Es(),E=Ys(),Me=r.company==null||E?.loggedInUserRoleMap!=null&&Ae(E.loggedInUserRole),Ze=ps(E?.loggedInUserRoleMap),ie=v.useRef(!0),re=he("/:tenantEmailDomain/onboarding/*")!==null,X=he("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),we=G(n=>z.tenantId!=null?As(n,z.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&y!=null){const n=X.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=xs(Number(b[0])),s=Number(b[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,Ue.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(Ts(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,y]),v.useEffect(()=>{N||(Ce(!0),f(B.TENANT_FETCHING)),ie.current?ie.current=!1:!js(te,z)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s){if(ge(b?.userId,b?.zeniSessionId,n.tenantId),d(ks(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Ue.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?se.identify(n.userId,{tenant_id:n.tenantId}):se.resetUserIdentity()}(z,j,U,we))},[z,te,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,is=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,os=d!=null&&d.externalConnections==null;if(Y&&is){k(Ie(s));const J=H.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(m.userId,s)))}else Y&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),Y&&os&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(m.userId,s)));if(Y){se.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(Vs(m.userId,s,m.zeniSessionId))),J&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,p,r,y,j,f,U))},[y,p]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),j!=null&&be(j,r,S,void 0,W.tenantsBaseInOrder))},[W,h,r,j]),v.useEffect(()=>{p==="In-Progress"&&f(B.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[p,h,y,N]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&p==="Completed"&&N&&(oe.current=!0,function(n=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Qs[m];M!=null?M().then(()=>ae(()=>d(s+1))).catch(()=>ae(()=>d(s+1))):d(s+1)};ae(()=>d(0))},b)}())},[p,N]);const C=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:ze}=P(L.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,ce=Se&&!C,qe=bs(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,ue=me&&Hs(E?.loggedInUserRoleMap),_e=Le&&!C,Ye=r.company!=null&&Rs(r.company),Je=Be&&Ye===!0&&!C,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ce&&ys(E?.loggedInUserRoleMap),Xe=_e&&fs(E?.loggedInUserRoleMap),es=Cs(E?.loggedInUserRoleMap),ss=vs(E?.loggedInUserRoleMap),A=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),I=Ls(E?.loggedInUserRoleMap),T=Bs(E?.loggedInUserRoleMap),Ee=le&&I,pe=me&&T,as=_e&&A,ns=Je&&x,ee=ce&&g,ts=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||qe===!0||es===!0||ss===!0;return H.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||h==="Completed"?(de===!0||K&&!re)&&We===!1&&u===!1&&q===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||de!==!1||re||K?N&&r?.userRole&&u!=null&&q!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(ws,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Ta,{isDashboardAccess:F,isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:q})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(oa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(ea,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ts||F?e.jsx(aa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(na,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(ta,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||Ge||$e?e.jsx(ra,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(ma,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ia,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xa,{})}),e.jsx(t,{path:"address/*",element:Ke||ue||Xe||Qe?e.jsx(sa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:as?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:ns?e.jsx(da,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ve?e.jsx(Ea,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:Fe&&C===!1?e.jsx(pa,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_a,{})}),e.jsx(t,{path:"vendors/*",element:Me?e.jsx(ia,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Ne?e.jsx(la,{hasAdminLevelAccess:ue}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:ee?e.jsx(ua,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(Aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(ga,{isFileUploadEnabled:Q}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Ta=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ba,{tenantEmailDomain:O}):S?e.jsx(Ua,{tenantEmailDomain:O}):U?e.jsx(Ha,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(ja,{tenantEmailDomain:O}):e.jsx(D,{}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ba=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),fe=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wa as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-DvKPzrwo.js";import{a as p}from"./sentry-Be8twC83.js";import{h as V,g as Q,u as D,j as h,s as se,n as $,i as G,o as W,p as E}from"./core-CQnSJ9vO.js";import{bn as Ee,eW as T,go as Ae,mW as ve,Q1 as we,hA as ue,ND as ke,qN as Pe,ks as pe,mS as je,hC as Te,NF as Me,NE as De,Q2 as Ue,z3 as _e,Eo as Re,PC as Fe,PL as Be,c7 as ee,cM as ze,cN as Ve,LL as Le,Q3 as Oe,LM as Ne,xw as Qe,Q4 as $e,GP as Ge,E4 as Ke,DX as ge,DU as He,xA as me,D_ as he,E1 as fe,E7 as ne,t_ as te,xz as Ze,k4 as X,k7 as be,Q5 as qe,l8 as Je,xP as We,My as Xe,Mz as Ye,k2 as en,Q6 as nn,k5 as tn,rf as an,Q7 as on,Q8 as sn,rj as cn,hl as ln,LU as J,he as rn,hh as dn,LV as un,xM as pn,Q9 as gn,Qa as mn,El as hn,fc as Se,fe as ye,Qb as fn,gc as bn,M2 as Sn,xL as ie,gh as ce,gg as yn,xK as Cn,gf as In,ge as xn,Qc as En,fh as Ce,Qd as An,Qe as vn,xS as wn,xJ as le,Qf as kn,fy as Pn,xG as jn,b_ as Tn,c6 as Mn,c5 as Dn,b$ as Un,c3 as _n,c2 as Rn,c1 as Fn,c4 as Bn,c0 as zn}from"./zeni-epic-state-DKeO4Z0C.js";import{H as ae,x as R,z as w,af as Ie,bO as Vn,c as q,e as Ln,bz as On,j as K,B as oe,bP as Nn,bQ as Qn,aq as $n,h as xe,bR as Gn,bS as Kn,bT as Hn,a9 as Zn,Y as qn,bU as Jn,r as Wn,bV as Xn}from"./index-CKi6vsOO.js";import{n as F}from"./mui-sKCdI-e6.js";import{M as U}from"./MobileAppDrawer-Dos6aPiF.js";import{a as H,g as Z,m as Yn}from"./accountMappingHelper-DDqSB3xQ.js";import{t as et,A as nt}from"./AddressScreen-BUUFD2sw.js";import N from"./NotFoundScreen-DhKhgQXf.js";import{g as tt}from"./analyticsHelper-DvY5NpaM.js";import{B as at}from"./BusinessVerificationPageScreen-Cz8yHsjg.js";import{C as ot}from"./CompanyPassportScreen-DWoq6mXR.js";import{q as re}from"./QBOConnectionScreen-D9SI3hOs.js";import{B as st}from"./BillPayApprovalRoutes-CInNrMhS.js";import{R as it}from"./ReimbursementApprovalRoutes-BzPo26FL.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./routePaths-DnD95y3h.js";import"./empty-DjW_4H8B.js";import"./pdf-lib-C9eLuUx2.js";import"./index-BtlQ6O6E.js";import"./url-CuDHWvgT.js";import"./index-DgHQU_66.js";import"./decodeURIComponentSafe-BprI0TcI.js";import"./ReimbursementApprovalRuleDetailScreen-Dq4iE7Qu.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]="7fbd23e5-c1b8-437b-b42e-5a69a0005702",e._sentryDebugIdIdentifier="sentry-dbid-7fbd23e5-c1b8-437b-b42e-5a69a0005702")}catch{}})();const ct=F.div`
1
+ import{j as o}from"./liveblocks-DvKPzrwo.js";import{a as p}from"./sentry-Be8twC83.js";import{h as V,g as Q,u as D,j as h,s as se,n as $,i as G,o as W,p as E}from"./core-CQnSJ9vO.js";import{bn as Ee,eW as T,go as Ae,mW as ve,Q1 as we,hA as ue,ND as ke,qN as Pe,ks as pe,mS as je,hC as Te,NF as Me,NE as De,Q2 as Ue,z3 as _e,Eo as Re,PC as Fe,PL as Be,c7 as ee,cM as ze,cN as Ve,LL as Le,Q3 as Oe,LM as Ne,xw as Qe,Q4 as $e,GP as Ge,E4 as Ke,DX as ge,DU as He,xA as me,D_ as he,E1 as fe,E7 as ne,t_ as te,xz as Ze,k4 as X,k7 as be,Q5 as qe,l8 as Je,xP as We,My as Xe,Mz as Ye,k2 as en,Q6 as nn,k5 as tn,rf as an,Q7 as on,Q8 as sn,rj as cn,hl as ln,LU as J,he as rn,hh as dn,LV as un,xM as pn,Q9 as gn,Qa as mn,El as hn,fc as Se,fe as ye,Qb as fn,gc as bn,M2 as Sn,xL as ie,gh as ce,gg as yn,xK as Cn,gf as In,ge as xn,Qc as En,fh as Ce,Qd as An,Qe as vn,xS as wn,xJ as le,Qf as kn,fy as Pn,xG as jn,b_ as Tn,c6 as Mn,c5 as Dn,b$ as Un,c3 as _n,c2 as Rn,c1 as Fn,c4 as Bn,c0 as zn}from"./zeni-epic-state-DKeO4Z0C.js";import{H as ae,x as R,z as w,af as Ie,bO as Vn,c as q,e as Ln,bz as On,j as K,B as oe,bP as Nn,bQ as Qn,aq as $n,h as xe,bR as Gn,bS as Kn,bT as Hn,a9 as Zn,Y as qn,bU as Jn,r as Wn,bV as Xn}from"./index-W83PhAZh.js";import{n as F}from"./mui-sKCdI-e6.js";import{M as U}from"./MobileAppDrawer-CjoW3Rax.js";import{a as H,g as Z,m as Yn}from"./accountMappingHelper-DDqSB3xQ.js";import{t as et,A as nt}from"./AddressScreen-DHENiPsE.js";import N from"./NotFoundScreen-FcrdBNP0.js";import{g as tt}from"./analyticsHelper-CvGdvadP.js";import{B as at}from"./BusinessVerificationPageScreen-7ydI8UR9.js";import{C as ot}from"./CompanyPassportScreen-AZhDXSZE.js";import{q as re}from"./QBOConnectionScreen-B8QVReQm.js";import{B as st}from"./BillPayApprovalRoutes-re8xxMBE.js";import{R as it}from"./ReimbursementApprovalRoutes-DOhkjING.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./routePaths-stnXzrYV.js";import"./empty-DjW_4H8B.js";import"./pdf-lib-C9eLuUx2.js";import"./index-BtlQ6O6E.js";import"./url-CuDHWvgT.js";import"./index-DgHQU_66.js";import"./decodeURIComponentSafe-BprI0TcI.js";import"./ReimbursementApprovalRuleDetailScreen-BgYFphfr.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]="7fbd23e5-c1b8-437b-b42e-5a69a0005702",e._sentryDebugIdIdentifier="sentry-dbid-7fbd23e5-c1b8-437b-b42e-5a69a0005702")}catch{}})();const ct=F.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DvKPzrwo.js";import{h as Q,g as Y,u as ee,i as W,j as _,N as j,n as G,t as Ye}from"./core-CQnSJ9vO.js";import{bJ as en,cp as Ie,Pq as ye,eW as V,cB as nn,zk as $,z3 as tn,PC as an,PF as sn,ry as ne,rm as te,l0 as ae,tw as L,PH as Ae,gg as $e,gf as He,ge as We,PI as on,zt as cn,E4 as ke,DX as Pe,DU as _e,DL as J,D_ as ve,E1 as Ee,E7 as we,t_ as Te,gv as rn,cw as un,fe as dn,fc as ln,fd as pn,bs as mn,PJ as yn,CL as le,Dn as fn,PK as gn,bK as Sn,Fn as pe,Eo as bn,PL as hn,PM as Cn,Fr as In,Fv as An,tp as kn,JV as Pn,G0 as Ce,H0 as me,PN as _n,PO as vn,PP as En,PQ as Ge,PR as wn,Mm as Tn,OP as Dn,Mx as Un,PS as Ke,PT as Ve,Gm as qe,l8 as On,rp as Je,ty as Fn,bE as je,tK as Re,cz as Vn,PU as Xe,fx as xn,FK as Bn,FO as jn,PV as Rn,G3 as ze,PW as zn,PX as Nn,PY as Ln,PZ as Mn,go as Zn,AE as $n,P_ as Hn,AJ as Wn,AI as Gn}from"./zeni-epic-state-DKeO4Z0C.js";import{j as ie,H as se,x as de,m as De,aN as X,bz as Qe,z as D,w as oe,c as U,B as Ue,e as H,bA as Kn,at as ce,bB as x,bC as qn,bD as Jn,af as Be,bE as Xn,r as Ne,au as Le,K as Qn,A as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-CKi6vsOO.js";import{a as C}from"./sentry-Be8twC83.js";import{n as xe,D as it,S as st}from"./mui-sKCdI-e6.js";import{M as fe}from"./MobileAppDrawer-Dos6aPiF.js";import N from"./NotFoundScreen-DhKhgQXf.js";import{a as Me}from"./analyticsHelper-DvY5NpaM.js";import{d as Ze}from"./routePaths-DnD95y3h.js";import{B as Fe}from"./BusinessVerificationPageScreen-Cz8yHsjg.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]="a43db33a-501c-4730-8007-f0990568feea",e._sentryDebugIdIdentifier="sentry-dbid-a43db33a-501c-4730-8007-f0990568feea")}catch{}})();const ot=xe.div`
1
+ import{j as u}from"./liveblocks-DvKPzrwo.js";import{h as Q,g as Y,u as ee,i as W,j as _,N as j,n as G,t as Ye}from"./core-CQnSJ9vO.js";import{bJ as en,cp as Ie,Pq as ye,eW as V,cB as nn,zk as $,z3 as tn,PC as an,PF as sn,ry as ne,rm as te,l0 as ae,tw as L,PH as Ae,gg as $e,gf as He,ge as We,PI as on,zt as cn,E4 as ke,DX as Pe,DU as _e,DL as J,D_ as ve,E1 as Ee,E7 as we,t_ as Te,gv as rn,cw as un,fe as dn,fc as ln,fd as pn,bs as mn,PJ as yn,CL as le,Dn as fn,PK as gn,bK as Sn,Fn as pe,Eo as bn,PL as hn,PM as Cn,Fr as In,Fv as An,tp as kn,JV as Pn,G0 as Ce,H0 as me,PN as _n,PO as vn,PP as En,PQ as Ge,PR as wn,Mm as Tn,OP as Dn,Mx as Un,PS as Ke,PT as Ve,Gm as qe,l8 as On,rp as Je,ty as Fn,bE as je,tK as Re,cz as Vn,PU as Xe,fx as xn,FK as Bn,FO as jn,PV as Rn,G3 as ze,PW as zn,PX as Nn,PY as Ln,PZ as Mn,go as Zn,AE as $n,P_ as Hn,AJ as Wn,AI as Gn}from"./zeni-epic-state-DKeO4Z0C.js";import{j as ie,H as se,x as de,m as De,aN as X,bz as Qe,z as D,w as oe,c as U,B as Ue,e as H,bA as Kn,at as ce,bB as x,bC as qn,bD as Jn,af as Be,bE as Xn,r as Ne,au as Le,K as Qn,A as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-W83PhAZh.js";import{a as C}from"./sentry-Be8twC83.js";import{n as xe,D as it,S as st}from"./mui-sKCdI-e6.js";import{M as fe}from"./MobileAppDrawer-CjoW3Rax.js";import N from"./NotFoundScreen-FcrdBNP0.js";import{a as Me}from"./analyticsHelper-CvGdvadP.js";import{d as Ze}from"./routePaths-stnXzrYV.js";import{B as Fe}from"./BusinessVerificationPageScreen-7ydI8UR9.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]="a43db33a-501c-4730-8007-f0990568feea",e._sentryDebugIdIdentifier="sentry-dbid-a43db33a-501c-4730-8007-f0990568feea")}catch{}})();const ot=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-DvKPzrwo.js";import{a as u,b as D,q as T}from"./sentry-Be8twC83.js";import{u as A,h as z,j as c,g as M,N as O,n as j}from"./core-CQnSJ9vO.js";import{u as F,z as s,m as P,c as w,D as B,d as _,e as N,f as V,g as W,Q as Y,h as v}from"./index-CKi6vsOO.js";import{eW as $,Ly as q,Lz as G,fa as H,fD as J,LE as Q,gn as K,cY as R,LF as C,LG as X,LH as Z,bY as y}from"./zeni-epic-state-DKeO4Z0C.js";import"./mui-sKCdI-e6.js";import{u as ee}from"./useDeviceId-KC-rY1dP.js";import{f as te}from"./analyticsHelper-DvY5NpaM.js";import{t as ne}from"./getLocaleForTenant-Cwvzl8db.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="11c366f0-35d2-4dff-8872-4a67f5fa3acd",t._sentryDebugIdIdentifier="sentry-dbid-11c366f0-35d2-4dff-8872-4a67f5fa3acd")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),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:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(C())}}})(Y),ae=D.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:U,accountUnlockTime:h}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),I=c(e=>q(e)),m=M(),E=P().mode,b=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(G(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(J(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,k,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!b,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&h!=null?f.jsx(V,{onClose:()=>i(C()),unlockDate:h}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-DvKPzrwo.js";import{a as u,b as D,q as T}from"./sentry-Be8twC83.js";import{u as A,h as z,j as c,g as M,N as O,n as j}from"./core-CQnSJ9vO.js";import{u as F,z as s,m as P,c as w,D as B,d as _,e as N,f as V,g as W,Q as Y,h as v}from"./index-W83PhAZh.js";import{eW as $,Ly as q,Lz as G,fa as H,fD as J,LE as Q,gn as K,cY as R,LF as C,LG as X,LH as Z,bY as y}from"./zeni-epic-state-DKeO4Z0C.js";import"./mui-sKCdI-e6.js";import{u as ee}from"./useDeviceId-KC-rY1dP.js";import{f as te}from"./analyticsHelper-CvGdvadP.js";import{t as ne}from"./getLocaleForTenant-CAvD8CfA.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="11c366f0-35d2-4dff-8872-4a67f5fa3acd",t._sentryDebugIdIdentifier="sentry-dbid-11c366f0-35d2-4dff-8872-4a67f5fa3acd")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),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:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(C())}}})(Y),ae=D.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:U,accountUnlockTime:h}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),I=c(e=>q(e)),m=M(),E=P().mode,b=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(G(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(J(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),K().then(()=>{const e=W();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,k,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!b,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&h!=null?f.jsx(V,{onClose:()=>i(C()),unlockDate:h}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DvKPzrwo.js";import{a as n}from"./sentry-Be8twC83.js";import{u,g as m,h as g,N as p}from"./core-CQnSJ9vO.js";import{z as c,B as y,t as b,c as d,e as h}from"./index-CKi6vsOO.js";import{gs as x,gt as I,LW as w}from"./zeni-epic-state-DKeO4Z0C.js";import{n as j}from"./mui-sKCdI-e6.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="d4c898fa-41ea-4d93-8abe-4eb34c475780",e._sentryDebugIdIdentifier="sentry-dbid-d4c898fa-41ea-4d93-8abe-4eb34c475780")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),w(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
1
+ import{j as s}from"./liveblocks-DvKPzrwo.js";import{a as n}from"./sentry-Be8twC83.js";import{u,g as m,h as g,N as p}from"./core-CQnSJ9vO.js";import{z as c,B as y,t as b,c as d,e as h}from"./index-W83PhAZh.js";import{gs as x,gt as I,LW as w}from"./zeni-epic-state-DKeO4Z0C.js";import{n as j}from"./mui-sKCdI-e6.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="d4c898fa-41ea-4d93-8abe-4eb34c475780",e._sentryDebugIdIdentifier="sentry-dbid-d4c898fa-41ea-4d93-8abe-4eb34c475780")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),w(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DvKPzrwo.js";import{a as b}from"./sentry-Be8twC83.js";import{h as _,u as v,g as K,j as G,i as q,n as z}from"./core-CQnSJ9vO.js";import{z as x,H,x as p,_ as W,w as M,c as O,e as V,d8 as Z,r as g,q as Q}from"./index-CKi6vsOO.js";import{eW as J,Th as F,IH as C,Ti as R,Td as X,I3 as y,Tj as Y,Ib as E,Hx as aa,II as S,Tk as B,f9 as ea,Iy as ta,ID as sa,Iq as oa,Io as w,IE as na,Il as ia,Tl as la,Tm as ra,Tn as ka,To as ca,Tp as T,ei as da,Tq as ua,Tr as pa}from"./zeni-epic-state-DKeO4Z0C.js";import{n as Ta}from"./mui-sKCdI-e6.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import{M as ga}from"./MobileAppDrawer-Dos6aPiF.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="6615deed-6a9a-473c-bb9d-ed662f7a514b",e._sentryDebugIdIdentifier="sentry-dbid-6615deed-6a9a-473c-bb9d-ed662f7a514b")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-DvKPzrwo.js";import{a as b}from"./sentry-Be8twC83.js";import{h as _,u as v,g as K,j as G,i as q,n as z}from"./core-CQnSJ9vO.js";import{z as x,H,x as p,_ as W,w as M,c as O,e as V,d8 as Z,r as g,q as Q}from"./index-W83PhAZh.js";import{eW as J,Th as F,IH as C,Ti as R,Td as X,I3 as y,Tj as Y,Ib as E,Hx as aa,II as S,Tk as B,f9 as ea,Iy as ta,ID as sa,Iq as oa,Io as w,IE as na,Il as ia,Tl as la,Tm as ra,Tn as ka,To as ca,Tp as T,ei as da,Tq as ua,Tr as pa}from"./zeni-epic-state-DKeO4Z0C.js";import{n as Ta}from"./mui-sKCdI-e6.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{M as ga}from"./MobileAppDrawer-CjoW3Rax.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="6615deed-6a9a-473c-bb9d-ed662f7a514b",e._sentryDebugIdIdentifier="sentry-dbid-6615deed-6a9a-473c-bb9d-ed662f7a514b")}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-DvKPzrwo.js";import se from"./NotFoundScreen-DhKhgQXf.js";import{a as c}from"./sentry-Be8twC83.js";import{h as _,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-CQnSJ9vO.js";import{HK as Z,HN as le,HH as de,eW as M,Td as W,H$ as K,HE as pe,Iv as ue,Io as ke,Te as Q,Tf as N,HA as me,Hx as fe,ry as ge,rm as he,l0 as Se,HV as Ie,Tg as Te,Ia as be,I7 as Ee,HQ as Ce,I4 as Ge,I3 as De}from"./zeni-epic-state-DKeO4Z0C.js";import{z as G,d6 as xe,W as ye,H as je,x as b,q as X,r as v,w as we,c as V,e as ve,d7 as Re,h as z,at as Fe}from"./index-CKi6vsOO.js";import{n as Be}from"./mui-sKCdI-e6.js";import{u as Pe}from"./useInitialThreadRequest-BqamPVgS.js";import{M as Ue}from"./MobileAppDrawer-Dos6aPiF.js";import Le from"./TaskListScreen-D3R7s1AA.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-vLqybwHr.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]="f961ac76-1e7f-4837-b3c3-82626ba0c2c0",e._sentryDebugIdIdentifier="sentry-dbid-f961ac76-1e7f-4837-b3c3-82626ba0c2c0")}catch{}})();function He(){const e=_(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.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:l,onSave:k})}let A,q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${z.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${z.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(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:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=_(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,Y]=c.useState(!1),[F,J]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>W(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(J(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,C,l,s,e]);const H=g(i=>Q(i,r)),j=H.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&H.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Be.div`
1
+ import{j as n}from"./liveblocks-DvKPzrwo.js";import se from"./NotFoundScreen-FcrdBNP0.js";import{a as c}from"./sentry-Be8twC83.js";import{h as _,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-CQnSJ9vO.js";import{HK as Z,HN as le,HH as de,eW as M,Td as W,H$ as K,HE as pe,Iv as ue,Io as ke,Te as Q,Tf as N,HA as me,Hx as fe,ry as ge,rm as he,l0 as Se,HV as Ie,Tg as Te,Ia as be,I7 as Ee,HQ as Ce,I4 as Ge,I3 as De}from"./zeni-epic-state-DKeO4Z0C.js";import{z as G,d6 as xe,W as ye,H as je,x as b,q as X,r as v,w as we,c as V,e as ve,d7 as Re,h as z,at as Fe}from"./index-W83PhAZh.js";import{n as Be}from"./mui-sKCdI-e6.js";import{u as Pe}from"./useInitialThreadRequest-BDAn-AM4.js";import{M as Ue}from"./MobileAppDrawer-CjoW3Rax.js";import Le from"./TaskListScreen-DMgU1v4z.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.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]="f961ac76-1e7f-4837-b3c3-82626ba0c2c0",e._sentryDebugIdIdentifier="sentry-dbid-f961ac76-1e7f-4837-b3c3-82626ba0c2c0")}catch{}})();function He(){const e=_(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.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:l,onSave:k})}let A,q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${z.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${z.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(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:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=_(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,Y]=c.useState(!1),[F,J]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>W(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(J(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,C,l,s,e]);const H=g(i=>Q(i,r)),j=H.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&H.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-DvKPzrwo.js";import i from"./NotFoundScreen-DhKhgQXf.js";import{T as r}from"./TransactionDetailScreen-DCUgWZCw.js";import"./sentry-Be8twC83.js";import{o as a,p as o}from"./core-CQnSJ9vO.js";import"./zeni-epic-state-DKeO4Z0C.js";import"./recharts-Cv5d-Vxs.js";import"./index-CKi6vsOO.js";import"./mui-sKCdI-e6.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import"./decodeURIComponentSafe-BprI0TcI.js";import"./routePaths-DnD95y3h.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]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}catch{}})();function k(){return t.jsxs(a,{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-DvKPzrwo.js";import i from"./NotFoundScreen-FcrdBNP0.js";import{T as r}from"./TransactionDetailScreen-ABqf1zzA.js";import"./sentry-Be8twC83.js";import{o as a,p as o}from"./core-CQnSJ9vO.js";import"./zeni-epic-state-DKeO4Z0C.js";import"./recharts-Cv5d-Vxs.js";import"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import"./decodeURIComponentSafe-BprI0TcI.js";import"./routePaths-stnXzrYV.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]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}catch{}})();function k(){return t.jsxs(a,{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 w}from"./liveblocks-DvKPzrwo.js";import{a as r}from"./sentry-Be8twC83.js";import{u as G,k as Ye,j as h,s as Qe,g as he,h as ge,i as Se,N as Ze,n as Xe}from"./core-CQnSJ9vO.js";import{nJ as me,eW as Y,go as Ke,mW as ea,mE as aa,bn as ta,cU as ye,bt as Te,r6 as j,ML as $,NM as be,NN as ae,N9 as Ee,kD as ve,NO as Ie,Ne as te,Nf as ne,ls as Ce,JO as oe,MF as z,kx as De,kv as ke,kH as na,nw as oa,NP as sa,NQ as ia,va as J,kC as Ae,J7 as xe,cZ as ra,c_ as ca,NR as la,ME as da,NS as ua,v6 as ma,NT as pa,NU as fa,NV as ha,NW as ga,NX as Sa,kG as ya,NY as Ta,NZ as ba,MG as Ea,N_ as va,N$ as Ia,O0 as Ca,J1 as Da,IT as ka,Jg as Aa,kI as xa,JP as pe,nB as wa}from"./zeni-epic-state-DKeO4Z0C.js";import{H as W,x as F,z as we,aN as Fe,m as Fa,K as Pa,aO as Ua,A as _a,q as K,j as Na,aP as Va,r as ee,_ as Ba,aQ as Oa,c as Pe,aR as La,at as Ra,a2 as X}from"./index-CKi6vsOO.js";import{n as za,S as Ga,D as Ma}from"./mui-sKCdI-e6.js";import{u as ja}from"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import{d as Ue}from"./decodeURIComponentSafe-BprI0TcI.js";import{h as _e,c as Ne,g as $a,e as Wa}from"./routePaths-DnD95y3h.js";import{u as qa}from"./utils-BcJ2NV01.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]="820aacc5-be7b-461a-aa92-97e364ee785d",a._sentryDebugIdIdentifier="sentry-dbid-820aacc5-be7b-461a-aa92-97e364ee785d")}catch{}})();function Ha(a=!0){const e=G(),s=Ye(),{useFeatureGate:t}=W(),{isFeatureEnabled:n}=t(F.isCreateTransferEntryFromExpenseEnabled);r.useEffect(()=>{if(!a||n!==!0)return;const o=i=>{const l=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return l!=="In-Progress"&&l!=="Completed"};o("transferEntryEligible")&&e(me({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(me({kind:"creditCardOnlyEligible"}))},[a,n,e,s])}function Ja(a,e){const s=function(){const l=G(),[m,f]=r.useState(!1),[E,p]=r.useState(null),{useDynamicConfig:g}=W(),{configValue:P,isDynamicConfigLoading:T}=g("transaction_categorization_config"),u=!T&&P?.capitalization_enabled===!0,D=h(I=>Y(I)),v=D.companyId,A=h(I=>Ke(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:b,globalThreshold:k,maxCeiling:U,onboardingShownForPrepaid:_,onboardingShownForFixedAsset:B}=h(I=>{const S=I.tenantState.currentTenantId,c=S!=null?I.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:c?.capitalizableAccounts??null,globalThreshold:c?.capitalizationThreshold??null,maxCeiling:c?.capitalizationThresholdMaxCeiling??null,onboardingShownForPrepaid:c?.capitalizationOnboardingShownForPrepaid===!0,onboardingShownForFixedAsset:c?.capitalizationOnboardingShownForFixedAsset===!0}},Qe),M=r.useCallback(I=>{if(!u||b==null||k!=null&&k>0)return;const S=b.accounts??[],c=new Set(I);let V=!1,C=!1;for(const x of S)c.has(x.accountId)&&(x.classificationType==="prepaid"?V=!0:x.classificationType==="fixed_asset"&&(C=!0));V&&!_?(p("prepaid"),f(!0)):C&&!B&&(p("fixed_asset"),f(!0))},[u,b,k,_,B]),O=r.useCallback(I=>{E!=null&&(l(ea(v,I,U,E)),f(!1),p(null))},[l,v,E,U]),N=r.useCallback(()=>{E!=null&&(l(aa(v,E)),f(!1),p(null))},[l,v,E]);return{showPopup:m&&u,popupType:E,currencySymbol:A,checkAndShowPopup:M,handleSubmit:O,handleDismiss:N}}(),t=r.useRef(void 0),n=r.useRef([]),o=r.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=r.useRef(e);return i.current=e,r.useEffect(()=>{a==="In-Progress"&&(n.current=i.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const se=()=>{const a=we.getSignedInUser(),{useFeatureGate:e}=W(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return r.useMemo(()=>ta(a)&&s,[a,s])};function Ve(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ft(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=W(),o=h(y=>Y(y)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ye(o.userRole),m=o.userRole!=null&&Te(o.userRole),{isFeatureEnabled:f}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=t(F.isExpenseAutomationEnabled),{configValue:p}=n(Fe.enableUncategorizedExpenseCategory),g=p?.uncategorized_expense_category_enabled===!0,P=se(),T=r.useMemo(()=>({id:a,type:j(e)}),[a,e]),u=h(y=>$(y,T)),D=u?.transactionDetailUpdateStatus?.fetchState,v=u?.transactionDetailLocalData?.lineItemById,A=h(y=>{const H=$(y,T)?.transactionDetailLocalData.vendorUpdates?.id;return H==null?"Not-Started":y.transactionVendorViewState.editVendorStateById[H]?.saveStatus.fetchState??"Not-Started"}),b=r.useMemo(()=>u?.fetchState==="Completed"?Ve(u?.transaction):void 0,[u?.fetchState,u?.transaction]),k=h(y=>{if(b!=null)return be(y.customerIncomeState,y.vendorExpenseState,y.trendState,b,"month")}),U=h(y=>ae(y)),_=h(y=>{if(b!=null)return Ee(y.trendWithTransactionsState,b,"TransactionDetail")}),B=o.company?.companyInfo.firstMonthOfFY??1,M=h(y=>ve(y.accountState,y.accountListState,"accountList")),[O,N]=r.useState(!1),[I,S]=r.useState(!1),[c,V]=r.useState(!1);r.useEffect(()=>{N(!1),S(!1),V(!1)},[a,e]);const C=r.useCallback(()=>{N(!1),S(!1)},[]),[x,L]=r.useState(!1),q=_?.selectedPeriod?.timePeriod;return r.useEffect(()=>{c||u==null||u.transaction==null||(s(Ie({id:u.transaction.id,type:u.transaction.type})),V(!0)),b!=null&&(!i||l&&m===!1)&&(O?I||k==null||(S(!0),s(oe(b,"TransactionDetail",{timeframe:"month",timePeriod:q??k}))):(s(te()),s(ne()),N(!0),s(Ce(b))))},[s,c,u?.fetchState,u?.transaction,b,i,l,m,O,I,k,q]),r.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{s(z("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:m,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isChainOfThoughtEnabled:P,selectedTransaction:T,transactionDetail:u,rawDetailSaveStatus:D,rawDetailLineItemById:v,vendorSaveStatus:A,tranEntity:b,defaultTrendTransactionTimePeriod:k,vendorViewDetails:U,uiState:_,firstMonthOfFY:B,uncategorizedAccounts:M,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:x,setIsCreateVendorDrawerOpen:L}}const Ya={overlayWidth:new _a(100,100,58)},Qa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Fa(),i=Pa(),l=G(),m=h(p=>ae(p)),f=()=>{t()},E={vendorDetailView:n??m,onSaveSuccess:()=>{l(ke()),l(na("Not-Started")),s()},onSaveVendor:e,onCancelClick:f,saveVendorDetailLocalData:p=>{l(De({vendorId:void 0,localData:p}))}};return w.jsx(Ma,{anchor:"right",open:a,PaperProps:{style:{width:Ya.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:f,children:w.jsx(Za,{onClick:p=>p.stopPropagation(),children:w.jsx(Ua,{...E})})})},Za=za(Ga)`
1
+ import{j as w}from"./liveblocks-DvKPzrwo.js";import{a as r}from"./sentry-Be8twC83.js";import{u as G,k as Ye,j as h,s as Qe,g as he,h as ge,i as Se,N as Ze,n as Xe}from"./core-CQnSJ9vO.js";import{nJ as me,eW as Y,go as Ke,mW as ea,mE as aa,bn as ta,cU as ye,bt as Te,r6 as j,ML as $,NM as be,NN as ae,N9 as Ee,kD as ve,NO as Ie,Ne as te,Nf as ne,ls as Ce,JO as oe,MF as z,kx as De,kv as ke,kH as na,nw as oa,NP as sa,NQ as ia,va as J,kC as Ae,J7 as xe,cZ as ra,c_ as ca,NR as la,ME as da,NS as ua,v6 as ma,NT as pa,NU as fa,NV as ha,NW as ga,NX as Sa,kG as ya,NY as Ta,NZ as ba,MG as Ea,N_ as va,N$ as Ia,O0 as Ca,J1 as Da,IT as ka,Jg as Aa,kI as xa,JP as pe,nB as wa}from"./zeni-epic-state-DKeO4Z0C.js";import{H as W,x as F,z as we,aN as Fe,m as Fa,K as Pa,aO as Ua,A as _a,q as K,j as Na,aP as Va,r as ee,_ as Ba,aQ as Oa,c as Pe,aR as La,at as Ra,a2 as X}from"./index-W83PhAZh.js";import{n as za,S as Ga,D as Ma}from"./mui-sKCdI-e6.js";import{u as ja}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{d as Ue}from"./decodeURIComponentSafe-BprI0TcI.js";import{h as _e,c as Ne,g as $a,e as Wa}from"./routePaths-stnXzrYV.js";import{u as qa}from"./utils-BcJ2NV01.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]="820aacc5-be7b-461a-aa92-97e364ee785d",a._sentryDebugIdIdentifier="sentry-dbid-820aacc5-be7b-461a-aa92-97e364ee785d")}catch{}})();function Ha(a=!0){const e=G(),s=Ye(),{useFeatureGate:t}=W(),{isFeatureEnabled:n}=t(F.isCreateTransferEntryFromExpenseEnabled);r.useEffect(()=>{if(!a||n!==!0)return;const o=i=>{const l=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return l!=="In-Progress"&&l!=="Completed"};o("transferEntryEligible")&&e(me({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(me({kind:"creditCardOnlyEligible"}))},[a,n,e,s])}function Ja(a,e){const s=function(){const l=G(),[m,f]=r.useState(!1),[E,p]=r.useState(null),{useDynamicConfig:g}=W(),{configValue:P,isDynamicConfigLoading:T}=g("transaction_categorization_config"),u=!T&&P?.capitalization_enabled===!0,D=h(I=>Y(I)),v=D.companyId,A=h(I=>Ke(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:b,globalThreshold:k,maxCeiling:U,onboardingShownForPrepaid:_,onboardingShownForFixedAsset:B}=h(I=>{const S=I.tenantState.currentTenantId,c=S!=null?I.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:c?.capitalizableAccounts??null,globalThreshold:c?.capitalizationThreshold??null,maxCeiling:c?.capitalizationThresholdMaxCeiling??null,onboardingShownForPrepaid:c?.capitalizationOnboardingShownForPrepaid===!0,onboardingShownForFixedAsset:c?.capitalizationOnboardingShownForFixedAsset===!0}},Qe),M=r.useCallback(I=>{if(!u||b==null||k!=null&&k>0)return;const S=b.accounts??[],c=new Set(I);let V=!1,C=!1;for(const x of S)c.has(x.accountId)&&(x.classificationType==="prepaid"?V=!0:x.classificationType==="fixed_asset"&&(C=!0));V&&!_?(p("prepaid"),f(!0)):C&&!B&&(p("fixed_asset"),f(!0))},[u,b,k,_,B]),O=r.useCallback(I=>{E!=null&&(l(ea(v,I,U,E)),f(!1),p(null))},[l,v,E,U]),N=r.useCallback(()=>{E!=null&&(l(aa(v,E)),f(!1),p(null))},[l,v,E]);return{showPopup:m&&u,popupType:E,currencySymbol:A,checkAndShowPopup:M,handleSubmit:O,handleDismiss:N}}(),t=r.useRef(void 0),n=r.useRef([]),o=r.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=r.useRef(e);return i.current=e,r.useEffect(()=>{a==="In-Progress"&&(n.current=i.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const se=()=>{const a=we.getSignedInUser(),{useFeatureGate:e}=W(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return r.useMemo(()=>ta(a)&&s,[a,s])};function Ve(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ft(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=W(),o=h(y=>Y(y)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ye(o.userRole),m=o.userRole!=null&&Te(o.userRole),{isFeatureEnabled:f}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=t(F.isExpenseAutomationEnabled),{configValue:p}=n(Fe.enableUncategorizedExpenseCategory),g=p?.uncategorized_expense_category_enabled===!0,P=se(),T=r.useMemo(()=>({id:a,type:j(e)}),[a,e]),u=h(y=>$(y,T)),D=u?.transactionDetailUpdateStatus?.fetchState,v=u?.transactionDetailLocalData?.lineItemById,A=h(y=>{const H=$(y,T)?.transactionDetailLocalData.vendorUpdates?.id;return H==null?"Not-Started":y.transactionVendorViewState.editVendorStateById[H]?.saveStatus.fetchState??"Not-Started"}),b=r.useMemo(()=>u?.fetchState==="Completed"?Ve(u?.transaction):void 0,[u?.fetchState,u?.transaction]),k=h(y=>{if(b!=null)return be(y.customerIncomeState,y.vendorExpenseState,y.trendState,b,"month")}),U=h(y=>ae(y)),_=h(y=>{if(b!=null)return Ee(y.trendWithTransactionsState,b,"TransactionDetail")}),B=o.company?.companyInfo.firstMonthOfFY??1,M=h(y=>ve(y.accountState,y.accountListState,"accountList")),[O,N]=r.useState(!1),[I,S]=r.useState(!1),[c,V]=r.useState(!1);r.useEffect(()=>{N(!1),S(!1),V(!1)},[a,e]);const C=r.useCallback(()=>{N(!1),S(!1)},[]),[x,L]=r.useState(!1),q=_?.selectedPeriod?.timePeriod;return r.useEffect(()=>{c||u==null||u.transaction==null||(s(Ie({id:u.transaction.id,type:u.transaction.type})),V(!0)),b!=null&&(!i||l&&m===!1)&&(O?I||k==null||(S(!0),s(oe(b,"TransactionDetail",{timeframe:"month",timePeriod:q??k}))):(s(te()),s(ne()),N(!0),s(Ce(b))))},[s,c,u?.fetchState,u?.transaction,b,i,l,m,O,I,k,q]),r.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{s(z("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:m,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isChainOfThoughtEnabled:P,selectedTransaction:T,transactionDetail:u,rawDetailSaveStatus:D,rawDetailLineItemById:v,vendorSaveStatus:A,tranEntity:b,defaultTrendTransactionTimePeriod:k,vendorViewDetails:U,uiState:_,firstMonthOfFY:B,uncategorizedAccounts:M,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:x,setIsCreateVendorDrawerOpen:L}}const Ya={overlayWidth:new _a(100,100,58)},Qa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Fa(),i=Pa(),l=G(),m=h(p=>ae(p)),f=()=>{t()},E={vendorDetailView:n??m,onSaveSuccess:()=>{l(ke()),l(na("Not-Started")),s()},onSaveVendor:e,onCancelClick:f,saveVendorDetailLocalData:p=>{l(De({vendorId:void 0,localData:p}))}};return w.jsx(Ma,{anchor:"right",open:a,PaperProps:{style:{width:Ya.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:f,children:w.jsx(Za,{onClick:p=>p.stopPropagation(),children:w.jsx(Ua,{...E})})})},Za=za(Ga)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DvKPzrwo.js";import{h as Z,g as U,u as K,i as Q,j as h,N as w,n as X,o as be,p as j}from"./core-CQnSJ9vO.js";import{eW as H,qN as ee,jR as p,Rc as te,JF as De,bq as le,Rd as Ee,ks as ae,Nb as ne,Re as ue,Rf as ve,bE as Y,JB as ye,Rg as Pe,Rh as me,Ri as je,JE as Ae,Rj as xe,Rk as pe,Rl as Me,Rm as ge,Rn as Fe,Ro as Le,Rp as fe,KR as Be,bn as Ce}from"./zeni-epic-state-DKeO4Z0C.js";import{D as de,H as W,x as G,c as z,cl as ce,r as q,q as oe,Y as Re,z as Oe}from"./index-CKi6vsOO.js";import"./mui-sKCdI-e6.js";import{a as S}from"./sentry-Be8twC83.js";import{w as se}from"./withTransactionSidePanel-Ak3Soyd6.js";import{p as ie,c as re}from"./routePaths-DnD95y3h.js";import{v as ze}from"./utils-BcJ2NV01.js";import{d as E}from"./decodeURIComponentSafe-BprI0TcI.js";import{Z as we}from"./ZeniAccountStatementScreen-BM5LaChl.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import"./TransactionDetailScreen-DCUgWZCw.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]="3a03f5b9-53f1-4b31-a328-1fdb937ac8e5",a._sentryDebugIdIdentifier="sentry-dbid-3a03f5b9-53f1-4b31-a328-1fdb937ac8e5")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),_e=X(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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=N(e.selectedAccount.tranListType),u=Je(t,n,c,l,e.bookCloseDate);z.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:N(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Z(),t=U(),n=K(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>H(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=W(),{isFeatureEnabled:k}=g(G.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:L,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[B,P]=S.useState(!1),[C,R]=S.useState(void 0),T=S.useMemo(()=>{const r=p(v);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,L]);S.useEffect(()=>{if(!B&&T!=null){P(!0),z.trackTransactionList(void 0,void 0,void 0,T.title);const r=N(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,T,n]);let M=T;return T!=null&&C!=null&&(M={...T,period:C}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(_e,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:L,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>R(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:""}},Ve=(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}}},Je=(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},Ne=X(function(a,e){const t=Pe(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),z.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(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=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>ve(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>H(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ue(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=He(L?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(Ne,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ue=(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")?p(a):p(e),We=X(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),z.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(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),Ze=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>je(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>H(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ke(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Qe(L?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(We,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(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,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Le(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(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)}`),z.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(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=at(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=Q(),f=E(l??""),g=E(u??""),k=E(A??""),x=!(I!=null&&I==="exclude_subaccounts"),L=h(b=>Me(b.transactionListState,g,f)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(b=>H(b)),T=R.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=R.company?.companyInfo.firstMonthOfFY??1;let r;const _=et(f,g,m,D,y,k);if(_){const b={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(L?.dateRange,b);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&P!=null&&(i={...r,period:P});const{useFeatureGate:O}=W(),{isFeatureEnabled:F}=O(G.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(G.isProjectsTransactionsEnabled),d=h(b=>ee(b))&&V,{areTenantIdsInSync:$}=Re();S.useEffect(()=>{!v&&r!=null&&$&&(B(!0),z.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(b=>b!=null);return _&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:F,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>C(b),...e}):s.jsx(w,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(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,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Be}/statements`;function Yt(){const a=U().state?.referrer,e=Oe.getSignedInUser(),t=Ce(e),{useFeatureGate:n}=W(),{isFeatureEnabled:c}=n(G.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>H(m)).tenantId],{isFeatureEnabled:l}=n(G.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(be,{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(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(J,{})}),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(Ze,{referrerType:a})})]})}export{Yt as default};
1
+ import{j as s}from"./liveblocks-DvKPzrwo.js";import{h as Z,g as U,u as K,i as Q,j as h,N as w,n as X,o as be,p as j}from"./core-CQnSJ9vO.js";import{eW as H,qN as ee,jR as p,Rc as te,JF as De,bq as le,Rd as Ee,ks as ae,Nb as ne,Re as ue,Rf as ve,bE as Y,JB as ye,Rg as Pe,Rh as me,Ri as je,JE as Ae,Rj as xe,Rk as pe,Rl as Me,Rm as ge,Rn as Fe,Ro as Le,Rp as fe,KR as Be,bn as Ce}from"./zeni-epic-state-DKeO4Z0C.js";import{D as de,H as W,x as G,c as z,cl as ce,r as q,q as oe,Y as Re,z as Oe}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import{a as S}from"./sentry-Be8twC83.js";import{w as se}from"./withTransactionSidePanel-B9fglQqM.js";import{p as ie,c as re}from"./routePaths-stnXzrYV.js";import{v as ze}from"./utils-BcJ2NV01.js";import{d as E}from"./decodeURIComponentSafe-BprI0TcI.js";import{Z as we}from"./ZeniAccountStatementScreen-Ciuw5n7i.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import"./TransactionDetailScreen-ABqf1zzA.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]="3a03f5b9-53f1-4b31-a328-1fdb937ac8e5",a._sentryDebugIdIdentifier="sentry-dbid-3a03f5b9-53f1-4b31-a328-1fdb937ac8e5")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),_e=X(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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=N(e.selectedAccount.tranListType),u=Je(t,n,c,l,e.bookCloseDate);z.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:N(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Z(),t=U(),n=K(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>H(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=W(),{isFeatureEnabled:k}=g(G.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:L,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[B,P]=S.useState(!1),[C,R]=S.useState(void 0),T=S.useMemo(()=>{const r=p(v);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,L]);S.useEffect(()=>{if(!B&&T!=null){P(!0),z.trackTransactionList(void 0,void 0,void 0,T.title);const r=N(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,T,n]);let M=T;return T!=null&&C!=null&&(M={...T,period:C}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(_e,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:L,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>R(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:""}},Ve=(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}}},Je=(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},Ne=X(function(a,e){const t=Pe(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),z.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(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=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>ve(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>H(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ue(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=He(L?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(Ne,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ue=(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")?p(a):p(e),We=X(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),z.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(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),Ze=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>je(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>H(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ke(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Qe(L?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(We,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(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,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Le(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(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)}`),z.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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(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=at(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=Q(),f=E(l??""),g=E(u??""),k=E(A??""),x=!(I!=null&&I==="exclude_subaccounts"),L=h(b=>Me(b.transactionListState,g,f)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(b=>H(b)),T=R.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=R.company?.companyInfo.firstMonthOfFY??1;let r;const _=et(f,g,m,D,y,k);if(_){const b={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(L?.dateRange,b);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&P!=null&&(i={...r,period:P});const{useFeatureGate:O}=W(),{isFeatureEnabled:F}=O(G.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(G.isProjectsTransactionsEnabled),d=h(b=>ee(b))&&V,{areTenantIdsInSync:$}=Re();S.useEffect(()=>{!v&&r!=null&&$&&(B(!0),z.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(b=>b!=null);return _&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:F,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>C(b),...e}):s.jsx(w,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(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,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Be}/statements`;function Yt(){const a=U().state?.referrer,e=Oe.getSignedInUser(),t=Ce(e),{useFeatureGate:n}=W(),{isFeatureEnabled:c}=n(G.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>H(m)).tenantId],{isFeatureEnabled:l}=n(G.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(be,{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(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(J,{})}),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(Ze,{referrerType:a})})]})}export{Yt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-DvKPzrwo.js";import{h as L,g as B,u as U,i as O,j as y,N as P,n as N,o as Ce,p as k}from"./core-CQnSJ9vO.js";import{cq as _,eW as D,PU as R,G0 as ae,fx as H,FK as ne,PW as Ie,G3 as ke,PS as be,PT as se,Qa as je,E7 as Ae,t_ as Ee,PY as ve,Gm as De,PV as re,cT as K,yd as oe,fc as Fe,fe as Pe,R9 as Le,Ra as Be,FL as Ue,Rb as Re,FM as Me,FV as Ve,bt as Oe,bJ as Ne,cB as _e,bK as Ge,cp as ze,fw as $e,bs as qe,LA as He,co as Ke}from"./zeni-epic-state-DKeO4Z0C.js";import{j as G,aq as We,z as A,w as z,c as b,ce as Ze,cf as Je,cg as q,K as W,m as Ye,Y as Qe,_ as Xe,H as ie,x as E,A as et,B as tt,ch as at,at as Z,r as nt,ci as st,q as J,cj as rt,M as Q,ck as ot,a9 as it}from"./index-CKi6vsOO.js";import{D as ct,n as M,S as lt}from"./mui-sKCdI-e6.js";import ut from"./NotFoundScreen-DhKhgQXf.js";import{S as X}from"./SetupPagesScreen-CV2uB6tM.js";import{a as p}from"./sentry-Be8twC83.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-vLqybwHr.js";import{u as pt}from"./useInitialThreadRequest-BqamPVgS.js";import{u as mt}from"./useCashManagementBanner-CrBaeOUK.js";import{M as ce}from"./MobileAppDrawer-Dos6aPiF.js";import{F as ft}from"./FeaturePreviewScreen-LQn2_3HO.js";import{a as ee}from"./analyticsHelper-DvY5NpaM.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./routePaths-DnD95y3h.js";import"./BusinessVerificationPageScreen-Cz8yHsjg.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]="719b97ff-dcf2-4bf6-97e8-27835a2c7664",t._sentryDebugIdIdentifier="sentry-dbid-719b97ff-dcf2-4bf6-97e8-27835a2c7664")}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))}}})(Ze);function gt(){const t=L(),a=B(),n=U(),{tenantEmailDomain:o}=O(),m=G(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=We(s),r=_(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,w]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=y(I=>R(I,g)),C=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||C!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,C,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(H()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(w(!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(P,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||C!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{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(Ee("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ae(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),St=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=U(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,w]=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)),T=A.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),C=y(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||T==null||(r(!0),o(ae(T,!0,!1)))},[f,d,T,o]),p.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(H()))},[l,c,T,o]),p.useEffect(()=>{u||h!=="Not-Started"||T==null||(w(!0),o(ne()))},[u,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:C,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{q(b,"review",S.treasuryTransferMoneyLocalData,C.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
1
+ import{j as e}from"./liveblocks-DvKPzrwo.js";import{h as L,g as B,u as U,i as O,j as y,N as P,n as N,o as Ce,p as k}from"./core-CQnSJ9vO.js";import{cq as _,eW as D,PU as R,G0 as ae,fx as H,FK as ne,PW as Ie,G3 as ke,PS as be,PT as se,Qa as je,E7 as Ae,t_ as Ee,PY as ve,Gm as De,PV as re,cT as K,yd as oe,fc as Fe,fe as Pe,R9 as Le,Ra as Be,FL as Ue,Rb as Re,FM as Me,FV as Ve,bt as Oe,bJ as Ne,cB as _e,bK as Ge,cp as ze,fw as $e,bs as qe,LA as He,co as Ke}from"./zeni-epic-state-DKeO4Z0C.js";import{j as G,aq as We,z as A,w as z,c as b,ce as Ze,cf as Je,cg as q,K as W,m as Ye,Y as Qe,_ as Xe,H as ie,x as E,A as et,B as tt,ch as at,at as Z,r as nt,ci as st,q as J,cj as rt,M as Q,ck as ot,a9 as it}from"./index-W83PhAZh.js";import{D as ct,n as M,S as lt}from"./mui-sKCdI-e6.js";import ut from"./NotFoundScreen-FcrdBNP0.js";import{S as X}from"./SetupPagesScreen-DtddTp_T.js";import{a as p}from"./sentry-Be8twC83.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{u as pt}from"./useInitialThreadRequest-BDAn-AM4.js";import{u as mt}from"./useCashManagementBanner-D8slgHwh.js";import{M as ce}from"./MobileAppDrawer-CjoW3Rax.js";import{F as ft}from"./FeaturePreviewScreen-9NvuDbvP.js";import{a as ee}from"./analyticsHelper-CvGdvadP.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./routePaths-stnXzrYV.js";import"./BusinessVerificationPageScreen-7ydI8UR9.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]="719b97ff-dcf2-4bf6-97e8-27835a2c7664",t._sentryDebugIdIdentifier="sentry-dbid-719b97ff-dcf2-4bf6-97e8-27835a2c7664")}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))}}})(Ze);function gt(){const t=L(),a=B(),n=U(),{tenantEmailDomain:o}=O(),m=G(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=We(s),r=_(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,w]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=y(I=>R(I,g)),C=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||C!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,C,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(H()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(w(!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(P,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||C!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{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(Ee("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ae(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),St=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=U(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,w]=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)),T=A.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),C=y(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||T==null||(r(!0),o(ae(T,!0,!1)))},[f,d,T,o]),p.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(H()))},[l,c,T,o]),p.useEffect(()=>{u||h!=="Not-Started"||T==null||(w(!0),o(ne()))},[u,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:C,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{q(b,"review",S.treasuryTransferMoneyLocalData,C.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%;