@zeniai/web-app-ui 5.1.25-dev → 5.1.25-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-BB0ro6wv.js → AddressRoutes-BO7_ztL-.js} +1 -1
  2. package/dist/assets/{AddressScreen-t45pXVvS.js → AddressScreen-qDs8FTIM.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-7mHfCmdb.js → AiCfoScreen-BdfrkE-x.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DbZZgApj.js → BillPayApprovalRoutes-CHbvFE3b.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DGHURUBB.js → BillPayRoutes-DtWSNOxA.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DRR9km69.js → BusinessVerificationPageScreen-DmTGb48M.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-DSSh6FmN.js → ChargeCardRoutes-Bsiqi1N3.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-03cd6rew.js → CompanyPassportScreen-CBnJsrN4.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CUXkV4cL.js → ConnectionAuthScreen-oV9xidgd.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-DxioIAXi.js → CustomerOnboardingAuthScreen-CT6vX9lK.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-CJBZR08A.js → CustomerOnboardingRoutes-SknKGVun.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-BWWut7Lp.js → DashboardRoutes-e8rwyA4g.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-D0x0VK8i.js → DefaultTenantHome-CKZbeU4z.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-By9DmOyv.js → DomesticWireDetailScreen-DBmeU2Lc.js} +1 -1
  15. package/dist/assets/{DrawerScreen-DHM1klM-.js → DrawerScreen-BWhuJpJg.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-CETjyGK7.js → EntityDetailRoutes-CTTfstSP.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BMCXnpCB.js → ExpenseAutomationRoutes-CspHbytv.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-4ttP8nOi.js → FeaturePreviewScreen-cfOOP0Wo.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-CNkM-iq3.js → HubSpotOAuthCallbackScreen-DjPOIxHN.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-BKlgQ_Ie.js → MagicLinkRoutes-CsBDI8QQ.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-CQoHv1Ew.js → MagicLinkSignInScreen-m9ssOXwv.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-Biso_61t.js → MobileAppDrawer-BmawIQiO.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-C0-Skng9.js → NotFoundScreen-CgebWRjN.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-D9fJ9SYM.js → NotificationRoutes-Cl7PLaOs.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-C9NM67kC.js → OAuthConsentScreen-qriEiLoe.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-DTh6WUET.js → PandLWithForecastRoutes-Cl99HhDr.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-CfzOn3nZ.js → PeopleRoutes-OPsUJqGZ.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-BRNqvpgs.js → PerformanceRoutes-CEO5F026.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CmHLrNN0.js → QBOConnectionScreen-Jf2FDuvS.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-DGyOm6sF.js → ReferralListScreen-CZNvkt7D.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-CCftKChl.js → ReimbursementApprovalRoutes-BwzrkQxk.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js → ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-B0uSlLog.js → ReimbursementRoutes-BppSio00.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-RqLKE5WA.js → ReportsRoutes-CpXDACgQ.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-COd7r8nd.js → RewardsRoutes-30RCnxCS.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-nOndy_UK.js → ScreenRoutes-A_nicqZg.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-CzU-HcCn.js → SettingsRoutes-Bf46HJcH.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-Bi9C_-FR.js → SetupPagesScreen-DE1Mdjhy.js} +1 -1
  39. package/dist/assets/{SignInScreen-BfWJdDbb.js → SignInScreen-C3IJUUVm.js} +1 -1
  40. package/dist/assets/{SignOutScreen-DqrJH-ux.js → SignOutScreen-qEnjjx7M.js} +1 -1
  41. package/dist/assets/{TaskListScreen-Bwwbd5X8.js → TaskListScreen-Cf5iv59C.js} +1 -1
  42. package/dist/assets/{TaskRoutes-CBdj5pZX.js → TaskRoutes-Bguabkg5.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-BtVYAo59.js → TransactionDetailRoutes-Cv9DmhGT.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-BxH3gBsf.js → TransactionDetailScreen-CIFGLtuW.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-DaBzUpfC.js → TransactionListRoutes-2qkBEL3R.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-opcOBJb-.js → TreasuryRoutes-Bs8jZ6mk.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-Fq7EQRDW.js → VendorsRoutes-Ck9fOO3Y.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-C3f57wCu.js → WiseConfirmationScreen-CSSSMXbe.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-2E4c7VWB.js → ZeniAccountRoutes-B_icMfds.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-CgW4jBMr.js → ZeniAccountStatementScreen-CSKHvFWp.js} +1 -1
  51. package/dist/assets/{analyticsHelper-tq4PT7c_.js → analyticsHelper-BjBUUOIH.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-DwUbw-k6.js → getLocaleForTenant-DYNL1b9l.js} +1 -1
  53. package/dist/assets/{index-BCP41PwF.js → index-CPHDDMJD.js} +5 -5
  54. package/dist/assets/{routePaths-jIme_4o7.js → routePaths-BZSOS5PJ.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js → useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-CVdued0l.js → useAskAiCfoHostNavButtonProps-DEByTqFW.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-Du_koxHd.js → useInitialThreadRequest-DhlqNdmZ.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-DYnpLjtY.js → withTransactionSidePanel-CQ9Z6rVO.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-BWWut7Lp.js","assets/sentry-DQGl2YSn.js","assets/core-DYij5xsh.js","assets/zeni-epic-state-YenBAkdY.js","assets/index-BCP41PwF.js","assets/mui-CdvNR06J.js","assets/analytics-DyffXLrl.js","assets/utils-BCjesvPZ.js","assets/withTransactionSidePanel-DYnpLjtY.js","assets/useAskAiCfoHostNavButtonProps-CVdued0l.js","assets/TransactionDetailScreen-BxH3gBsf.js","assets/decodeURIComponentSafe-CSUd4Wt5.js","assets/routePaths-jIme_4o7.js","assets/NotFoundScreen-C0-Skng9.js","assets/useInitialThreadRequest-Du_koxHd.js","assets/analyticsHelper-tq4PT7c_.js","assets/CompanyPassportScreen-03cd6rew.js","assets/MobileAppDrawer-Biso_61t.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js","assets/FeaturePreviewScreen-4ttP8nOi.js","assets/ReferralListScreen-DGyOm6sF.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-DGHURUBB.js","assets/AddressScreen-t45pXVvS.js","assets/DomesticWireDetailScreen-By9DmOyv.js","assets/DrawerScreen-DHM1klM-.js","assets/SetupPagesScreen-Bi9C_-FR.js","assets/BusinessVerificationPageScreen-DRR9km69.js","assets/BillPayApprovalRoutes-DbZZgApj.js","assets/ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js","assets/getLocaleForTenant-DwUbw-k6.js","assets/ReimbursementRoutes-B0uSlLog.js","assets/ReimbursementApprovalRoutes-CCftKChl.js","assets/TransactionListRoutes-DaBzUpfC.js","assets/ZeniAccountStatementScreen-CgW4jBMr.js","assets/SettingsRoutes-CzU-HcCn.js","assets/accountMappingHelper-EVwRyhXo.js","assets/QBOConnectionScreen-CmHLrNN0.js","assets/empty-zLrsqSwy.js","assets/index-C2zxt7CG.js","assets/url-DRf0E0e8.js","assets/index-3OE7eXoF.js","assets/ReportsRoutes-RqLKE5WA.js","assets/ChargeCardRoutes-DSSh6FmN.js","assets/PeopleRoutes-CfzOn3nZ.js","assets/ExpenseAutomationRoutes-BMCXnpCB.js","assets/TreasuryRoutes-opcOBJb-.js","assets/VendorsRoutes-Fq7EQRDW.js","assets/pathToGoBack-DzYXGaMH.js","assets/ZeniAccountRoutes-2E4c7VWB.js","assets/AddressRoutes-BB0ro6wv.js","assets/PandLWithForecastRoutes-DTh6WUET.js","assets/CustomerOnboardingRoutes-CJBZR08A.js","assets/TransactionDetailRoutes-BtVYAo59.js","assets/EntityDetailRoutes-CETjyGK7.js","assets/NotificationRoutes-D9fJ9SYM.js","assets/PerformanceRoutes-BRNqvpgs.js","assets/RewardsRoutes-COd7r8nd.js","assets/TaskRoutes-CBdj5pZX.js","assets/TaskListScreen-Bwwbd5X8.js","assets/AiCfoScreen-7mHfCmdb.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eQ as ls,e$ as cs,eZ as ds,e_ as ms,fI as us,eU as _s,cP as Ae,cx as As,ff as Es,cp as ps,bE as xs,bq as Is,fk as gs,v as Ts,Js as hs,bt as js,Jt as Us,bG as bs,fh as Hs,bF as Rs,bs as Ds,cl as fs,Ju as ys,Jv as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mX as Ee,eX as pe,fS as Bs,fo as xe,fP as Ie,fQ as ge,fp as ks}from"./zeni-epic-state-YenBAkdY.js";import{j as e}from"./liveblocks-BiGkkGoP.js";import{a as v}from"./sentry-DQGl2YSn.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-DYij5xsh.js";import{h as ws,u as Gs,z as H,n as zs,a as $s,V as Js,c as L,A as Ys,L as B,D as he,t as _,P as qs,d as K,l}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{f as je}from"./analyticsHelper-tq4PT7c_.js";import{t as Ws}from"./getLocaleForTenant-DwUbw-k6.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="0f0a334d-859e-4e0b-90bf-fe4d28b827ad",i._sentryDebugIdIdentifier="sentry-dbid-0f0a334d-859e-4e0b-90bf-fe4d28b827ad")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-BWWut7Lp.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-DGHURUBB.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-B0uSlLog.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-DaBzUpfC.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-CzU-HcCn.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-RqLKE5WA.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DSSh6FmN.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-CfzOn3nZ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-BMCXnpCB.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-opcOBJb-.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-Fq7EQRDW.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-2E4c7VWB.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>n(()=>import("./ReportsRoutes-RqLKE5WA.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-BB0ro6wv.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-CfzOn3nZ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-DTh6WUET.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-CJBZR08A.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-Fq7EQRDW.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-BtVYAo59.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CETjyGK7.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-BWWut7Lp.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]))),be=l(()=>n(()=>import("./BillPayRoutes-DGHURUBB.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-CzU-HcCn.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]))),He=l(()=>n(()=>import("./ReimbursementRoutes-B0uSlLog.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-2E4c7VWB.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-opcOBJb-.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-DaBzUpfC.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-DSSh6FmN.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-D9fJ9SYM.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),An=l(()=>n(()=>import("./PerformanceRoutes-BRNqvpgs.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-BMCXnpCB.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-COd7r8nd.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),xn=l(()=>n(()=>import("./TaskRoutes-CBdj5pZX.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),In=l(()=>n(()=>import("./AiCfoScreen-7mHfCmdb.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),f=l(()=>n(()=>import("./NotFoundScreen-C0-Skng9.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gn=l(()=>n(()=>import("./TaskListScreen-Bwwbd5X8.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:y,clearAllLoading:O,clearLoading:Z}=Gs(),D=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),W=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),Q=$s(),fe=Js(),{isFeatureEnabled:ye}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||ye&&W,{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),E=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),J=G(a=>us(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=Ys(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{y(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&D!=null){const a=X.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=xs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(gs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,D]),v.useEffect(()=>{N||(De(!0),y(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&H.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(xe(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ws(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?K.identify(a.userId,{tenant_id:a.tenantId}):K.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(xe(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(Y){K.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,D,h,y,U))},[D,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&J.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(J.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,J.tenantsBaseInOrder))},[J,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&y(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):E==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(a=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[E,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&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(A?.loggedInUserRoleMap),me=Oe&&!C,Je=r.company!=null&&Hs(r.company),Ye=Pe&&Je===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),We=oe&&Ds(A?.loggedInUserRoleMap),Qe=me&&fs(A?.loggedInUserRoleMap),Xe=ys(A?.loggedInUserRoleMap),Ke=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),x=Os(A?.loggedInUserRoleMap),I=Ps(A?.loggedInUserRoleMap),g=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&g,_e=ce&&T,es=me&&p,ss=Ye&&x,ns=oe&&I,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Xe===!0||Ke===!0;return H.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||W&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||W?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Ks,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,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:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"address/*",element:qe||de||Qe||We?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(f,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(f,{})}),e.jsx(t,{path:"performance",element:fe?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):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(f,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(f,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(f,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(In,{isFileUploadEnabled:Ve}):e.jsx(f,{})}),e.jsx(t,{path:"*",element:e.jsx(f,{})})]})}):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:y,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"}):y?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:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Hn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(f,{}),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`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Hn=({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-e8rwyA4g.js","assets/sentry-DQGl2YSn.js","assets/core-DYij5xsh.js","assets/zeni-epic-state-YenBAkdY.js","assets/index-CPHDDMJD.js","assets/mui-CdvNR06J.js","assets/analytics-DyffXLrl.js","assets/utils-BCjesvPZ.js","assets/withTransactionSidePanel-CQ9Z6rVO.js","assets/useAskAiCfoHostNavButtonProps-DEByTqFW.js","assets/TransactionDetailScreen-CIFGLtuW.js","assets/decodeURIComponentSafe-CSUd4Wt5.js","assets/routePaths-BZSOS5PJ.js","assets/NotFoundScreen-CgebWRjN.js","assets/useInitialThreadRequest-DhlqNdmZ.js","assets/analyticsHelper-BjBUUOIH.js","assets/CompanyPassportScreen-CBnJsrN4.js","assets/MobileAppDrawer-BmawIQiO.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js","assets/FeaturePreviewScreen-cfOOP0Wo.js","assets/ReferralListScreen-CZNvkt7D.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-DtWSNOxA.js","assets/AddressScreen-qDs8FTIM.js","assets/DomesticWireDetailScreen-DBmeU2Lc.js","assets/DrawerScreen-BWhuJpJg.js","assets/SetupPagesScreen-DE1Mdjhy.js","assets/BusinessVerificationPageScreen-DmTGb48M.js","assets/BillPayApprovalRoutes-CHbvFE3b.js","assets/ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js","assets/getLocaleForTenant-DYNL1b9l.js","assets/ReimbursementRoutes-BppSio00.js","assets/ReimbursementApprovalRoutes-BwzrkQxk.js","assets/TransactionListRoutes-2qkBEL3R.js","assets/ZeniAccountStatementScreen-CSKHvFWp.js","assets/SettingsRoutes-Bf46HJcH.js","assets/accountMappingHelper-EVwRyhXo.js","assets/QBOConnectionScreen-Jf2FDuvS.js","assets/empty-zLrsqSwy.js","assets/index-C2zxt7CG.js","assets/url-DRf0E0e8.js","assets/index-3OE7eXoF.js","assets/ReportsRoutes-CpXDACgQ.js","assets/ChargeCardRoutes-Bsiqi1N3.js","assets/PeopleRoutes-OPsUJqGZ.js","assets/ExpenseAutomationRoutes-CspHbytv.js","assets/TreasuryRoutes-Bs8jZ6mk.js","assets/VendorsRoutes-Ck9fOO3Y.js","assets/pathToGoBack-DzYXGaMH.js","assets/ZeniAccountRoutes-B_icMfds.js","assets/AddressRoutes-BO7_ztL-.js","assets/PandLWithForecastRoutes-Cl99HhDr.js","assets/CustomerOnboardingRoutes-SknKGVun.js","assets/TransactionDetailRoutes-Cv9DmhGT.js","assets/EntityDetailRoutes-CTTfstSP.js","assets/NotificationRoutes-Cl7PLaOs.js","assets/PerformanceRoutes-CEO5F026.js","assets/RewardsRoutes-30RCnxCS.js","assets/TaskRoutes-Bguabkg5.js","assets/TaskListScreen-Cf5iv59C.js","assets/AiCfoScreen-BdfrkE-x.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eQ as ls,e$ as cs,eZ as ds,e_ as ms,fI as us,eU as _s,cP as Ae,cx as As,ff as Es,cp as ps,bE as xs,bq as Is,fk as gs,v as Ts,Js as hs,bt as js,Jt as Us,bG as bs,fh as Hs,bF as Rs,bs as Ds,cl as fs,Ju as ys,Jv as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,mX as Ee,eX as pe,fS as Bs,fo as xe,fP as Ie,fQ as ge,fp as ks}from"./zeni-epic-state-YenBAkdY.js";import{j as e}from"./liveblocks-BiGkkGoP.js";import{a as v}from"./sentry-DQGl2YSn.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-DYij5xsh.js";import{h as ws,u as Gs,z as H,n as zs,a as $s,V as Js,c as L,A as Ys,L as B,D as he,t as _,P as qs,d as K,l}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{f as je}from"./analyticsHelper-BjBUUOIH.js";import{t as Ws}from"./getLocaleForTenant-DYNL1b9l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="0f0a334d-859e-4e0b-90bf-fe4d28b827ad",i._sentryDebugIdIdentifier="sentry-dbid-0f0a334d-859e-4e0b-90bf-fe4d28b827ad")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-e8rwyA4g.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-DtWSNOxA.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-BppSio00.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-2qkBEL3R.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-Bf46HJcH.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-CpXDACgQ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-Bsiqi1N3.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-OPsUJqGZ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CspHbytv.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-Bs8jZ6mk.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-Ck9fOO3Y.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-B_icMfds.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>n(()=>import("./ReportsRoutes-CpXDACgQ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-BO7_ztL-.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-OPsUJqGZ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-Cl99HhDr.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-SknKGVun.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-Ck9fOO3Y.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-Cv9DmhGT.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CTTfstSP.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-e8rwyA4g.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]))),be=l(()=>n(()=>import("./BillPayRoutes-DtWSNOxA.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-Bf46HJcH.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]))),He=l(()=>n(()=>import("./ReimbursementRoutes-BppSio00.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-B_icMfds.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-Bs8jZ6mk.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-2qkBEL3R.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-Bsiqi1N3.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-Cl7PLaOs.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),An=l(()=>n(()=>import("./PerformanceRoutes-CEO5F026.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-CspHbytv.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-30RCnxCS.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),xn=l(()=>n(()=>import("./TaskRoutes-Bguabkg5.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),In=l(()=>n(()=>import("./AiCfoScreen-BdfrkE-x.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),f=l(()=>n(()=>import("./NotFoundScreen-CgebWRjN.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gn=l(()=>n(()=>import("./TaskListScreen-Cf5iv59C.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:y,clearAllLoading:O,clearLoading:Z}=Gs(),D=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),W=os(h),z=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),Q=$s(),fe=Js(),{isFeatureEnabled:ye}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||ye&&W,{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),E=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),J=G(a=>us(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=Ys(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{y(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&D!=null){const a=X.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=xs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(gs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,D]),v.useEffect(()=>{N||(De(!0),y(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&H.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(xe(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ws(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?K.identify(a.userId,{tenant_id:a.tenantId}):K.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(xe(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(Y){K.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,D,h,y,U))},[D,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&J.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(J.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,J.tenantsBaseInOrder))},[J,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&y(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):E==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(a=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[E,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&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(A?.loggedInUserRoleMap),me=Oe&&!C,Je=r.company!=null&&Hs(r.company),Ye=Pe&&Je===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),We=oe&&Ds(A?.loggedInUserRoleMap),Qe=me&&fs(A?.loggedInUserRoleMap),Xe=ys(A?.loggedInUserRoleMap),Ke=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),x=Os(A?.loggedInUserRoleMap),I=Ps(A?.loggedInUserRoleMap),g=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&g,_e=ce&&T,es=me&&p,ss=Ye&&x,ns=oe&&I,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Xe===!0||Ke===!0;return H.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||W&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||W?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Ks,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,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:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"address/*",element:qe||de||Qe||We?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(f,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(f,{})}),e.jsx(t,{path:"performance",element:fe?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):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(f,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:I,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(f,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(f,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(In,{isFileUploadEnabled:Ve}):e.jsx(f,{})}),e.jsx(t,{path:"*",element:e.jsx(f,{})})]})}):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:y,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"}):y?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:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Hn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(f,{}),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`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Hn=({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-BiGkkGoP.js";import{a as p}from"./sentry-DQGl2YSn.js";import{h as _,g as R,u as v,j as h,n as B,i as O,o as W,p as I}from"./core-DYij5xsh.js";import{bn as xe,eQ as j,gO as de,Lx as Ee,pE as Ae,jH as ue,l_ as we,gQ as je,Lz as ke,Ly as ve,NY as Pe,xR as De,Ck as Ue,Nx as Me,NG as _e,c2 as ee,cH as Te,cI as Re,JE as Be,NZ as Oe,JF as Fe,wh as Ve,N_ as Le,EA as Ne,C0 as $e,BT as pe,BQ as Ke,wl as ge,BW as me,BZ as fe,C3 as ne,sS as te,wk as Ge,jj as X,jm as he,N$ as ze,kn as Je,wA as Ze,Ks as He,Kt as Qe,jh as qe,O0 as We,jk as Xe,q6 as Ye,O1 as en,O2 as nn,qa as tn,gy as an,JN as q,gn as sn,gu as on,JO as cn,wx as rn,O3 as ln,O4 as dn,Ch as un,eZ as be,e$ as Se,O5 as pn,fB as gn,JX as mn,ww as oe,fG as ie,fF as fn,wv as hn,fE as bn,fD as Sn,O6 as Cn,f2 as Ce,O7 as yn,O8 as In,wD as xn,wu as ce,O9 as En,fj as An,wr as wn,bV as jn,c1 as kn,c0 as vn,bW as Pn,b_ as Dn,bZ as Un,bY as Mn,b$ as _n,bX as Tn}from"./zeni-epic-state-YenBAkdY.js";import{n as ae,c as U,z as E,af as ye,bI as Rn,d as K,f as Bn,A as F,B as se,bJ as On,bK as Fn,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,W as Gn,bO as zn,r as Jn,bP as Zn}from"./index-BCP41PwF.js";import{n as M}from"./mui-CdvNR06J.js";import{M as P}from"./MobileAppDrawer-Biso_61t.js";import{a as N,g as $,m as Hn}from"./accountMappingHelper-EVwRyhXo.js";import{t as Qn,A as qn}from"./AddressScreen-t45pXVvS.js";import T from"./NotFoundScreen-C0-Skng9.js";import{g as Wn}from"./analyticsHelper-tq4PT7c_.js";import{B as Xn}from"./BusinessVerificationPageScreen-DRR9km69.js";import{C as Yn}from"./CompanyPassportScreen-03cd6rew.js";import{q as re}from"./QBOConnectionScreen-CmHLrNN0.js";import{B as et}from"./BillPayApprovalRoutes-DbZZgApj.js";import{R as nt}from"./ReimbursementApprovalRoutes-CCftKChl.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./routePaths-jIme_4o7.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./ReimbursementApprovalRuleDetailScreen-DYLPHNtr.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]="b29a118c-8236-41f4-9c2d-7c94ec7ebef1",e._sentryDebugIdIdentifier="sentry-dbid-b29a118c-8236-41f4-9c2d-7c94ec7ebef1")}catch{}})();const tt=M.div`
1
+ import{j as a}from"./liveblocks-BiGkkGoP.js";import{a as p}from"./sentry-DQGl2YSn.js";import{h as _,g as R,u as v,j as h,n as B,i as O,o as W,p as I}from"./core-DYij5xsh.js";import{bn as xe,eQ as j,gO as de,Lx as Ee,pE as Ae,jH as ue,l_ as we,gQ as je,Lz as ke,Ly as ve,NY as Pe,xR as De,Ck as Ue,Nx as Me,NG as _e,c2 as ee,cH as Te,cI as Re,JE as Be,NZ as Oe,JF as Fe,wh as Ve,N_ as Le,EA as Ne,C0 as $e,BT as pe,BQ as Ke,wl as ge,BW as me,BZ as fe,C3 as ne,sS as te,wk as Ge,jj as X,jm as he,N$ as ze,kn as Je,wA as Ze,Ks as He,Kt as Qe,jh as qe,O0 as We,jk as Xe,q6 as Ye,O1 as en,O2 as nn,qa as tn,gy as an,JN as q,gn as sn,gu as on,JO as cn,wx as rn,O3 as ln,O4 as dn,Ch as un,eZ as be,e$ as Se,O5 as pn,fB as gn,JX as mn,ww as oe,fG as ie,fF as fn,wv as hn,fE as bn,fD as Sn,O6 as Cn,f2 as Ce,O7 as yn,O8 as In,wD as xn,wu as ce,O9 as En,fj as An,wr as wn,bV as jn,c1 as kn,c0 as vn,bW as Pn,b_ as Dn,bZ as Un,bY as Mn,b$ as _n,bX as Tn}from"./zeni-epic-state-YenBAkdY.js";import{n as ae,c as U,z as E,af as ye,bI as Rn,d as K,f as Bn,A as F,B as se,bJ as On,bK as Fn,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,W as Gn,bO as zn,r as Jn,bP as Zn}from"./index-CPHDDMJD.js";import{n as M}from"./mui-CdvNR06J.js";import{M as P}from"./MobileAppDrawer-BmawIQiO.js";import{a as N,g as $,m as Hn}from"./accountMappingHelper-EVwRyhXo.js";import{t as Qn,A as qn}from"./AddressScreen-qDs8FTIM.js";import T from"./NotFoundScreen-CgebWRjN.js";import{g as Wn}from"./analyticsHelper-BjBUUOIH.js";import{B as Xn}from"./BusinessVerificationPageScreen-DmTGb48M.js";import{C as Yn}from"./CompanyPassportScreen-CBnJsrN4.js";import{q as re}from"./QBOConnectionScreen-Jf2FDuvS.js";import{B as et}from"./BillPayApprovalRoutes-CHbvFE3b.js";import{R as nt}from"./ReimbursementApprovalRoutes-BwzrkQxk.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./routePaths-BZSOS5PJ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.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]="b29a118c-8236-41f4-9c2d-7c94ec7ebef1",e._sentryDebugIdIdentifier="sentry-dbid-b29a118c-8236-41f4-9c2d-7c94ec7ebef1")}catch{}})();const tt=M.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BiGkkGoP.js";import{h as J,g as Y,u as X,i as H,j as E,N as j,n as W,s as Ye}from"./core-DYij5xsh.js";import{bF as Xe,cl as Ie,Nl as ye,eQ as x,cx as en,y0 as Z,xR as nn,Nx as tn,NA as an,qp as ee,qd as ne,kf as te,so as z,NC as Ae,fF as $e,fE as He,fD as We,ND as sn,y9 as on,C0 as ke,BT as _e,BQ as ve,BH as K,BW as Pe,BZ as Ee,C3 as De,sS as we,fU as cn,cs as rn,e$ as un,eZ as dn,e_ as ln,bs as pn,NE as mn,AJ as le,Bl as yn,NF as fn,bG as gn,Dg as pe,Ck as Sn,NG as bn,NH as hn,Dk as Cn,Do as In,sh as An,HN as kn,DV as Ce,EO as me,NI as _n,NJ as vn,NK as Pn,NL as Ge,NM as En,Kf as Dn,MK as wn,Kr as Tn,NN as qe,NO as Fe,E7 as Ke,kn as Un,qg as Qe,sq as On,bE as Ne,sC as je,cv as Bn,NP as Je,fi as Fn,DD as xn,DH as Vn,NQ as Nn,DY as Re,NR as jn,NS as Rn,NT as zn,NU as Ln,fN as Mn,zk as Zn,NV as $n,zp as Hn,zo as Wn}from"./zeni-epic-state-YenBAkdY.js";import{A as ae,n as ie,c as de,h as Te,aN as Q,z as D,x as se,d as w,B as Ue,f as $,bx as Gn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Qn,r as ze,au as Le,k as Jn,y as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-BCP41PwF.js";import{a as C}from"./sentry-DQGl2YSn.js";import{n as xe,D as at,S as it}from"./mui-CdvNR06J.js";import{M as fe}from"./MobileAppDrawer-Biso_61t.js";import R from"./NotFoundScreen-C0-Skng9.js";import{a as Me}from"./analyticsHelper-tq4PT7c_.js";import{d as Ze}from"./routePaths-jIme_4o7.js";import{B as Be}from"./BusinessVerificationPageScreen-DRR9km69.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]="fb5c2207-024f-4728-b438-091e24102661",e._sentryDebugIdIdentifier="sentry-dbid-fb5c2207-024f-4728-b438-091e24102661")}catch{}})();const st=xe.div`
1
+ import{j as u}from"./liveblocks-BiGkkGoP.js";import{h as J,g as Y,u as X,i as H,j as E,N as j,n as W,s as Ye}from"./core-DYij5xsh.js";import{bF as Xe,cl as Ie,Nl as ye,eQ as x,cx as en,y0 as Z,xR as nn,Nx as tn,NA as an,qp as ee,qd as ne,kf as te,so as z,NC as Ae,fF as $e,fE as He,fD as We,ND as sn,y9 as on,C0 as ke,BT as _e,BQ as ve,BH as K,BW as Pe,BZ as Ee,C3 as De,sS as we,fU as cn,cs as rn,e$ as un,eZ as dn,e_ as ln,bs as pn,NE as mn,AJ as le,Bl as yn,NF as fn,bG as gn,Dg as pe,Ck as Sn,NG as bn,NH as hn,Dk as Cn,Do as In,sh as An,HN as kn,DV as Ce,EO as me,NI as _n,NJ as vn,NK as Pn,NL as Ge,NM as En,Kf as Dn,MK as wn,Kr as Tn,NN as qe,NO as Fe,E7 as Ke,kn as Un,qg as Qe,sq as On,bE as Ne,sC as je,cv as Bn,NP as Je,fi as Fn,DD as xn,DH as Vn,NQ as Nn,DY as Re,NR as jn,NS as Rn,NT as zn,NU as Ln,fN as Mn,zk as Zn,NV as $n,zp as Hn,zo as Wn}from"./zeni-epic-state-YenBAkdY.js";import{A as ae,n as ie,c as de,h as Te,aN as Q,z as D,x as se,d as w,B as Ue,f as $,bx as Gn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Qn,r as ze,au as Le,k as Jn,y as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-CPHDDMJD.js";import{a as C}from"./sentry-DQGl2YSn.js";import{n as xe,D as at,S as it}from"./mui-CdvNR06J.js";import{M as fe}from"./MobileAppDrawer-BmawIQiO.js";import R from"./NotFoundScreen-CgebWRjN.js";import{a as Me}from"./analyticsHelper-BjBUUOIH.js";import{d as Ze}from"./routePaths-BZSOS5PJ.js";import{B as Be}from"./BusinessVerificationPageScreen-DmTGb48M.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]="fb5c2207-024f-4728-b438-091e24102661",e._sentryDebugIdIdentifier="sentry-dbid-fb5c2207-024f-4728-b438-091e24102661")}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-BiGkkGoP.js";import{a as u,b as T,q as A}from"./sentry-DQGl2YSn.js";import{u as z,h as D,j as c,g as M,N as J,n as P}from"./core-DYij5xsh.js";import{u as j,z as s,h as F,d as E,D as O,e as _,f as B,K as N,g as V,R as $,i as v}from"./index-BCP41PwF.js";import{eQ as q,Jr as K,Js as Q,eX as R,fo as W,Jx as H,fM as X,cT as G,Jy as b,Jz as Y,JA as Z,bT as y}from"./zeni-epic-state-YenBAkdY.js";import"./mui-CdvNR06J.js";import{u as ee}from"./useDeviceId-Dsh8klAH.js";import{f as te}from"./analyticsHelper-tq4PT7c_.js";import{t as ne}from"./getLocaleForTenant-DwUbw-k6.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="89ef3f14-0ecd-4a1b-baf4-38c91b26f173",t._sentryDebugIdIdentifier="sentry-dbid-89ef3f14-0ecd-4a1b-baf4-38c91b26f173")}catch{}})();const ie=P(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(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:x,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=>q(e)),I=c(e=>K(e)),m=M(),w=F().mode,C=m.state?.magicLinkExpired,U=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(Q(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),O.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),X().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(J,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-BiGkkGoP.js";import{a as u,b as T,q as A}from"./sentry-DQGl2YSn.js";import{u as z,h as D,j as c,g as M,N as J,n as P}from"./core-DYij5xsh.js";import{u as j,z as s,h as F,d as E,D as O,e as _,f as B,K as N,g as V,R as $,i as v}from"./index-CPHDDMJD.js";import{eQ as q,Jr as K,Js as Q,eX as R,fo as W,Jx as H,fM as X,cT as G,Jy as b,Jz as Y,JA as Z,bT as y}from"./zeni-epic-state-YenBAkdY.js";import"./mui-CdvNR06J.js";import{u as ee}from"./useDeviceId-Dsh8klAH.js";import{f as te}from"./analyticsHelper-BjBUUOIH.js";import{t as ne}from"./getLocaleForTenant-DYNL1b9l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="89ef3f14-0ecd-4a1b-baf4-38c91b26f173",t._sentryDebugIdIdentifier="sentry-dbid-89ef3f14-0ecd-4a1b-baf4-38c91b26f173")}catch{}})();const ie=P(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(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:x,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=>q(e)),I=c(e=>K(e)),m=M(),w=F().mode,C=m.state?.magicLinkExpired,U=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(Q(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),O.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),X().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(J,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import{a}from"./sentry-DQGl2YSn.js";import{u,g as m,h as p,N as g}from"./core-DYij5xsh.js";import{z as d,B as y,t as h,d as c,f as b}from"./index-BCP41PwF.js";import{fR as x,fS as I,JP as j}from"./zeni-epic-state-YenBAkdY.js";import{n as w}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="ef5ed0c3-d878-414d-9e45-314d9bcac27c",e._sentryDebugIdIdentifier="sentry-dbid-ef5ed0c3-d878-414d-9e45-314d9bcac27c")}catch{}})();function $(){const e=u(),t=m(),i=p(),n=a.useRef(!1),f=d.isSignedIn(),r=t.state?.message==="logout",o=r||f;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),j(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
1
+ import{j as s}from"./liveblocks-BiGkkGoP.js";import{a}from"./sentry-DQGl2YSn.js";import{u,g as m,h as p,N as g}from"./core-DYij5xsh.js";import{z as d,B as y,t as h,d as c,f as b}from"./index-CPHDDMJD.js";import{fR as x,fS as I,JP as j}from"./zeni-epic-state-YenBAkdY.js";import{n as w}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="ef5ed0c3-d878-414d-9e45-314d9bcac27c",e._sentryDebugIdIdentifier="sentry-dbid-ef5ed0c3-d878-414d-9e45-314d9bcac27c")}catch{}})();function $(){const e=u(),t=m(),i=p(),n=a.useRef(!1),f=d.isSignedIn(),r=t.state?.message==="logout",o=r||f;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),j(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as v,u as K,g as Z,j as b,i as z,n as V}from"./core-DYij5xsh.js";import{z as R,n as W,c as d,Z as q,x as M,d as O,f as X,cQ as Y,r as f,p as H}from"./index-BCP41PwF.js";import{eQ as J,QR as Q,Gt as y,QS as x,QN as aa,FR as S,QT as ea,FZ as I,Fj as ta,Gu as B,QU as w,gU as sa,Gk as oa,Gp as na,Gc as ia,Ga as L,Gq as la,G7 as ra,QV as ka,QW as ca,QX as ua,QY as pa,QZ as m,ec as da,Q_ as ma,Q$ as Ta}from"./zeni-epic-state-YenBAkdY.js";import{n as ga}from"./mui-CdvNR06J.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{M as Ga}from"./MobileAppDrawer-Biso_61t.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="3f6b4174-1e1f-453b-9988-55a1332e8878",e._sentryDebugIdIdentifier="sentry-dbid-3f6b4174-1e1f-453b-9988-55a1332e8878")}catch{}})();const ha=ga.div`
1
+ import{j as p}from"./liveblocks-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as v,u as K,g as Z,j as b,i as z,n as V}from"./core-DYij5xsh.js";import{z as R,n as W,c as d,Z as q,x as M,d as O,f as X,cQ as Y,r as f,p as H}from"./index-CPHDDMJD.js";import{eQ as J,QR as Q,Gt as y,QS as x,QN as aa,FR as S,QT as ea,FZ as I,Fj as ta,Gu as B,QU as w,gU as sa,Gk as oa,Gp as na,Gc as ia,Ga as L,Gq as la,G7 as ra,QV as ka,QW as ca,QX as ua,QY as pa,QZ as m,ec as da,Q_ as ma,Q$ as Ta}from"./zeni-epic-state-YenBAkdY.js";import{n as ga}from"./mui-CdvNR06J.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{M as Ga}from"./MobileAppDrawer-BmawIQiO.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="3f6b4174-1e1f-453b-9988-55a1332e8878",e._sentryDebugIdIdentifier="sentry-dbid-3f6b4174-1e1f-453b-9988-55a1332e8878")}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-BiGkkGoP.js";import se from"./NotFoundScreen-C0-Skng9.js";import{a as c}from"./sentry-DQGl2YSn.js";import{h as O,u as _,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-DYij5xsh.js";import{Fw as M,Fz as le,Ft as de,eQ as Z,QN as H,FN as Y,Fq as pe,Gh as ue,Ga as ke,QO as W,QP as q,Fm as me,Fj as fe,qp as ge,qd as he,kf as Se,FH as Ie,QQ as Te,FY as be,FV as Ee,FC as Ge,FS as Ce,FR as Fe}from"./zeni-epic-state-YenBAkdY.js";import{z as C,cO as De,v as xe,n as je,c as b,p as X,r as w,x as ye,d as z,f as we,cP as ve,i as V,at as Re}from"./index-BCP41PwF.js";import{n as Pe}from"./mui-CdvNR06J.js";import{u as Be}from"./useInitialThreadRequest-Du_koxHd.js";import{M as Ue}from"./MobileAppDrawer-Biso_61t.js";import Le from"./TaskListScreen-Bwwbd5X8.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.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]="1071aa7d-3416-445e-b248-585ae1a6f1a8",e._sentryDebugIdIdentifier="sentry-dbid-1071aa7d-3416-445e-b248-585ae1a6f1a8")}catch{}})();function Ne(){const e=O(),t=_(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(M())},[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 Q,A=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?q(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:F}=d,E=r.recurringSourceTaskId,D=E!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==Q&&(Q=I,A=Object.values(I)),A),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=>q(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(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(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(Y(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=O(),t=_(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{P||L==="Completed"||(ee(!0),t(ue()))},[P,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return x(!1),void(T.current=!1);if(G==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const N=g(i=>W(i,r)),j=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ye,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(qe,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:E})]})]})}const qe=Pe.div`
1
+ import{j as n}from"./liveblocks-BiGkkGoP.js";import se from"./NotFoundScreen-CgebWRjN.js";import{a as c}from"./sentry-DQGl2YSn.js";import{h as O,u as _,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-DYij5xsh.js";import{Fw as M,Fz as le,Ft as de,eQ as Z,QN as H,FN as Y,Fq as pe,Gh as ue,Ga as ke,QO as W,QP as q,Fm as me,Fj as fe,qp as ge,qd as he,kf as Se,FH as Ie,QQ as Te,FY as be,FV as Ee,FC as Ge,FS as Ce,FR as Fe}from"./zeni-epic-state-YenBAkdY.js";import{z as C,cO as De,v as xe,n as je,c as b,p as X,r as w,x as ye,d as z,f as we,cP as ve,i as V,at as Re}from"./index-CPHDDMJD.js";import{n as Pe}from"./mui-CdvNR06J.js";import{u as Be}from"./useInitialThreadRequest-DhlqNdmZ.js";import{M as Ue}from"./MobileAppDrawer-BmawIQiO.js";import Le from"./TaskListScreen-Cf5iv59C.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-DEByTqFW.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]="1071aa7d-3416-445e-b248-585ae1a6f1a8",e._sentryDebugIdIdentifier="sentry-dbid-1071aa7d-3416-445e-b248-585ae1a6f1a8")}catch{}})();function Ne(){const e=O(),t=_(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(M())},[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 Q,A=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?q(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:F}=d,E=r.recurringSourceTaskId,D=E!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==Q&&(Q=I,A=Object.values(I)),A),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=>q(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(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(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(Y(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=O(),t=_(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{P||L==="Completed"||(ee(!0),t(ue()))},[P,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return x(!1),void(T.current=!1);if(G==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const N=g(i=>W(i,r)),j=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ye,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(qe,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:E})]})]})}const qe=Pe.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BiGkkGoP.js";import i from"./NotFoundScreen-C0-Skng9.js";import{T as r}from"./TransactionDetailScreen-BxH3gBsf.js";import"./sentry-DQGl2YSn.js";import{o as a,p as o}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./routePaths-jIme_4o7.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-BiGkkGoP.js";import i from"./NotFoundScreen-CgebWRjN.js";import{T as r}from"./TransactionDetailScreen-CIFGLtuW.js";import"./sentry-DQGl2YSn.js";import{o as a,p as o}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./routePaths-BZSOS5PJ.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-BiGkkGoP.js";import{a as d}from"./sentry-DQGl2YSn.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-DYij5xsh.js";import{bn as $e,eQ as K,cP as ue,bt as me,pZ as Y,KF as B,LG as pe,LH as Q,L3 as he,jS as fe,LI as ge,L8 as X,L9 as Z,kH as Se,HF as J,Kz as x,jM as Te,jK as ye,jW as He,LJ as Me,LK as We,tX as N,jR as ve,GX as Ee,cU as qe,cV as Ke,LL as Ye,Ky as Qe,LM as Xe,t$ as Ze,LN as Je,LO as ea,LP as aa,LQ as ta,LR as na,jV as oa,LS as sa,LT as ia,KA as ca,LU as ra,LV as la,LW as da,GR as ua,GF as ma,H7 as pa,jX as ha,HG as ie,GO as fa}from"./zeni-epic-state-YenBAkdY.js";import{z as be,n as ee,c as L,aN as De,h as ga,k as Sa,aO as Ta,y as ya,p as W,A as va,aP as Ea,r as q,Z as ba,d as Ce,aQ as Da,at as Ca,a2 as M}from"./index-BCP41PwF.js";import{n as Ia,S as ka,D as La}from"./mui-CdvNR06J.js";import{u as Ua}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{d as Ie}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{h as ke,g as Aa,e as xa,c as _a}from"./routePaths-jIme_4o7.js";import{t as Va}from"./utils-BCjesvPZ.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]="a57bde79-3847-4444-b832-bdbc31aac743",a._sentryDebugIdIdentifier="sentry-dbid-a57bde79-3847-4444-b832-bdbc31aac743")}catch{}})();const ae=()=>{const a=be.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:C}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,U=ae(),y=d.useMemo(()=>({id:a,type:Y(e)}),[a,e]),m=S(u=>B(u,y)),D=S(u=>{const R=B(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return R==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[R]?.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 H=d.useCallback(()=>{V(!1),P(!1)},[]),[b,I]=d.useState(!1),F=_?.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(J(p,"TransactionDetail",{timeframe:"month",timePeriod:F??v}))):(s(X()),s(Z()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,w,O,v,F]),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:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:U,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:A,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:b,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Fa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Q(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(He("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(Ba,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...C})})})},Ba=Ia(ka)`
1
+ import{j as k}from"./liveblocks-BiGkkGoP.js";import{a as d}from"./sentry-DQGl2YSn.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-DYij5xsh.js";import{bn as $e,eQ as K,cP as ue,bt as me,pZ as Y,KF as B,LG as pe,LH as Q,L3 as he,jS as fe,LI as ge,L8 as X,L9 as Z,kH as Se,HF as J,Kz as x,jM as Te,jK as ye,jW as He,LJ as Me,LK as We,tX as N,jR as ve,GX as Ee,cU as qe,cV as Ke,LL as Ye,Ky as Qe,LM as Xe,t$ as Ze,LN as Je,LO as ea,LP as aa,LQ as ta,LR as na,jV as oa,LS as sa,LT as ia,KA as ca,LU as ra,LV as la,LW as da,GR as ua,GF as ma,H7 as pa,jX as ha,HG as ie,GO as fa}from"./zeni-epic-state-YenBAkdY.js";import{z as be,n as ee,c as L,aN as De,h as ga,k as Sa,aO as Ta,y as ya,p as W,A as va,aP as Ea,r as q,Z as ba,d as Ce,aQ as Da,at as Ca,a2 as M}from"./index-CPHDDMJD.js";import{n as Ia,S as ka,D as La}from"./mui-CdvNR06J.js";import{u as Ua}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{d as Ie}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{h as ke,g as Aa,e as xa,c as _a}from"./routePaths-BZSOS5PJ.js";import{t as Va}from"./utils-BCjesvPZ.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]="a57bde79-3847-4444-b832-bdbc31aac743",a._sentryDebugIdIdentifier="sentry-dbid-a57bde79-3847-4444-b832-bdbc31aac743")}catch{}})();const ae=()=>{const a=be.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:C}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,U=ae(),y=d.useMemo(()=>({id:a,type:Y(e)}),[a,e]),m=S(u=>B(u,y)),D=S(u=>{const R=B(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return R==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[R]?.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 H=d.useCallback(()=>{V(!1),P(!1)},[]),[b,I]=d.useState(!1),F=_?.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(J(p,"TransactionDetail",{timeframe:"month",timePeriod:F??v}))):(s(X()),s(Z()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,w,O,v,F]),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:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:U,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:A,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:b,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Fa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Q(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(He("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(Ba,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...C})})})},Ba=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-BiGkkGoP.js";import{h as Z,g as H,u as K,i as Q,j as h,N as w,n as X,o as Ye,p as j}from"./core-DYij5xsh.js";import{eQ as U,pE as ee,j4 as p,P1 as te,Hw as De,bq as le,P2 as be,jH as ae,L5 as ne,P3 as ue,P4 as ve,bE as P,Hs as ye,P5 as Ee,P6 as me,P7 as je,Hv as Ae,P8 as xe,P9 as pe,Pa as Me,Pb as ge,Pc as Le,Pd as Fe,Pe as fe,IJ as Ce,bn as Be}from"./zeni-epic-state-YenBAkdY.js";import{D as de,n as W,c as _,d as G,cc as ce,r as q,p as oe,W as ze,z as Oe}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{a as S}from"./sentry-DQGl2YSn.js";import{w as se}from"./withTransactionSidePanel-DYnpLjtY.js";import{p as ie,c as re}from"./routePaths-jIme_4o7.js";import{u as Ge}from"./utils-BCjesvPZ.js";import{d as b}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{Z as we}from"./ZeniAccountStatementScreen-CgW4jBMr.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import"./TransactionDetailScreen-BxH3gBsf.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]="32672698-0181-4b64-a6b7-5b63b1aff545",a._sentryDebugIdIdentifier="sentry-dbid-32672698-0181-4b64-a6b7-5b63b1aff545")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ge(a),Re=X(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),u=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:N(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Z(),t=H(),n=K(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=W(),{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=N(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}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=X(function(a,e){const t=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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Z(),n=H(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=b(l??""),g=b(u??""),k=b(m??""),x=b(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}=W(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=He(f,g,k,D,y,A,x);if(O){const d={startDate:P(y,"YYYY-MM-DD"),endDate:P(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(Ne,{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},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(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),We=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ze=se(function({referrerType:a,...e}){const t=Z(),n=H(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=b(l??""),g=b(u??""),k=b(m??""),x=b(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}=W(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=Ke(f,g,k,D,y,A,x);if(O){const d={startDate:P(y,"YYYY-MM-DD"),endDate:P(A,"YYYY-MM-DD")},$=Qe(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(We,{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},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Z(),n=H(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=Q(),f=b(l??""),g=b(u??""),k=b(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(Y=>Me(Y.transactionListState,g,f)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(Y=>U(Y)),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 Y={startDate:P(D,"YYYY-MM-DD"),endDate:P(y,"YYYY-MM-DD")},Pe=tt(F?.dateRange,Y);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Pe}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=W(),{isFeatureEnabled:L}=O(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(_.isProjectsTransactionsEnabled),d=h(Y=>ee(Y))&&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(Y=>Y!=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:Y=>B(Y),...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")&&P(n,"YYYY-MM-DD").isValid()&&P(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 Pt(){const a=H().state?.referrer,e=Oe.getSignedInUser(),t=Be(e),{useFeatureGate:n}=W(),{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(Ye,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{Pt as default};
1
+ import{j as s}from"./liveblocks-BiGkkGoP.js";import{h as Z,g as H,u as K,i as Q,j as h,N as w,n as X,o as Ye,p as j}from"./core-DYij5xsh.js";import{eQ as U,pE as ee,j4 as p,P1 as te,Hw as De,bq as le,P2 as be,jH as ae,L5 as ne,P3 as ue,P4 as ve,bE as P,Hs as ye,P5 as Ee,P6 as me,P7 as je,Hv as Ae,P8 as xe,P9 as pe,Pa as Me,Pb as ge,Pc as Le,Pd as Fe,Pe as fe,IJ as Ce,bn as Be}from"./zeni-epic-state-YenBAkdY.js";import{D as de,n as W,c as _,d as G,cc as ce,r as q,p as oe,W as ze,z as Oe}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{a as S}from"./sentry-DQGl2YSn.js";import{w as se}from"./withTransactionSidePanel-CQ9Z6rVO.js";import{p as ie,c as re}from"./routePaths-BZSOS5PJ.js";import{u as Ge}from"./utils-BCjesvPZ.js";import{d as b}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{Z as we}from"./ZeniAccountStatementScreen-CSKHvFWp.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import"./TransactionDetailScreen-CIFGLtuW.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]="32672698-0181-4b64-a6b7-5b63b1aff545",a._sentryDebugIdIdentifier="sentry-dbid-32672698-0181-4b64-a6b7-5b63b1aff545")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ge(a),Re=X(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),u=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:N(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Z(),t=H(),n=K(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=W(),{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=N(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}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=X(function(a,e){const t=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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Z(),n=H(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=b(l??""),g=b(u??""),k=b(m??""),x=b(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}=W(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=He(f,g,k,D,y,A,x);if(O){const d={startDate:P(y,"YYYY-MM-DD"),endDate:P(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(Ne,{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},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(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),We=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ze=se(function({referrerType:a,...e}){const t=Z(),n=H(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=b(l??""),g=b(u??""),k=b(m??""),x=b(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}=W(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const O=Ke(f,g,k,D,y,A,x);if(O){const d={startDate:P(y,"YYYY-MM-DD"),endDate:P(A,"YYYY-MM-DD")},$=Qe(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(We,{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},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Z(),n=H(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=Q(),f=b(l??""),g=b(u??""),k=b(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(Y=>Me(Y.transactionListState,g,f)),[v,C]=S.useState(!1),[E,B]=S.useState(void 0),z=h(Y=>U(Y)),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 Y={startDate:P(D,"YYYY-MM-DD"),endDate:P(y,"YYYY-MM-DD")},Pe=tt(F?.dateRange,Y);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Pe}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=W(),{isFeatureEnabled:L}=O(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(_.isProjectsTransactionsEnabled),d=h(Y=>ee(Y))&&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(Y=>Y!=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:Y=>B(Y),...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")&&P(n,"YYYY-MM-DD").isValid()&&P(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 Pt(){const a=H().state?.referrer,e=Oe.getSignedInUser(),t=Be(e),{useFeatureGate:n}=W(),{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(Ye,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{Pt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-BiGkkGoP.js";import{h as U,g as B,u as P,i as M,j as f,N as L,n as N,o as Te,p as k}from"./core-DYij5xsh.js";import{cm as V,eQ as v,NP as R,DV as ae,fi as q,DD as ne,NR as we,DY as Ie,NN as Ce,NO as se,O4 as ke,C3 as je,sS as be,NT as Ae,E7 as Ee,NQ as re,cO as H,w_ as oe,eZ as De,e$ as ve,O_ as Fe,O$ as Le,DE as Ue,P0 as Be,DF as Pe,DO as Re,bt as Oe,bF as Me,cx as Ne,bG as Ve,cl as _e,fh as $e,bs as ze,Jt as Ge,ck as Ze}from"./zeni-epic-state-YenBAkdY.js";import{A as _,aq as qe,z as A,x as $,d as j,c5 as He,c6 as We,c7 as Z,k as W,h as Ke,W as Qe,Z as Je,n as ie,c as D,y as Ye,B as Xe,c8 as et,at as K,r as tt,c9 as at,p as Q,ca as nt,M as Y,cb as st,a9 as rt}from"./index-BCP41PwF.js";import{D as ot,n as O,S as it}from"./mui-CdvNR06J.js";import ct from"./NotFoundScreen-C0-Skng9.js";import{S as X}from"./SetupPagesScreen-Bi9C_-FR.js";import{a as d}from"./sentry-DQGl2YSn.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{u as ut}from"./useInitialThreadRequest-Du_koxHd.js";import{M as ce}from"./MobileAppDrawer-Biso_61t.js";import{F as dt}from"./FeaturePreviewScreen-4ttP8nOi.js";import{a as ee}from"./analyticsHelper-tq4PT7c_.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./routePaths-jIme_4o7.js";import"./BusinessVerificationPageScreen-DRR9km69.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]="61b9a2af-a2b1-4a99-a3d0-6285c9e2cddc",t._sentryDebugIdIdentifier="sentry-dbid-61b9a2af-a2b1-4a99-a3d0-6285c9e2cddc")}catch{}})();const pt=N(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(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(He);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=M(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=qe(r),s=V(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>v(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=f(C=>R(C,y)),w=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.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||(I(!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(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=N(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"))}}})(We),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=M(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=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=>v(x)),T=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(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||(I(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{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-BiGkkGoP.js";import{h as U,g as B,u as P,i as M,j as f,N as L,n as N,o as Te,p as k}from"./core-DYij5xsh.js";import{cm as V,eQ as v,NP as R,DV as ae,fi as q,DD as ne,NR as we,DY as Ie,NN as Ce,NO as se,O4 as ke,C3 as je,sS as be,NT as Ae,E7 as Ee,NQ as re,cO as H,w_ as oe,eZ as De,e$ as ve,O_ as Fe,O$ as Le,DE as Ue,P0 as Be,DF as Pe,DO as Re,bt as Oe,bF as Me,cx as Ne,bG as Ve,cl as _e,fh as $e,bs as ze,Jt as Ge,ck as Ze}from"./zeni-epic-state-YenBAkdY.js";import{A as _,aq as qe,z as A,x as $,d as j,c5 as He,c6 as We,c7 as Z,k as W,h as Ke,W as Qe,Z as Je,n as ie,c as D,y as Ye,B as Xe,c8 as et,at as K,r as tt,c9 as at,p as Q,ca as nt,M as Y,cb as st,a9 as rt}from"./index-CPHDDMJD.js";import{D as ot,n as O,S as it}from"./mui-CdvNR06J.js";import ct from"./NotFoundScreen-CgebWRjN.js";import{S as X}from"./SetupPagesScreen-DE1Mdjhy.js";import{a as d}from"./sentry-DQGl2YSn.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{u as ut}from"./useInitialThreadRequest-DhlqNdmZ.js";import{M as ce}from"./MobileAppDrawer-BmawIQiO.js";import{F as dt}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{a as ee}from"./analyticsHelper-BjBUUOIH.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./routePaths-BZSOS5PJ.js";import"./BusinessVerificationPageScreen-DmTGb48M.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]="61b9a2af-a2b1-4a99-a3d0-6285c9e2cddc",t._sentryDebugIdIdentifier="sentry-dbid-61b9a2af-a2b1-4a99-a3d0-6285c9e2cddc")}catch{}})();const pt=N(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(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(He);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=M(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=qe(r),s=V(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>v(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=f(C=>R(C,y)),w=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.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||(I(!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(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=N(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"))}}})(We),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=M(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=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=>v(x)),T=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(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||(I(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{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-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as J,g as Y,i as R,j as S,n as G,u as z,o as at,p as B,N as $}from"./core-DYij5xsh.js";import{eQ as V,Kv as Ee,Kw as Ue,fU as X,cs as Ie,ct as be,vz as St,Kx as nt,vD as zt,IA as ee,jH as te,vx as Yt,vr as qt,Ky as Me,vj as Ht,vi as Qt,vc as Wt,vo as Zt,vE as Xt,Kz as he,KA as Ne,vk as ea,KB as pe,f4 as ft,vT as gt,vM as vt,KC as xt,ot as Tt,vH as yt,vF as Dt,KD as Ct,v_ as Et,vX as It,vI as bt,vZ as Je,GX as kt,KE as ta,KF as aa,cv as na,KG as sa,KH as oa,KI as me,KJ as ie,KK as ke,IB as Ge,wd as ye,Iz as De,w0 as wt,vA as $e,KL as la,IC as H,KM as Ke,vu as ia,KN as ca,KO as da,KP as ze,KQ as Ye,KR as qe,KS as He,w7 as we,KT as At,vQ as Ft,KU as ra,KV as ua,KW as ha,KX as pa,KY as ma,KZ as Sa,K_ as fa,K$ as ga,t2 as va,t3 as xa,HG as Fe,L0 as Ta,L1 as ya,j4 as je,bq as Da,L2 as Ca,L3 as Ea,kF as Ia,kO as ba,HF as Le,bE as st,L4 as jt,Hg as Lt,L5 as ka,L6 as wa,L7 as Aa,kQ as Fa,L8 as ot,L9 as lt,La as it,Lb as ct,Lc as ja,kM as La,Ld as Pa,kP as _a,Le as Va,Lf as Pt,I0 as _t,k3 as Ba,Lg as Oa,Lh as Pe,Li as Vt,H_ as Bt,yq as Ra,Lj as Ua,Lk as Ma,kn as Ot,Ll as Na,Lm as Ja,Ic as Ga,qK as $a,Ln as Rt,Lo as dt,I9 as _e,Lp as rt,Lq as Ka,Ie as za,Lr as Ya,Ls as qa,Lt as Ha,Lu as Qa,Lv as Wa,qN as Za,Lw as Xa,ID as en,Lx as tn,HT as Ve,gQ as an,Ly as nn,Lz as sn,gO as on,LA as ln,LB as cn,yu as dn,LC as rn,LD as un,LE as hn,LF as pn,k7 as mn,bn as Sn,e$ as fn,eZ as gn}from"./zeni-epic-state-YenBAkdY.js";import{z as U,aq as Be,B as Ut,x as W,d as F,a2 as Z,aw as vn,r as N,D as Ce,v as ce,ax as Qe,ay as xn,az as Tn,p as We,aA as yn,h as Dn,k as de,y as Ze,n as ae,c as K,aB as Cn,i as Xe,Z as Se,aC as En,aD as Mt,W as In,aE as bn,A as kn,aF as wn,at as Nt,aG as An,o as Q,S as Fn,F as Jt,U as jn,aH as Ln,aI as Pn,f as et,aJ as _n,aK as Vn,E as Bn,aL as On,aM as Rn}from"./index-BCP41PwF.js";import{n as M,D as Un,S as Gt}from"./mui-CdvNR06J.js";import{t as Mn,A as Nn}from"./AddressScreen-t45pXVvS.js";import le from"./NotFoundScreen-C0-Skng9.js";import{F as Jn}from"./FeaturePreviewScreen-4ttP8nOi.js";import{c as q,v as tt,d as Gn}from"./routePaths-jIme_4o7.js";import{p as $t}from"./pathToGoBack-DzYXGaMH.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{M as ge}from"./MobileAppDrawer-Biso_61t.js";import{D as $n}from"./DrawerScreen-DHM1klM-.js";import{g as Kn,m as zn}from"./accountMappingHelper-EVwRyhXo.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="c4f6048d-89a6-42d1-815d-2c3550ebd8a3",e._sentryDebugIdIdentifier="sentry-dbid-c4f6048d-89a6-42d1-815d-2c3550ebd8a3")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Ue(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=N(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}=R(),{scheduleType:o}=R();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=U.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=>Ue(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(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(W,{analytics:F,onLoad:()=>{Qn(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:F,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}},Qn=(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=Ie(s.controllers),i=be(s.controllerUserIds);t!=null&&F.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})},Wn=M.div`
1
+ import{j as l}from"./liveblocks-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as J,g as Y,i as R,j as S,n as G,u as z,o as at,p as B,N as $}from"./core-DYij5xsh.js";import{eQ as V,Kv as Ee,Kw as Ue,fU as X,cs as Ie,ct as be,vz as St,Kx as nt,vD as zt,IA as ee,jH as te,vx as Yt,vr as qt,Ky as Me,vj as Ht,vi as Qt,vc as Wt,vo as Zt,vE as Xt,Kz as he,KA as Ne,vk as ea,KB as pe,f4 as ft,vT as gt,vM as vt,KC as xt,ot as Tt,vH as yt,vF as Dt,KD as Ct,v_ as Et,vX as It,vI as bt,vZ as Je,GX as kt,KE as ta,KF as aa,cv as na,KG as sa,KH as oa,KI as me,KJ as ie,KK as ke,IB as Ge,wd as ye,Iz as De,w0 as wt,vA as $e,KL as la,IC as H,KM as Ke,vu as ia,KN as ca,KO as da,KP as ze,KQ as Ye,KR as qe,KS as He,w7 as we,KT as At,vQ as Ft,KU as ra,KV as ua,KW as ha,KX as pa,KY as ma,KZ as Sa,K_ as fa,K$ as ga,t2 as va,t3 as xa,HG as Fe,L0 as Ta,L1 as ya,j4 as je,bq as Da,L2 as Ca,L3 as Ea,kF as Ia,kO as ba,HF as Le,bE as st,L4 as jt,Hg as Lt,L5 as ka,L6 as wa,L7 as Aa,kQ as Fa,L8 as ot,L9 as lt,La as it,Lb as ct,Lc as ja,kM as La,Ld as Pa,kP as _a,Le as Va,Lf as Pt,I0 as _t,k3 as Ba,Lg as Oa,Lh as Pe,Li as Vt,H_ as Bt,yq as Ra,Lj as Ua,Lk as Ma,kn as Ot,Ll as Na,Lm as Ja,Ic as Ga,qK as $a,Ln as Rt,Lo as dt,I9 as _e,Lp as rt,Lq as Ka,Ie as za,Lr as Ya,Ls as qa,Lt as Ha,Lu as Qa,Lv as Wa,qN as Za,Lw as Xa,ID as en,Lx as tn,HT as Ve,gQ as an,Ly as nn,Lz as sn,gO as on,LA as ln,LB as cn,yu as dn,LC as rn,LD as un,LE as hn,LF as pn,k7 as mn,bn as Sn,e$ as fn,eZ as gn}from"./zeni-epic-state-YenBAkdY.js";import{z as U,aq as Be,B as Ut,x as W,d as F,a2 as Z,aw as vn,r as N,D as Ce,v as ce,ax as Qe,ay as xn,az as Tn,p as We,aA as yn,h as Dn,k as de,y as Ze,n as ae,c as K,aB as Cn,i as Xe,Z as Se,aC as En,aD as Mt,W as In,aE as bn,A as kn,aF as wn,at as Nt,aG as An,o as Q,S as Fn,F as Jt,U as jn,aH as Ln,aI as Pn,f as et,aJ as _n,aK as Vn,E as Bn,aL as On,aM as Rn}from"./index-CPHDDMJD.js";import{n as M,D as Un,S as Gt}from"./mui-CdvNR06J.js";import{t as Mn,A as Nn}from"./AddressScreen-qDs8FTIM.js";import le from"./NotFoundScreen-CgebWRjN.js";import{F as Jn}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{c as q,v as tt,d as Gn}from"./routePaths-BZSOS5PJ.js";import{p as $t}from"./pathToGoBack-DzYXGaMH.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{M as ge}from"./MobileAppDrawer-BmawIQiO.js";import{D as $n}from"./DrawerScreen-BWhuJpJg.js";import{g as Kn,m as zn}from"./accountMappingHelper-EVwRyhXo.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="c4f6048d-89a6-42d1-815d-2c3550ebd8a3",e._sentryDebugIdIdentifier="sentry-dbid-c4f6048d-89a6-42d1-815d-2c3550ebd8a3")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Ue(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=N(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}=R(),{scheduleType:o}=R();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=U.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=>Ue(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(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(W,{analytics:F,onLoad:()=>{Qn(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:F,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}},Qn=(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=Ie(s.controllers),i=be(s.controllerUserIds);t!=null&&F.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})},Wn=M.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-BiGkkGoP.js";import{a as c}from"./sentry-DQGl2YSn.js";import{s as u,u as h,j as b,N as y}from"./core-DYij5xsh.js";import{JM as I,eX as w,zL as j}from"./zeni-epic-state-YenBAkdY.js";import{z as l,B as x,F as S,U as D}from"./index-BCP41PwF.js";import{n as f}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="01561278-1038-4cab-b78d-208c8c83bdc6",e._sentryDebugIdIdentifier="sentry-dbid-01561278-1038-4cab-b78d-208c8c83bdc6")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,g]=c.useState(!1),a=h(),s=b(m=>I(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(y,{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),c.useEffect(()=>{n||(g(!0),a(j(t,p,i)))},[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=f.div`
1
+ import{j as o}from"./liveblocks-BiGkkGoP.js";import{a as c}from"./sentry-DQGl2YSn.js";import{s as u,u as h,j as b,N as y}from"./core-DYij5xsh.js";import{JM as I,eX as w,zL as j}from"./zeni-epic-state-YenBAkdY.js";import{z as l,B as x,F as S,U as D}from"./index-CPHDDMJD.js";import{n as f}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="01561278-1038-4cab-b78d-208c8c83bdc6",e._sentryDebugIdIdentifier="sentry-dbid-01561278-1038-4cab-b78d-208c8c83bdc6")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,g]=c.useState(!1),a=h(),s=b(m=>I(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(y,{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),c.useEffect(()=>{n||(g(!0),a(j(t,p,i)))},[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=f.div`
2
2
  display: flex;
3
3
  width: 100%;
4
4
  height: 100vh;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-BiGkkGoP.js";import{h as ne,g as W,u as _,i as K,j as k,n as Y,N as X,o as Ve,p as w}from"./core-DYij5xsh.js";import{eQ as U,OG as Ce,OH as $e,cl as ee,cm as Ze,fh as Ne,wY as we,B9 as He,wS as Tn,OI as On,OJ as Bn,wV as Fn,x0 as fe,wP as Rn,wM as Ln,Ns as le,OK as Un,Et as zn,Ky as Mn,Ev as _n,ko as Oe,OL as Vn,qp as Ge,qd as We,kf as Ke,ki as Be,Kz as Fe,KA as $n,OM as Zn,kh as Nn,kE as Hn,k6 as Gn,iF as Wn,iE as Kn,ON as Yn,OO as ye,Ea as qn,OP as Jn,OQ as Qn,Nl as ke,OR as Re,OS as Xn,EG as ea,O4 as na,C3 as Ye,sS as qe,OT as aa,ED as ta,OU as Je,cM as Ae,EK as Qe,fi as oa,eZ as Xe,e$ as De,EI as sa,BZ as ra,EA as ia,OV as en,OW as nn,Ec as an,Em as Le,OX as ca,NU as la,EL as da,bt as ua,bF as pa,cx as ma,bG as ha,bs as ga,Jt as fa}from"./zeni-epic-state-YenBAkdY.js";import{A as ae,n as Z,z as S,c as F,h as z,B as de,bW as ya,a2 as Ie,k as V,y as q,p as tn,aq as xa,af as Ue,d as R,bX as Ca,at as Se,bY as wa,x as ue,bZ as ka,f as be,aN as G,b_ as Aa,W as Da,Z as on,ac as Ia,b$ as ze,c0 as Sa,r as ce,c1 as ba,c2 as Ea,c3 as va,a9 as Pa,o as ja}from"./index-BCP41PwF.js";import{n as M,D as J,S as Q}from"./mui-CdvNR06J.js";import ie from"./NotFoundScreen-C0-Skng9.js";import{S as Me}from"./SetupPagesScreen-Bi9C_-FR.js";import{F as sn}from"./FeaturePreviewScreen-4ttP8nOi.js";import{a as d}from"./sentry-DQGl2YSn.js";import{M as pe}from"./MobileAppDrawer-Biso_61t.js";import{A as Ta,D as Oa,V as Ba}from"./DomesticWireDetailScreen-By9DmOyv.js";import{A as Fa}from"./AddressScreen-t45pXVvS.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{Z as Ra}from"./ZeniAccountStatementScreen-CgW4jBMr.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./analyticsHelper-tq4PT7c_.js";import"./routePaths-jIme_4o7.js";import"./BusinessVerificationPageScreen-DRR9km69.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]="ac56149e-90e4-4fdb-a3e9-a30bae12e1be",e._sentryDebugIdIdentifier="sentry-dbid-ac56149e-90e4-4fdb-a3e9-a30bae12e1be")}catch{}})();const La=M.div`
1
+ import{j as n}from"./liveblocks-BiGkkGoP.js";import{h as ne,g as W,u as _,i as K,j as k,n as Y,N as X,o as Ve,p as w}from"./core-DYij5xsh.js";import{eQ as U,OG as Ce,OH as $e,cl as ee,cm as Ze,fh as Ne,wY as we,B9 as He,wS as Tn,OI as On,OJ as Bn,wV as Fn,x0 as fe,wP as Rn,wM as Ln,Ns as le,OK as Un,Et as zn,Ky as Mn,Ev as _n,ko as Oe,OL as Vn,qp as Ge,qd as We,kf as Ke,ki as Be,Kz as Fe,KA as $n,OM as Zn,kh as Nn,kE as Hn,k6 as Gn,iF as Wn,iE as Kn,ON as Yn,OO as ye,Ea as qn,OP as Jn,OQ as Qn,Nl as ke,OR as Re,OS as Xn,EG as ea,O4 as na,C3 as Ye,sS as qe,OT as aa,ED as ta,OU as Je,cM as Ae,EK as Qe,fi as oa,eZ as Xe,e$ as De,EI as sa,BZ as ra,EA as ia,OV as en,OW as nn,Ec as an,Em as Le,OX as ca,NU as la,EL as da,bt as ua,bF as pa,cx as ma,bG as ha,bs as ga,Jt as fa}from"./zeni-epic-state-YenBAkdY.js";import{A as ae,n as Z,z as S,c as F,h as z,B as de,bW as ya,a2 as Ie,k as V,y as q,p as tn,aq as xa,af as Ue,d as R,bX as Ca,at as Se,bY as wa,x as ue,bZ as ka,f as be,aN as G,b_ as Aa,W as Da,Z as on,ac as Ia,b$ as ze,c0 as Sa,r as ce,c1 as ba,c2 as Ea,c3 as va,a9 as Pa,o as ja}from"./index-CPHDDMJD.js";import{n as M,D as J,S as Q}from"./mui-CdvNR06J.js";import ie from"./NotFoundScreen-CgebWRjN.js";import{S as Me}from"./SetupPagesScreen-DE1Mdjhy.js";import{F as sn}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{a as d}from"./sentry-DQGl2YSn.js";import{M as pe}from"./MobileAppDrawer-BmawIQiO.js";import{A as Ta,D as Oa,V as Ba}from"./DomesticWireDetailScreen-DBmeU2Lc.js";import{A as Fa}from"./AddressScreen-qDs8FTIM.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{Z as Ra}from"./ZeniAccountStatementScreen-CSKHvFWp.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./analyticsHelper-BjBUUOIH.js";import"./routePaths-BZSOS5PJ.js";import"./BusinessVerificationPageScreen-DmTGb48M.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]="ac56149e-90e4-4fdb-a3e9-a30bae12e1be",e._sentryDebugIdIdentifier="sentry-dbid-ac56149e-90e4-4fdb-a3e9-a30bae12e1be")}catch{}})();const La=M.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-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{h as x,u as j,g as B,i as $,j as p}from"./core-DYij5xsh.js";import{IJ as s,II as v,OY as C,eQ as T,OZ as z}from"./zeni-epic-state-YenBAkdY.js";import{k as D,at as g,h as E,z as L,B as P,c4 as N,p as U}from"./index-BCP41PwF.js";import{n as _}from"./mui-CdvNR06J.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]="25cb0a3b-7438-4ad5-aba1-84db8d8d474f",e._sentryDebugIdIdentifier="sentry-dbid-25cb0a3b-7438-4ad5-aba1-84db8d8d474f")}catch{}})();const G=_.div`
1
+ import{j as i}from"./liveblocks-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{h as x,u as j,g as B,i as $,j as p}from"./core-DYij5xsh.js";import{IJ as s,II as v,OY as C,eQ as T,OZ as z}from"./zeni-epic-state-YenBAkdY.js";import{k as D,at as g,h as E,z as L,B as P,c4 as N,p as U}from"./index-CPHDDMJD.js";import{n as _}from"./mui-CdvNR06J.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]="25cb0a3b-7438-4ad5-aba1-84db8d8d474f",e._sentryDebugIdIdentifier="sentry-dbid-25cb0a3b-7438-4ad5-aba1-84db8d8d474f")}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,JE as _,JF as d}from"./zeni-epic-state-YenBAkdY.js";import{d as u}from"./index-BCP41PwF.js";import"./sentry-DQGl2YSn.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]="4f66d56c-14f3-451e-81aa-39cfd5fbe0ce",e._sentryDebugIdIdentifier="sentry-dbid-4f66d56c-14f3-451e-81aa-39cfd5fbe0ce")}catch{}})();const h=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"}},b=(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,b as f,g,h as t};
1
+ import{cH as m,cI as l,JE as _,JF as d}from"./zeni-epic-state-YenBAkdY.js";import{d as u}from"./index-CPHDDMJD.js";import"./sentry-DQGl2YSn.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]="4f66d56c-14f3-451e-81aa-39cfd5fbe0ce",e._sentryDebugIdIdentifier="sentry-dbid-4f66d56c-14f3-451e-81aa-39cfd5fbe0ce")}catch{}})();const h=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"}},b=(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,b as f,g,h as t};
@@ -1 +1 @@
1
- import{j as n}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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-CPHDDMJD.js";import"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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};