@zeniai/web-app-ui 5.1.99-dev → 5.1.99-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/assets/{AddressRoutes-SzC0f9Ey.js → AddressRoutes-ChIEG7ZZ.js} +1 -1
  2. package/dist/assets/{AddressScreen-B6jePLNb.js → AddressScreen-CBnElFxM.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BIqmmB2_.js → AiCfoScreen-DXLxFBnQ.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BxBCP76q.js → BillPayApprovalRoutes-CB55AV0C.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BbDMo6Fo.js → BillPayRoutes-UVA-u63A.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BVQ7YkrT.js → BusinessVerificationPageScreen-DsowR4fB.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-C1i1iivR.js → CardsAiCfoScreen-BaEolMVN.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-Bg0csdWv.js → ChargeCardRoutes-D3n7KJn0.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-DJBa9GcN.js → CompanyPassportScreen-wSnqdrZm.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-U6qbLxl3.js → ConnectionAuthScreen-RH-ZQnmS.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-BUx9I6JP.js → CustomerOnboardingAuthScreen-Bro8vP9Q.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-C_IeyrHG.js → CustomerOnboardingRoutes-DT_Ih6lH.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-qsNqx2F0.js → DashboardRoutes-B4SpN_q5.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-CxB3ue_3.js → DefaultTenantHome-C-Q9oQmt.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-DFtHvoPg.js → DomesticWireDetailScreen-DmspT9Qv.js} +1 -1
  16. package/dist/assets/{DrawerScreen-BcnO9pRK.js → DrawerScreen-CTBdvd2J.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-BEeCoXzX.js → EntityDetailRoutes-DPOfKd1l.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-BxBGqZYB.js → ExpenseAutomationRoutes-nIGBHuEd.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-CMmpeBsa.js → FeaturePreviewScreen-CS0na0Uv.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-TBX3l_v_.js → HubSpotOAuthCallbackScreen-CDdCifUI.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-m2wKYUQr.js → MagicLinkRoutes-BTau9CfB.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-CWP7KaD9.js → MagicLinkSignInScreen-BQxK3HJS.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-DRd73Iks.js → MobileAppDrawer-By5kqJZy.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-YuP4L1AW.js → NotFoundScreen-BUpSeNgf.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-B3RoBaR6.js → NotificationRoutes-CkKMsCoc.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-XaLucPtZ.js → OAuthConsentScreen-BzkRmkhL.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-wD1K6rfI.js → PandLWithForecastRoutes-DB98rpg8.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-D_Oa27_2.js → PeopleRoutes-BPQhjQKR.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-CLJo-8IK.js → PerformanceRoutes-Cu8GwbPn.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-ptFN6mr0.js → QBOConnectionScreen-BOAmyhRI.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-BVoIBvNf.js → ReferralListScreen-Bg4MIsqb.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-Kcgc1mYC.js → ReimbursementApprovalRoutes-CLqW8bjU.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BuRLJNpP.js → ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-aNal0ziw.js → ReimbursementRoutes-CnfaWQKq.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-C6hGF7yo.js → ReportsRoutes-ZKjtrrXu.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-C2PQ6DsC.js → RewardsRoutes-Dmsl5Hhz.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-CjAalKPw.js → ScreenRoutes-DtVjvGeB.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-CwDHbTT4.js → SettingsRoutes-0RQL-spt.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-CnC81M3U.js → SetupPagesScreen-lXVOcLJ8.js} +1 -1
  40. package/dist/assets/{SignInScreen-ByIOXV6F.js → SignInScreen-Caakz2DY.js} +1 -1
  41. package/dist/assets/{SignOutScreen-C5xrOplh.js → SignOutScreen-CtzEkEl4.js} +1 -1
  42. package/dist/assets/{TaskListScreen-BQI4lSnv.js → TaskListScreen-BtTYiD21.js} +1 -1
  43. package/dist/assets/{TaskRoutes-D3GZ9e6L.js → TaskRoutes-X8P3xHwH.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-BdKXH06W.js → TransactionDetailRoutes-DFhCPCQa.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-Df5fqXxJ.js → TransactionDetailScreen-CRWTcneH.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-Do-Bz9c8.js → TransactionListRoutes-kn0wMJaj.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DeRwBYUX.js → TreasuryRoutes-h3ROpRx5.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-DRIUcak8.js → VendorsRoutes-x1VmRs4J.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-BHC5yOsA.js → WiseConfirmationScreen-CIMiBhET.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-DQKc0S6j.js → ZeniAccountRoutes-BOVvauFK.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-su4HxFHo.js → ZeniAccountStatementScreen-DZHjDSg5.js} +1 -1
  52. package/dist/assets/{analyticsHelper-Cp1NXf0W.js → analyticsHelper-C8vUB4gm.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-DtzopER1.js → getLocaleForTenant-CqQ308VG.js} +1 -1
  54. package/dist/assets/{index-sRBDhi1m.js → index-Dy73EgcO.js} +5 -5
  55. package/dist/assets/{routePaths-Bj6MBuce.js → routePaths-YBRbNv0i.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BSw9qIge.js → useAiCfoDashboardSuggestedQuestionsChips-B3JxpD0o.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-GvI044sz.js → useAskAiCfoHostNavButtonProps-Dx1w_2sk.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-BjggUhzA.js → useCashManagementBanner-MgmXXc9G.js} +1 -1
  59. package/dist/assets/{useChargeCardPusherEvents-04WGk6du.js → useChargeCardPusherEvents-DGhBtw5K.js} +1 -1
  60. package/dist/assets/{useEmailConnectResultRefresh-CzyKHMLk.js → useEmailConnectResultRefresh-CG-YyoOP.js} +1 -1
  61. package/dist/assets/{useInitialThreadRequest-auUWihGo.js → useInitialThreadRequest-B7WOjZ27.js} +1 -1
  62. package/dist/assets/{withTransactionSidePanel-CBDlugrB.js → withTransactionSidePanel-BsJ58rSa.js} +1 -1
  63. package/dist/index.html +1 -1
  64. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-tpE-grBU.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-0WK0Zss8.js";import{eX as H,QQ as ue,c6 as pe,EM as Fe,kL as dt,EZ as oe,EY as re,QR as ut,bn as be,gp as Ue,QS as pt,Nd as bt,kA as Le,Ne as Ae,Nf as gt,jv as ht,Q8 as ft,jK as St,EA as It,ue as Rt,jC as yt,Fk as Pe,QT as $e,QU as At,QV as kt,QW as vt,QX as Ct,QY as Et,F4 as ke,jQ as wt,Qh as xt,E_ as Bt,EK as Tt,QZ as jt,EJ as Dt,Q_ as Ft,ES as ve,F8 as Ut,F7 as Lt,F3 as Pt,Q$ as Me,Kj as $t,bq as Mt,EV as _t,FC as Nt,R0 as Ot,R1 as Gt,Fg as Qt,Fd as Ce,PD as zt,EH as Zt,R2 as _e,G2 as Ee,Ga as Ht,R3 as Vt,R4 as Q,R5 as Wt,R6 as Ne,R7 as Kt,R8 as Oe,R9 as Ge,Fs as le,bu as qt,bK as ge,cH as he,fE as Qe,fC as ze,Ra as Jt,fz as Xt,PQ as Yt,Rb as en,Rc as Ze,PU as tn,QC as nn,Rd as an,QP as sn,G7 as we,G6 as on,Re as rn,Rf as ln,Rg as mn,Rh as cn,Ri as dn,Qn as un,FZ as pn,G1 as bn,bs as gn,bJ as hn,cB as fn,cp as Sn,bt as In,M1 as Rn,cR as yn,cU as An,cT as kn,cA as vn}from"./zeni-epic-state-Bx_bp9Xr.js";import{Q as He,m as Ve,C as ee,G as E,z as $,c1 as We,D as te,d as k,aM as xe,o as D,au as X,I as Cn,a as Ke,c2 as En,r as z,a0 as qe,c3 as wn,T as ne,c4 as xn,_ as Bn,E as Tn,B as fe,f as Je,a9 as jn,bp as Dn,a4 as Fn,y as Xe,c5 as Un,i as Ln}from"./index-sRBDhi1m.js";import{n as N,S as Pn}from"./mui-NHWzIwJg.js";import me from"./NotFoundScreen-YuP4L1AW.js";import{S as Be}from"./SetupPagesScreen-CnC81M3U.js";import{F as Ye}from"./FeaturePreviewScreen-CMmpeBsa.js";import{a as f}from"./sentry-D58SEIt0.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import{u as et}from"./useInitialThreadRequest-auUWihGo.js";import{D as $n}from"./DrawerScreen-BcnO9pRK.js";import{M as tt}from"./MobileAppDrawer-DRd73Iks.js";import{R as Mn}from"./ReimbursementApprovalRoutes-Kcgc1mYC.js";import{FallBackRoute as _n}from"./ScreenRoutes-CjAalKPw.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./analyticsHelper-Cp1NXf0W.js";import"./routePaths-Bj6MBuce.js";import"./BusinessVerificationPageScreen-BVQ7YkrT.js";import"./ReimbursementApprovalRuleDetailScreen-BuRLJNpP.js";import"./getLocaleForTenant-DtzopER1.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]="d2b20ad4-8dc1-42ac-8df2-2d3889fa8b65",e._sentryDebugIdIdentifier="sentry-dbid-d2b20ad4-8dc1-42ac-8df2-2d3889fa8b65")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(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(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!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(ve(!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(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({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($e()),e(At());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),v=$.getSignedInUser(),I=w((p=>H(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Qn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Gn=N.div`
