@zeniai/web-app-ui 5.1.22-dev → 5.1.22-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 (60) hide show
  1. package/dist/assets/{AddressRoutes-DFAo71dm.js → AddressRoutes-CT41ny-f.js} +1 -1
  2. package/dist/assets/{AddressScreen-CAEk8mk_.js → AddressScreen-CLP4FP-O.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BKo76Cv4.js → AiCfoScreen-BLZXZArd.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CHqAEZsW.js → BillPayApprovalRoutes-B93D6K86.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-C35OH9Bu.js → BillPayRoutes-BjRPRC0a.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CgVN0Nsi.js → BusinessVerificationPageScreen-COS298yT.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-D1ynSFue.js → ChargeCardRoutes-DOf8ZxFe.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-CZyzwqAN.js → CompanyPassportScreen-E_X2D3vf.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-BxOtTv2G.js → ConnectionAuthScreen-Cu1m3qnO.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-dnPP_THl.js → CustomerOnboardingAuthScreen-BlnEv_rI.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-CV3lMFDm.js → CustomerOnboardingRoutes-DKTu3TSV.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-CyRdXBry.js → DashboardRoutes-DQ8scLPs.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-2SpQFMEh.js → DefaultTenantHome-Bz8KR5te.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BwV8uHFK.js → DomesticWireDetailScreen-Dt8QkNl1.js} +1 -1
  15. package/dist/assets/{DrawerScreen-C8Y4hZ9A.js → DrawerScreen-B0s6XB_a.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-Cf-UIj8k.js → EntityDetailRoutes-BFnZxzSO.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-DlB2tX8j.js → ExpenseAutomationRoutes-Du15OqPm.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-CzGmkIs5.js → FeaturePreviewScreen-B1hf1dDh.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-J9VXEJ_b.js → HubSpotOAuthCallbackScreen-Btz0OQdh.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-Dzny_0z8.js → MagicLinkRoutes-BkrcEfxv.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-B7WrkbOS.js → MagicLinkSignInScreen-B7-oTG61.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-NgQTATqT.js → MobileAppDrawer-CzXbfz6E.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-Dnnx5_jI.js → NotFoundScreen-B6lzVM70.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-5ZrD3JXy.js → NotificationRoutes-m1_3MbJD.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-DMk4QIE9.js → OAuthConsentScreen-C3grO2B9.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-DXkA6slP.js → PandLWithForecastRoutes-tDYLv6EF.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-DT-OdVos.js → PeopleRoutes-BvrpCiXR.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-GPH8MNJm.js → PerformanceRoutes-D65HLS4l.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CAQUllDp.js → QBOConnectionScreen-CoUX8FMs.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-DAm5IsxS.js → ReferralListScreen-BJK_FqYN.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-DEpRS8Cq.js → ReimbursementApprovalRoutes-Deq3_qrD.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BvSQCWpJ.js → ReimbursementApprovalRuleDetailScreen-B-HB-2Ii.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-gjTC-Wvb.js → ReimbursementRoutes-CT53GTQR.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-BNBlzfhF.js → ReportsRoutes-Bd2DqBOB.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-CIjKku01.js → RewardsRoutes-D5m9btlG.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-CrJaHpxC.js → ScreenRoutes-B800Vl-U.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-DQuZAuVf.js → SettingsRoutes-BTpkC5ER.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-ALhX_tKy.js → SetupPagesScreen-BLeSibic.js} +1 -1
  39. package/dist/assets/{SignInScreen-Cg3_Sp1a.js → SignInScreen-D56meGXv.js} +1 -1
  40. package/dist/assets/{SignOutScreen-Dca3TL76.js → SignOutScreen-D3B_wlKC.js} +1 -1
  41. package/dist/assets/{TaskListScreen-C_Tqt5Br.js → TaskListScreen-DV56A-OD.js} +1 -1
  42. package/dist/assets/{TaskRoutes-WPpNWz-g.js → TaskRoutes-C1MBk6tP.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-DhINrWYz.js → TransactionDetailRoutes-D8PM2qy_.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-Ciduelax.js → TransactionDetailScreen-CrAEKQhU.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-DmwWnTvd.js → TransactionListRoutes-BcEl6aLg.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-BaAE21GJ.js → TreasuryRoutes-udOEEHS2.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-ONRRLMlr.js → VendorsRoutes-DIXbOVo9.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-DtERxgVf.js → WiseConfirmationScreen-CO9e9Q0A.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-BZd2UMK8.js → ZeniAccountRoutes-BcmFR78c.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-DkPXPFSa.js → ZeniAccountStatementScreen-seV3Vtmq.js} +1 -1
  51. package/dist/assets/{analyticsHelper-uVQynfBH.js → analyticsHelper-DLVGE934.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-BikYpzid.js → getLocaleForTenant-D8ujXHmv.js} +1 -1
  53. package/dist/assets/{index-CYj5jhrI.js → index-BRBKIeck.js} +5 -5
  54. package/dist/assets/{routePaths-CJs7QSKh.js → routePaths-f58A_7uy.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DliEl8yr.js → useAiCfoDashboardSuggestedQuestionsChips-CDWxxCLl.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-CyyAGXJ-.js → useAskAiCfoHostNavButtonProps-lMf8y8xS.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-Chgglzdd.js → useInitialThreadRequest-B5lLxxrW.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-DYzLuoli.js → withTransactionSidePanel-Dqu6-_83.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CyRdXBry.js","assets/sentry-p9ArnUH9.js","assets/core-rmRh_ZE8.js","assets/zeni-epic-state-DH4sFgeZ.js","assets/index-CYj5jhrI.js","assets/mui-DRkb5v8u.js","assets/analytics-CnRKHa3G.js","assets/utils-B4k-7_rU.js","assets/withTransactionSidePanel-DYzLuoli.js","assets/useAskAiCfoHostNavButtonProps-CyyAGXJ-.js","assets/TransactionDetailScreen-Ciduelax.js","assets/decodeURIComponentSafe-C5DyNl7Z.js","assets/routePaths-CJs7QSKh.js","assets/NotFoundScreen-Dnnx5_jI.js","assets/useInitialThreadRequest-Chgglzdd.js","assets/analyticsHelper-uVQynfBH.js","assets/CompanyPassportScreen-CZyzwqAN.js","assets/MobileAppDrawer-NgQTATqT.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DliEl8yr.js","assets/FeaturePreviewScreen-CzGmkIs5.js","assets/ReferralListScreen-DAm5IsxS.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-C35OH9Bu.js","assets/AddressScreen-CAEk8mk_.js","assets/DomesticWireDetailScreen-BwV8uHFK.js","assets/DrawerScreen-C8Y4hZ9A.js","assets/SetupPagesScreen-ALhX_tKy.js","assets/BusinessVerificationPageScreen-CgVN0Nsi.js","assets/BillPayApprovalRoutes-CHqAEZsW.js","assets/ReimbursementApprovalRuleDetailScreen-BvSQCWpJ.js","assets/getLocaleForTenant-BikYpzid.js","assets/ReimbursementRoutes-gjTC-Wvb.js","assets/ReimbursementApprovalRoutes-DEpRS8Cq.js","assets/TransactionListRoutes-DmwWnTvd.js","assets/ZeniAccountStatementScreen-DkPXPFSa.js","assets/SettingsRoutes-DQuZAuVf.js","assets/accountMappingHelper-DjOpJLte.js","assets/QBOConnectionScreen-CAQUllDp.js","assets/empty-BR41JKH4.js","assets/index-BcKPNqyh.js","assets/url-B-b7cLPz.js","assets/index-CTpsdld-.js","assets/ReportsRoutes-BNBlzfhF.js","assets/ChargeCardRoutes-D1ynSFue.js","assets/PeopleRoutes-DT-OdVos.js","assets/ExpenseAutomationRoutes-DlB2tX8j.js","assets/TreasuryRoutes-BaAE21GJ.js","assets/VendorsRoutes-ONRRLMlr.js","assets/pathToGoBack-BjLk76KL.js","assets/ZeniAccountRoutes-BZd2UMK8.js","assets/AddressRoutes-DFAo71dm.js","assets/PandLWithForecastRoutes-DXkA6slP.js","assets/CustomerOnboardingRoutes-CV3lMFDm.js","assets/TransactionDetailRoutes-DhINrWYz.js","assets/EntityDetailRoutes-Cf-UIj8k.js","assets/NotificationRoutes-5ZrD3JXy.js","assets/PerformanceRoutes-GPH8MNJm.js","assets/RewardsRoutes-CIjKku01.js","assets/TaskRoutes-WPpNWz-g.js","assets/TaskListScreen-C_Tqt5Br.js","assets/AiCfoScreen-BKo76Cv4.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eP as ls,e_ as cs,eY as ds,eZ as ms,fH as us,eT as _s,cP as Ee,cx as Es,fe as As,cp as ps,bE as gs,bq as xs,fj as Is,v as Ts,Jr as hs,bt as js,Js as Us,bG as Hs,fg as bs,bF as Rs,bs as Ds,cl as ys,Jt as fs,Ju as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mW as Ae,eW as pe,fR as Bs,fn as ge,fO as xe,fP as Ie,fo as ks}from"./zeni-epic-state-DH4sFgeZ.js";import{j as e}from"./liveblocks-oKBQUmhq.js";import{a as v}from"./sentry-p9ArnUH9.js";import{u as Vs,h as Ss,i as Ns,g as Ms,j as G,l as Te,N as c,o as Zs,p as t}from"./core-rmRh_ZE8.js";import{h as ws,u as Gs,z as b,v as zs,a as $s,X as Ws,T as L,k as Ys,L as B,D as he,t as _,P as Js,c as Q,l}from"./index-CYj5jhrI.js";import"./mui-DRkb5v8u.js";import{f as je}from"./analyticsHelper-uVQynfBH.js";import{t as qs}from"./getLocaleForTenant-BikYpzid.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="212cec0d-cb34-481d-be74-464406c6135e",i._sentryDebugIdIdentifier="sentry-dbid-212cec0d-cb34-481d-be74-464406c6135e")}catch{}})();const Xs={dashboard:()=>n(()=>import("./DashboardRoutes-CyRdXBry.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-C35OH9Bu.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-gjTC-Wvb.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-DmwWnTvd.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-DQuZAuVf.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-BNBlzfhF.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-D1ynSFue.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-DT-OdVos.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-DlB2tX8j.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-BaAE21GJ.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-ONRRLMlr.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-BZd2UMK8.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Ks=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-BNBlzfhF.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-DFAo71dm.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-DT-OdVos.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-DXkA6slP.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-CV3lMFDm.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-ONRRLMlr.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-DhINrWYz.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-Cf-UIj8k.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-CyRdXBry.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]))),He=l(()=>n(()=>import("./BillPayRoutes-C35OH9Bu.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]))),ln=l(()=>n(()=>import("./SettingsRoutes-DQuZAuVf.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),be=l(()=>n(()=>import("./ReimbursementRoutes-gjTC-Wvb.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]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-BZd2UMK8.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-BaAE21GJ.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-DmwWnTvd.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-D1ynSFue.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-5ZrD3JXy.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-GPH8MNJm.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-DlB2tX8j.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-CIjKku01.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),gn=l(()=>n(()=>import("./TaskRoutes-WPpNWz-g.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),xn=l(()=>n(()=>import("./AiCfoScreen-BKo76Cv4.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-Dnnx5_jI.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),In=l(()=>n(()=>import("./TaskListScreen-C_Tqt5Br.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),D=b.getSignedInUserTenant(o)?.tenantId,h=b.getSignedInUser(),q=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),X=$s(),ye=Ws(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),W=G(a=>us(a));if(o!=null){const a=b.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Ys(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&D!=null){const a=K.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(Is(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&b.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=b.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?Q.identify(a.userId,{tenant_id:a.tenantId}):Q.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,b]),v.useEffect(()=>{b.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(ge(s));const J=b.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(J?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)));if(Y){Q.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,D,h,f,U))},[D,A]),v.useEffect(()=>{b.isSignedIn()&&j==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),b.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,W.tenantsBaseInOrder))},[W,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):A==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Ks,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Xs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,We=r.company!=null&&bs(r.company),Ye=Pe&&We===!0&&!C,Je=re&&Rs(E?.loggedInUserRoleMap),qe=oe&&Ds(E?.loggedInUserRoleMap),Xe=me&&ys(E?.loggedInUserRoleMap),Ke=fs(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),g=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),I=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&I,_e=ce&&T,es=me&&p,ss=Ye&&g,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Ke===!0||Qe===!0;return b.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Qs,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(In,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(gn,{})}),e.jsx(t,{path:"address/*",element:Je||de||Xe||qe?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:X?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:X?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:X?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(bn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wn as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DQ8scLPs.js","assets/sentry-p9ArnUH9.js","assets/core-rmRh_ZE8.js","assets/zeni-epic-state-DH4sFgeZ.js","assets/index-BRBKIeck.js","assets/mui-DRkb5v8u.js","assets/analytics-CnRKHa3G.js","assets/utils-B4k-7_rU.js","assets/withTransactionSidePanel-Dqu6-_83.js","assets/useAskAiCfoHostNavButtonProps-lMf8y8xS.js","assets/TransactionDetailScreen-CrAEKQhU.js","assets/decodeURIComponentSafe-C5DyNl7Z.js","assets/routePaths-f58A_7uy.js","assets/NotFoundScreen-B6lzVM70.js","assets/useInitialThreadRequest-B5lLxxrW.js","assets/analyticsHelper-DLVGE934.js","assets/CompanyPassportScreen-E_X2D3vf.js","assets/MobileAppDrawer-CzXbfz6E.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CDWxxCLl.js","assets/FeaturePreviewScreen-B1hf1dDh.js","assets/ReferralListScreen-BJK_FqYN.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BjRPRC0a.js","assets/AddressScreen-CLP4FP-O.js","assets/DomesticWireDetailScreen-Dt8QkNl1.js","assets/DrawerScreen-B0s6XB_a.js","assets/SetupPagesScreen-BLeSibic.js","assets/BusinessVerificationPageScreen-COS298yT.js","assets/BillPayApprovalRoutes-B93D6K86.js","assets/ReimbursementApprovalRuleDetailScreen-B-HB-2Ii.js","assets/getLocaleForTenant-D8ujXHmv.js","assets/ReimbursementRoutes-CT53GTQR.js","assets/ReimbursementApprovalRoutes-Deq3_qrD.js","assets/TransactionListRoutes-BcEl6aLg.js","assets/ZeniAccountStatementScreen-seV3Vtmq.js","assets/SettingsRoutes-BTpkC5ER.js","assets/accountMappingHelper-DjOpJLte.js","assets/QBOConnectionScreen-CoUX8FMs.js","assets/empty-BR41JKH4.js","assets/index-BcKPNqyh.js","assets/url-B-b7cLPz.js","assets/index-CTpsdld-.js","assets/ReportsRoutes-Bd2DqBOB.js","assets/ChargeCardRoutes-DOf8ZxFe.js","assets/PeopleRoutes-BvrpCiXR.js","assets/ExpenseAutomationRoutes-Du15OqPm.js","assets/TreasuryRoutes-udOEEHS2.js","assets/VendorsRoutes-DIXbOVo9.js","assets/pathToGoBack-BjLk76KL.js","assets/ZeniAccountRoutes-BcmFR78c.js","assets/AddressRoutes-CT41ny-f.js","assets/PandLWithForecastRoutes-tDYLv6EF.js","assets/CustomerOnboardingRoutes-DKTu3TSV.js","assets/TransactionDetailRoutes-D8PM2qy_.js","assets/EntityDetailRoutes-BFnZxzSO.js","assets/NotificationRoutes-m1_3MbJD.js","assets/PerformanceRoutes-D65HLS4l.js","assets/RewardsRoutes-D5m9btlG.js","assets/TaskRoutes-C1MBk6tP.js","assets/TaskListScreen-DV56A-OD.js","assets/AiCfoScreen-BLZXZArd.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eP as ls,e_ as cs,eY as ds,eZ as ms,fH as us,eT as _s,cP as Ee,cx as Es,fe as As,cp as ps,bE as gs,bq as xs,fj as Is,v as Ts,Jr as hs,bt as js,Js as Us,bG as Hs,fg as bs,bF as Rs,bs as Ds,cl as ys,Jt as fs,Ju as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mW as Ae,eW as pe,fR as Bs,fn as ge,fO as xe,fP as Ie,fo as ks}from"./zeni-epic-state-DH4sFgeZ.js";import{j as e}from"./liveblocks-oKBQUmhq.js";import{a as v}from"./sentry-p9ArnUH9.js";import{u as Vs,h as Ss,i as Ns,g as Ms,j as G,l as Te,N as c,o as Zs,p as t}from"./core-rmRh_ZE8.js";import{h as ws,u as Gs,z as b,v as zs,a as $s,X as Ws,T as L,k as Ys,L as B,D as he,t as _,P as Js,c as Q,l}from"./index-BRBKIeck.js";import"./mui-DRkb5v8u.js";import{f as je}from"./analyticsHelper-DLVGE934.js";import{t as qs}from"./getLocaleForTenant-D8ujXHmv.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="212cec0d-cb34-481d-be74-464406c6135e",i._sentryDebugIdIdentifier="sentry-dbid-212cec0d-cb34-481d-be74-464406c6135e")}catch{}})();const Xs={dashboard:()=>n(()=>import("./DashboardRoutes-DQ8scLPs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-BjRPRC0a.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-CT53GTQR.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-BcEl6aLg.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-BTpkC5ER.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-Bd2DqBOB.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DOf8ZxFe.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-BvrpCiXR.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-Du15OqPm.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-udOEEHS2.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-DIXbOVo9.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-BcmFR78c.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Ks=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Qs=l(()=>n(()=>import("./ReportsRoutes-Bd2DqBOB.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-CT41ny-f.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-BvrpCiXR.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-tDYLv6EF.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-DKTu3TSV.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-DIXbOVo9.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-D8PM2qy_.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-BFnZxzSO.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-DQ8scLPs.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]))),He=l(()=>n(()=>import("./BillPayRoutes-BjRPRC0a.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]))),ln=l(()=>n(()=>import("./SettingsRoutes-BTpkC5ER.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),be=l(()=>n(()=>import("./ReimbursementRoutes-CT53GTQR.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]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-BcmFR78c.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-udOEEHS2.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-BcEl6aLg.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-DOf8ZxFe.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-m1_3MbJD.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-D65HLS4l.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-Du15OqPm.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-D5m9btlG.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),gn=l(()=>n(()=>import("./TaskRoutes-C1MBk6tP.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),xn=l(()=>n(()=>import("./AiCfoScreen-BLZXZArd.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-B6lzVM70.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),In=l(()=>n(()=>import("./TaskListScreen-DV56A-OD.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),D=b.getSignedInUserTenant(o)?.tenantId,h=b.getSignedInUser(),q=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),X=$s(),ye=Ws(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),W=G(a=>us(a));if(o!=null){const a=b.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Ys(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&D!=null){const a=K.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(Is(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&b.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=b.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?Q.identify(a.userId,{tenant_id:a.tenantId}):Q.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,b]),v.useEffect(()=>{b.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(ge(s));const J=b.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(J?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)));if(Y){Q.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,D,h,f,U))},[D,A]),v.useEffect(()=>{b.isSignedIn()&&j==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),b.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,W.tenantsBaseInOrder))},[W,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):A==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Ks,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Xs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,We=r.company!=null&&bs(r.company),Ye=Pe&&We===!0&&!C,Je=re&&Rs(E?.loggedInUserRoleMap),qe=oe&&Ds(E?.loggedInUserRoleMap),Xe=me&&ys(E?.loggedInUserRoleMap),Ke=fs(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),g=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),I=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&I,_e=ce&&T,es=me&&p,ss=Ye&&g,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Ke===!0||Qe===!0;return b.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Qs,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(In,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(gn,{})}),e.jsx(t,{path:"address/*",element:Je||de||Xe||qe?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:X?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:X?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:X?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(bn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-oKBQUmhq.js";import{a as p}from"./sentry-p9ArnUH9.js";import{h as _,g as R,u as k,j as h,n as B,i as F,o as Q,p as I}from"./core-rmRh_ZE8.js";import{bn as xe,eP as j,gN as de,Lw as Ee,pD as Ae,jG as ue,lZ as we,gP as je,Ly as Pe,Lx as ke,NX as ve,xQ as De,Cj as Me,Nw as Ue,NF as _e,c2 as ee,cH as Te,cI as Re,JD as Be,NY as Fe,JE as Oe,wg as Ve,NZ as Le,Ez as Ne,B$ as $e,BS as pe,BP as Ke,wk as ge,BV as me,BY as fe,C2 as ne,sR as te,wj as ze,ji as W,jl as he,N_ as Je,km as Ge,wz as Ze,Kr as qe,Ks as He,jg as Ye,N$ as Qe,jj as We,q5 as Xe,O0 as en,O1 as nn,q9 as tn,gx as an,JM as Y,gm as sn,gt as on,JN as cn,ww as rn,O2 as ln,O3 as dn,Cg as un,eY as be,e_ as Se,O4 as pn,fA as gn,JW as mn,wv as oe,fF as ie,fE as fn,wu as hn,fD as bn,fC as Sn,O5 as Cn,f1 as Ce,O6 as yn,O7 as In,wC as xn,wt as ce,O8 as En,fi as An,wq as wn,bV as jn,c1 as Pn,c0 as kn,bW as vn,b_ as Dn,bZ as Mn,bY as Un,b$ as _n,bX as Tn}from"./zeni-epic-state-DH4sFgeZ.js";import{v as ae,T as M,z as E,af as ye,bI as Rn,c as K,e as Bn,k as O,s as se,bJ as Fn,bK as On,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,V as zn,bO as Jn,q as Gn,bP as Zn}from"./index-CYj5jhrI.js";import{n as U}from"./mui-DRkb5v8u.js";import{M as v}from"./MobileAppDrawer-NgQTATqT.js";import{a as N,g as $,m as qn}from"./accountMappingHelper-DjOpJLte.js";import{t as Hn,A as Yn}from"./AddressScreen-CAEk8mk_.js";import T from"./NotFoundScreen-Dnnx5_jI.js";import{g as Qn}from"./analyticsHelper-uVQynfBH.js";import{B as Wn}from"./BusinessVerificationPageScreen-CgVN0Nsi.js";import{C as Xn}from"./CompanyPassportScreen-CZyzwqAN.js";import{q as re}from"./QBOConnectionScreen-CAQUllDp.js";import{B as et}from"./BillPayApprovalRoutes-CHqAEZsW.js";import{R as nt}from"./ReimbursementApprovalRoutes-DEpRS8Cq.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./routePaths-CJs7QSKh.js";import"./empty-BR41JKH4.js";import"./pdf-lib-B5Yv6f0X.js";import"./index-BcKPNqyh.js";import"./url-B-b7cLPz.js";import"./index-CTpsdld-.js";import"./decodeURIComponentSafe-C5DyNl7Z.js";import"./ReimbursementApprovalRuleDetailScreen-BvSQCWpJ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="69e1e267-661a-4627-8224-97733f510a76",e._sentryDebugIdIdentifier="sentry-dbid-69e1e267-661a-4627-8224-97733f510a76")}catch{}})();const tt=U.div`
1
+ import{j as a}from"./liveblocks-oKBQUmhq.js";import{a as p}from"./sentry-p9ArnUH9.js";import{h as _,g as R,u as k,j as h,n as B,i as F,o as Q,p as I}from"./core-rmRh_ZE8.js";import{bn as xe,eP as j,gN as de,Lw as Ee,pD as Ae,jG as ue,lZ as we,gP as je,Ly as Pe,Lx as ke,NX as ve,xQ as De,Cj as Me,Nw as Ue,NF as _e,c2 as ee,cH as Te,cI as Re,JD as Be,NY as Fe,JE as Oe,wg as Ve,NZ as Le,Ez as Ne,B$ as $e,BS as pe,BP as Ke,wk as ge,BV as me,BY as fe,C2 as ne,sR as te,wj as ze,ji as W,jl as he,N_ as Je,km as Ge,wz as Ze,Kr as qe,Ks as He,jg as Ye,N$ as Qe,jj as We,q5 as Xe,O0 as en,O1 as nn,q9 as tn,gx as an,JM as Y,gm as sn,gt as on,JN as cn,ww as rn,O2 as ln,O3 as dn,Cg as un,eY as be,e_ as Se,O4 as pn,fA as gn,JW as mn,wv as oe,fF as ie,fE as fn,wu as hn,fD as bn,fC as Sn,O5 as Cn,f1 as Ce,O6 as yn,O7 as In,wC as xn,wt as ce,O8 as En,fi as An,wq as wn,bV as jn,c1 as Pn,c0 as kn,bW as vn,b_ as Dn,bZ as Mn,bY as Un,b$ as _n,bX as Tn}from"./zeni-epic-state-DH4sFgeZ.js";import{v as ae,T as M,z as E,af as ye,bI as Rn,c as K,e as Bn,k as O,s as se,bJ as Fn,bK as On,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,V as zn,bO as Jn,q as Gn,bP as Zn}from"./index-BRBKIeck.js";import{n as U}from"./mui-DRkb5v8u.js";import{M as v}from"./MobileAppDrawer-CzXbfz6E.js";import{a as N,g as $,m as qn}from"./accountMappingHelper-DjOpJLte.js";import{t as Hn,A as Yn}from"./AddressScreen-CLP4FP-O.js";import T from"./NotFoundScreen-B6lzVM70.js";import{g as Qn}from"./analyticsHelper-DLVGE934.js";import{B as Wn}from"./BusinessVerificationPageScreen-COS298yT.js";import{C as Xn}from"./CompanyPassportScreen-E_X2D3vf.js";import{q as re}from"./QBOConnectionScreen-CoUX8FMs.js";import{B as et}from"./BillPayApprovalRoutes-B93D6K86.js";import{R as nt}from"./ReimbursementApprovalRoutes-Deq3_qrD.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./routePaths-f58A_7uy.js";import"./empty-BR41JKH4.js";import"./pdf-lib-B5Yv6f0X.js";import"./index-BcKPNqyh.js";import"./url-B-b7cLPz.js";import"./index-CTpsdld-.js";import"./decodeURIComponentSafe-C5DyNl7Z.js";import"./ReimbursementApprovalRuleDetailScreen-B-HB-2Ii.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="69e1e267-661a-4627-8224-97733f510a76",e._sentryDebugIdIdentifier="sentry-dbid-69e1e267-661a-4627-8224-97733f510a76")}catch{}})();const tt=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-oKBQUmhq.js";import{h as Q,g as Y,u as X,i as G,j as E,N as j,n as W,s as Ye}from"./core-rmRh_ZE8.js";import{bF as Xe,cl as Ie,Nk as ye,eP as x,cx as en,x$ as Z,xQ as nn,Nw as tn,Nz as an,qo as ee,qc as ne,ke as te,sn as z,NB as Ae,fE as $e,fD as Ge,fC as We,NC as sn,y8 as on,B$ as ke,BS as _e,BP as ve,BG as K,BV as Pe,BY as Ee,C2 as we,sR as De,fT as cn,cs as rn,e_ as un,eY as dn,eZ as ln,bs as pn,ND as mn,AI as le,Bk as yn,NE as fn,bG as gn,Df as pe,Cj as Sn,NF as bn,NG as hn,Dj as Cn,Dn as In,sg as An,HM as kn,DU as Ce,EN as me,NH as _n,NI as vn,NJ as Pn,NK as He,NL as En,Ke as wn,MJ as Dn,Kq as Tn,NM as qe,NN as Fe,E6 as Ke,km as Un,qf as Je,sp as On,bE as Ne,sB as je,cv as Bn,NO as Qe,fh as Fn,DC as xn,DG as Vn,NP as Nn,DX as Re,NQ as jn,NR as Rn,NS as zn,NT as Ln,fM as Mn,zj as Zn,NU as $n,zo as Gn,zn as Wn}from"./zeni-epic-state-DH4sFgeZ.js";import{k as ae,v as ie,T as de,h as Te,aN as J,z as w,K as se,c as D,s as Ue,e as $,bx as Hn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Jn,q as ze,au as Le,J as Qn,x as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-CYj5jhrI.js";import{a as C}from"./sentry-p9ArnUH9.js";import{n as xe,D as at,S as it}from"./mui-DRkb5v8u.js";import{M as fe}from"./MobileAppDrawer-NgQTATqT.js";import R from"./NotFoundScreen-Dnnx5_jI.js";import{a as Me}from"./analyticsHelper-uVQynfBH.js";import{d as Ze}from"./routePaths-CJs7QSKh.js";import{B as Be}from"./BusinessVerificationPageScreen-CgVN0Nsi.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]="00442faf-7ad0-45a4-86a9-4f28bf10c835",e._sentryDebugIdIdentifier="sentry-dbid-00442faf-7ad0-45a4-86a9-4f28bf10c835")}catch{}})();const st=xe.div`
1
+ import{j as u}from"./liveblocks-oKBQUmhq.js";import{h as Q,g as Y,u as X,i as G,j as E,N as j,n as W,s as Ye}from"./core-rmRh_ZE8.js";import{bF as Xe,cl as Ie,Nk as ye,eP as x,cx as en,x$ as Z,xQ as nn,Nw as tn,Nz as an,qo as ee,qc as ne,ke as te,sn as z,NB as Ae,fE as $e,fD as Ge,fC as We,NC as sn,y8 as on,B$ as ke,BS as _e,BP as ve,BG as K,BV as Pe,BY as Ee,C2 as we,sR as De,fT as cn,cs as rn,e_ as un,eY as dn,eZ as ln,bs as pn,ND as mn,AI as le,Bk as yn,NE as fn,bG as gn,Df as pe,Cj as Sn,NF as bn,NG as hn,Dj as Cn,Dn as In,sg as An,HM as kn,DU as Ce,EN as me,NH as _n,NI as vn,NJ as Pn,NK as He,NL as En,Ke as wn,MJ as Dn,Kq as Tn,NM as qe,NN as Fe,E6 as Ke,km as Un,qf as Je,sp as On,bE as Ne,sB as je,cv as Bn,NO as Qe,fh as Fn,DC as xn,DG as Vn,NP as Nn,DX as Re,NQ as jn,NR as Rn,NS as zn,NT as Ln,fM as Mn,zj as Zn,NU as $n,zo as Gn,zn as Wn}from"./zeni-epic-state-DH4sFgeZ.js";import{k as ae,v as ie,T as de,h as Te,aN as J,z as w,K as se,c as D,s as Ue,e as $,bx as Hn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Jn,q as ze,au as Le,J as Qn,x as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-BRBKIeck.js";import{a as C}from"./sentry-p9ArnUH9.js";import{n as xe,D as at,S as it}from"./mui-DRkb5v8u.js";import{M as fe}from"./MobileAppDrawer-CzXbfz6E.js";import R from"./NotFoundScreen-B6lzVM70.js";import{a as Me}from"./analyticsHelper-DLVGE934.js";import{d as Ze}from"./routePaths-f58A_7uy.js";import{B as Be}from"./BusinessVerificationPageScreen-COS298yT.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]="00442faf-7ad0-45a4-86a9-4f28bf10c835",e._sentryDebugIdIdentifier="sentry-dbid-00442faf-7ad0-45a4-86a9-4f28bf10c835")}catch{}})();const st=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-oKBQUmhq.js";import{a as u,b as T,q as A}from"./sentry-p9ArnUH9.js";import{u as D,h as z,j as c,g as J,N as M,n as O}from"./core-rmRh_ZE8.js";import{u as P,z as s,h as j,c as E,D as F,d as _,e as B,f as N,g as q,p as V,i as v}from"./index-CYj5jhrI.js";import{eP as W,Jq as $,Jr as G,eW as H,fn as K,Jw as Q,fL as R,cT as X,Jx as x,Jy as Y,Jz as Z,bT as y}from"./zeni-epic-state-DH4sFgeZ.js";import"./mui-DRkb5v8u.js";import{u as ee}from"./useDeviceId-DDLhcPdX.js";import{f as te}from"./analyticsHelper-uVQynfBH.js";import{t as ne}from"./getLocaleForTenant-BikYpzid.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="9e59efcc-6e86-4118-9400-ff95aaf6e417",t._sentryDebugIdIdentifier="sentry-dbid-9e59efcc-6e86-4118-9400-ff95aaf6e417")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(x())}}})(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>W(e)),I=c(e=>$(e)),m=J(),w=j().mode,U=m.state?.magicLinkExpired,b=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),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(G(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),R().then(()=>{const e=q();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(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(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!b,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(N,{onClose:()=>i(x()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-oKBQUmhq.js";import{a as u,b as T,q as A}from"./sentry-p9ArnUH9.js";import{u as D,h as z,j as c,g as J,N as M,n as O}from"./core-rmRh_ZE8.js";import{u as P,z as s,h as j,c as E,D as F,d as _,e as B,f as N,g as q,p as V,i as v}from"./index-BRBKIeck.js";import{eP as W,Jq as $,Jr as G,eW as H,fn as K,Jw as Q,fL as R,cT as X,Jx as x,Jy as Y,Jz as Z,bT as y}from"./zeni-epic-state-DH4sFgeZ.js";import"./mui-DRkb5v8u.js";import{u as ee}from"./useDeviceId-DDLhcPdX.js";import{f as te}from"./analyticsHelper-DLVGE934.js";import{t as ne}from"./getLocaleForTenant-D8ujXHmv.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="9e59efcc-6e86-4118-9400-ff95aaf6e417",t._sentryDebugIdIdentifier="sentry-dbid-9e59efcc-6e86-4118-9400-ff95aaf6e417")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(x())}}})(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>W(e)),I=c(e=>$(e)),m=J(),w=j().mode,U=m.state?.magicLinkExpired,b=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),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(G(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),R().then(()=>{const e=q();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(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(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!b,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(N,{onClose:()=>i(x()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-oKBQUmhq.js";import{a as n}from"./sentry-p9ArnUH9.js";import{u,g as m,h as p,N as g}from"./core-rmRh_ZE8.js";import{z as f,s as y,t as b,c as d,e as h}from"./index-CYj5jhrI.js";import{fQ as x,fR as I,JO as w}from"./zeni-epic-state-DH4sFgeZ.js";import{n as j}from"./mui-DRkb5v8u.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="da7a630f-188d-4b8d-9b5e-93c5011f900a",e._sentryDebugIdIdentifier="sentry-dbid-da7a630f-188d-4b8d-9b5e-93c5011f900a")}catch{}})();function U(){const e=u(),t=m(),i=p(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=j.div`
1
+ import{j as s}from"./liveblocks-oKBQUmhq.js";import{a as n}from"./sentry-p9ArnUH9.js";import{u,g as m,h as p,N as g}from"./core-rmRh_ZE8.js";import{z as f,s as y,t as b,c as d,e as h}from"./index-BRBKIeck.js";import{fQ as x,fR as I,JO as w}from"./zeni-epic-state-DH4sFgeZ.js";import{n as j}from"./mui-DRkb5v8u.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="da7a630f-188d-4b8d-9b5e-93c5011f900a",e._sentryDebugIdIdentifier="sentry-dbid-da7a630f-188d-4b8d-9b5e-93c5011f900a")}catch{}})();function U(){const e=u(),t=m(),i=p(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=j.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-oKBQUmhq.js";import{a as g}from"./sentry-p9ArnUH9.js";import{h as K,u as _,g as z,j as D,i as O,n as V}from"./core-rmRh_ZE8.js";import{z as Q,v as W,T as d,_ as q,K as M,c as Z,e as J,cQ as X,q as f,n as H}from"./index-CYj5jhrI.js";import{eP as Y,QN as R,Gs as y,QO as x,QJ as aa,FQ as S,QP as ea,FY as I,Fi as ta,Gt as B,QQ as w,gT as sa,Gj as oa,Go as na,Gb as ia,G9 as L,Gp as la,G6 as ra,QR as ca,QS as ka,QT as ua,QU as pa,QV as T,ec as da,QW as Ta,QX as ma}from"./zeni-epic-state-DH4sFgeZ.js";import{n as ga}from"./mui-DRkb5v8u.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import{M as Ga}from"./MobileAppDrawer-NgQTATqT.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="e959b0df-2b38-4e3a-98bc-4c405a62ef78",e._sentryDebugIdIdentifier="sentry-dbid-e959b0df-2b38-4e3a-98bc-4c405a62ef78")}catch{}})();const ha=ga.div`
1
+ import{j as p}from"./liveblocks-oKBQUmhq.js";import{a as g}from"./sentry-p9ArnUH9.js";import{h as K,u as _,g as z,j as D,i as O,n as V}from"./core-rmRh_ZE8.js";import{z as Q,v as W,T as d,_ as q,K as M,c as Z,e as J,cQ as X,q as f,n as H}from"./index-BRBKIeck.js";import{eP as Y,QN as R,Gs as y,QO as x,QJ as aa,FQ as S,QP as ea,FY as I,Fi as ta,Gt as B,QQ as w,gT as sa,Gj as oa,Go as na,Gb as ia,G9 as L,Gp as la,G6 as ra,QR as ca,QS as ka,QT as ua,QU as pa,QV as T,ec as da,QW as Ta,QX as ma}from"./zeni-epic-state-DH4sFgeZ.js";import{n as ga}from"./mui-DRkb5v8u.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import{M as Ga}from"./MobileAppDrawer-CzXbfz6E.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="e959b0df-2b38-4e3a-98bc-4c405a62ef78",e._sentryDebugIdIdentifier="sentry-dbid-e959b0df-2b38-4e3a-98bc-4c405a62ef78")}catch{}})();const ha=ga.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-oKBQUmhq.js";import se from"./NotFoundScreen-Dnnx5_jI.js";import{a as c}from"./sentry-p9ArnUH9.js";import{h as O,u as Q,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-rmRh_ZE8.js";import{Fv as _,Fy as le,Fs as de,eP as Z,QJ as K,FM as H,Fp as pe,Gg as ue,G9 as ke,QK as J,QL as N,Fl as me,Fi as fe,qo as ge,qc as he,ke as Se,FG as Ie,QM as Te,FX as be,FU as Ge,FB as Ee,FR as Ce,FQ as Fe}from"./zeni-epic-state-DH4sFgeZ.js";import{z as C,cO as De,N as xe,v as ye,T as b,n as W,q as v,K as je,c as z,e as ve,cP as we,i as V,at as Re}from"./index-CYj5jhrI.js";import{n as Be}from"./mui-DRkb5v8u.js";import{u as Pe}from"./useInitialThreadRequest-Chgglzdd.js";import{M as Ue}from"./MobileAppDrawer-NgQTATqT.js";import Le from"./TaskListScreen-C_Tqt5Br.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.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]="d812c7a1-2160-4e35-a6a4-2f84f0f6075c",e._sentryDebugIdIdentifier="sentry-dbid-d812c7a1-2160-4e35-a6a4-2f84f0f6075c")}catch{}})();function $e(){const e=O(),t=Q(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(_())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(De,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,M=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=J(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=K(e),{tenantEmailDomain:F}=d,G=r.recurringSourceTaskId,D=G!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,M=Object.values(I)),M),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.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:D,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(Fe({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=w(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(_())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(we);function j(){const e=O(),t=Q(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,X]=c.useState(!1),[R,Y]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>K(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(X(!0),t(H(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(Y(!0),t(pe()))},[R,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})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return x(!1),void(T.current=!1);if(E==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=w(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>J(i,r)),y=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=w(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx(qe,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:G})]})]})}const Ne=Be.div`
1
+ import{j as n}from"./liveblocks-oKBQUmhq.js";import se from"./NotFoundScreen-B6lzVM70.js";import{a as c}from"./sentry-p9ArnUH9.js";import{h as O,u as Q,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-rmRh_ZE8.js";import{Fv as _,Fy as le,Fs as de,eP as Z,QJ as K,FM as H,Fp as pe,Gg as ue,G9 as ke,QK as J,QL as N,Fl as me,Fi as fe,qo as ge,qc as he,ke as Se,FG as Ie,QM as Te,FX as be,FU as Ge,FB as Ee,FR as Ce,FQ as Fe}from"./zeni-epic-state-DH4sFgeZ.js";import{z as C,cO as De,N as xe,v as ye,T as b,n as W,q as v,K as je,c as z,e as ve,cP as we,i as V,at as Re}from"./index-BRBKIeck.js";import{n as Be}from"./mui-DRkb5v8u.js";import{u as Pe}from"./useInitialThreadRequest-B5lLxxrW.js";import{M as Ue}from"./MobileAppDrawer-CzXbfz6E.js";import Le from"./TaskListScreen-DV56A-OD.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./useAskAiCfoHostNavButtonProps-lMf8y8xS.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]="d812c7a1-2160-4e35-a6a4-2f84f0f6075c",e._sentryDebugIdIdentifier="sentry-dbid-d812c7a1-2160-4e35-a6a4-2f84f0f6075c")}catch{}})();function $e(){const e=O(),t=Q(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(_())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(De,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,M=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=J(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=K(e),{tenantEmailDomain:F}=d,G=r.recurringSourceTaskId,D=G!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,M=Object.values(I)),M),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.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:D,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(Fe({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=w(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(_())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(we);function j(){const e=O(),t=Q(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,X]=c.useState(!1),[R,Y]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>K(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(X(!0),t(H(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(Y(!0),t(pe()))},[R,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})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return x(!1),void(T.current=!1);if(E==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=w(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>J(i,r)),y=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=w(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx(qe,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:G})]})]})}const Ne=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-oKBQUmhq.js";import i from"./NotFoundScreen-Dnnx5_jI.js";import{T as r}from"./TransactionDetailScreen-Ciduelax.js";import"./sentry-p9ArnUH9.js";import{o as a,p as o}from"./core-rmRh_ZE8.js";import"./zeni-epic-state-DH4sFgeZ.js";import"./recharts-BG7SNYPF.js";import"./index-CYj5jhrI.js";import"./mui-DRkb5v8u.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import"./decodeURIComponentSafe-C5DyNl7Z.js";import"./routePaths-CJs7QSKh.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-oKBQUmhq.js";import i from"./NotFoundScreen-B6lzVM70.js";import{T as r}from"./TransactionDetailScreen-CrAEKQhU.js";import"./sentry-p9ArnUH9.js";import{o as a,p as o}from"./core-rmRh_ZE8.js";import"./zeni-epic-state-DH4sFgeZ.js";import"./recharts-BG7SNYPF.js";import"./index-BRBKIeck.js";import"./mui-DRkb5v8u.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import"./decodeURIComponentSafe-C5DyNl7Z.js";import"./routePaths-f58A_7uy.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-oKBQUmhq.js";import{a as d}from"./sentry-p9ArnUH9.js";import{u as G,j as S,g as re,h as le,i as de,N as Ge,n as je}from"./core-rmRh_ZE8.js";import{bn as $e,eP as K,cP as ue,bt as me,pY as Y,KE as F,LF as pe,LG as Q,L2 as he,jR as fe,LH as ge,L7 as J,L8 as X,kG as Se,HE as Z,Ky as x,jL as Te,jJ as ye,jV as We,LI as He,LJ as Me,tW as z,jQ as ve,GW as Ee,cU as qe,cV as Ke,LK as Ye,Kx as Qe,LL as Je,t_ as Xe,LM as Ze,LN as ea,LO as aa,LP as ta,LQ as na,jU as oa,LR as sa,LS as ia,Kz as ca,LT as ra,LU as la,LV as da,GQ as ua,GE as ma,H6 as pa,jW as ha,HF as ie,GN as fa}from"./zeni-epic-state-DH4sFgeZ.js";import{z as De,v as ee,T as L,aN as Ce,h as ga,J as Sa,aO as Ta,x as ya,n as M,k as va,aP as Ea,q,_ as Da,c as be,aQ as Ca,at as ba,a2 as H}from"./index-CYj5jhrI.js";import{n as Ia,S as ka,D as La}from"./mui-DRkb5v8u.js";import{u as Ua}from"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import{d as Ie}from"./decodeURIComponentSafe-C5DyNl7Z.js";import{h as ke,g as Aa,e as xa,c as _a}from"./routePaths-CJs7QSKh.js";import{t as Va}from"./utils-B4k-7_rU.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]="7e542dcf-d5ec-436f-aee5-1da99020a448",a._sentryDebugIdIdentifier="sentry-dbid-7e542dcf-d5ec-436f-aee5-1da99020a448")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(L.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Le(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Qa(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>K(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(Ce.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,U=ae(),y=d.useMemo(()=>({id:a,type:Y(e)}),[a,e]),m=S(u=>F(u,y)),C=S(u=>{const N=F(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Le(m?.transaction):void 0,[m?.fetchState,m?.transaction]),v=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Q(u)),_=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[w,V]=d.useState(!1),[O,P]=d.useState(!1),[E,c]=d.useState(!1);d.useEffect(()=>{V(!1),P(!1),c(!1)},[a,e]);const W=d.useCallback(()=>{V(!1),P(!1)},[]),[D,I]=d.useState(!1),B=_?.selectedPeriod?.timePeriod;return d.useEffect(()=>{E||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),c(!0)),p!=null&&(!i||l&&g===!1)&&(w?O||v==null||(P(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:B??v}))):(s(J()),s(X()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,w,O,v,B]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(x("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:U,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:C,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:A,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:W,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Q(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(We("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return k.jsx(La,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:k.jsx(Fa,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...b})})})},Fa=Ia(ka)`
1
+ import{j as k}from"./liveblocks-oKBQUmhq.js";import{a as d}from"./sentry-p9ArnUH9.js";import{u as G,j as S,g as re,h as le,i as de,N as Ge,n as je}from"./core-rmRh_ZE8.js";import{bn as $e,eP as K,cP as ue,bt as me,pY as Y,KE as F,LF as pe,LG as Q,L2 as he,jR as fe,LH as ge,L7 as J,L8 as X,kG as Se,HE as Z,Ky as x,jL as Te,jJ as ye,jV as We,LI as He,LJ as Me,tW as z,jQ as ve,GW as Ee,cU as qe,cV as Ke,LK as Ye,Kx as Qe,LL as Je,t_ as Xe,LM as Ze,LN as ea,LO as aa,LP as ta,LQ as na,jU as oa,LR as sa,LS as ia,Kz as ca,LT as ra,LU as la,LV as da,GQ as ua,GE as ma,H6 as pa,jW as ha,HF as ie,GN as fa}from"./zeni-epic-state-DH4sFgeZ.js";import{z as De,v as ee,T as L,aN as Ce,h as ga,J as Sa,aO as Ta,x as ya,n as M,k as va,aP as Ea,q,_ as Da,c as be,aQ as Ca,at as ba,a2 as H}from"./index-BRBKIeck.js";import{n as Ia,S as ka,D as La}from"./mui-DRkb5v8u.js";import{u as Ua}from"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import{d as Ie}from"./decodeURIComponentSafe-C5DyNl7Z.js";import{h as ke,g as Aa,e as xa,c as _a}from"./routePaths-f58A_7uy.js";import{t as Va}from"./utils-B4k-7_rU.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]="7e542dcf-d5ec-436f-aee5-1da99020a448",a._sentryDebugIdIdentifier="sentry-dbid-7e542dcf-d5ec-436f-aee5-1da99020a448")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(L.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Le(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Qa(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>K(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(Ce.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,U=ae(),y=d.useMemo(()=>({id:a,type:Y(e)}),[a,e]),m=S(u=>F(u,y)),C=S(u=>{const N=F(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Le(m?.transaction):void 0,[m?.fetchState,m?.transaction]),v=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Q(u)),_=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[w,V]=d.useState(!1),[O,P]=d.useState(!1),[E,c]=d.useState(!1);d.useEffect(()=>{V(!1),P(!1),c(!1)},[a,e]);const W=d.useCallback(()=>{V(!1),P(!1)},[]),[D,I]=d.useState(!1),B=_?.selectedPeriod?.timePeriod;return d.useEffect(()=>{E||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),c(!0)),p!=null&&(!i||l&&g===!1)&&(w?O||v==null||(P(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:B??v}))):(s(J()),s(X()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,w,O,v,B]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(x("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:U,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:C,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:A,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:W,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Q(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(We("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return k.jsx(La,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:k.jsx(Fa,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...b})})})},Fa=Ia(ka)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-oKBQUmhq.js";import{h as Q,g as q,u as W,i as K,j as h,N as w,n as X,o as Pe,p as j}from"./core-rmRh_ZE8.js";import{eP as U,pD as ee,j3 as p,P0 as te,Hv as De,bq as le,P1 as Ye,jG as ae,L4 as ne,P2 as ue,P3 as ve,bE as b,Hr as ye,P4 as Ee,P5 as me,P6 as je,Hu as Ae,P7 as xe,P8 as pe,P9 as Me,Pa as ge,Pb as Le,Pc as Fe,Pd as fe,II as Ce,bn as Be}from"./zeni-epic-state-DH4sFgeZ.js";import{D as de,v as Z,T as _,c as G,cc as ce,q as H,n as oe,V as ze,z as Oe}from"./index-CYj5jhrI.js";import"./mui-DRkb5v8u.js";import{a as S}from"./sentry-p9ArnUH9.js";import{w as se}from"./withTransactionSidePanel-DYzLuoli.js";import{p as ie,c as re}from"./routePaths-CJs7QSKh.js";import{u as Ge}from"./utils-B4k-7_rU.js";import{d as Y}from"./decodeURIComponentSafe-C5DyNl7Z.js";import{Z as we}from"./ZeniAccountStatementScreen-DkPXPFSa.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import"./TransactionDetailScreen-Ciduelax.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]="254ba9bf-d68f-4b68-a811-161abdecb6fb",a._sentryDebugIdIdentifier="sentry-dbid-254ba9bf-d68f-4b68-a811-161abdecb6fb")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Ge(a),Re=X(function(a,e){const t=Ye(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),u=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:u},type:J(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),N=se(function({...a}){const e=Q(),t=q(),n=W(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=K(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=Z(),{isFeatureEnabled:k}=g(_.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:F,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[C,E]=S.useState(!1),[B,z]=S.useState(void 0),T=S.useMemo(()=>{const r=p(v);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,F]);S.useEffect(()=>{if(!C&&T!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,T.title);const r=J(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[C,T,n]);let M=T;return T!=null&&B!=null&&(M={...T,period:B}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(Re,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:F,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>z(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=X(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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),He=se(function({referrerType:a,...e}){const t=Q(),n=q(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=K(),f=Y(l??""),g=Y(u??""),k=Y(m??""),x=Y(I??""),F=h(d=>ve(d.transactionListState,g,f,k)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(d=>U(d)),T=z.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=qe(f,g,k,D,y,A,x);if(O){const d={startDate:b(y,"YYYY-MM-DD"),endDate:b(A,"YYYY-MM-DD")},$=Ue(F?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(C(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Je,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(w,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&b(c,"YYYY-MM-DD").isValid()&&b(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Ze=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=q(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=K(),f=Y(l??""),g=Y(u??""),k=Y(m??""),x=Y(I??""),F=h(d=>je(d.transactionListState,g,f,k)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(d=>U(d)),T=z.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=We(f,g,k,D,y,A,x);if(O){const d={startDate:b(y,"YYYY-MM-DD"),endDate:b(A,"YYYY-MM-DD")},$=Ke(F?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(C(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ze,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(w,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&b(c,"YYYY-MM-DD").isValid()&&b(o,"YYYY-MM-DD").isValid()&&l!=null,Ke=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Fe(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=q(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=K(),f=Y(l??""),g=Y(u??""),k=Y(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(P=>Me(P.transactionListState,g,f)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(P=>U(P)),T=z.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=z.company?.companyInfo.firstMonthOfFY??1;let r;const R=et(f,g,m,D,y,k);if(R){const P={startDate:b(D,"YYYY-MM-DD"),endDate:b(y,"YYYY-MM-DD")},be=tt(F?.dateRange,P);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:be}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=Z(),{isFeatureEnabled:L}=O(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(_.isProjectsTransactionsEnabled),d=h(P=>ee(P))&&V,{areTenantIdsInSync:$}=ze();S.useEffect(()=>{!v&&r!=null&&$&&(C(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(P=>P!=null);return R&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:P=>B(P),...e}):s.jsx(w,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&b(n,"YYYY-MM-DD").isValid()&&b(c,"YYYY-MM-DD").isValid()&&o!=null,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Ce}/statements`;function bt(){const a=q().state?.referrer,e=Oe.getSignedInUser(),t=Be(e),{useFeatureGate:n}=Z(),{isFeatureEnabled:c}=n(_.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>U(m)).tenantId],{isFeatureEnabled:l}=n(_.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(Pe,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{bt as default};
1
+ import{j as s}from"./liveblocks-oKBQUmhq.js";import{h as Q,g as q,u as W,i as K,j as h,N as w,n as X,o as Pe,p as j}from"./core-rmRh_ZE8.js";import{eP as U,pD as ee,j3 as p,P0 as te,Hv as De,bq as le,P1 as Ye,jG as ae,L4 as ne,P2 as ue,P3 as ve,bE as b,Hr as ye,P4 as Ee,P5 as me,P6 as je,Hu as Ae,P7 as xe,P8 as pe,P9 as Me,Pa as ge,Pb as Le,Pc as Fe,Pd as fe,II as Ce,bn as Be}from"./zeni-epic-state-DH4sFgeZ.js";import{D as de,v as Z,T as _,c as G,cc as ce,q as H,n as oe,V as ze,z as Oe}from"./index-BRBKIeck.js";import"./mui-DRkb5v8u.js";import{a as S}from"./sentry-p9ArnUH9.js";import{w as se}from"./withTransactionSidePanel-Dqu6-_83.js";import{p as ie,c as re}from"./routePaths-f58A_7uy.js";import{u as Ge}from"./utils-B4k-7_rU.js";import{d as Y}from"./decodeURIComponentSafe-C5DyNl7Z.js";import{Z as we}from"./ZeniAccountStatementScreen-seV3Vtmq.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import"./TransactionDetailScreen-CrAEKQhU.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]="254ba9bf-d68f-4b68-a811-161abdecb6fb",a._sentryDebugIdIdentifier="sentry-dbid-254ba9bf-d68f-4b68-a811-161abdecb6fb")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Ge(a),Re=X(function(a,e){const t=Ye(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),u=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:u},type:J(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),N=se(function({...a}){const e=Q(),t=q(),n=W(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=K(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=Z(),{isFeatureEnabled:k}=g(_.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:F,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[C,E]=S.useState(!1),[B,z]=S.useState(void 0),T=S.useMemo(()=>{const r=p(v);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,F]);S.useEffect(()=>{if(!C&&T!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,T.title);const r=J(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[C,T,n]);let M=T;return T!=null&&B!=null&&(M={...T,period:B}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(Re,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:F,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>z(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=X(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:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(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),He=se(function({referrerType:a,...e}){const t=Q(),n=q(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=K(),f=Y(l??""),g=Y(u??""),k=Y(m??""),x=Y(I??""),F=h(d=>ve(d.transactionListState,g,f,k)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(d=>U(d)),T=z.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=qe(f,g,k,D,y,A,x);if(O){const d={startDate:b(y,"YYYY-MM-DD"),endDate:b(A,"YYYY-MM-DD")},$=Ue(F?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(C(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Je,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(w,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&b(c,"YYYY-MM-DD").isValid()&&b(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Ze=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=q(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=K(),f=Y(l??""),g=Y(u??""),k=Y(m??""),x=Y(I??""),F=h(d=>je(d.transactionListState,g,f,k)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(d=>U(d)),T=z.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=We(f,g,k,D,y,A,x);if(O){const d={startDate:b(y,"YYYY-MM-DD"),endDate:b(A,"YYYY-MM-DD")},$=Ke(F?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(C(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ze,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(w,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&b(c,"YYYY-MM-DD").isValid()&&b(o,"YYYY-MM-DD").isValid()&&l!=null,Ke=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Fe(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=q(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=K(),f=Y(l??""),g=Y(u??""),k=Y(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(P=>Me(P.transactionListState,g,f)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(P=>U(P)),T=z.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=z.company?.companyInfo.firstMonthOfFY??1;let r;const R=et(f,g,m,D,y,k);if(R){const P={startDate:b(D,"YYYY-MM-DD"),endDate:b(y,"YYYY-MM-DD")},be=tt(F?.dateRange,P);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:be}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=Z(),{isFeatureEnabled:L}=O(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(_.isProjectsTransactionsEnabled),d=h(P=>ee(P))&&V,{areTenantIdsInSync:$}=ze();S.useEffect(()=>{!v&&r!=null&&$&&(C(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(P=>P!=null);return R&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:P=>B(P),...e}):s.jsx(w,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&b(n,"YYYY-MM-DD").isValid()&&b(c,"YYYY-MM-DD").isValid()&&o!=null,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Ce}/statements`;function bt(){const a=q().state?.referrer,e=Oe.getSignedInUser(),t=Be(e),{useFeatureGate:n}=Z(),{isFeatureEnabled:c}=n(_.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>U(m)).tenantId],{isFeatureEnabled:l}=n(_.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(Pe,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{bt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-oKBQUmhq.js";import{h as L,g as P,u as B,i as N,j as f,N as U,n as M,o as Te,p as k}from"./core-rmRh_ZE8.js";import{cm as V,eP as D,NO as R,DU as ae,fh as q,DC as ne,NQ as we,DX as Ce,NM as Ie,NN as se,O3 as ke,C2 as je,sR as be,NS as Ae,E6 as Ee,NP as re,cO as H,wZ as oe,eY as ve,e_ as De,OZ as Fe,O_ as Ue,DD as Le,O$ as Pe,DE as Be,DN as Re,bt as Oe,bF as Ne,cx as Me,bG as Ve,cl as _e,fg as ze,bs as $e,Js as Ge,ck as Ze}from"./zeni-epic-state-DH4sFgeZ.js";import{k as _,aq as qe,z as A,K as z,c as j,c5 as He,c6 as Je,c7 as Z,J,h as We,V as Ke,_ as Qe,v as ie,T as v,x as Xe,s as Ye,c8 as et,at as W,q as tt,c9 as at,n as K,ca as nt,R as X,cb as st,a9 as rt}from"./index-CYj5jhrI.js";import{D as ot,n as O,S as it}from"./mui-DRkb5v8u.js";import ct from"./NotFoundScreen-Dnnx5_jI.js";import{S as Y}from"./SetupPagesScreen-ALhX_tKy.js";import{a as d}from"./sentry-p9ArnUH9.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import{u as ut}from"./useInitialThreadRequest-Chgglzdd.js";import{M as ce}from"./MobileAppDrawer-NgQTATqT.js";import{F as dt}from"./FeaturePreviewScreen-CzGmkIs5.js";import{a as ee}from"./analyticsHelper-uVQynfBH.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./routePaths-CJs7QSKh.js";import"./BusinessVerificationPageScreen-CgVN0Nsi.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]="866e27d4-e237-47db-be3a-88a6ae437518",t._sentryDebugIdIdentifier="sentry-dbid-866e27d4-e237-47db-be3a-88a6ae437518")}catch{}})();const pt=M(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ce(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(He);function mt(){const t=L(),a=P(),n=B(),{tenantEmailDomain:o}=N(),p=_(),r=f(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=qe(r),s=V(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,C]=d.useState(!1),[u,c]=d.useState(!1),h=f(I=>D(I)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=f(I=>R(I,y)),w=f(I=>I.treasurySetupViewState.fetchState),x=f(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,w,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(q()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(C(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(U,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=M(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),yt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=N(),o=B(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,C]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),T=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ie(x)),w=f(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||T==null||(s(!0),o(ae(T,!0,!1)))},[m,u,T,o]),d.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(q()))},[l,c,T,o]),d.useEffect(()=>{g||h!=="Not-Started"||T==null||(C(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:w,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=O.div`
1
+ import{j as e}from"./liveblocks-oKBQUmhq.js";import{h as L,g as P,u as B,i as N,j as f,N as U,n as M,o as Te,p as k}from"./core-rmRh_ZE8.js";import{cm as V,eP as D,NO as R,DU as ae,fh as q,DC as ne,NQ as we,DX as Ce,NM as Ie,NN as se,O3 as ke,C2 as je,sR as be,NS as Ae,E6 as Ee,NP as re,cO as H,wZ as oe,eY as ve,e_ as De,OZ as Fe,O_ as Ue,DD as Le,O$ as Pe,DE as Be,DN as Re,bt as Oe,bF as Ne,cx as Me,bG as Ve,cl as _e,fg as ze,bs as $e,Js as Ge,ck as Ze}from"./zeni-epic-state-DH4sFgeZ.js";import{k as _,aq as qe,z as A,K as z,c as j,c5 as He,c6 as Je,c7 as Z,J,h as We,V as Ke,_ as Qe,v as ie,T as v,x as Xe,s as Ye,c8 as et,at as W,q as tt,c9 as at,n as K,ca as nt,R as X,cb as st,a9 as rt}from"./index-BRBKIeck.js";import{D as ot,n as O,S as it}from"./mui-DRkb5v8u.js";import ct from"./NotFoundScreen-B6lzVM70.js";import{S as Y}from"./SetupPagesScreen-BLeSibic.js";import{a as d}from"./sentry-p9ArnUH9.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import{u as ut}from"./useInitialThreadRequest-B5lLxxrW.js";import{M as ce}from"./MobileAppDrawer-CzXbfz6E.js";import{F as dt}from"./FeaturePreviewScreen-B1hf1dDh.js";import{a as ee}from"./analyticsHelper-DLVGE934.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./routePaths-f58A_7uy.js";import"./BusinessVerificationPageScreen-COS298yT.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]="866e27d4-e237-47db-be3a-88a6ae437518",t._sentryDebugIdIdentifier="sentry-dbid-866e27d4-e237-47db-be3a-88a6ae437518")}catch{}})();const pt=M(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ce(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(He);function mt(){const t=L(),a=P(),n=B(),{tenantEmailDomain:o}=N(),p=_(),r=f(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=qe(r),s=V(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,C]=d.useState(!1),[u,c]=d.useState(!1),h=f(I=>D(I)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=f(I=>R(I,y)),w=f(I=>I.treasurySetupViewState.fetchState),x=f(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,w,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(q()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(C(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(U,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=M(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),yt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=N(),o=B(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,C]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),T=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ie(x)),w=f(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||T==null||(s(!0),o(ae(T,!0,!1)))},[m,u,T,o]),d.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(q()))},[l,c,T,o]),d.useEffect(()=>{g||h!=="Not-Started"||T==null||(C(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:w,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=O.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-oKBQUmhq.js";import{a as g}from"./sentry-p9ArnUH9.js";import{h as J,g as Y,i as U,j as S,n as G,u as z,o as at,p as B,N as $}from"./core-rmRh_ZE8.js";import{eP as V,Ku as Ee,Kv as Re,fT as X,cs as be,ct as Ie,vy as St,Kw as nt,vC as zt,Iz as ee,jG as te,vw as Yt,vq as qt,Kx as Ne,vi as Ht,vh as Wt,vb as Qt,vn as Zt,vD as Xt,Ky as he,Kz as Me,vj as ea,KA as pe,f3 as ft,vS as gt,vL as vt,KB as xt,os as Tt,vG as yt,vE as Dt,KC as Ct,vZ as Et,vW as bt,vH as It,vY as Je,GW as kt,KD as ta,KE as aa,cv as na,KF as sa,KG as oa,KH as me,KI as ie,KJ as ke,IA as Ge,wc as ye,Iy as De,v$ as wt,vz as $e,KK as la,IB as H,KL as Ke,vt as ia,KM as ca,KN as da,KO as ze,KP as Ye,KQ as qe,KR as He,w6 as we,KS as At,vP as jt,KT as ra,KU as ua,KV as ha,KW as pa,KX as ma,KY as Sa,KZ as fa,K_ as ga,t1 as va,t2 as xa,HF as je,K$ as Ta,L0 as ya,j3 as Le,bq as Da,L1 as Ca,L2 as Ea,kE as ba,kN as Ia,HE as Fe,bE as st,L3 as Lt,Hf as Ft,L4 as ka,L5 as wa,L6 as Aa,kP as ja,L7 as ot,L8 as lt,L9 as it,La as ct,Lb as La,kL as Fa,Lc as Pa,kO as _a,Ld as Va,Le as Pt,H$ as _t,k2 as Ba,Lf as Oa,Lg as Pe,Lh as Vt,HZ as Bt,yp as Ua,Li as Ra,Lj as Na,km as Ot,Lk as Ma,Ll as Ja,Ib as Ga,qJ as $a,Lm as Ut,Ln as dt,I8 as _e,Lo as rt,Lp as Ka,Id as za,Lq as Ya,Lr as qa,Ls as Ha,Lt as Wa,Lu as Qa,qM as Za,Lv as Xa,IC as en,Lw as tn,HS as Ve,gP as an,Lx as nn,Ly as sn,gN as on,Lz as ln,LA as cn,yt as dn,LB as rn,LC as un,LD as hn,LE as pn,k6 as mn,bn as Sn,e_ as fn,eY as gn}from"./zeni-epic-state-DH4sFgeZ.js";import{z as R,aq as Be,s as Rt,K as Q,c as j,a2 as Z,aw as vn,q as M,D as Ce,N as ce,ax as We,ay as xn,az as Tn,n as Qe,aA as yn,h as Dn,J as de,x as Ze,v as ae,T as K,aB as Cn,i as Xe,_ as Se,aC as En,aD as Nt,V as bn,aE as In,k as kn,aF as wn,at as Mt,aG as An,o as W,S as jn,y as Jt,A as Ln,aH as Fn,aI as Pn,e as et,aJ as _n,aK as Vn,m as Bn,aL as On,aM as Un}from"./index-CYj5jhrI.js";import{n as N,D as Rn,S as Gt}from"./mui-DRkb5v8u.js";import{t as Nn,A as Mn}from"./AddressScreen-CAEk8mk_.js";import le from"./NotFoundScreen-Dnnx5_jI.js";import{F as Jn}from"./FeaturePreviewScreen-CzGmkIs5.js";import{c as q,v as tt,d as Gn}from"./routePaths-CJs7QSKh.js";import{p as $t}from"./pathToGoBack-BjLk76KL.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import{M as ge}from"./MobileAppDrawer-NgQTATqT.js";import{D as $n}from"./DrawerScreen-C8Y4hZ9A.js";import{g as Kn,m as zn}from"./accountMappingHelper-DjOpJLte.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="e8bb3d66-4b90-4735-808e-ef72234a8b0b",e._sentryDebugIdIdentifier="sentry-dbid-e8bb3d66-4b90-4735-808e-ef72234a8b0b")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Re(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=U(),{scheduleType:o}=U();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Re(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Kt=e=>{const a=Yn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...Kt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=N.div`
1
+ import{j as l}from"./liveblocks-oKBQUmhq.js";import{a as g}from"./sentry-p9ArnUH9.js";import{h as J,g as Y,i as U,j as S,n as G,u as z,o as at,p as B,N as $}from"./core-rmRh_ZE8.js";import{eP as V,Ku as Ee,Kv as Re,fT as X,cs as be,ct as Ie,vy as St,Kw as nt,vC as zt,Iz as ee,jG as te,vw as Yt,vq as qt,Kx as Ne,vi as Ht,vh as Wt,vb as Qt,vn as Zt,vD as Xt,Ky as he,Kz as Me,vj as ea,KA as pe,f3 as ft,vS as gt,vL as vt,KB as xt,os as Tt,vG as yt,vE as Dt,KC as Ct,vZ as Et,vW as bt,vH as It,vY as Je,GW as kt,KD as ta,KE as aa,cv as na,KF as sa,KG as oa,KH as me,KI as ie,KJ as ke,IA as Ge,wc as ye,Iy as De,v$ as wt,vz as $e,KK as la,IB as H,KL as Ke,vt as ia,KM as ca,KN as da,KO as ze,KP as Ye,KQ as qe,KR as He,w6 as we,KS as At,vP as jt,KT as ra,KU as ua,KV as ha,KW as pa,KX as ma,KY as Sa,KZ as fa,K_ as ga,t1 as va,t2 as xa,HF as je,K$ as Ta,L0 as ya,j3 as Le,bq as Da,L1 as Ca,L2 as Ea,kE as ba,kN as Ia,HE as Fe,bE as st,L3 as Lt,Hf as Ft,L4 as ka,L5 as wa,L6 as Aa,kP as ja,L7 as ot,L8 as lt,L9 as it,La as ct,Lb as La,kL as Fa,Lc as Pa,kO as _a,Ld as Va,Le as Pt,H$ as _t,k2 as Ba,Lf as Oa,Lg as Pe,Lh as Vt,HZ as Bt,yp as Ua,Li as Ra,Lj as Na,km as Ot,Lk as Ma,Ll as Ja,Ib as Ga,qJ as $a,Lm as Ut,Ln as dt,I8 as _e,Lo as rt,Lp as Ka,Id as za,Lq as Ya,Lr as qa,Ls as Ha,Lt as Wa,Lu as Qa,qM as Za,Lv as Xa,IC as en,Lw as tn,HS as Ve,gP as an,Lx as nn,Ly as sn,gN as on,Lz as ln,LA as cn,yt as dn,LB as rn,LC as un,LD as hn,LE as pn,k6 as mn,bn as Sn,e_ as fn,eY as gn}from"./zeni-epic-state-DH4sFgeZ.js";import{z as R,aq as Be,s as Rt,K as Q,c as j,a2 as Z,aw as vn,q as M,D as Ce,N as ce,ax as We,ay as xn,az as Tn,n as Qe,aA as yn,h as Dn,J as de,x as Ze,v as ae,T as K,aB as Cn,i as Xe,_ as Se,aC as En,aD as Nt,V as bn,aE as In,k as kn,aF as wn,at as Mt,aG as An,o as W,S as jn,y as Jt,A as Ln,aH as Fn,aI as Pn,e as et,aJ as _n,aK as Vn,m as Bn,aL as On,aM as Un}from"./index-BRBKIeck.js";import{n as N,D as Rn,S as Gt}from"./mui-DRkb5v8u.js";import{t as Nn,A as Mn}from"./AddressScreen-CLP4FP-O.js";import le from"./NotFoundScreen-B6lzVM70.js";import{F as Jn}from"./FeaturePreviewScreen-B1hf1dDh.js";import{c as q,v as tt,d as Gn}from"./routePaths-f58A_7uy.js";import{p as $t}from"./pathToGoBack-BjLk76KL.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import{M as ge}from"./MobileAppDrawer-CzXbfz6E.js";import{D as $n}from"./DrawerScreen-B0s6XB_a.js";import{g as Kn,m as zn}from"./accountMappingHelper-DjOpJLte.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="e8bb3d66-4b90-4735-808e-ef72234a8b0b",e._sentryDebugIdIdentifier="sentry-dbid-e8bb3d66-4b90-4735-808e-ef72234a8b0b")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Re(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=U(),{scheduleType:o}=U();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Re(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Kt=e=>{const a=Yn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...Kt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-oKBQUmhq.js";import{a as f}from"./sentry-p9ArnUH9.js";import{s as u,u as h,j as y,N as b}from"./core-rmRh_ZE8.js";import{JL as I,eW as w,zK as j}from"./zeni-epic-state-DH4sFgeZ.js";import{z as c,s as x,y as S,A as D}from"./index-CYj5jhrI.js";import{n as l}from"./mui-DRkb5v8u.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="b49238f9-b2cc-45a3-809d-29c772d575dc",e._sentryDebugIdIdentifier="sentry-dbid-b49238f9-b2cc-45a3-809d-29c772d575dc")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,g]=f.useState(!1),a=h(),i=y(m=>I(m)),r=c.getSignedInUser(),d=c.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(g(!0),a(j(t,p,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=l.div`
1
+ import{j as o}from"./liveblocks-oKBQUmhq.js";import{a as f}from"./sentry-p9ArnUH9.js";import{s as u,u as h,j as y,N as b}from"./core-rmRh_ZE8.js";import{JL as I,eW as w,zK as j}from"./zeni-epic-state-DH4sFgeZ.js";import{z as c,s as x,y as S,A as D}from"./index-BRBKIeck.js";import{n as l}from"./mui-DRkb5v8u.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.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]="b49238f9-b2cc-45a3-809d-29c772d575dc",e._sentryDebugIdIdentifier="sentry-dbid-b49238f9-b2cc-45a3-809d-29c772d575dc")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,g]=f.useState(!1),a=h(),i=y(m=>I(m)),r=c.getSignedInUser(),d=c.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(g(!0),a(j(t,p,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=l.div`
2
2
  display: flex;
3
3
  width: 100%;
4
4
  height: 100vh;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-oKBQUmhq.js";import{h as ne,g as W,u as M,i as K,j as k,n as Y,N as Q,o as Ve,p as w}from"./core-rmRh_ZE8.js";import{eP as U,OF as Ce,OG as $e,cl as ee,cm as Ne,fg as He,wX as we,B8 as Ze,wR as Tn,OH as On,OI as Bn,wU as Fn,w$ as fe,wO as Rn,wL as Ln,Nr as le,OJ as Un,Es as _n,Kx as zn,Eu as Mn,kn as Oe,OK as Vn,qo as Ge,qc as We,ke as Ke,kh as Be,Ky as Fe,Kz as $n,OL as Nn,kg as Hn,kD as Zn,k5 as Gn,iE as Wn,iD as Kn,OM as Yn,ON as ye,E9 as qn,OO as Jn,OP as Xn,Nk as ke,OQ as Re,OR as Qn,EF as ea,O3 as na,C2 as Ye,sR as qe,OS as aa,EC as ta,OT as Je,cM as Ae,EJ as Xe,fh as oa,eY as Qe,e_ as De,EH as sa,BY as ra,Ez as ia,OU as en,OV as nn,Eb as an,El as Le,OW as ca,NT as la,EK as da,bt as ua,bF as pa,cx as ma,bG as ha,bs as ga,Js as fa}from"./zeni-epic-state-DH4sFgeZ.js";import{k as ae,v as N,z as S,T as F,h as _,s as de,bW as ya,a2 as Ie,J as V,x as q,n as tn,aq as xa,af as Ue,c as R,bX as Ca,at as Se,bY as wa,K as ue,bZ as ka,e as be,aN as G,b_ as Aa,V as Da,_ as on,ac as Ia,b$ as _e,c0 as Sa,q as ce,c1 as ba,c2 as Ea,c3 as va,a9 as Pa,o as ja}from"./index-CYj5jhrI.js";import{n as z,D as J,S as X}from"./mui-DRkb5v8u.js";import ie from"./NotFoundScreen-Dnnx5_jI.js";import{S as ze}from"./SetupPagesScreen-ALhX_tKy.js";import{F as sn}from"./FeaturePreviewScreen-CzGmkIs5.js";import{a as d}from"./sentry-p9ArnUH9.js";import{M as pe}from"./MobileAppDrawer-NgQTATqT.js";import{A as Ta,D as Oa,V as Ba}from"./DomesticWireDetailScreen-BwV8uHFK.js";import{A as Fa}from"./AddressScreen-CAEk8mk_.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-CyyAGXJ-.js";import{Z as Ra}from"./ZeniAccountStatementScreen-DkPXPFSa.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./analyticsHelper-uVQynfBH.js";import"./routePaths-CJs7QSKh.js";import"./BusinessVerificationPageScreen-CgVN0Nsi.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]="82a1a0a7-5ad1-42a8-bdef-83673347414d",e._sentryDebugIdIdentifier="sentry-dbid-82a1a0a7-5ad1-42a8-bdef-83673347414d")}catch{}})();const La=z.div`
1
+ import{j as n}from"./liveblocks-oKBQUmhq.js";import{h as ne,g as W,u as M,i as K,j as k,n as Y,N as Q,o as Ve,p as w}from"./core-rmRh_ZE8.js";import{eP as U,OF as Ce,OG as $e,cl as ee,cm as Ne,fg as He,wX as we,B8 as Ze,wR as Tn,OH as On,OI as Bn,wU as Fn,w$ as fe,wO as Rn,wL as Ln,Nr as le,OJ as Un,Es as _n,Kx as zn,Eu as Mn,kn as Oe,OK as Vn,qo as Ge,qc as We,ke as Ke,kh as Be,Ky as Fe,Kz as $n,OL as Nn,kg as Hn,kD as Zn,k5 as Gn,iE as Wn,iD as Kn,OM as Yn,ON as ye,E9 as qn,OO as Jn,OP as Xn,Nk as ke,OQ as Re,OR as Qn,EF as ea,O3 as na,C2 as Ye,sR as qe,OS as aa,EC as ta,OT as Je,cM as Ae,EJ as Xe,fh as oa,eY as Qe,e_ as De,EH as sa,BY as ra,Ez as ia,OU as en,OV as nn,Eb as an,El as Le,OW as ca,NT as la,EK as da,bt as ua,bF as pa,cx as ma,bG as ha,bs as ga,Js as fa}from"./zeni-epic-state-DH4sFgeZ.js";import{k as ae,v as N,z as S,T as F,h as _,s as de,bW as ya,a2 as Ie,J as V,x as q,n as tn,aq as xa,af as Ue,c as R,bX as Ca,at as Se,bY as wa,K as ue,bZ as ka,e as be,aN as G,b_ as Aa,V as Da,_ as on,ac as Ia,b$ as _e,c0 as Sa,q as ce,c1 as ba,c2 as Ea,c3 as va,a9 as Pa,o as ja}from"./index-BRBKIeck.js";import{n as z,D as J,S as X}from"./mui-DRkb5v8u.js";import ie from"./NotFoundScreen-B6lzVM70.js";import{S as ze}from"./SetupPagesScreen-BLeSibic.js";import{F as sn}from"./FeaturePreviewScreen-B1hf1dDh.js";import{a as d}from"./sentry-p9ArnUH9.js";import{M as pe}from"./MobileAppDrawer-CzXbfz6E.js";import{A as Ta,D as Oa,V as Ba}from"./DomesticWireDetailScreen-Dt8QkNl1.js";import{A as Fa}from"./AddressScreen-CLP4FP-O.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-lMf8y8xS.js";import{Z as Ra}from"./ZeniAccountStatementScreen-seV3Vtmq.js";import"./recharts-BG7SNYPF.js";import"./analytics-CnRKHa3G.js";import"./plaid-DkZRc6lf.js";import"./dnd-DhJJZ165.js";import"./stripe-DMRn4zHo.js";import"./lottie-BEwdV52_.js";import"./lexical-Bbb_9RJE.js";import"./pdf-DTUmIE_Y.js";import"./utils-B4k-7_rU.js";import"./analyticsHelper-DLVGE934.js";import"./routePaths-f58A_7uy.js";import"./BusinessVerificationPageScreen-COS298yT.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]="82a1a0a7-5ad1-42a8-bdef-83673347414d",e._sentryDebugIdIdentifier="sentry-dbid-82a1a0a7-5ad1-42a8-bdef-83673347414d")}catch{}})();const La=z.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-oKBQUmhq.js";import{a as f}from"./sentry-p9ArnUH9.js";import{h as x,u as j,g as $,i as v,j as p}from"./core-rmRh_ZE8.js";import{II as s,IH as B,OX as C,eP as P,OY as T}from"./zeni-epic-state-DH4sFgeZ.js";import{J as z,at as g,h as D,z as E,s as L,c4 as N,n as U}from"./index-CYj5jhrI.js";import{n as _}from"./mui-DRkb5v8u.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]="193b6ee5-df97-4c4a-89cc-6b685ac7a06c",e._sentryDebugIdIdentifier="sentry-dbid-193b6ee5-df97-4c4a-89cc-6b685ac7a06c")}catch{}})();const G=_.div`
1
+ import{j as i}from"./liveblocks-oKBQUmhq.js";import{a as f}from"./sentry-p9ArnUH9.js";import{h as x,u as j,g as $,i as v,j as p}from"./core-rmRh_ZE8.js";import{II as s,IH as B,OX as C,eP as P,OY as T}from"./zeni-epic-state-DH4sFgeZ.js";import{J as z,at as g,h as D,z as E,s as L,c4 as N,n as U}from"./index-BRBKIeck.js";import{n as _}from"./mui-DRkb5v8u.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]="193b6ee5-df97-4c4a-89cc-6b685ac7a06c",e._sentryDebugIdIdentifier="sentry-dbid-193b6ee5-df97-4c4a-89cc-6b685ac7a06c")}catch{}})();const G=_.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{cH as m,cI as l,JD as _,JE as d}from"./zeni-epic-state-DH4sFgeZ.js";import{c as u}from"./index-CYj5jhrI.js";import"./sentry-p9ArnUH9.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]="1429d6e3-4d05-41b9-80af-8843db66835c",e._sentryDebugIdIdentifier="sentry-dbid-1429d6e3-4d05-41b9-80af-8843db66835c")}catch{}})();const b=e=>{switch(e){case"this_month_to_date":case"this_week_to_date":case"this_year_to_date":case"last_year":case"last_week":case"last_month":case"last_6_months":case"last_3_months":case"last_12_months":case"free_range":return e;case"month":default:return"months";case"quarter":return"quarters";case"year":return"years"}},h=(e,a,o,i,s)=>{const r=[],c=[];let t=[];s?.forEach(n=>{r.push(n.companyId),c.push(n.companyName),t=t.concat(n.userRole)}),u.identify(e.userId,{tenant_id:a.tenantId,tenant_email_domain:a.tenantEmailDomain,company_id:a.companyId,company_name:a.companyName,user_role:a.userRole,chargebee_customer_id:i,$email:e.userEmail,user_email_domain:e.userEmailDomain,$first_name:e.firstName,$last_name:e.lastName,company_ids:s!=null?r:void 0,company_names:s!=null?c:void 0,user_roles:s!=null?t:void 0,app_type:"web",appearance:o})},g=(e,a)=>m(e,a)?"bill_pay":l(e,a)?"reimbursement":_(e,a)?"zeni_accounts":d(e,a)?"charge_cards":"bill_pay",I=e=>Object.values(e.allocation).map(String).join("-");export{I as a,h as f,g,b as t};
1
+ import{cH as m,cI as l,JD as _,JE as d}from"./zeni-epic-state-DH4sFgeZ.js";import{c as u}from"./index-BRBKIeck.js";import"./sentry-p9ArnUH9.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]="1429d6e3-4d05-41b9-80af-8843db66835c",e._sentryDebugIdIdentifier="sentry-dbid-1429d6e3-4d05-41b9-80af-8843db66835c")}catch{}})();const b=e=>{switch(e){case"this_month_to_date":case"this_week_to_date":case"this_year_to_date":case"last_year":case"last_week":case"last_month":case"last_6_months":case"last_3_months":case"last_12_months":case"free_range":return e;case"month":default:return"months";case"quarter":return"quarters";case"year":return"years"}},h=(e,a,o,i,s)=>{const r=[],c=[];let t=[];s?.forEach(n=>{r.push(n.companyId),c.push(n.companyName),t=t.concat(n.userRole)}),u.identify(e.userId,{tenant_id:a.tenantId,tenant_email_domain:a.tenantEmailDomain,company_id:a.companyId,company_name:a.companyName,user_role:a.userRole,chargebee_customer_id:i,$email:e.userEmail,user_email_domain:e.userEmailDomain,$first_name:e.firstName,$last_name:e.lastName,company_ids:s!=null?r:void 0,company_names:s!=null?c:void 0,user_roles:s!=null?t:void 0,app_type:"web",appearance:o})},g=(e,a)=>m(e,a)?"bill_pay":l(e,a)?"reimbursement":_(e,a)?"zeni_accounts":d(e,a)?"charge_cards":"bill_pay",I=e=>Object.values(e.allocation).map(String).join("-");export{I as a,h as f,g,b as t};
@@ -1 +1 @@
1
- import{j as n}from"./index-CYj5jhrI.js";import"./mui-DRkb5v8u.js";import"./sentry-p9ArnUH9.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]="b6b8e9af-f8bc-404b-b199-bcf35ce4c4cd",e._sentryDebugIdIdentifier="sentry-dbid-b6b8e9af-f8bc-404b-b199-bcf35ce4c4cd")}catch{}})();function r(e){if(e.companyLocaleInfo!=null&&e.companyLocaleInfo.languageCode.length>0&&e.companyLocaleInfo.companyIncCountryCode.length>0){const o=`${e.companyLocaleInfo.languageCode.toLowerCase()}-${e.companyLocaleInfo.companyIncCountryCode.toUpperCase()}`;return console.warn(`localeID ${o}`),n(o)??"en"}return"en"}export{r as t};
1
+ import{j as n}from"./index-BRBKIeck.js";import"./mui-DRkb5v8u.js";import"./sentry-p9ArnUH9.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]="b6b8e9af-f8bc-404b-b199-bcf35ce4c4cd",e._sentryDebugIdIdentifier="sentry-dbid-b6b8e9af-f8bc-404b-b199-bcf35ce4c4cd")}catch{}})();function r(e){if(e.companyLocaleInfo!=null&&e.companyLocaleInfo.languageCode.length>0&&e.companyLocaleInfo.companyIncCountryCode.length>0){const o=`${e.companyLocaleInfo.languageCode.toLowerCase()}-${e.companyLocaleInfo.companyIncCountryCode.toUpperCase()}`;return console.warn(`localeID ${o}`),n(o)??"en"}return"en"}export{r as t};