1
+ import{j as s}from"./liveblocks-tpE-grBU.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-0WK0Zss8.js";import{eX as H,QQ as ue,c6 as pe,EM as Fe,kL as dt,EZ as oe,EY as re,QR as ut,bn as be,gp as Ue,QS as pt,Nd as bt,kA as Le,Ne as Ae,Nf as gt,jv as ht,Q8 as ft,jK as St,EA as It,ue as Rt,jC as yt,Fk as Pe,QT as $e,QU as At,QV as kt,QW as vt,QX as Ct,QY as Et,F4 as ke,jQ as wt,Qh as xt,E_ as Bt,EK as Tt,QZ as jt,EJ as Dt,Q_ as Ft,ES as ve,F8 as Ut,F7 as Lt,F3 as Pt,Q$ as Me,Kj as $t,bq as Mt,EV as _t,FC as Nt,R0 as Ot,R1 as Gt,Fg as Qt,Fd as Ce,PD as zt,EH as Zt,R2 as _e,G2 as Ee,Ga as Ht,R3 as Vt,R4 as Q,R5 as Wt,R6 as Ne,R7 as Kt,R8 as Oe,R9 as Ge,Fs as le,bu as qt,bK as ge,cH as he,fE as Qe,fC as ze,Ra as Jt,fz as Xt,PQ as Yt,Rb as en,Rc as Ze,PU as tn,QC as nn,Rd as an,QP as sn,G7 as we,G6 as on,Re as rn,Rf as ln,Rg as mn,Rh as cn,Ri as dn,Qn as un,FZ as pn,G1 as bn,bs as gn,bJ as hn,cB as fn,cp as Sn,bt as In,M1 as Rn,cR as yn,cU as An,cT as kn,cA as vn}from"./zeni-epic-state-Bx_bp9Xr.js";import{Q as He,m as Ve,C as ee,G as E,z as $,c1 as We,D as te,d as k,aM as xe,o as D,au as X,I as Cn,a as Ke,c2 as En,r as z,a0 as qe,c3 as wn,T as ne,c4 as xn,_ as Bn,E as Tn,B as fe,f as Je,a9 as jn,bp as Dn,a4 as Fn,y as Xe,c5 as Un,i as Ln}from"./index-Dy73EgcO.js";import{n as N,S as Pn}from"./mui-NHWzIwJg.js";import me from"./NotFoundScreen-BUpSeNgf.js";import{S as Be}from"./SetupPagesScreen-lXVOcLJ8.js";import{F as Ye}from"./FeaturePreviewScreen-CS0na0Uv.js";import{a as f}from"./sentry-D58SEIt0.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import{u as et}from"./useInitialThreadRequest-B7WOjZ27.js";import{D as $n}from"./DrawerScreen-CTBdvd2J.js";import{M as tt}from"./MobileAppDrawer-By5kqJZy.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CLqW8bjU.js";import{FallBackRoute as _n}from"./ScreenRoutes-DtVjvGeB.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./analyticsHelper-C8vUB4gm.js";import"./routePaths-YBRbNv0i.js";import"./BusinessVerificationPageScreen-DsowR4fB.js";import"./ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js";import"./getLocaleForTenant-CqQ308VG.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]="d2b20ad4-8dc1-42ac-8df2-2d3889fa8b65",e._sentryDebugIdIdentifier="sentry-dbid-d2b20ad4-8dc1-42ac-8df2-2d3889fa8b65")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(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(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!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(ve(!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(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({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($e()),e(At());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),v=$.getSignedInUser(),I=w((p=>H(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Qn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Gn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-tpE-grBU.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-0WK0Zss8.js";import{eX as L,fT as w,Mu as Te,kA as K,qU as W,rJ as A,ko as Re,js as Me,vh as Q,rO as Oe,bs as Ae,Mv as Fe,bn as ke,wq as De,Mw as Ee,Mx as je,v9 as Pe,My as Y,Mz as Le,MA as ve,MB as Be,MC as Ue,MD as I,ME as F,MF as k,MG as N,MH as D,MI as E,dK as Ve,w6 as xe,vW as $,vX as q,wc as ze,v$ as X,wi as Ge,MJ as He,MK as Ye,ML as Ne,MM as $e,MN as qe,fE as Xe,fC as Ze}from"./zeni-epic-state-Bx_bp9Xr.js";import{W as Je,X as Ke,Y as We,Z as Qe,m as ea,C as ee,G as j,z as ae,_ as aa,T as sa,c as ta,$ as oa,a0 as na,D as ra,d as P,f as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-sRBDhi1m.js";import"./mui-NHWzIwJg.js";import fa from"./NotFoundScreen-YuP4L1AW.js";import{F as ma}from"./FeaturePreviewScreen-CMmpeBsa.js";import{a as _}from"./sentry-D58SEIt0.js";import{u as ua}from"./useInitialThreadRequest-auUWihGo.js";import{t as Z,a as J,b as _a}from"./routePaths-Bj6MBuce.js";import{M as ha}from"./MobileAppDrawer-DRd73Iks.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="219dd663-dacb-4816-a4ed-befe69d5d395",e._sentryDebugIdIdentifier="sentry-dbid-219dd663-dacb-4816-a4ed-befe69d5d395")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},Ca=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled: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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e($(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(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({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(X(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 Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(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?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(Q())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>K(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!v&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,v,g,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(Q());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&&Ae(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Je(he??"")==="reports",be=Ke(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled: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=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Xe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-tpE-grBU.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-0WK0Zss8.js";import{eX as L,fT as w,Mu as Te,kA as K,qU as W,rJ as A,ko as Re,js as Me,vh as Q,rO as Oe,bs as Ae,Mv as Fe,bn as ke,wq as De,Mw as Ee,Mx as je,v9 as Pe,My as Y,Mz as Le,MA as ve,MB as Be,MC as Ue,MD as I,ME as F,MF as k,MG as N,MH as D,MI as E,dK as Ve,w6 as xe,vW as $,vX as q,wc as ze,v$ as X,wi as Ge,MJ as He,MK as Ye,ML as Ne,MM as $e,MN as qe,fE as Xe,fC as Ze}from"./zeni-epic-state-Bx_bp9Xr.js";import{W as Je,X as Ke,Y as We,Z as Qe,m as ea,C as ee,G as j,z as ae,_ as aa,T as sa,c as ta,$ as oa,a0 as na,D as ra,d as P,f as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-Dy73EgcO.js";import"./mui-NHWzIwJg.js";import fa from"./NotFoundScreen-BUpSeNgf.js";import{F as ma}from"./FeaturePreviewScreen-CS0na0Uv.js";import{a as _}from"./sentry-D58SEIt0.js";import{u as ua}from"./useInitialThreadRequest-B7WOjZ27.js";import{t as Z,a as J,b as _a}from"./routePaths-YBRbNv0i.js";import{M as ha}from"./MobileAppDrawer-By5kqJZy.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="219dd663-dacb-4816-a4ed-befe69d5d395",e._sentryDebugIdIdentifier="sentry-dbid-219dd663-dacb-4816-a4ed-befe69d5d395")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},Ca=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled: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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e($(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(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({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(X(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 Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(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?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(Q())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>K(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!v&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,v,g,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(Q());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&&Ae(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Je(he??"")==="reports",be=Ke(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled: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=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Xe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-tpE-grBU.js";import{C as x,z as w,aS as y,D as E,d as p,f as F,d9 as L,G as T}from"./index-sRBDhi1m.js";import"./mui-NHWzIwJg.js";import m from"./NotFoundScreen-YuP4L1AW.js";import{a as d}from"./sentry-D58SEIt0.js";import{u as P,j as b,h as V,g as A,n as R,o as U,p as f}from"./core-0WK0Zss8.js";import{eX as z,TI as C,Q1 as G,TJ as v,vN as K,fK as Y,TK as J,vL as O}from"./zeni-epic-state-Bx_bp9Xr.js";import{R as j}from"./ReferralListScreen-BVoIBvNf.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import"./MobileAppDrawer-DRd73Iks.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]="a6014409-e5ee-4608-8ad4-0fb158c4fdd7",e._sentryDebugIdIdentifier="sentry-dbid-a6014409-e5ee-4608-8ad4-0fb158c4fdd7")}catch{}})();const Q=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=w.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(J({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(L),X=()=>{const e=P(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b((o=>z(o))),c=V(),D=A(),{useDynamicConfig:g}=x(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=b((o=>C(o))),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),k=G(S);d.useEffect((()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))}),[]),d.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))}),[l.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(Q,{navigate:c,location:D,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(j,{}):a.jsx(m,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(X,{}):a.jsx(m,{})}),a.jsx(f,{path:"*",element:a.jsx(m,{})})]})}export{fe as default};
1
+ import{j as a}from"./liveblocks-tpE-grBU.js";import{C as x,z as w,aS as y,D as E,d as p,f as F,d9 as L,G as T}from"./index-Dy73EgcO.js";import"./mui-NHWzIwJg.js";import m from"./NotFoundScreen-BUpSeNgf.js";import{a as d}from"./sentry-D58SEIt0.js";import{u as P,j as b,h as V,g as A,n as R,o as U,p as f}from"./core-0WK0Zss8.js";import{eX as z,TI as C,Q1 as G,TJ as v,vN as K,fK as Y,TK as J,vL as O}from"./zeni-epic-state-Bx_bp9Xr.js";import{R as j}from"./ReferralListScreen-Bg4MIsqb.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import"./MobileAppDrawer-By5kqJZy.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]="a6014409-e5ee-4608-8ad4-0fb158c4fdd7",e._sentryDebugIdIdentifier="sentry-dbid-a6014409-e5ee-4608-8ad4-0fb158c4fdd7")}catch{}})();const Q=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=w.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(J({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(L),X=()=>{const e=P(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b((o=>z(o))),c=V(),D=A(),{useDynamicConfig:g}=x(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=b((o=>C(o))),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),k=G(S);d.useEffect((()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))}),[]),d.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))}),[l.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(Q,{navigate:c,location:D,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(j,{}):a.jsx(m,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(X,{}):a.jsx(m,{})}),a.jsx(f,{path:"*",element:a.jsx(m,{})})]})}export{fe as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-qsNqx2F0.js","assets/sentry-D58SEIt0.js","assets/core-0WK0Zss8.js","assets/zeni-epic-state-Bx_bp9Xr.js","assets/index-sRBDhi1m.js","assets/mui-NHWzIwJg.js","assets/analytics-1WMvk5Rb.js","assets/utils-CHGPa257.js","assets/withTransactionSidePanel-CBDlugrB.js","assets/useAskAiCfoHostNavButtonProps-GvI044sz.js","assets/TransactionDetailScreen-Df5fqXxJ.js","assets/decodeURIComponentSafe-DYdex7Fp.js","assets/routePaths-Bj6MBuce.js","assets/NotFoundScreen-YuP4L1AW.js","assets/useInitialThreadRequest-auUWihGo.js","assets/analyticsHelper-Cp1NXf0W.js","assets/CompanyPassportScreen-DJBa9GcN.js","assets/MobileAppDrawer-DRd73Iks.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BSw9qIge.js","assets/FeaturePreviewScreen-CMmpeBsa.js","assets/ReferralListScreen-BVoIBvNf.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-BbDMo6Fo.js","assets/AddressScreen-B6jePLNb.js","assets/DomesticWireDetailScreen-DFtHvoPg.js","assets/DrawerScreen-BcnO9pRK.js","assets/SetupPagesScreen-CnC81M3U.js","assets/BusinessVerificationPageScreen-BVQ7YkrT.js","assets/BillPayApprovalRoutes-BxBCP76q.js","assets/ReimbursementApprovalRuleDetailScreen-BuRLJNpP.js","assets/getLocaleForTenant-DtzopER1.js","assets/ReimbursementRoutes-aNal0ziw.js","assets/ReimbursementApprovalRoutes-Kcgc1mYC.js","assets/TransactionListRoutes-Do-Bz9c8.js","assets/ZeniAccountStatementScreen-su4HxFHo.js","assets/SettingsRoutes-CwDHbTT4.js","assets/accountMappingHelper-DNCKLg7K.js","assets/useEmailConnectResultRefresh-CzyKHMLk.js","assets/QBOConnectionScreen-ptFN6mr0.js","assets/empty-o2YkWI97.js","assets/index-CqKRE3AP.js","assets/url-wdUk7Rbg.js","assets/index-CmH-4r8j.js","assets/ReportsRoutes-C6hGF7yo.js","assets/ChargeCardRoutes-Bg0csdWv.js","assets/useChargeCardPusherEvents-04WGk6du.js","assets/PeopleRoutes-D_Oa27_2.js","assets/ExpenseAutomationRoutes-BxBGqZYB.js","assets/TreasuryRoutes-DeRwBYUX.js","assets/useCashManagementBanner-BjggUhzA.js","assets/VendorsRoutes-DRIUcak8.js","assets/pathToGoBack-BmJj5cme.js","assets/ZeniAccountRoutes-DQKc0S6j.js","assets/AddressRoutes-SzC0f9Ey.js","assets/PandLWithForecastRoutes-wD1K6rfI.js","assets/CustomerOnboardingRoutes-C_IeyrHG.js","assets/TransactionDetailRoutes-BdKXH06W.js","assets/EntityDetailRoutes-BEeCoXzX.js","assets/NotificationRoutes-B3RoBaR6.js","assets/PerformanceRoutes-CLJo-8IK.js","assets/RewardsRoutes-C2PQ6DsC.js","assets/TaskRoutes-D3GZ9e6L.js","assets/TaskListScreen-BQI4lSnv.js","assets/AiCfoScreen-BIqmmB2_.js","assets/CardsAiCfoScreen-C1i1iivR.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cV as pe,cB as hs,fU as Es,ct as ps,bE as Rs,bo as xs,fY as gs,v as Is,M0 as Ts,bs as js,M1 as As,bK as bs,bJ as Ds,bt as fs,cp as ys,M2 as Cs,M3 as vs,cR as Us,cU as ws,cT as Os,cA as Ps,cH as Fs,oc as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as Te,g1 as ks}from"./zeni-epic-state-Bx_bp9Xr.js";import{j as e}from"./liveblocks-tpE-grBU.js";import{a as O}from"./sentry-D58SEIt0.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-0WK0Zss8.js";import{y as Ms,u as Zs,z as D,C as Gs,c as zs,R as $s,G as z,i as Ys,J as Ws,T as qs,L as F,a as Ae,t as _,P as Js,d as Q,l}from"./index-sRBDhi1m.js";import"./mui-NHWzIwJg.js";import{f as be}from"./analyticsHelper-Cp1NXf0W.js";import{t as Ks}from"./getLocaleForTenant-DtzopER1.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="1abd83e8-6be2-445e-9da7-b7db5ddc0055",o._sentryDebugIdIdentifier="sentry-dbid-1abd83e8-6be2-445e-9da7-b7db5ddc0055")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-qsNqx2F0.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:()=>t((()=>import("./BillPayRoutes-BbDMo6Fo.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:()=>t((()=>import("./ReimbursementRoutes-aNal0ziw.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:()=>t((()=>import("./TransactionListRoutes-Do-Bz9c8.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t((()=>import("./SettingsRoutes-CwDHbTT4.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t((()=>import("./ReportsRoutes-C6hGF7yo.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-Bg0csdWv.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t((()=>import("./PeopleRoutes-D_Oa27_2.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-BxBGqZYB.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t((()=>import("./TreasuryRoutes-DeRwBYUX.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t((()=>import("./VendorsRoutes-DRIUcak8.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DQKc0S6j.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-C6hGF7yo.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])))),st=l((()=>t((()=>import("./AddressRoutes-SzC0f9Ey.js")),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21])))),tt=l((()=>t((()=>import("./PeopleRoutes-D_Oa27_2.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-wD1K6rfI.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-C_IeyrHG.js")),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21])))),ot=l((()=>t((()=>import("./VendorsRoutes-DRIUcak8.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-BdKXH06W.js")),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21])))),De=l((()=>t((()=>import("./EntityDetailRoutes-BEeCoXzX.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21])))),it=l((()=>t((()=>import("./DashboardRoutes-qsNqx2F0.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])))),fe=l((()=>t((()=>import("./BillPayRoutes-BbDMo6Fo.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])))),lt=l((()=>t((()=>import("./SettingsRoutes-CwDHbTT4.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])))),ye=l((()=>t((()=>import("./ReimbursementRoutes-aNal0ziw.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])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-DQKc0S6j.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21])))),dt=l((()=>t((()=>import("./TreasuryRoutes-DeRwBYUX.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])))),ct=l((()=>t((()=>import("./TransactionListRoutes-Do-Bz9c8.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-Bg0csdWv.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])))),_t=l((()=>t((()=>import("./NotificationRoutes-B3RoBaR6.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21])))),ht=l((()=>t((()=>import("./PerformanceRoutes-CLJo-8IK.js")),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-BxBGqZYB.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])))),pt=l((()=>t((()=>import("./RewardsRoutes-C2PQ6DsC.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21])))),Rt=l((()=>t((()=>import("./TaskRoutes-D3GZ9e6L.js")),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21])))),xt=l((()=>t((()=>import("./AiCfoScreen-BIqmmB2_.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-C1i1iivR.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,21])))),y=l((()=>t((()=>import("./NotFoundScreen-YuP4L1AW.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,21])))),gt=l((()=>t((()=>import("./TaskListScreen-BQI4lSnv.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Zs(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?ds(ne,r):void 0,J=T==="Completed"||A==="Completed"?cs(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&be(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,X=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(X!=null&&v!=null){const n=X.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?j(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[X,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,Z)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,b,d,s){if(xe(b?.userId,b?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,j,Ze))}),[Z,ae,I,j,D]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,b,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ts(Y.tenantsBaseInOrder)),I!=null&&be(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Qs,b=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),b)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&bs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&fs(E?.loggedInUserRoleMap),Xe=_e&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||Ye===!0||Qe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Xe||Ke?e.jsx(st,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(fe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(fe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},f=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(y,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{f as FallBackRoute,St as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-B4SpN_q5.js","assets/sentry-D58SEIt0.js","assets/core-0WK0Zss8.js","assets/zeni-epic-state-Bx_bp9Xr.js","assets/index-Dy73EgcO.js","assets/mui-NHWzIwJg.js","assets/analytics-1WMvk5Rb.js","assets/utils-CHGPa257.js","assets/withTransactionSidePanel-BsJ58rSa.js","assets/useAskAiCfoHostNavButtonProps-Dx1w_2sk.js","assets/TransactionDetailScreen-CRWTcneH.js","assets/decodeURIComponentSafe-DYdex7Fp.js","assets/routePaths-YBRbNv0i.js","assets/NotFoundScreen-BUpSeNgf.js","assets/useInitialThreadRequest-B7WOjZ27.js","assets/analyticsHelper-C8vUB4gm.js","assets/CompanyPassportScreen-wSnqdrZm.js","assets/MobileAppDrawer-By5kqJZy.js","assets/useAiCfoDashboardSuggestedQuestionsChips-B3JxpD0o.js","assets/FeaturePreviewScreen-CS0na0Uv.js","assets/ReferralListScreen-Bg4MIsqb.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-UVA-u63A.js","assets/AddressScreen-CBnElFxM.js","assets/DomesticWireDetailScreen-DmspT9Qv.js","assets/DrawerScreen-CTBdvd2J.js","assets/SetupPagesScreen-lXVOcLJ8.js","assets/BusinessVerificationPageScreen-DsowR4fB.js","assets/BillPayApprovalRoutes-CB55AV0C.js","assets/ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js","assets/getLocaleForTenant-CqQ308VG.js","assets/ReimbursementRoutes-CnfaWQKq.js","assets/ReimbursementApprovalRoutes-CLqW8bjU.js","assets/TransactionListRoutes-kn0wMJaj.js","assets/ZeniAccountStatementScreen-DZHjDSg5.js","assets/SettingsRoutes-0RQL-spt.js","assets/accountMappingHelper-DNCKLg7K.js","assets/useEmailConnectResultRefresh-CG-YyoOP.js","assets/QBOConnectionScreen-BOAmyhRI.js","assets/empty-o2YkWI97.js","assets/index-CqKRE3AP.js","assets/url-wdUk7Rbg.js","assets/index-CmH-4r8j.js","assets/ReportsRoutes-ZKjtrrXu.js","assets/ChargeCardRoutes-D3n7KJn0.js","assets/useChargeCardPusherEvents-DGhBtw5K.js","assets/PeopleRoutes-BPQhjQKR.js","assets/ExpenseAutomationRoutes-nIGBHuEd.js","assets/TreasuryRoutes-h3ROpRx5.js","assets/useCashManagementBanner-MgmXXc9G.js","assets/VendorsRoutes-x1VmRs4J.js","assets/pathToGoBack-BmJj5cme.js","assets/ZeniAccountRoutes-BOVvauFK.js","assets/AddressRoutes-ChIEG7ZZ.js","assets/PandLWithForecastRoutes-DB98rpg8.js","assets/CustomerOnboardingRoutes-DT_Ih6lH.js","assets/TransactionDetailRoutes-DFhCPCQa.js","assets/EntityDetailRoutes-DPOfKd1l.js","assets/NotificationRoutes-CkKMsCoc.js","assets/PerformanceRoutes-Cu8GwbPn.js","assets/RewardsRoutes-Dmsl5Hhz.js","assets/TaskRoutes-X8P3xHwH.js","assets/TaskListScreen-BtTYiD21.js","assets/AiCfoScreen-DXLxFBnQ.js","assets/CardsAiCfoScreen-BaEolMVN.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cV as pe,cB as hs,fU as Es,ct as ps,bE as Rs,bo as xs,fY as gs,v as Is,M0 as Ts,bs as js,M1 as As,bK as bs,bJ as Ds,bt as fs,cp as ys,M2 as Cs,M3 as vs,cR as Us,cU as ws,cT as Os,cA as Ps,cH as Fs,oc as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as Te,g1 as ks}from"./zeni-epic-state-Bx_bp9Xr.js";import{j as e}from"./liveblocks-tpE-grBU.js";import{a as O}from"./sentry-D58SEIt0.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-0WK0Zss8.js";import{y as Ms,u as Zs,z as D,C as Gs,c as zs,R as $s,G as z,i as Ys,J as Ws,T as qs,L as F,a as Ae,t as _,P as Js,d as Q,l}from"./index-Dy73EgcO.js";import"./mui-NHWzIwJg.js";import{f as be}from"./analyticsHelper-C8vUB4gm.js";import{t as Ks}from"./getLocaleForTenant-CqQ308VG.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="1abd83e8-6be2-445e-9da7-b7db5ddc0055",o._sentryDebugIdIdentifier="sentry-dbid-1abd83e8-6be2-445e-9da7-b7db5ddc0055")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-B4SpN_q5.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:()=>t((()=>import("./BillPayRoutes-UVA-u63A.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:()=>t((()=>import("./ReimbursementRoutes-CnfaWQKq.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:()=>t((()=>import("./TransactionListRoutes-kn0wMJaj.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t((()=>import("./SettingsRoutes-0RQL-spt.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t((()=>import("./ReportsRoutes-ZKjtrrXu.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-D3n7KJn0.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t((()=>import("./PeopleRoutes-BPQhjQKR.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-nIGBHuEd.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t((()=>import("./TreasuryRoutes-h3ROpRx5.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t((()=>import("./VendorsRoutes-x1VmRs4J.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-BOVvauFK.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-ZKjtrrXu.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])))),st=l((()=>t((()=>import("./AddressRoutes-ChIEG7ZZ.js")),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21])))),tt=l((()=>t((()=>import("./PeopleRoutes-BPQhjQKR.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-DB98rpg8.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-DT_Ih6lH.js")),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21])))),ot=l((()=>t((()=>import("./VendorsRoutes-x1VmRs4J.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-DFhCPCQa.js")),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21])))),De=l((()=>t((()=>import("./EntityDetailRoutes-DPOfKd1l.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21])))),it=l((()=>t((()=>import("./DashboardRoutes-B4SpN_q5.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])))),fe=l((()=>t((()=>import("./BillPayRoutes-UVA-u63A.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])))),lt=l((()=>t((()=>import("./SettingsRoutes-0RQL-spt.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])))),ye=l((()=>t((()=>import("./ReimbursementRoutes-CnfaWQKq.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])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-BOVvauFK.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21])))),dt=l((()=>t((()=>import("./TreasuryRoutes-h3ROpRx5.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])))),ct=l((()=>t((()=>import("./TransactionListRoutes-kn0wMJaj.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-D3n7KJn0.js")),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])))),_t=l((()=>t((()=>import("./NotificationRoutes-CkKMsCoc.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21])))),ht=l((()=>t((()=>import("./PerformanceRoutes-Cu8GwbPn.js")),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-nIGBHuEd.js")),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])))),pt=l((()=>t((()=>import("./RewardsRoutes-Dmsl5Hhz.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21])))),Rt=l((()=>t((()=>import("./TaskRoutes-X8P3xHwH.js")),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21])))),xt=l((()=>t((()=>import("./AiCfoScreen-DXLxFBnQ.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-BaEolMVN.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,21])))),y=l((()=>t((()=>import("./NotFoundScreen-BUpSeNgf.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,21])))),gt=l((()=>t((()=>import("./TaskListScreen-BtTYiD21.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Zs(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?ds(ne,r):void 0,J=T==="Completed"||A==="Completed"?cs(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&be(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,X=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(X!=null&&v!=null){const n=X.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?j(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[X,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,Z)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,b,d,s){if(xe(b?.userId,b?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,j,Ze))}),[Z,ae,I,j,D]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,b,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ts(Y.tenantsBaseInOrder)),I!=null&&be(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Qs,b=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),b)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&bs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&fs(E?.loggedInUserRoleMap),Xe=_e&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||Ye===!0||Qe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Xe||Ke?e.jsx(st,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(fe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(fe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},f=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(y,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{f as FallBackRoute,St as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt0.js";import{h as L,g as $,u as U,j as S,s as le,n as H,i as G,o as ne,p as v}from"./core-0WK0Zss8.js";import{bn as De,eX as j,gp as Me,n2 as re,Ol as Te,hF as he,Oc as Ue,qU as _e,kA as be,m_ as Fe,hH as Re,Oe as Be,Od as Oe,QE as Ve,zo as ze,ER as Le,Qd as Ne,Qm as Qe,c6 as ae,cM as $e,cN as He,bs as Ge,Md as Ze,xQ as Ke,QF as qe,Hg as Je,Ex as Xe,Eo as Se,El as We,xU as ye,Er as Ce,Eu as Ie,EA as oe,ue as se,xT as Ye,kc as X,kf as Ae,QG as en,lg as nn,y7 as tn,N4 as an,N5 as on,ka as sn,QH as cn,kd as ln,rm as rn,M$ as dn,N0 as un,rq as pn,hq as gn,Ml as ee,hi as de,hf as mn,hn as fn,Mm as hn,y4 as bn,QI as Sn,QJ as yn,EO as Cn,fC as Ee,fE as xe,QK as In,gd as An,Mv as En,y3 as ue,gi as pe,gh as xn,y2 as vn,gg as kn,gf as wn,QL as Pn,fH as ve,QM as jn,QN as Dn,ya as Mn,y1 as ge,QO as Tn,fX as Un,x_ as _n,bZ as Fn,c5 as Rn,c4 as Bn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-Bx_bp9Xr.js";import{C as W,G as O,z as w,ag as ke,bT as $n,d as Z,f as Hn,bE as Gn,T as K,B as ie,bU as Zn,i as we,J as Pe,bV as Kn,ar as qn,k as je,bW as Jn,bX as Xn,bY as Wn,_ as Yn,bZ as et,r as nt,b_ as tt}from"./index-sRBDhi1m.js";import{n as V}from"./mui-NHWzIwJg.js";import{M as R}from"./MobileAppDrawer-DRd73Iks.js";import{a as q,g as J,m as at}from"./accountMappingHelper-DNCKLg7K.js";import{t as ot,A as st}from"./AddressScreen-B6jePLNb.js";import Q from"./NotFoundScreen-YuP4L1AW.js";import{g as it}from"./analyticsHelper-Cp1NXf0W.js";import{B as ct}from"./BusinessVerificationPageScreen-BVQ7YkrT.js";import{C as lt}from"./CompanyPassportScreen-DJBa9GcN.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-CzyKHMLk.js";import{q as me}from"./QBOConnectionScreen-ptFN6mr0.js";import{B as ut}from"./BillPayApprovalRoutes-BxBCP76q.js";import{R as pt}from"./ReimbursementApprovalRoutes-Kcgc1mYC.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./routePaths-Bj6MBuce.js";import"./empty-o2YkWI97.js";import"./pdf-lib-CxgB1_73.js";import"./index-CqKRE3AP.js";import"./url-wdUk7Rbg.js";import"./index-CmH-4r8j.js";import"./decodeURIComponentSafe-DYdex7Fp.js";import"./ReimbursementApprovalRuleDetailScreen-BuRLJNpP.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="597c9ddb-0a76-4b1e-890c-b3755779d069",e._sentryDebugIdIdentifier="sentry-dbid-597c9ddb-0a76-4b1e-890c-b3755779d069")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-tpE-grBU.js";import{a as u}from"./sentry-D58SEIt0.js";import{h as L,g as $,u as U,j as S,s as le,n as H,i as G,o as ne,p as v}from"./core-0WK0Zss8.js";import{bn as De,eX as j,gp as Me,n2 as re,Ol as Te,hF as he,Oc as Ue,qU as _e,kA as be,m_ as Fe,hH as Re,Oe as Be,Od as Oe,QE as Ve,zo as ze,ER as Le,Qd as Ne,Qm as Qe,c6 as ae,cM as $e,cN as He,bs as Ge,Md as Ze,xQ as Ke,QF as qe,Hg as Je,Ex as Xe,Eo as Se,El as We,xU as ye,Er as Ce,Eu as Ie,EA as oe,ue as se,xT as Ye,kc as X,kf as Ae,QG as en,lg as nn,y7 as tn,N4 as an,N5 as on,ka as sn,QH as cn,kd as ln,rm as rn,M$ as dn,N0 as un,rq as pn,hq as gn,Ml as ee,hi as de,hf as mn,hn as fn,Mm as hn,y4 as bn,QI as Sn,QJ as yn,EO as Cn,fC as Ee,fE as xe,QK as In,gd as An,Mv as En,y3 as ue,gi as pe,gh as xn,y2 as vn,gg as kn,gf as wn,QL as Pn,fH as ve,QM as jn,QN as Dn,ya as Mn,y1 as ge,QO as Tn,fX as Un,x_ as _n,bZ as Fn,c5 as Rn,c4 as Bn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as Qn}from"./zeni-epic-state-Bx_bp9Xr.js";import{C as W,G as O,z as w,ag as ke,bT as $n,d as Z,f as Hn,bE as Gn,T as K,B as ie,bU as Zn,i as we,J as Pe,bV as Kn,ar as qn,k as je,bW as Jn,bX as Xn,bY as Wn,_ as Yn,bZ as et,r as nt,b_ as tt}from"./index-Dy73EgcO.js";import{n as V}from"./mui-NHWzIwJg.js";import{M as R}from"./MobileAppDrawer-By5kqJZy.js";import{a as q,g as J,m as at}from"./accountMappingHelper-DNCKLg7K.js";import{t as ot,A as st}from"./AddressScreen-CBnElFxM.js";import Q from"./NotFoundScreen-BUpSeNgf.js";import{g as it}from"./analyticsHelper-C8vUB4gm.js";import{B as ct}from"./BusinessVerificationPageScreen-DsowR4fB.js";import{C as lt}from"./CompanyPassportScreen-wSnqdrZm.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-CG-YyoOP.js";import{q as me}from"./QBOConnectionScreen-BOAmyhRI.js";import{B as ut}from"./BillPayApprovalRoutes-CB55AV0C.js";import{R as pt}from"./ReimbursementApprovalRoutes-CLqW8bjU.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./routePaths-YBRbNv0i.js";import"./empty-o2YkWI97.js";import"./pdf-lib-CxgB1_73.js";import"./index-CqKRE3AP.js";import"./url-wdUk7Rbg.js";import"./index-CmH-4r8j.js";import"./decodeURIComponentSafe-DYdex7Fp.js";import"./ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="597c9ddb-0a76-4b1e-890c-b3755779d069",e._sentryDebugIdIdentifier="sentry-dbid-597c9ddb-0a76-4b1e-890c-b3755779d069")}catch{}})();const gt=V.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-tpE-grBU.js";import{h as X,g as ee,u as ne,i as G,j as v,N as x,n as W,t as en}from"./core-0WK0Zss8.js";import{bJ as nn,cp as Ce,Q1 as ye,eX as B,cB as tn,zE as Q,zo as an,Qd as sn,Qg as on,rF as te,rt as ae,l8 as ie,tM as z,Qi as Ie,gh as $e,gg as Ge,gf as We,Qj as cn,zN as rn,Ex as Ae,Eo as ke,El as _e,E3 as J,Er as Ee,Eu as Pe,EA as ve,ue as we,gw as un,cw as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qk as fn,D3 as le,DH as gn,Ql as bn,bK as Sn,FQ as pe,ER as hn,Qm as Cn,Qn as In,FU as An,FY as kn,tF as _n,Km as En,Gt as he,Ht as me,Qo as Pn,Qp as vn,Qq as wn,Qr as He,Qs as Tn,MP as Dn,Pq as Un,N2 as On,Qt as qe,E7 as Fn,N3 as Bn,Eb as Vn,Qu as Oe,GP as Ke,lg as xn,rw as Je,tO as jn,bE as Re,t_ as Ne,cz as Rn,Qv as Ye,fW as Nn,Gb as zn,Gf as Ln,Qw as Mn,Gw as ze,Qx as Zn,Qy as Qn,Qz as $n,QA as Gn,gp as Wn,AY as Hn,QB as qn,B1 as Kn,B0 as Jn}from"./zeni-epic-state-Bx_bp9Xr.js";import{T as se,C as oe,G as K,y as Te,aS as Y,bE as Xe,z as U,D as ce,d as O,B as De,f as $,bF as Yn,au as re,bG as V,bH as Xn,bI as et,ag as xe,bJ as nt,r as Le,av as Me,m as tt,E as at,bK as it,bL as st,bM as ot,a9 as ct}from"./index-sRBDhi1m.js";import{a as h}from"./sentry-D58SEIt0.js";import{n as Fe,D as rt,S as ut}from"./mui-NHWzIwJg.js";import{M as fe}from"./MobileAppDrawer-DRd73Iks.js";import N from"./NotFoundScreen-YuP4L1AW.js";import{a as Ze}from"./analyticsHelper-Cp1NXf0W.js";import{d as Qe}from"./routePaths-Bj6MBuce.js";import{B as Ue}from"./BusinessVerificationPageScreen-BVQ7YkrT.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]="21aa06a5-4eb0-4242-9be4-65229e7df8b7",e._sentryDebugIdIdentifier="sentry-dbid-21aa06a5-4eb0-4242-9be4-65229e7df8b7")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-tpE-grBU.js";import{h as X,g as ee,u as ne,i as G,j as v,N as x,n as W,t as en}from"./core-0WK0Zss8.js";import{bJ as nn,cp as Ce,Q1 as ye,eX as B,cB as tn,zE as Q,zo as an,Qd as sn,Qg as on,rF as te,rt as ae,l8 as ie,tM as z,Qi as Ie,gh as $e,gg as Ge,gf as We,Qj as cn,zN as rn,Ex as Ae,Eo as ke,El as _e,E3 as J,Er as Ee,Eu as Pe,EA as ve,ue as we,gw as un,cw as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qk as fn,D3 as le,DH as gn,Ql as bn,bK as Sn,FQ as pe,ER as hn,Qm as Cn,Qn as In,FU as An,FY as kn,tF as _n,Km as En,Gt as he,Ht as me,Qo as Pn,Qp as vn,Qq as wn,Qr as He,Qs as Tn,MP as Dn,Pq as Un,N2 as On,Qt as qe,E7 as Fn,N3 as Bn,Eb as Vn,Qu as Oe,GP as Ke,lg as xn,rw as Je,tO as jn,bE as Re,t_ as Ne,cz as Rn,Qv as Ye,fW as Nn,Gb as zn,Gf as Ln,Qw as Mn,Gw as ze,Qx as Zn,Qy as Qn,Qz as $n,QA as Gn,gp as Wn,AY as Hn,QB as qn,B1 as Kn,B0 as Jn}from"./zeni-epic-state-Bx_bp9Xr.js";import{T as se,C as oe,G as K,y as Te,aS as Y,bE as Xe,z as U,D as ce,d as O,B as De,f as $,bF as Yn,au as re,bG as V,bH as Xn,bI as et,ag as xe,bJ as nt,r as Le,av as Me,m as tt,E as at,bK as it,bL as st,bM as ot,a9 as ct}from"./index-Dy73EgcO.js";import{a as h}from"./sentry-D58SEIt0.js";import{n as Fe,D as rt,S as ut}from"./mui-NHWzIwJg.js";import{M as fe}from"./MobileAppDrawer-By5kqJZy.js";import N from"./NotFoundScreen-BUpSeNgf.js";import{a as Ze}from"./analyticsHelper-C8vUB4gm.js";import{d as Qe}from"./routePaths-YBRbNv0i.js";import{B as Ue}from"./BusinessVerificationPageScreen-DsowR4fB.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]="21aa06a5-4eb0-4242-9be4-65229e7df8b7",e._sentryDebugIdIdentifier="sentry-dbid-21aa06a5-4eb0-4242-9be4-65229e7df8b7")}catch{}})();const dt=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-tpE-grBU.js";import{a as u,b as A,q as M}from"./sentry-D58SEIt0.js";import{u as T,h as z,j as l,g as D,N as j,n as O}from"./core-0WK0Zss8.js";import{u as P,z as s,y as F,d as E,a as B,e as _,f as N,g as $,h as V,j as q,k as v}from"./index-sRBDhi1m.js";import{eX as J,L$ as W,M0 as X,fA as Y,g0 as Z,M5 as H,go as G,cZ as K,M6 as b,M7 as Q,M8 as R,bY as y}from"./zeni-epic-state-Bx_bp9Xr.js";import"./mui-NHWzIwJg.js";import{u as ee}from"./useDeviceId-SayLljl1.js";import{f as te}from"./analyticsHelper-Cp1NXf0W.js";import{t as ne}from"./getLocaleForTenant-DtzopER1.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="e98340fe-456b-49d7-aaf9-473f7f41a9fe",t._sentryDebugIdIdentifier="sentry-dbid-e98340fe-456b-49d7-aaf9-473f7f41a9fe")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{M({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}}))(q),ae=A.memo(ie);function ve({setTenantEmailDomain:t}){const i=T(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>J(e))),I=l((e=>W(e))),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(X(I.tenantsInOrder),o.zeniSessionId),Y(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=V();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-tpE-grBU.js";import{a as u,b as A,q as M}from"./sentry-D58SEIt0.js";import{u as T,h as z,j as l,g as D,N as j,n as O}from"./core-0WK0Zss8.js";import{u as P,z as s,y as F,d as E,a as B,e as _,f as N,g as $,h as V,j as q,k as v}from"./index-Dy73EgcO.js";import{eX as J,L$ as W,M0 as X,fA as Y,g0 as Z,M5 as H,go as G,cZ as K,M6 as b,M7 as Q,M8 as R,bY as y}from"./zeni-epic-state-Bx_bp9Xr.js";import"./mui-NHWzIwJg.js";import{u as ee}from"./useDeviceId-SayLljl1.js";import{f as te}from"./analyticsHelper-C8vUB4gm.js";import{t as ne}from"./getLocaleForTenant-CqQ308VG.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="e98340fe-456b-49d7-aaf9-473f7f41a9fe",t._sentryDebugIdIdentifier="sentry-dbid-e98340fe-456b-49d7-aaf9-473f7f41a9fe")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{M({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}}))(q),ae=A.memo(ie);function ve({setTenantEmailDomain:t}){const i=T(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>J(e))),I=l((e=>W(e))),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(X(I.tenantsInOrder),o.zeniSessionId),Y(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=V();e!=null&&_(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-tpE-grBU.js";import{a as i}from"./sentry-D58SEIt0.js";import{u as d,g as l,N as u}from"./core-0WK0Zss8.js";import{z as n,d as a,f as m,B as p}from"./index-sRBDhi1m.js";import{gt as g,Mn as b}from"./zeni-epic-state-Bx_bp9Xr.js";import{n as y}from"./mui-NHWzIwJg.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="005f6327-ccb3-4540-be19-a975dfa1b1f0",e._sentryDebugIdIdentifier="sentry-dbid-005f6327-ccb3-4540-be19-a975dfa1b1f0")}catch{}})();function M(){const e=d(),t=l(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
1
+ import{j as s}from"./liveblocks-tpE-grBU.js";import{a as i}from"./sentry-D58SEIt0.js";import{u as d,g as l,N as u}from"./core-0WK0Zss8.js";import{z as n,d as a,f as m,B as p}from"./index-Dy73EgcO.js";import{gt as g,Mn as b}from"./zeni-epic-state-Bx_bp9Xr.js";import{n as y}from"./mui-NHWzIwJg.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="005f6327-ccb3-4540-be19-a975dfa1b1f0",e._sentryDebugIdIdentifier="sentry-dbid-005f6327-ccb3-4540-be19-a975dfa1b1f0")}catch{}})();function M(){const e=d(),t=l(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-tpE-grBU.js";import{a as b}from"./sentry-D58SEIt0.js";import{h as _,u as v,g as z,j as G,i as K,n as J}from"./core-0WK0Zss8.js";import{z as R,C as O,G as p,a0 as V,D as W,d as Z,f as q,dc as M,r as g,q as Q}from"./index-sRBDhi1m.js";import{eX as X,TP as F,J8 as I,TQ as x,TL as H,Iw as E,TR as Y,IE as y,H_ as aa,J9 as S,TS as B,fz as ea,I$ as ta,J4 as sa,IT as oa,IR as w,J5 as na,IO as ia,TT as la,TU as ra,TV as ca,TW as ka,TX as T,ej as da,TY as ua,TZ as pa}from"./zeni-epic-state-Bx_bp9Xr.js";import{n as Ta}from"./mui-NHWzIwJg.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import{M as ga}from"./MobileAppDrawer-DRd73Iks.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="442d05c5-94b5-42b1-998d-41bce4ec9fcd",e._sentryDebugIdIdentifier="sentry-dbid-442d05c5-94b5-42b1-998d-41bce4ec9fcd")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-tpE-grBU.js";import{a as b}from"./sentry-D58SEIt0.js";import{h as _,u as v,g as z,j as G,i as K,n as J}from"./core-0WK0Zss8.js";import{z as R,C as O,G as p,a0 as V,D as W,d as Z,f as q,dc as M,r as g,q as Q}from"./index-Dy73EgcO.js";import{eX as X,TP as F,J8 as I,TQ as x,TL as H,Iw as E,TR as Y,IE as y,H_ as aa,J9 as S,TS as B,fz as ea,I$ as ta,J4 as sa,IT as oa,IR as w,J5 as na,IO as ia,TT as la,TU as ra,TV as ca,TW as ka,TX as T,ej as da,TY as ua,TZ as pa}from"./zeni-epic-state-Bx_bp9Xr.js";import{n as Ta}from"./mui-NHWzIwJg.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import{M as ga}from"./MobileAppDrawer-By5kqJZy.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="442d05c5-94b5-42b1-998d-41bce4ec9fcd",e._sentryDebugIdIdentifier="sentry-dbid-442d05c5-94b5-42b1-998d-41bce4ec9fcd")}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-tpE-grBU.js";import se from"./NotFoundScreen-YuP4L1AW.js";import{a as c}from"./sentry-D58SEIt0.js";import{h as M,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-0WK0Zss8.js";import{Ib as Z,Ie as le,I8 as de,eX as H,TL as Q,Is as X,I5 as pe,IY as ue,IR as ke,TM as J,TN as z,I1 as me,H_ as fe,rF as ge,rt as he,l8 as Ie,Im as Se,TO as Te,ID as be,IA as Ee,Ih as Ce,Ix as Ge,Iw as De}from"./zeni-epic-state-Bx_bp9Xr.js";import{z as G,da as xe,Q as ye,C as je,G as b,q as K,r as v,D as we,d as A,f as ve,db as Re,k as V,au as Fe}from"./index-sRBDhi1m.js";import{n as Be}from"./mui-NHWzIwJg.js";import{u as Pe}from"./useInitialThreadRequest-auUWihGo.js";import{M as Ue}from"./MobileAppDrawer-DRd73Iks.js";import Le from"./TaskListScreen-BQI4lSnv.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./useAskAiCfoHostNavButtonProps-GvI044sz.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]="7214ac42-209c-4813-b710-b88f80f0dc10",e._sentryDebugIdIdentifier="sentry-dbid-7214ac42-209c-4813-b710-b88f80f0dc10")}catch{}})();function Ne(){const e=M(),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,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[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 q,_=[];const $e=re((function(e,t){const{location:s,taskGroupId:u}=t,r=J(e,t.taskId),d=H(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=Q(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==q&&(q=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(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=K(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(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!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=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>H(i))),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,W]=c.useState(!1),[F,Y]=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=>Q(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(W(!0),t(X(!1,r)))}),[p,t]),c.useEffect((()=>{F||U.fetchState==="Completed"||(Y(!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=K(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 N=g((i=>J(i,r))),j=N.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.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:A,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx($e,{analytics:A,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:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
1
+ import{j as n}from"./liveblocks-tpE-grBU.js";import se from"./NotFoundScreen-BUpSeNgf.js";import{a as c}from"./sentry-D58SEIt0.js";import{h as M,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-0WK0Zss8.js";import{Ib as Z,Ie as le,I8 as de,eX as H,TL as Q,Is as X,I5 as pe,IY as ue,IR as ke,TM as J,TN as z,I1 as me,H_ as fe,rF as ge,rt as he,l8 as Ie,Im as Se,TO as Te,ID as be,IA as Ee,Ih as Ce,Ix as Ge,Iw as De}from"./zeni-epic-state-Bx_bp9Xr.js";import{z as G,da as xe,Q as ye,C as je,G as b,q as K,r as v,D as we,d as A,f as ve,db as Re,k as V,au as Fe}from"./index-Dy73EgcO.js";import{n as Be}from"./mui-NHWzIwJg.js";import{u as Pe}from"./useInitialThreadRequest-B7WOjZ27.js";import{M as Ue}from"./MobileAppDrawer-By5kqJZy.js";import Le from"./TaskListScreen-BtTYiD21.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.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]="7214ac42-209c-4813-b710-b88f80f0dc10",e._sentryDebugIdIdentifier="sentry-dbid-7214ac42-209c-4813-b710-b88f80f0dc10")}catch{}})();function Ne(){const e=M(),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,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[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 q,_=[];const $e=re((function(e,t){const{location:s,taskGroupId:u}=t,r=J(e,t.taskId),d=H(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=Q(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==q&&(q=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(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=K(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(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!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=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>H(i))),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,W]=c.useState(!1),[F,Y]=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=>Q(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(W(!0),t(X(!1,r)))}),[p,t]),c.useEffect((()=>{F||U.fetchState==="Completed"||(Y(!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=K(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 N=g((i=>J(i,r))),j=N.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.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:A,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx($e,{analytics:A,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:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-tpE-grBU.js";import i from"./NotFoundScreen-YuP4L1AW.js";import{T as r}from"./TransactionDetailScreen-Df5fqXxJ.js";import"./sentry-D58SEIt0.js";import{o as s,p as o}from"./core-0WK0Zss8.js";import"./zeni-epic-state-Bx_bp9Xr.js";import"./recharts-CUzwcISX.js";import"./index-sRBDhi1m.js";import"./mui-NHWzIwJg.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import"./decodeURIComponentSafe-DYdex7Fp.js";import"./routePaths-Bj6MBuce.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-tpE-grBU.js";import i from"./NotFoundScreen-BUpSeNgf.js";import{T as r}from"./TransactionDetailScreen-CRWTcneH.js";import"./sentry-D58SEIt0.js";import{o as s,p as o}from"./core-0WK0Zss8.js";import"./zeni-epic-state-Bx_bp9Xr.js";import"./recharts-CUzwcISX.js";import"./index-Dy73EgcO.js";import"./mui-NHWzIwJg.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import"./decodeURIComponentSafe-DYdex7Fp.js";import"./routePaths-YBRbNv0i.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as x}from"./liveblocks-tpE-grBU.js";import{a as i}from"./sentry-D58SEIt0.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as Ee,N as Qe,n as Xe}from"./core-0WK0Zss8.js";import{nR as he,eX as Q,gp as Ze,Ol as et,n2 as tt,mM as at,bn as nt,cV as be,bs as ve,rd as W,Nk as J,Om as Ie,On as oe,NK as De,kL as Ce,Oo as ke,NP as se,NQ as ce,lA as Ae,Kf as ie,Ne as M,kF as Oe,kD as Ue,kP as ot,nE as st,Op as ct,Oq as it,vu as Y,kK as xe,JA as we,ci as rt,c_ as lt,Or as dt,Nd as ut,Os as mt,vq as pt,Ot as ft,Ou as ht,Ov as yt,Ow as St,Ox as gt,kO as Tt,Oy as Et,Oz as bt,Nf as vt,OA as It,OB as Dt,OC as Ct,Ju as kt,Jk as At,JJ as Ot,kQ as Ut,Kg as ye,nJ as xt}from"./zeni-epic-state-Bx_bp9Xr.js";import{C as H,G as w,z as Pe,aS as _e,y as wt,m as Pt,aT as _t,E as Ft,q as ae,T as Vt,aU as Bt,r as ne,a0 as Nt,aV as Rt,d as Fe,aW as zt,au as Lt,a4 as te}from"./index-sRBDhi1m.js";import{n as Gt,S as jt,D as $t}from"./mui-NHWzIwJg.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import{d as Ve}from"./decodeURIComponentSafe-DYdex7Fp.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-Bj6MBuce.js";import{u as Jt}from"./utils-CHGPa257.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d1bd632c-d43e-483d-a636-2b4a3ec8f127",t._sentryDebugIdIdentifier="sentry-dbid-d1bd632c-d43e-483d-a636-2b4a3ec8f127")}catch{}})();function Ht(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=H(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Kt(t,e){const s=(function(){const r=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=H(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),E=k.companyId,U=S((h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:P,capitalizableAccountOverrides:B,dismissedAccounts:L}=S((h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(P);G.current=P;const N=i.useRef(B);N.current=B;const _=i.useRef(L);_.current=L;const R=S((h=>et(h.accountState)),fe),v=i.useMemo((()=>{const h={};for(const b of R)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h}),[R]),l=m!=null?v[m]??null:null,j=i.useCallback((h=>{if(!I)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),X=N.current??{},K=_.current;for(const z of u)if($.has(z.accountId)&&X[z.accountId]==null&&K?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void g(!0)}),[I]),D=i.useCallback(((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)}),[r,E]),F=i.useCallback((()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))}),[r,E,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=Pe.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=H(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(_e.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:W(e)})),[t,e]),f=S((u=>J(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=J(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),E=i.useMemo((()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(E!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),P=S((u=>oe(u))),B=S((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),L=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,_]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{_(!1),v(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{_(!1),v(!1)}),[]),[F,h]=i.useState(!1),b=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),_(!0),s(Ae(E))))}),[s,l,f?.fetchState,f?.transaction,E,c,r,p,N,R,U,b]),i.useEffect((()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[P.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:P,uiState:B,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=Pt(),r=q(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(_t,{...A})})})},Xt=Gt(jt)`
1
+ import{j as x}from"./liveblocks-tpE-grBU.js";import{a as i}from"./sentry-D58SEIt0.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as Ee,N as Qe,n as Xe}from"./core-0WK0Zss8.js";import{nR as he,eX as Q,gp as Ze,Ol as et,n2 as tt,mM as at,bn as nt,cV as be,bs as ve,rd as W,Nk as J,Om as Ie,On as oe,NK as De,kL as Ce,Oo as ke,NP as se,NQ as ce,lA as Ae,Kf as ie,Ne as M,kF as Oe,kD as Ue,kP as ot,nE as st,Op as ct,Oq as it,vu as Y,kK as xe,JA as we,ci as rt,c_ as lt,Or as dt,Nd as ut,Os as mt,vq as pt,Ot as ft,Ou as ht,Ov as yt,Ow as St,Ox as gt,kO as Tt,Oy as Et,Oz as bt,Nf as vt,OA as It,OB as Dt,OC as Ct,Ju as kt,Jk as At,JJ as Ot,kQ as Ut,Kg as ye,nJ as xt}from"./zeni-epic-state-Bx_bp9Xr.js";import{C as H,G as w,z as Pe,aS as _e,y as wt,m as Pt,aT as _t,E as Ft,q as ae,T as Vt,aU as Bt,r as ne,a0 as Nt,aV as Rt,d as Fe,aW as zt,au as Lt,a4 as te}from"./index-Dy73EgcO.js";import{n as Gt,S as jt,D as $t}from"./mui-NHWzIwJg.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import{d as Ve}from"./decodeURIComponentSafe-DYdex7Fp.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-YBRbNv0i.js";import{u as Jt}from"./utils-CHGPa257.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d1bd632c-d43e-483d-a636-2b4a3ec8f127",t._sentryDebugIdIdentifier="sentry-dbid-d1bd632c-d43e-483d-a636-2b4a3ec8f127")}catch{}})();function Ht(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=H(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Kt(t,e){const s=(function(){const r=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=H(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),E=k.companyId,U=S((h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:P,capitalizableAccountOverrides:B,dismissedAccounts:L}=S((h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(P);G.current=P;const N=i.useRef(B);N.current=B;const _=i.useRef(L);_.current=L;const R=S((h=>et(h.accountState)),fe),v=i.useMemo((()=>{const h={};for(const b of R)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h}),[R]),l=m!=null?v[m]??null:null,j=i.useCallback((h=>{if(!I)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),X=N.current??{},K=_.current;for(const z of u)if($.has(z.accountId)&&X[z.accountId]==null&&K?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void g(!0)}),[I]),D=i.useCallback(((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)}),[r,E]),F=i.useCallback((()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))}),[r,E,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=Pe.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=H(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(_e.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:W(e)})),[t,e]),f=S((u=>J(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=J(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),E=i.useMemo((()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(E!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),P=S((u=>oe(u))),B=S((u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")})),L=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,_]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{_(!1),v(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{_(!1),v(!1)}),[]),[F,h]=i.useState(!1),b=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),_(!0),s(Ae(E))))}),[s,l,f?.fetchState,f?.transaction,E,c,r,p,N,R,U,b]),i.useEffect((()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[P.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:P,uiState:B,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=Pt(),r=q(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(_t,{...A})})})},Xt=Gt(jt)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-tpE-grBU.js";import{h as X,g as U,u as Q,i as Z,j as h,N as z,n as H,o as ve,p as j}from"./core-0WK0Zss8.js";import{eX as K,qU as W,jZ as u,RL as ee,K6 as De,bo as le,RM as be,kA as te,NM as ae,RN as ue,RO as Pe,bE as Y,K2 as ye,RP as Ee,RQ as me,RR as je,K5 as Ae,RS as xe,RT as pe,RU as Me,RV as ge,RW as Le,RX as Ce,RY as fe,Li as Be}from"./zeni-epic-state-Bx_bp9Xr.js";import{a as de,C as ne,G as V,d as G,cq as ce,r as J,q as oe,_ as Re,R as Fe}from"./index-sRBDhi1m.js";import"./mui-NHWzIwJg.js";import{a as g}from"./sentry-D58SEIt0.js";import{w as se}from"./withTransactionSidePanel-CBDlugrB.js";import{p as ie,c as re}from"./routePaths-Bj6MBuce.js";import{v as Oe}from"./utils-CHGPa257.js";import{d as b}from"./decodeURIComponentSafe-DYdex7Fp.js";import{Z as Ge}from"./ZeniAccountStatementScreen-su4HxFHo.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import"./TransactionDetailScreen-Df5fqXxJ.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]="0851fa3d-8e10-463f-a32d-accb555a80b6",a._sentryDebugIdIdentifier="sentry-dbid-0851fa3d-8e10-463f-a32d-accb555a80b6")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],q=a=>Oe(a),we=H((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,q(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=q(e.selectedAccount.tranListType),m=Ne(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:q(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:q(e.selectedAccount.tranListType)}))}}}))(ce),N=se((function({...a}){const e=X(),t=U(),n=Q(),c=t.pathname.split("/").find((r=>ze.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Z(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(V.isProjectsTransactionsEnabled),x=h((r=>W(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[R,F]=g.useState(void 0),f=g.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,S,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=q(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&R!=null&&(M={...f,period:R}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>F(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},qe=H((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(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),Ve=se((function({referrerType:a,...e}){const t=X(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>Pe(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h((d=>W(d)))&&r;let i;const O=Je(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Je=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=H((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(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),Xe=se((function({referrerType:a,...e}){const t=X(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>je(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h((d=>W(d)))&&r;let i;const O=Qe(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:Se($.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(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,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=X(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Z(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h((v=>Me(v.transactionListState,A,p))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((v=>K(v))),f=F.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=F.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(V.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(V.isProjectsTransactionsEnabled),d=h((v=>W(v)))&&$,{areTenantIdsInSync:_}=Re();g.useEffect((()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,S,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(He,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>R(v),...e}):s.jsx(z,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[h((n=>K(n))).tenantId],t=Fe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ve,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Xe,{referrerType:a})})]})}export{kt as default};
1
+ import{j as s}from"./liveblocks-tpE-grBU.js";import{h as X,g as U,u as Q,i as Z,j as h,N as z,n as H,o as ve,p as j}from"./core-0WK0Zss8.js";import{eX as K,qU as W,jZ as u,RL as ee,K6 as De,bo as le,RM as be,kA as te,NM as ae,RN as ue,RO as Pe,bE as Y,K2 as ye,RP as Ee,RQ as me,RR as je,K5 as Ae,RS as xe,RT as pe,RU as Me,RV as ge,RW as Le,RX as Ce,RY as fe,Li as Be}from"./zeni-epic-state-Bx_bp9Xr.js";import{a as de,C as ne,G as V,d as G,cq as ce,r as J,q as oe,_ as Re,R as Fe}from"./index-Dy73EgcO.js";import"./mui-NHWzIwJg.js";import{a as g}from"./sentry-D58SEIt0.js";import{w as se}from"./withTransactionSidePanel-BsJ58rSa.js";import{p as ie,c as re}from"./routePaths-YBRbNv0i.js";import{v as Oe}from"./utils-CHGPa257.js";import{d as b}from"./decodeURIComponentSafe-DYdex7Fp.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DZHjDSg5.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import"./TransactionDetailScreen-CRWTcneH.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]="0851fa3d-8e10-463f-a32d-accb555a80b6",a._sentryDebugIdIdentifier="sentry-dbid-0851fa3d-8e10-463f-a32d-accb555a80b6")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],q=a=>Oe(a),we=H((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,q(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=q(e.selectedAccount.tranListType),m=Ne(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:q(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:q(e.selectedAccount.tranListType)}))}}}))(ce),N=se((function({...a}){const e=X(),t=U(),n=Q(),c=t.pathname.split("/").find((r=>ze.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Z(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(V.isProjectsTransactionsEnabled),x=h((r=>W(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[R,F]=g.useState(void 0),f=g.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,S,C]);g.useEffect((()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=q(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&R!=null&&(M={...f,period:R}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>F(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},qe=H((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(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),Ve=se((function({referrerType:a,...e}){const t=X(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>Pe(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h((d=>W(d)))&&r;let i;const O=Je(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Je=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=H((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(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),Xe=se((function({referrerType:a,...e}){const t=X(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h((d=>je(d.transactionListState,A,p,k))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((d=>K(d))),f=F.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h((d=>W(d)))&&r;let i;const O=Qe(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect((()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter((d=>d!=null));return O&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>R(d),...e}):s.jsx(z,{to:Se($.length)})})),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(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,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=X(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Z(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h((v=>Me(v.transactionListState,A,p))),[P,B]=g.useState(!1),[E,R]=g.useState(void 0),F=h((v=>K(v))),f=F.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=F.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(V.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(V.isProjectsTransactionsEnabled),d=h((v=>W(v)))&&$,{areTenantIdsInSync:_}=Re();g.useEffect((()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,S,T,D,y].filter((v=>v!=null));return w&&i!=null?s.jsx(He,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>R(v),...e}):s.jsx(z,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[h((n=>K(n))).tenantId],t=Fe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ve,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Xe,{referrerType:a})})]})}export{kt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-tpE-grBU.js";import{h as F,g as B,u as U,i as O,j as g,N as D,n as G,o as Te,p as k}from"./core-0WK0Zss8.js";import{cq as N,eX as E,Qv as L,Gt as ae,fW as H,Gb as ne,Qx as Ie,Gw as ke,Qt as je,Qu as se,QJ as be,EA as Ae,ue as Ee,Qz as ve,GP as De,Qw as re,cU as q,yx as oe,fC as Fe,fE as Be,RI as Ue,RJ as Le,Gc as Pe,RK as Re,Gd as Me,Gm as Ve,bs as Oe,bJ as Ge,cB as Ne,bK as _e,cp as ze,bt as $e,M1 as Qe,co as He}from"./zeni-epic-state-Bx_bp9Xr.js";import{T as _,ar as qe,z as A,D as z,d as j,cj as Ze,ck as Je,cl as Q,m as Z,y as Ke,_ as We,a0 as Xe,C as ie,G as v,E as Ye,B as et,cm as tt,au as J,r as at,cn as nt,q as K,co as st,H as X,cp as rt,i as ot}from"./index-sRBDhi1m.js";import{D as it,n as R,S as ct}from"./mui-NHWzIwJg.js";import lt from"./NotFoundScreen-YuP4L1AW.js";import{S as Y}from"./SetupPagesScreen-CnC81M3U.js";import{a as p}from"./sentry-D58SEIt0.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-GvI044sz.js";import{u as dt}from"./useInitialThreadRequest-auUWihGo.js";import{u as pt}from"./useCashManagementBanner-BjggUhzA.js";import{M as ce}from"./MobileAppDrawer-DRd73Iks.js";import{F as mt}from"./FeaturePreviewScreen-CMmpeBsa.js";import{a as ee}from"./analyticsHelper-Cp1NXf0W.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./routePaths-Bj6MBuce.js";import"./BusinessVerificationPageScreen-BVQ7YkrT.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]="c9cb943c-8317-4e68-8678-c6f4e9e0e606",t._sentryDebugIdIdentifier="sentry-dbid-c9cb943c-8317-4e68-8678-c6f4e9e0e606")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:L(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}}))(Ze);function yt(){const t=F(),a=B(),n=U(),{tenantEmailDomain:r}=O(),m=_(),s=g((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=qe(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g((I=>E(I))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((I=>L(I,y))),T=g((I=>I.treasurySetupViewState.fetchState)),C=g((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,T,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(H()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(w(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=G((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:L(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.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:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Je),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=U(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),T=g((C=>L(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(H()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(w(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:T,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(j,"review",h.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
1
+ import{j as e}from"./liveblocks-tpE-grBU.js";import{h as F,g as B,u as U,i as O,j as g,N as D,n as G,o as Te,p as k}from"./core-0WK0Zss8.js";import{cq as N,eX as E,Qv as L,Gt as ae,fW as H,Gb as ne,Qx as Ie,Gw as ke,Qt as je,Qu as se,QJ as be,EA as Ae,ue as Ee,Qz as ve,GP as De,Qw as re,cU as q,yx as oe,fC as Fe,fE as Be,RI as Ue,RJ as Le,Gc as Pe,RK as Re,Gd as Me,Gm as Ve,bs as Oe,bJ as Ge,cB as Ne,bK as _e,cp as ze,bt as $e,M1 as Qe,co as He}from"./zeni-epic-state-Bx_bp9Xr.js";import{T as _,ar as qe,z as A,D as z,d as j,cj as Ze,ck as Je,cl as Q,m as Z,y as Ke,_ as We,a0 as Xe,C as ie,G as v,E as Ye,B as et,cm as tt,au as J,r as at,cn as nt,q as K,co as st,H as X,cp as rt,i as ot}from"./index-Dy73EgcO.js";import{D as it,n as R,S as ct}from"./mui-NHWzIwJg.js";import lt from"./NotFoundScreen-BUpSeNgf.js";import{S as Y}from"./SetupPagesScreen-lXVOcLJ8.js";import{a as p}from"./sentry-D58SEIt0.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import{u as dt}from"./useInitialThreadRequest-B7WOjZ27.js";import{u as pt}from"./useCashManagementBanner-MgmXXc9G.js";import{M as ce}from"./MobileAppDrawer-By5kqJZy.js";import{F as mt}from"./FeaturePreviewScreen-CS0na0Uv.js";import{a as ee}from"./analyticsHelper-C8vUB4gm.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./routePaths-YBRbNv0i.js";import"./BusinessVerificationPageScreen-DsowR4fB.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]="c9cb943c-8317-4e68-8678-c6f4e9e0e606",t._sentryDebugIdIdentifier="sentry-dbid-c9cb943c-8317-4e68-8678-c6f4e9e0e606")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:L(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}}))(Ze);function yt(){const t=F(),a=B(),n=U(),{tenantEmailDomain:r}=O(),m=_(),s=g((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=qe(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g((I=>E(I))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((I=>L(I,y))),T=g((I=>I.treasurySetupViewState.fetchState)),C=g((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,T,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(H()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(w(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=G((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:L(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.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:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Je),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=U(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),T=g((C=>L(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(H()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(w(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:T,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(j,"review",h.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;