@zeniai/web-app-ui 5.1.45-dev → 5.1.47-dev

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 (145) hide show
  1. package/dist/assets/AddressRoutes-CZCF3Ed7.js +1 -0
  2. package/dist/assets/AddressScreen-DVPbua-7.js +9 -0
  3. package/dist/assets/AiCfoScreen-CquZXfRI.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-Bsqa7UIt.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DzxfBsX4.js → BillPayRoutes-DrhDRZTP.js} +33 -33
  6. package/dist/assets/BusinessVerificationPageScreen-BVkfBtGX.js +9 -0
  7. package/dist/assets/ChargeCardRoutes-DJ3TgdzU.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-DNxF2lkY.js → CompanyPassportScreen-Bd9dcAEb.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-DtUVl4gJ.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-y2T_jVxs.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-_VvrC-ga.js → CustomerOnboardingRoutes-D0TFB5es.js} +5 -5
  12. package/dist/assets/{DashboardRoutes-Dovp7HGT.js → DashboardRoutes-AglkqdZb.js} +4 -4
  13. package/dist/assets/DefaultTenantHome-D0gpxBnQ.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-hVPTa7zl.js +18 -0
  15. package/dist/assets/DrawerScreen-Dcd16rrd.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Be1JmzWy.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-DQU2nPFS.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-nQP4PBuN.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-CJZCnYYo.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-DmvvOL_Y.js → MagicLinkRoutes-C-x0DqRV.js} +10 -10
  21. package/dist/assets/MagicLinkSignInScreen-BJYa-6dE.js +12 -0
  22. package/dist/assets/MobileAppDrawer-MkL6Ri_E.js +1 -0
  23. package/dist/assets/NotFoundScreen-B1j26TaW.js +1 -0
  24. package/dist/assets/NotificationRoutes-CTsePQJL.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-Bf7Rz5GL.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-BYdB78V0.js +1 -0
  27. package/dist/assets/PeopleRoutes-D04-zoLL.js +22 -0
  28. package/dist/assets/PerformanceRoutes-qo5w7ss8.js +1 -0
  29. package/dist/assets/{Preview-B1kObDl3.js → Preview-evpWpYgT.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-Bn0720kQ.js → QBOConnectionScreen-DjJePSxH.js} +1 -1
  31. package/dist/assets/ReferralListScreen-BVRl8Eqw.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-C0W7Zcf-.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B-QO8l6D.js → ReimbursementApprovalRuleDetailScreen-D_U8RiI7.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-C_8B-Cx9.js → ReimbursementRoutes-DkEf0a2t.js} +9 -9
  35. package/dist/assets/ReportsRoutes-DVYYxF0q.js +1 -0
  36. package/dist/assets/RewardsRoutes-D1Dw_YCi.js +1 -0
  37. package/dist/assets/ScreenRoutes-DL6N-VWP.js +2 -0
  38. package/dist/assets/{SettingsRoutes-D8sH0k-9.js → SettingsRoutes-BTd0zpvV.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-CyzzOWiJ.js → SetupPagesScreen-Bsr5a1pQ.js} +5 -5
  40. package/dist/assets/SignInScreen-D29YArRQ.js +1 -0
  41. package/dist/assets/SignOutScreen-CkM8N7kI.js +9 -0
  42. package/dist/assets/TaskListScreen-QBxj3x6l.js +9 -0
  43. package/dist/assets/TaskRoutes-CbCeuDZl.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-B8Gwc4cc.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-BZ1U45_F.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-BhOdNCNy.js → TransactionListRoutes-mnxKDjQ_.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-BQN9aD4y.js → TreasuryRoutes-Dk7L5dYO.js} +6 -6
  48. package/dist/assets/VendorsRoutes-Brv3hCD7.js +112 -0
  49. package/dist/assets/WiseConfirmationScreen-1oJ6ZH1s.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-CaJgy_QF.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-Coj3gUoh.js +9 -0
  52. package/dist/assets/{accountMappingHelper-Bg3QrS2B.js → accountMappingHelper-BrnyZK4h.js} +1 -1
  53. package/dist/assets/{analytics-CR-Ji6KN.js → analytics-BoOSk_FS.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BkTwMm2V.js → analyticsHelper-BEsUC0Tf.js} +1 -1
  55. package/dist/assets/{core-B1V19BTM.js → core-4srnP2ry.js} +2 -2
  56. package/dist/assets/{decodeURIComponentSafe-62zSMNJP.js → decodeURIComponentSafe-CVdrGRir.js} +1 -1
  57. package/dist/assets/{dnd-DY5CyMCW.js → dnd-CUjyBBrM.js} +1 -1
  58. package/dist/assets/{empty-DJY9ZnQE.js → empty-BLi0L7W4.js} +1 -1
  59. package/dist/assets/empty-Djhp5I5N.js +1 -0
  60. package/dist/assets/{emptyVideoElement-DyEXr5u4.js → emptyVideoElement-CHvCCbcl.js} +1 -1
  61. package/dist/assets/epic-CAI4UhoR.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BNybPRoM.js +1 -0
  63. package/dist/assets/index-65j4ugfY.js +1 -0
  64. package/dist/assets/{index-B32kgZ2L.js → index-B6rVBPLj.js} +1 -1
  65. package/dist/assets/{empty-BKpizSQk.js → index-BJV7t3Ln.js} +1 -1
  66. package/dist/assets/{index-B1BV6O_s.js → index-C7Pw0HtV.js} +15803 -18137
  67. package/dist/assets/{index-BWk0p_4u.js → index-CSlCNnzL.js} +1 -1
  68. package/dist/assets/{index-Rl-vwFod.js → index-Cd6KSZfb.js} +1 -1
  69. package/dist/assets/{index-CUT1Jf2m.js → index-D2Vz8Hnp.js} +2 -2
  70. package/dist/assets/{index-jGxvchTd.js → index-DF8zTrCI.js} +1 -1
  71. package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
  72. package/dist/assets/{lexical-DtEMPKph.js → lexical-B1-kkGoh.js} +1 -1
  73. package/dist/assets/{liveblocks-DtJmjn-F.js → liveblocks-FvHIfhey.js} +1 -1
  74. package/dist/assets/{lottie-PNrYlsmY.js → lottie-jiJBGHVV.js} +1 -1
  75. package/dist/assets/{mui-D6ES9V4N.js → mui-BM0jIy5o.js} +1 -1
  76. package/dist/assets/{pathToGoBack-BkwIN_c3.js → pathToGoBack-De4TIG3J.js} +1 -1
  77. package/dist/assets/{pdf-lib-D3JDQVpu.js → pdf-lib-D9nBH3t7.js} +1 -1
  78. package/dist/assets/{pdf-C3786_Gz.js → pdf-whYpMQAC.js} +4 -4
  79. package/dist/assets/{plaid-Cvs9FZAe.js → plaid-mry1J-xa.js} +1 -1
  80. package/dist/assets/{pusher-DQiFD9Ci.js → pusher-DhA-kRSw.js} +1 -1
  81. package/dist/assets/{react-DkNWIPJu.js → react-6uxZfi85.js} +1 -1
  82. package/dist/assets/{react-ZHmjCTUq.js → react-BSvTOr35.js} +1 -1
  83. package/dist/assets/{react-BQWMbpQu.js → react-BmGLt_sB.js} +1 -1
  84. package/dist/assets/{react-nBgf2eOj.js → react-CGiQlkN0.js} +1 -1
  85. package/dist/assets/{react-nsy5XQiM.js → react-Dx6ccGzO.js} +1 -1
  86. package/dist/assets/{react-CTxsS9D9.js → react-ego9yzv1.js} +1 -1
  87. package/dist/assets/{recharts-C_sYuD8f.js → recharts-DVgLcWbN.js} +1 -1
  88. package/dist/assets/{routePaths-BaN0YLzj.js → routePaths-DTTWQHJ_.js} +1 -1
  89. package/dist/assets/{sentry-DJoVhts9.js → sentry-BGmWGtx4.js} +1 -1
  90. package/dist/assets/{url-CZfStJg6.js → url-BrqJU0tJ.js} +1 -1
  91. package/dist/assets/{url-Dh3D7a-t.js → url-BrtamPmb.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B-gQ2ZCu.js → useAiCfoDashboardSuggestedQuestionsChips-DQgVgxsR.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-CHKiu4ka.js +1 -0
  94. package/dist/assets/{useDeviceId-zuDOu7ni.js → useDeviceId-BCg9_rD9.js} +1 -1
  95. package/dist/assets/useInitialThreadRequest-H-0PGnfZ.js +1 -0
  96. package/dist/assets/{utils-B1ItiyXC.js → utils-BQpFY40P.js} +2 -2
  97. package/dist/assets/{withTransactionSidePanel-CUAVvG-3.js → withTransactionSidePanel-Cg2hWd8r.js} +4 -4
  98. package/dist/assets/{zeni-epic-state-Ct7fOB-u.js → zeni-epic-state-Cicf7kze.js} +6 -6
  99. package/dist/index.html +1 -1
  100. package/package.json +4 -4
  101. package/dist/assets/AddressRoutes-CMaX3PoD.js +0 -1
  102. package/dist/assets/AddressScreen-C3jTD0QX.js +0 -9
  103. package/dist/assets/AiCfoScreen-BtMMWn6B.js +0 -22
  104. package/dist/assets/BillPayApprovalRoutes-DU855VPd.js +0 -1
  105. package/dist/assets/BusinessVerificationPageScreen-BiME3gzl.js +0 -9
  106. package/dist/assets/CardsAiCfoScreen-Dk4_VP17.js +0 -14
  107. package/dist/assets/ChargeCardRoutes-BozcfSlm.js +0 -71
  108. package/dist/assets/ConnectionAuthScreen-DXqmojb9.js +0 -11
  109. package/dist/assets/CustomerOnboardingAuthScreen-B-ksGe-B.js +0 -1
  110. package/dist/assets/DefaultTenantHome-D8-0czPn.js +0 -1
  111. package/dist/assets/DomesticWireDetailScreen-D62ComgW.js +0 -18
  112. package/dist/assets/DrawerScreen-Bzib8YfV.js +0 -1
  113. package/dist/assets/EntityDetailRoutes-BJQoxnJC.js +0 -1
  114. package/dist/assets/ExpenseAutomationRoutes-BEvk-l6F.js +0 -25
  115. package/dist/assets/FeaturePreviewScreen-KfiUQgFU.js +0 -1
  116. package/dist/assets/HubSpotOAuthCallbackScreen-Cn6vvoeb.js +0 -1
  117. package/dist/assets/MagicLinkSignInScreen-BTFCnths.js +0 -12
  118. package/dist/assets/MobileAppDrawer-DY_LJNf1.js +0 -1
  119. package/dist/assets/NotFoundScreen-98Ef_Sqs.js +0 -1
  120. package/dist/assets/NotificationRoutes-BkpJw4hc.js +0 -1
  121. package/dist/assets/OAuthConsentScreen-GPiaPY5A.js +0 -1
  122. package/dist/assets/PandLWithForecastRoutes-DE9xTiJG.js +0 -1
  123. package/dist/assets/PeopleRoutes--3fASQ5h.js +0 -22
  124. package/dist/assets/PerformanceRoutes-zr7-gR8p.js +0 -1
  125. package/dist/assets/ReferralListScreen-B9-Pm2jb.js +0 -5
  126. package/dist/assets/ReimbursementApprovalRoutes-DgN-DZyX.js +0 -1
  127. package/dist/assets/ReportsRoutes-3IlP_YGU.js +0 -1
  128. package/dist/assets/RewardsRoutes-Bn0Tad-r.js +0 -1
  129. package/dist/assets/ScreenRoutes-BZhSovog.js +0 -2
  130. package/dist/assets/SignInScreen-B7g5AeOc.js +0 -1
  131. package/dist/assets/SignOutScreen-Kk_O7nh6.js +0 -9
  132. package/dist/assets/TaskListScreen-VdSyXs6p.js +0 -9
  133. package/dist/assets/TaskRoutes-BEWp0wJa.js +0 -9
  134. package/dist/assets/TransactionDetailRoutes-DZjZQ9RI.js +0 -1
  135. package/dist/assets/TransactionDetailScreen-idWMKJZo.js +0 -5
  136. package/dist/assets/VendorsRoutes-CavsRr3z.js +0 -112
  137. package/dist/assets/WiseConfirmationScreen-Donx26qC.js +0 -12
  138. package/dist/assets/ZeniAccountRoutes-CYGjvO6a.js +0 -57
  139. package/dist/assets/ZeniAccountStatementScreen-BBbz4J4l.js +0 -9
  140. package/dist/assets/epic-BoLhMkLB.js +0 -2
  141. package/dist/assets/getLocaleForTenant-BaJta4jx.js +0 -1
  142. package/dist/assets/index-C1O76jd1.js +0 -1
  143. package/dist/assets/index-Cd64f4Pj.js +0 -1
  144. package/dist/assets/useAskAiCfoHostNavButtonProps-B1ysHqFw.js +0 -1
  145. package/dist/assets/useInitialThreadRequest-BrZkGF4L.js +0 -1
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-DtJmjn-F.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-B1V19BTM.js";import{P6 as k,Pd as J,gc as M,gb as W,ga as q,jm as K,Mf as L,rm as Q,eT as V,OE as D,jk as T,P7 as S,Pg as F,ji as j,jF as G}from"./zeni-epic-state-Ct7fOB-u.js";import{bw as X,J as R,a as N,z as U,m as O,p,d as v,B as Z,bx as Y,o as z,by as ee,n as te}from"./index-B1BV6O_s.js";import{n as H}from"./mui-D6ES9V4N.js";import"./sentry-DJoVhts9.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]="7f9396b2-2112-44ea-b8f1-c8d50f72233f",e._sentryDebugIdIdentifier="sentry-dbid-7f9396b2-2112-44ea-b8f1-c8d50f72233f")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(W(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(M(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(J(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(j(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??A();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??A(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=N(),c=U.getSignedInUser(),b=h(u=>V(u)),g=O(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const A=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},$=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return $(e,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ie=P(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(G(r))},onSaveHandler:r=>{e(j(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(F({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??E();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=N(),b=O(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-DtJmjn-F.js";import{J as l,D as f,m as c}from"./index-B1BV6O_s.js";import{D as p}from"./mui-D6ES9V4N.js";import"./sentry-DJoVhts9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="f80a1875-1e31-48de-8a1f-266d8b89633c",e._sentryDebugIdIdentifier="sentry-dbid-f80a1875-1e31-48de-8a1f-266d8b89633c")}catch{}})();const u={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{m as D};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DtJmjn-F.js";import{a as d}from"./sentry-DJoVhts9.js";import{h as A,u as B,g as G,i as N,j as l,N as q,n as F,o as O,p as R}from"./core-B1V19BTM.js";import{Nm as _,eT as J,ML as W,lp as Y,Jo as k,Nr as $,Me as z,kp as L,Jp as S,MQ as Q,MR as V,Mg as H,Mf as K}from"./zeni-epic-state-Ct7fOB-u.js";import{aS as U,e as X,p as Z,n as tt}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{d as b}from"./decodeURIComponentSafe-62zSMNJP.js";import{w as et}from"./withTransactionSidePanel-CUAVvG-3.js";import{f as at,c as nt}from"./routePaths-BaN0YLzj.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import"./TransactionDetailScreen-idWMKJZo.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="2caeaa62-6f33-4c8b-8ab5-98a7b91afa6e",a._sentryDebugIdIdentifier="sentry-dbid-2caeaa62-6f33-4c8b-8ab5-98a7b91afa6e")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:L(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(K("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Q()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=N(),r=b(w??""),p=b(x??""),f=rt(r,p),M=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),j=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>W(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(M.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(O,{children:s.jsx(R,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,25 +0,0 @@
1
- import{j as h}from"./liveblocks-DtJmjn-F.js";import aa from"./NotFoundScreen-98Ef_Sqs.js";import{a as o,b as Yt}from"./sentry-DJoVhts9.js";import{n as Ue,S as oa}from"./mui-D6ES9V4N.js";import{u as pe,h as Jt,g as Qe,j as x,n as sa,i as xt,o as ca,p as Ge}from"./core-B1V19BTM.js";import{eT as Re,S5 as ia,oc as ke,fv as la,rZ as ra,ou as Qt,oP as Kt,S6 as Zt,oZ as da,S7 as Ht,on as ua,rv as ma,ff as Ie,S8 as De,tX as Wt,DL as Xt,S9 as en,Sa as pa,r3 as Ke,Nn as Pt,Np as ha,ks as Sa,Nq as ga,kz as Ca,cW as fa,v7 as Ze,oA as tn,p2 as Fe,os as le,Sb as Ia,Mg as Rt,Mf as we,Sc as Dt,kQ as ka,Sd as Ea,Se as ya,Sf as ba,Sg as va,oH as Ta,p5 as xe,Sh as Aa,Si as wa,Sj as xa,pc as Pa,kD as Ra,ku as Da,Sk as Fa,kC as Ft,Nx as Ua,Sl as Ba,Sm as Va,q$ as _a,qD as za,p3 as me,qC as Ne,Sn as Oa,So as Ma,Sp as ja,m7 as La,bq as $a,m2 as Ut,lQ as qa,Sq as Ga,hC as Bt,gs as Na,l$ as Ya,x0 as Ja,Sr as Qa,pD as Ka,py as Za,pC as Ha,pn as Wa,Ss as Xa,fi as nn,oS as eo,oD as to,fw as Vt,p7 as no,St as ao,Su as oo,p4 as an,Sv as so,Sw as co,Sx as io,Sy as lo,Sz as _t,rb as ro,qu as uo,Me as mo,SA as po,SB as ho,kB as So,SC as go,Ip as Co,kA as fo,kp as Io,fh as ko,q0 as on,qm as Eo,p1 as zt,p6 as yo,bE as bo,lY as vo,lV as To,SD as Ao,pm as Ot,qi as Mt,qg as wo,SE as xo,q5 as Po,pN as Ro,qj as Do,SF as Fo,SG as Uo,pR as Bo,SH as Vo,pI as _o,pQ as zo,pO as Oo,qp as Mo}from"./zeni-epic-state-Ct7fOB-u.js";import{a as sn,d as ne,e as q,n as te,X as cn,_ as ln,cQ as jo,z as Be,cR as Lo,at as Pe,cS as $o,aU as jt,B as rn,cT as qo,aq as Ye,O as Go,a7 as No,cU as Yo,a2 as Jo,cV as Qo,V as Ko,cW as Zo,cX as Ho,s as Wo,A as Xo,aN as es,cY as ts,cZ as ns,b9 as as,D as os,aQ as ss}from"./index-B1BV6O_s.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{f as Lt,a as cs,b as is,g as ls,C as rs}from"./TransactionDetailScreen-idWMKJZo.js";import{w as ds}from"./withTransactionSidePanel-CUAVvG-3.js";import{h as us,v as ms}from"./routePaths-BaN0YLzj.js";import{g as Je}from"./accountMappingHelper-Bg3QrS2B.js";import{D as ps}from"./DrawerScreen-Bzib8YfV.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./decodeURIComponentSafe-62zSMNJP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="e4c5451f-be6a-4e75-bdd6-ce52f1af90e9",t._sentryDebugIdIdentifier="sentry-dbid-e4c5451f-be6a-4e75-bdd6-ce52f1af90e9")}catch{}})();const hs=()=>{const t=pe(),l=Jt(),B=Qe(),f=x(d=>Re(d)),{useFeatureGate:v}=sn(),{isFeatureEnabled:C}=v(ne.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=v(ne.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>ia(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,G,X=!1)=>{t(ke({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:X}))},[]),T=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(la(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(S,f.tenantId,!0)},[E,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=te(B.state?.pathnameStackToGoBack,B.pathname),k=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&E(S,f.tenantId)},[E,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(ra(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Ss,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:T,handleReviewButtonClick:k,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Ss=Ue.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
8
- `,gs=Yt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:v})=>{const C=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:E,statementUploadChosen:T}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{C(ma(e,n.split(".")[0]))},k=e=>{m!=null&&C(ua({accountId:l,selectedPeriod:E,fileId:e,statementUploadId:m}))},y=()=>{C(Zt({statementUploadChosen:!1}))},d=e=>{C(da({accountId:l,selectedPeriod:E,payload:e}))},G=e=>{C(Ht({accountId:l,selectedPeriod:E,localData:{accountSource:e}}))},X=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),O=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),_=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(Lo,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:E,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:v,onEditFileName:P,onDeleteFile:k,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:T,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:X})})}):_!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:O})})}):null}),$t=Ue.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,qt=Ue.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: auto;
21
- `;function Cs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const v=Be.getSignedInUser();if(v==null)throw Error("Can't access Customer Request page without signing in...");const C=x(r=>pa(r,t,v));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(qo,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const fs=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Is,comma:Gt,space:ks}},dateFormat:pn}=Go.getLocalizedStrings(),Nt=Mo,Es=sa(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:v,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,E={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},T=Ie(t),{selectedTransactionCategorizationTab:S}=T;return{expenseAutomationViewSelector:T,bulkUploadSelector:I===!0?T.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:E,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Jo}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:v,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:v,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:E,navigate:T,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:k,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,X=tn(k),O=Fe(X.start),_=Fe(X.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(k.month,k.year),t(uo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(_t(e,n,{fetchState:"In-Progress"}));const A=()=>t(_t(e,n,{fetchState:"Error"}));Qo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(V=>{V!=null?t(ro(e,V)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=te(I.state?.pathnameStackToGoBack,I.pathname);T(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(lo(e,n)),u!=null&&t(ke({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(io(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Is+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(co(e))},onUpdateMissingReceiptsUIState:e=>{t(so(e))},onFetchMissingReceiptsList:()=>{_!=null&&O!=null&&t(an({start:O,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Oo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(_o({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(Bo(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Uo())},onSetBulkUploadResultsTab:e=>{t(Fo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Do(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ro())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Po(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(xo())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(wo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(oo())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),_!=null&&O!=null&&t(me(c,{start:O,end:_},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(ao({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(no(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0})),T("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(to(e))},onSaveReconciliationReview:e=>{t(eo(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=te(I.state?.pathnameStackToGoBack,I.pathname);T(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=te(I.state?.pathnameStackToGoBack,I.pathname);T("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Je(G.prepaidExpensesAccountList,c.selectedOptions),A=Je(G.fixedAssetsAccountList,i.selectedOptions),V=Je(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:V.map(D=>D.accountId)};t(Xa({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Wa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:V,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(Y=>Y.id===A?.selectedOption):void 0,ae={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(Y=>Y.value===A?.selectedOption)?.label??"",logo:j?.logo},oe=g?.selectedOption!=null?V.find(Y=>Y.qboId===g.selectedOption):void 0,Ve=b?.selectedOption!=null?R.find(Y=>Y.classId===b.selectedOption):void 0,_e=i?.selectedOption!=null?D.find(Y=>Y.qboId===i.selectedOption):void 0;t(Ha({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:oe?.accountId,updatedClassId:Ve?.classId,updatedAccumulatedDepreciationCategoryID:_e?.accountId,updatedVendor:{id:ae.id,name:ae.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Za(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ja({selectedJEScheduleKey:n}));const i=te(I.state?.pathnameStackToGoBack,I.pathname);T(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Na())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ga(e))},onUpdateFileAttachment:e=>{t(qa({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t(La(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,$a().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=te(I.state?.pathnameStackToGoBack,I.pathname);T(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,V,R,D,j,ae,oe)=>{t(ja(e,n,c,i,E,b,g,A,V,R,D,j,ae,oe))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&O!=null&&(t(me(e,{start:O,end:_},!1,!1)),t(Ma(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),_!=null&&O!=null&&(t(Oa(e)),t(me("autoCategorized",{start:O,end:_},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),_!=null&&O!=null&&t(me(e,{start:O,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{_!=null&&O!=null&&t(me(e,{start:O,end:_},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,V)=>{t(za(e,n,c,i,V??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:E,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(k.month,k.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(k.month,k.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(_a(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:V,transaction:R,lineIds:D}=n;g!=null&&t(Ua({transactionId:V,customerUpdates:g})),t(Ba({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:E,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(Ze({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:v,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:V,transaction:R,lineIds:D}=n;g!=null&&(t(Ra({transactionId:V,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Da({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:E,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(Ze({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:v,isUncategorizedExpenseCategoryEnabled:A}))):t(Fa({selectedTab:i,transactionId:V.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(k,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Pa(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(xa(e))},updateOperatingExpensesIdsForReview:e=>{t(wa({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ms(e.id,e.qboId,l.tenantEmailDomain),c=te(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Aa({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(le(k,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Zt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(le(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Ta({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(Ea({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ke("bill"));const n=te(I.state?.pathnameStackToGoBack,I.pathname);T(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{T(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ia({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Qt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Kt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(le(k,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...v}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,E,T)=>{r.onUploadTransactionReceipt(s,p,u,E,T,C.authParams)}}}(t,l,v)})(No(Yo)),ys=ds(function(t){const l=t.displayName??t.name??"Component",B=Yt.memo(t),f=v=>{const C=pe(),r=function(){const P=pe(),k=x(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:k!=null,selectedAccountId:k,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,k)=>{C(Wt("expense_automation_reconcile",P,k))},[C]),u=o.useCallback((P,k)=>{const y=s?.companyId;y!=null&&(C(Xt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",k)),C(en({accountId:k,connectionInProgress:!0})))},[C,s?.companyId]),E=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(gs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),T=o.useMemo(()=>({reconPanelContent:E,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[E,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...v,...T})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:v,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Ko(),u=Zo(),{isOpen:E}=Ho(),T=Jt(),S=Qe(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:k}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{v===!0&&f!==!0&&t?.()},[t,v,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Qe(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,H=Ye($),J=Ye(L.fetchState),Z=o.useCallback(N=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,fs(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,W??null)},[w,a]);return o.useEffect(()=>{J===L.fetchState&&$===H||L.fetchState!=="Completed"||Z(!1)},[$,L.fetchState,H]),Z})(),X=Wo(),[O,_]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,V]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),ae=R?.contentType==="activity"?R.detail.transactionId:void 0,oe=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),Ve=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),_e=o.useCallback(()=>{u(),j(),y(),k()},[y,j,k,u]),Y=o.useRef(s);o.useEffect(()=>{s===!0&&Y.current===!1&&(u(),j(),y()),Y.current=s},[y,j,s,u]);const He=o.useRef(E);o.useEffect(()=>{E===!0&&He.current===!1&&(s&&p(!1),j(),v===!0&&f!==!0&&t?.()),He.current=E},[j,t,E,s,p,f,v]);const Ee=v===!0&&f!==!0,We=o.useRef(Ee);o.useEffect(()=>{Ee&&!We.current&&(s&&p(!1),u(),j()),We.current=Ee},[j,s,Ee,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:Sn}=xt(),[ze,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=Xo(),Oe=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:re}=sn(),{configValue:fn}=Cn(es.enableUncategorizedExpenseCategory),ee=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=re(ne.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=re(ne.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=re(ne.isTransactionActivityEnabled),{isFeatureEnabled:st}=re(ne.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=re(ne.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:kn}=re(ne.isProjectsTransactionsEnabled),En=o.useCallback(a=>{const U=Ke(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),yn=x(a=>mo(a,"common")),M=x(a=>Ie(a)),{categoryOptions:bn,paymentAccountNames:vn}=x(a=>po(a.accountState)),Tn=x(a=>ho(a.classState)),{monthEndCloseChecksView:K,currentSelectedView:F,selectedPeriod:z,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:An,currentSelectedViewFetchState:se,jeSchedules:Le,reconciliation:wn}=M;cs(F==="transaction_categorization");const xn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const de=is(xn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const J=H?.transactionReviewLocalData?.lineItemById;if(J!=null)for(const Z of Object.values(J)){const N=Z?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const H of w)for(const J of H.lines??[])"account"in J&&J.account?.accountId!=null&&a.push(J.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&v!==!0||oe(void 0)},[F,oe,v]);const Pn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Pn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Rn=x(a=>ae==null?void 0:So(a.transactionState,ae)),ce=Rn?.qboId,mt=x(a=>ce==null?void 0:go(a,ce));o.useEffect(()=>{ce!=null&&m(Co(ce))},[m,ce]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>ls(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ts,{activityLogView:mt,qboId:ce,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(ns,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,ce,pt,ht,St,gt]),Dn=Ct!=null,{selectedAccountId:Se}=wn,ft=Ye(Le.accountSettingsView.saveState.fetchState),Fn=x(a=>fo(a.accountState,a.accountListState,"accountList")),Un=x(a=>Io(a)),ge=tt!=null?ko(tt):F,Bn=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:se.fetchState==="Completed"}),Oe==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(z),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${z}`);const Vn=o.useCallback(()=>{i(!1)},[]),_n=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{V(a),g(!1)},[]),On=o.useCallback(()=>{V([])},[]),ve=M.missingReceipts.bulkUpload.phase,kt=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&ve==="matching"&&kt!=null&&m(on({cacheOverride:!0}))},[he,F,ve,kt,m]);const Et=Oe?.userId,Mn=z.month,jn=z.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&ve==="idle"&&Et!=null&&yt!=null&&m(Eo())},[F,he,ve,Et,yt,Mn,jn,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||se.fetchState!=="Completed"&&se.fetchState!=="Error"||!d||(hn(!0),m(zt(!1,!1,ee)))},[Xe,se,d,ee]),o.useEffect(()=>{!at&&d&&(m(zt(!1,!1,ee)),m(le(z,Se,!1,!1)))},[z.month,z.year,d,ee]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!ze,void 0,void 0,U,void 0,ee)),nt(!1);break;case"flux_analysis":m(xe(z,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(z.year,z.month,0),w=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(To(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(le(z,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,z,Se,ze,nt,ee]);o.useEffect(()=>{F===ge&&se.fetchState==="Not-Started"&&d&&bt(!0)},[se,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||ze||et.current||An.fetchState==="In-Progress"||se.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&m(ke({tenantId:n.tenantId,period:z,refreshViewInBackground:!1}))},[K.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(ke({tenantId:n.tenantId,period:z,refreshViewInBackground:!0})),m(Ao({companyId:n.companyId})),T("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,z,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&m(ke({tenantId:n.tenantId,period:z,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[K.fetchState,n.tenantId,z,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(le(z,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,le,Se,z]);const Ln=Lt();o.useEffect(()=>{const a=(K.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&K.monthEndCloseChecks?.reportEmailSentDate==null||T("../")},[F,K.monthEndCloseChecks]);const $n=r===!0?C:B,qn=r===!0||v===!0,Gn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(Ot())},[ft,Le.accountSettingsView.saveState.fetchState,Ot]);const{transactionId:vt,onSaveVendor:Nn,onSaveSuccess:Yn,onCancel:Jn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,J,Z;const N=Lt(),W=a.transactionView;let Tt=()=>{};const{transactions:Zn,selectedTransactionId:ue,selectedTransactionLineId:Te,transactionLocalData:Hn}=W;if(L==="transaction_categorization"){const $e=Hn.find(ie=>ie.transactionId===ue),Q=Zn.find(ie=>ie.id===ue),At=Te!=null?$e?.transactionReviewLocalData?.lineItemById[Te]:void 0,wt=At?.account;J=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const Xn=us(ue,Q?.typeOfTransaction);Q!=null&&Xn&&(Z={id:ue,type:Ke(Q.typeOfTransaction)}),Tt=()=>{if(ue!=null&&Te!=null&&Q!=null){const ie=W.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(ie!=null&&Q.lines!=null&&Q.lines.length>0){const Ae=ie.lineItemById[Te];let qe=ie.selectedEntity;if(fa(Q)||(qe=Ae.selectedEntityLine),qe!=null){const ea=qe,ta={transactionId:{id:Q.id,type:Q.type},transaction:Q,lineIds:Q.lines.map(na=>na.id)??[]};w(Ze({entity:ea,amount:Ae.amount.amount,transactionDetails:ta,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Wn=x($e=>Pt($e,void 0,H,J));return{transactionId:Z,onSaveVendor:()=>{w(Ca(Z,void 0,!1,!0))},onSaveSuccess:Tt,onCancel:()=>{Z!=null&&w(ha({transactionId:Z})),w(Sa()),w(ga()),U()},vendorViewDetails:Wn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{_(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:ee}),Kn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?K.fetchState==="Error"?h.jsx(as,{onGoHome:()=>T("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(ps,{isOpen:b,drawerLeftMargin:new os(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(Cs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:On})})}),vt!=null&&O&&h.jsx(rs,{isOpen:O,transactionId:vt,onSaveVendor:Nn,onSaveSuccess:Yn,onCancel:Jn,vendorViewDetails:Qn}),h.jsx(Es,{...Kn,navigate:T,location:S,themeState:X,categoryOptions:bn,classesForFilters:Tn,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:Bn,entityAutoCompleteView:yn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:ee,isAccountingClassesEnabled:Un,isProjectsTransactionsEnabled:kn,isCOTEnabled:Ln,currentTenant:n,companyId:n.companyId,signedInUser:Oe,isTransactionActivityEnabled:Me,isRightPanelOpen:Dn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?Ve:void 0,uncategorizedAccounts:Fn,onClickCustomerRequest:_n,handleEditClick:Vn,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:oe,closeSidePanel:Gn,openTransactionPanel:l,sidePanelIsOpen:qn,sidePanelIsFullView:r!==!0&&f,panelContent:$n,isAiCfoAccessEnabled:P,onAskAiCfoClick:_e,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:En,sidePanelListPercent:r===!0?66:void 0}),de.showPopup&&de.popupType!=null&&h.jsx(ss,{popupType:de.popupType,currencySymbol:de.currencySymbol,onSubmit:de.handleSubmit,onDismiss:de.handleDismiss})]})})),bs=Ue(oa)`
22
- display: flex;
23
- min-height: 100%;
24
- flex-direction: column;
25
- `;function Js(){return h.jsxs(ca,{children:[h.jsx(Ge,{path:"*",element:h.jsx(hs,{})}),h.jsx(Ge,{path:"/:selectedTab/:selectedPeriod/*",element:h.jsx(ys,{})}),h.jsx(Ge,{path:"*",element:h.jsx(aa,{})})]})}export{Js as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DtJmjn-F.js";import{a as r}from"./sentry-DJoVhts9.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import c from"./NotFoundScreen-98Ef_Sqs.js";import{h as u,g as b}from"./core-B1V19BTM.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-DJoVhts9.js";import{u as f,h as l,g as m}from"./core-B1V19BTM.js";import{hk as p,Lu as b,Lv as g}from"./zeni-epic-state-Ct7fOB-u.js";import{u as _,L as h,z as y}from"./index-B1BV6O_s.js";import"./liveblocks-DtJmjn-F.js";import"./recharts-C_sYuD8f.js";import"./mui-D6ES9V4N.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="6aff55b9-d5b3-420c-9116-bf42be16a2ee",e._sentryDebugIdIdentifier="sentry-dbid-6aff55b9-d5b3-420c-9116-bf42be16a2ee")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-DtJmjn-F.js";import{a as g}from"./sentry-DJoVhts9.js";import{u as F,g as _,h as w,t as M,j as l,N as T}from"./core-B1V19BTM.js";import{z as r,m as P,O as V,f as A,e as N,g as R,q,R as W,h as $}from"./index-B1BV6O_s.js";import{eT as B,L8 as G,Li as H,L9 as J,f6 as K,fz as Q,Le as X,gj as Y,cU as Z,Lj as ee,Lk as te}from"./zeni-epic-state-Ct7fOB-u.js";import{n as ne}from"./mui-D6ES9V4N.js";import{u as ae}from"./useDeviceId-zuDOu7ni.js";import{f as se}from"./analyticsHelper-BkTwMm2V.js";import{t as ie}from"./getLocaleForTenant-BaJta4jx.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="aa8cbbe3-64f6-4ae7-87d0-58b0cba9ee26",t._sentryDebugIdIdentifier="sentry-dbid-aa8cbbe3-64f6-4ae7-87d0-58b0cba9ee26")}catch{}})();const z=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function ze(){const t=F(),s=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),b=l(e=>G(e)),j=r.getSignedInUser(),L=P().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&z(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),a.zeniSessionId),K(a.userId,a.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,L,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,y,a,o,b,L,s.state,t]);const E=g.useCallback(()=>{m("/signin/auth")},[m]),O=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),U=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(q,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:O,onVerifyOtp:U,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||j!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!z(n,p)||f==null||I==="Error"){const e=s.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- z-index: 9999;
11
- background-color: ${t=>t.theme.colors.background};
12
- `;export{ze as default};
@@ -1 +0,0 @@
1
- import{j as U}from"./liveblocks-DtJmjn-F.js";import{a as c}from"./sentry-DJoVhts9.js";import{u as pe,j as s,i as Ke,g as We,h as Je,l as M}from"./core-B1V19BTM.js";import{eT as he,fb as Qe,fc as Se,e_ as Xe,bn as ea,eS as aa,fd as ta,fe as na,fg as sa,fj as oa,fs as ia,fk as g,fm as ra,fn as ue,fq as da,fo as la,fp as ca,fr as ua,cK as fa,fu as ma,cP as ba,bt as pa,eZ as ha,fz as Sa,fA as ga,fy as Ea}from"./zeni-epic-state-Ct7fOB-u.js";import{a7 as ka,a8 as Ca,s as ya,a as Ia,z as k,v as Ta,u as wa,d as r,a9 as Aa,aa as _a,A as Fa,c as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,e as R,$ as Ra,n as A,ai as N,aj as Na}from"./index-B1BV6O_s.js";import{D as Ua}from"./mui-D6ES9V4N.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="3b390721-e2b5-4236-94b7-3e7742e2b3b9",f._sentryDebugIdIdentifier="sentry-dbid-3b390721-e2b5-4236-94b7-3e7742e2b3b9")}catch{}})();const Va=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ke(),a=We(),C=ya(),o=Je(),V=Xe(),m=pe(),{useFeatureGate:i}=Ia(),j=k.getSignedInUser(),_=ea(j),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,x=s(e=>aa(e)),O=x.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,Z),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),H=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:K}=i(r.isExpenseAutomationEnabledV2),W=K||q&&_,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),J=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=s(e=>la(e,S,h,K,q,w).fetchState),ie=s(e=>ca(e).fetchState),je=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ua(n.userRole),[n.userRole]),Oe=fa(xe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&H.fetchState==="Completed"&&ma(H.notificationSettings,h.userEmail,Z,n),re=Da(),Ye=re&&va(a),de=ba(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ze,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const He=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ba(He);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ga,{signedInUser:j,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:je,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:Oe,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:qe,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:W&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=J===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",O??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(O!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Za=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Za as M};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DtJmjn-F.js";import{h as r,n}from"./core-B1V19BTM.js";import{M as i}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import"./sentry-DJoVhts9.js";import"./zeni-epic-state-Ct7fOB-u.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="59e35ec1-38d4-48f4-8af2-c43da8d96945",o._sentryDebugIdIdentifier="sentry-dbid-59e35ec1-38d4-48f4-8af2-c43da8d96945")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +0,0 @@
1
- import{l as ct,a as dt,m as mt,j as E}from"./liveblocks-DtJmjn-F.js";import lt from"./NotFoundScreen-98Ef_Sqs.js";import{a as k}from"./sentry-DJoVhts9.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as J}from"./core-B1V19BTM.js";import{cs as St,fd as X,eT as H,fr as bt,fk as b,S0 as Q,fn as m,fc as y,sh as M,xD as It,S1 as Ct,fb as Tt,fu as yt,sm as _t,S2 as $,bq as F,hC as w,sq as K,S3 as At,cD as Et,cx as Nt}from"./zeni-epic-state-Ct7fOB-u.js";import{X as xt,z as Bt,a as wt,d as Dt,_ as Rt,cN as vt,n as N,a7 as Pt,cO as Ut,a8 as Gt,p as $t}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="39f4d9f2-87a1-41be-80dc-2c8f0dc3f54d",t._sentryDebugIdIdentifier="sentry-dbid-39f4d9f2-87a1-41be-80dc-2c8f0dc3f54d")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=X(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:x,fetchMoreCommentsNotifications:D}=l;return{onNotificationClick:(a,o,d,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(x(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const d=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t(M("task_manager","dashboard",d))}else D?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(K("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{d==="read"&&(x(r),t($([r],F())))})).then(()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t($(s,F())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,D]=k.useState(!1),a=S(e=>X(e)),o=S(e=>H(e)),{useFeatureGate:d}=wt(),{isFeatureEnabled:c}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:P,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:L,hasFetchedAll:O}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=_||P===!0||C!==!0||_||P===!0||C!==!0;k.useEffect(()=>{U&&v!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))},[U,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(D(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(L||O===!0||z==null||z(),null)}).filter(f=>f!=null);s(m({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,P,L,C,O,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=mt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(J,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(J,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-DtJmjn-F.js";import{a as r}from"./sentry-DJoVhts9.js";import{u as T,g as A,j as o,N as j}from"./core-B1V19BTM.js";import{Lx as x,eT as z,fj as C,Ly as P,Lz as D,LA as M,LB as R,o2 as k,Ku as N}from"./zeni-epic-state-Ct7fOB-u.js";import{z as h,H as I}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="c5d63517-30e0-4cd0-9cf0-0f2a1db44a23",n._sentryDebugIdIdentifier="sentry-dbid-c5d63517-30e0-4cd0-9cf0-0f2a1db44a23")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>x(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>z(e)),l=o(e=>C(e)),d=o(e=>e.tenantState.fetchState),y=o(P),v=o(D),c=o(M),[S,b]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=S??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:b,approveError:E??v,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-DtJmjn-F.js";import{h as z,u as X,g as Z,i as H,j as d,n as J,o as K,p as I}from"./core-B1V19BTM.js";import{eT as v,s5 as P,rF as Q,M2 as M,rA as T,bt as ee,bn as ae,bU as te,rB as se,M3 as oe,LR as C,dG as re,vA as ne,M4 as ce,vX as ie,fa as le,f8 as de}from"./zeni-epic-state-Ct7fOB-u.js";import{z as me,X as fe,_ as pe,A as ue,a as O,d as w,w as he,e as $,ao as Fe,n as ge}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import be from"./NotFoundScreen-98Ef_Sqs.js";import{F as Ie}from"./FeaturePreviewScreen-KfiUQgFU.js";import{a as F}from"./sentry-DJoVhts9.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{u as Te}from"./useInitialThreadRequest-BrZkGF4L.js";import{t as Se}from"./routePaths-BaN0YLzj.js";import{M as ye}from"./MobileAppDrawer-DY_LJNf1.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="6231ddbc-ec0c-4cc9-9e42-23f5ffd518da",s._sentryDebugIdIdentifier="sentry-dbid-6231ddbc-ec0c-4cc9-9e42-23f5ffd518da")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(M(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(Fe);function U(){const s=z(),e=X(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[c,p]=F.useState(!1),[m,u]=F.useState(!1),h=me.getSignedInUser(),y=d(t=>v(t)),B=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),A=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:G}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect(()=>{if(!c&&g)p(!0),l||e(Q());else if(l&&!m){u(!0);const t=((f,E,R)=>E!=null?f.forecasts.findIndex(b=>b.id===E):R!=null?f.forecasts.findIndex(b=>b.id===R):f.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(M(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&g&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,P,T,g]);const D=ue(),N=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:q}=O(),{isFeatureEnabled:L}=q(w.isReportsCommentingEnabled),W=Te(L?y?.companyId:void 0,{clearParams:l&&m}),[Y,V]=F.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:B,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:N,isAiCfoAccessEnabled:_,onAskAiCfoClick:G,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>v(c)),{useFeatureGate:e}=O(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1,22 +0,0 @@
1
- import{j as s}from"./liveblocks-DtJmjn-F.js";import{L_ as te,eT as Q,kp as H,fa as X,f8 as ne,Js as q,LE as oe,uy as Ee,L$ as N,un as ke,uH as Ie,uB as ie,ur as re,uF as Pe,uC as je,M0 as le,wm as Le,g6 as Te,g9 as ve,M1 as _,uv as de,uu as ce,uK as Fe,c3 as Ae}from"./zeni-epic-state-Ct7fOB-u.js";import{J as pe,a as Y,d as E,z as K,a9 as ue,G as me,ak as ge,al as Oe,D as he,o as O,W as fe,O as Ce,am as Re,X as Ve,_ as Ue,w as Be,e as be,g as Ze,n as $e,an as _e,A as ze}from"./index-B1BV6O_s.js";import{D as ye,n as M,S as we}from"./mui-D6ES9V4N.js";import ae from"./NotFoundScreen-98Ef_Sqs.js";import{a as r}from"./sentry-DJoVhts9.js";import{u as ee,i as Ge,j as m,h as He,g as Ke,n as Me,o as se,p as $}from"./core-B1V19BTM.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{M as Je}from"./MobileAppDrawer-DY_LJNf1.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="8b92dfdb-fa1e-435a-9179-f39e9e52624a",a._sentryDebugIdIdentifier="sentry-dbid-8b92dfdb-fa1e-435a-9179-f39e9e52624a")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Ge(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>H(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=X(k,u),T=ne(u),v=q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{R===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Xe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},Xe=M(we)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,Se=M(fe.H6Regular)`
6
- margin-top: ${O.sp7};
7
- padding-left: ${O.sp8};
8
- padding-right: ${O.sp8};
9
- color: ${a=>a.theme.colors.primary};
10
- word-break: break-word;
11
- `,De=M(fe.LargeRegularSp)`
12
- color: ${a=>a.theme.colors.hero};
13
- padding-left: ${O.sp8};
14
- padding-right: ${O.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${O.sp4};
17
- white-space: pre-line;
18
- `,qe={overlayWidth:new he(100,100,48)},G=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Q(i)),u=m(i=>H(i)),{useFeatureGate:D}=Y(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=X(f,d),P=ne(d),T=q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{R===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),L=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:T,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:G.discardTitle}),descriptionComponent:s.jsx(De,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:F}):null,s.jsx(Re,{...b})]})})},ea=M(we)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,aa=Me(function(a,t){const l=le(a),n=K.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:H(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(_({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(_({searchText:o}))}}}})(_e);function J({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=He(),n=ee(),g=Ke(),{areTenantIdsInSync:o}=Ve(),y=K.getSignedInUser(),h=m(e=>Q(e)),{useFeatureGate:p}=Y(),{isFeatureEnabled:R}=p(E.isDebitCardFeatureEnabled),V=m(e=>H(e)),I=!X(R,h)&&V,w=q(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,T]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Le(e.classState,e.classListState)),L=m(e=>Te(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(_({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),T(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(_({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),T(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Ye,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Je,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:L,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(_({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function wa(){const a=ze();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(J,{})}),s.jsx($,{path:"new",element:s.jsx(J,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(J,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DtJmjn-F.js";import E from"./NotFoundScreen-98Ef_Sqs.js";import{a as r}from"./sentry-DJoVhts9.js";import{h as _,g as v,j as p,i as M,u as P,N as U,n as z,o as O,p as h}from"./core-B1V19BTM.js";import{eT as B,S4 as b,bo as F,bn as N,i6 as V,hC as $}from"./zeni-epic-state-Ct7fOB-u.js";import{s as q,z as I,_ as G,cP as H}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{M as K}from"./MobileAppDrawer-DY_LJNf1.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="1d7b8436-cf1a-4466-8133-315f4d6e3959",e._sentryDebugIdIdentifier="sentry-dbid-1d7b8436-cf1a-4466-8133-315f4d6e3959")}catch{}})();const L=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(H),Q=()=>{const e=_(),t=v(),c=q(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=J({mobileExploreReferrer:"Performance"});return G({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,5 +0,0 @@
1
- import{j as s}from"./liveblocks-DtJmjn-F.js";import{a as o}from"./sentry-DJoVhts9.js";import{j as f,h as V,u as _,g as H,n as F}from"./core-B1V19BTM.js";import{m as N,J as W,z as R,bb as M,D as U,X as $,_ as q,w as z,e as l,g as X,a7 as J,bc as G}from"./index-B1BV6O_s.js";import{fe as K,eT as Q,Or as P,Os as Y,vq as Z,vg as p,fg as ee,bO as ae,vl as re,Ot as ne}from"./zeni-epic-state-Ct7fOB-u.js";import{D as te,e as se,n as oe,S as ie}from"./mui-D6ES9V4N.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{M as de}from"./MobileAppDrawer-DY_LJNf1.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]="d8e1a1d0-6174-4e8c-bf8a-347d9415ea50",e._sentryDebugIdIdentifier="sentry-dbid-d8e1a1d0-6174-4e8c-bf8a-347d9415ea50")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=W();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>K(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(M,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,I="refer-and-earn-status-update",we=F(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(p(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(p(!0,!0))}}})(J(G));function ye({isReferralDrawerOpen:e}){const a=V(),r=_(),n=H(),[i,u]=o.useState(!1),[d,D]=o.useState(!1),[x,E]=o.useState(!1),[k,C]=o.useState(!1),w=R.getSignedInUser(),h=f(t=>Q(t)),m=f(t=>P(t)),v=m.fetchState,g=f(t=>t.referralViewState.rewardsPlanFetchState),b=Y([m,g]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&x===!1&&(r(Z()),E(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&c&&(u(!0),r(p(!0)))},[v,r,c]),o.useEffect(()=>{!d&&g.fetchState==="Not-Started"&&c&&(D(!0),r(ee(!0)))},[g,r,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:T}=le({mobileExploreReferrer:"Rewards"});q({isDataReady:b===!0});const L={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[b===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(X.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:T,...L})]})}export{ye as R};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-DtJmjn-F.js";import R from"./NotFoundScreen-98Ef_Sqs.js";import{a as p}from"./sentry-DJoVhts9.js";import{h as x,g as I,u as A,j as u,N as C,n as k,o as D,p as c}from"./core-B1V19BTM.js";import{eT as T,Pl as S,PB as g,ET as V,E0 as P,ES as m,EJ as U,PS as _}from"./zeni-epic-state-Ct7fOB-u.js";import{m as B,z as $,B as N,a7 as O,bS as W,af as z}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-B-QO8l6D.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e05cba10-d128-4a5e-9ae0-444ad235738e",e._sentryDebugIdIdentifier="sentry-dbid-e05cba10-d128-4a5e-9ae0-444ad235738e")}catch{}})();const d="reimbursement-approval-rule-update",J=k(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:g(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(d)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(O(W)),q=()=>{const e=x(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),v=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=B(),i=u(n=>S(n)),b=u(n=>g(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{b?.updateStatus.fetchState==="Completed"&&a(V())},[b]),p.useEffect(()=>{l||v!=="Not-Started"||(s(!0),a(P(!0)))},[l,v,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${d}`]:[],eventCallback:(n,F,E)=>{n.endsWith(d)&&E.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(C,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(N,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(q,{})}),t.jsx(c,{path:"/new",element:t.jsx(h,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +0,0 @@
1
- import{j as p}from"./liveblocks-DtJmjn-F.js";import{g as G,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as H}from"./core-B1V19BTM.js";import{eT as M,fp as I,LD as Te,kp as J,qK as W,rz as A,kd as Re,jh as Le,uW as X,rE as Oe,bt as Ae,LE as Fe,bn as ke,w3 as De,LF as Ee,LG as je,uO as Pe,LH as Y,LI as Me,LJ as ve,LK as Be,LL as Ve,LM as w,LN as F,LO as k,LP as N,LQ as D,LR as E,dG as Ue,vL as xe,vz as $,vA as q,vR as ze,vE as Q,vX as Ge,LS as He,LT as Ye,LU as Ne,LV as $e,LW as qe,fa as Qe,f8 as Ze}from"./zeni-epic-state-Ct7fOB-u.js";import{Q as Ke,T as Je,U as We,V as Xe,J as ea,a as ee,d as j,z as ae,X as aa,A as sa,c as ta,Z as oa,_ as na,w as ra,e as P,g as ia,$ as la,n as se,a0 as ca,a1 as da,a2 as pa}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import fa from"./NotFoundScreen-98Ef_Sqs.js";import{F as ma}from"./FeaturePreviewScreen-KfiUQgFU.js";import{a as _}from"./sentry-DJoVhts9.js";import{u as ua}from"./useInitialThreadRequest-BrZkGF4L.js";import{t as Z,a as K,b as _a}from"./routePaths-BaN0YLzj.js";import{M as ha}from"./MobileAppDrawer-DY_LJNf1.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="dd2c3e87-c606-4106-b623-dea0da8a13cb",e._sentryDebugIdIdentifier="sentry-dbid-dd2c3e87-c606-4106-b623-dea0da8a13cb")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return K(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?K(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>M(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),L=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!v&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,v,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":L&&s(X());break;case"balance_sheet":s(Le(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,L]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Ke(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:L,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>M(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Qe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DtJmjn-F.js";import{a as x,z as j,aN as y,w as E,e as p,g as F,c_ as P,d as L}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import m from"./NotFoundScreen-98Ef_Sqs.js";import{a as d}from"./sentry-DJoVhts9.js";import{u as T,j as b,h as V,g as A,n as R,o as U,p as u}from"./core-B1V19BTM.js";import{eT as z,SI as C,P0 as Y,SJ as S,vq as q,fg as G,SK as J,vo as K}from"./zeni-epic-state-Ct7fOB-u.js";import{R as w}from"./ReferralListScreen-B9-Pm2jb.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import"./MobileAppDrawer-DY_LJNf1.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="60c3c112-bd1c-4955-b4d9-2021a4756c21",a._sentryDebugIdIdentifier="sentry-dbid-60c3c112-bd1c-4955-b4d9-2021a4756c21")}catch{}})();const O=R(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{a(S()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(K())},onUpdateInviteFormLocalData:s=>{a(J({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const a=T(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=x(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),v=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),k=Y(D);d.useEffect(()=>{a(S()),r?.rewardsLastViewedTime==null&&i===!1&&(a(q()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(G(!0)))},[l.fetchState,a]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(O,{navigate:c,location:_,currentTenant:r,companyName:I,userName:v,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=x(),{isFeatureEnabled:t}=a(L.isReferralFeatureEnabled);return e.jsxs(U,{children:[e.jsx(u,{path:"/",element:t?e.jsx(w,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(w,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(B,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Dovp7HGT.js","assets/sentry-DJoVhts9.js","assets/core-B1V19BTM.js","assets/zeni-epic-state-Ct7fOB-u.js","assets/index-B1BV6O_s.js","assets/mui-D6ES9V4N.js","assets/analytics-CR-Ji6KN.js","assets/utils-B1ItiyXC.js","assets/withTransactionSidePanel-CUAVvG-3.js","assets/useAskAiCfoHostNavButtonProps-B1ysHqFw.js","assets/TransactionDetailScreen-idWMKJZo.js","assets/decodeURIComponentSafe-62zSMNJP.js","assets/routePaths-BaN0YLzj.js","assets/NotFoundScreen-98Ef_Sqs.js","assets/useInitialThreadRequest-BrZkGF4L.js","assets/analyticsHelper-BkTwMm2V.js","assets/CompanyPassportScreen-DNxF2lkY.js","assets/MobileAppDrawer-DY_LJNf1.js","assets/useAiCfoDashboardSuggestedQuestionsChips-B-gQ2ZCu.js","assets/FeaturePreviewScreen-KfiUQgFU.js","assets/ReferralListScreen-B9-Pm2jb.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DzxfBsX4.js","assets/AddressScreen-C3jTD0QX.js","assets/DomesticWireDetailScreen-D62ComgW.js","assets/DrawerScreen-Bzib8YfV.js","assets/SetupPagesScreen-CyzzOWiJ.js","assets/BusinessVerificationPageScreen-BiME3gzl.js","assets/BillPayApprovalRoutes-DU855VPd.js","assets/ReimbursementApprovalRuleDetailScreen-B-QO8l6D.js","assets/getLocaleForTenant-BaJta4jx.js","assets/ReimbursementRoutes-C_8B-Cx9.js","assets/ReimbursementApprovalRoutes-DgN-DZyX.js","assets/TransactionListRoutes-BhOdNCNy.js","assets/ZeniAccountStatementScreen-BBbz4J4l.js","assets/SettingsRoutes-D8sH0k-9.js","assets/accountMappingHelper-Bg3QrS2B.js","assets/QBOConnectionScreen-Bn0720kQ.js","assets/empty-DJY9ZnQE.js","assets/index-BWk0p_4u.js","assets/url-Dh3D7a-t.js","assets/index-Cd64f4Pj.js","assets/ReportsRoutes-3IlP_YGU.js","assets/ChargeCardRoutes-BozcfSlm.js","assets/PeopleRoutes--3fASQ5h.js","assets/ExpenseAutomationRoutes-BEvk-l6F.js","assets/TreasuryRoutes-BQN9aD4y.js","assets/VendorsRoutes-CavsRr3z.js","assets/pathToGoBack-BkwIN_c3.js","assets/ZeniAccountRoutes-CYGjvO6a.js","assets/AddressRoutes-CMaX3PoD.js","assets/PandLWithForecastRoutes-DE9xTiJG.js","assets/CustomerOnboardingRoutes-_VvrC-ga.js","assets/TransactionDetailRoutes-DZjZQ9RI.js","assets/EntityDetailRoutes-BJQoxnJC.js","assets/NotificationRoutes-BkpJw4hc.js","assets/PerformanceRoutes-zr7-gR8p.js","assets/RewardsRoutes-Bn0Tad-r.js","assets/TaskRoutes-BEWp0wJa.js","assets/TaskListScreen-VdSyXs6p.js","assets/AiCfoScreen-BtMMWn6B.js","assets/CardsAiCfoScreen-Dk4_VP17.js"])))=>i.map(i=>d[i]);
2
- import{_ as a,bn as ls,eT as cs,fa as ds,f8 as ms,f9 as us,gf as _s,e_ as Es,cQ as Ae,cy as ps,fq as As,cq as xs,bE as gs,bq as Is,fv as Ts,v as js,L9 as hs,bt as Us,La as bs,bG as Hs,fs as Rs,bF as Ds,bs as ys,cm as fs,Lb as Cs,Lc as vs,cN as Os,cP as Ps,cO as Fs,cx as Ls,cD as ks,o2 as xe,f6 as ge,gp as Bs,fz as Ie,gm as Te,gn as je,fA as Vs}from"./zeni-epic-state-Ct7fOB-u.js";import{j as e}from"./liveblocks-DtJmjn-F.js";import{a as v}from"./sentry-DJoVhts9.js";import{u as Ss,h as Ns,i as Ms,g as Zs,j as G,l as he,N as c,o as ws,p as t}from"./core-B1V19BTM.js";import{m as zs,u as Gs,z as H,a as $s,c as qs,x as Ys,d as L,A as Ws,L as k,O as Ue,t as _,P as Qs,e as se,l}from"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import{f as be}from"./analyticsHelper-BkTwMm2V.js";import{t as Js}from"./getLocaleForTenant-BaJta4jx.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="ba288519-5b35-4bcf-bae4-d9634f684738",i._sentryDebugIdIdentifier="sentry-dbid-ba288519-5b35-4bcf-bae4-d9634f684738")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-Dovp7HGT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-DzxfBsX4.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-C_8B-Cx9.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-BhOdNCNy.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-D8sH0k-9.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-3IlP_YGU.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BozcfSlm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21])),people:()=>a(()=>import("./PeopleRoutes--3fASQ5h.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-BEvk-l6F.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-BQN9aD4y.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-CavsRr3z.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-CYGjvO6a.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"],ae=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},ea=l(()=>a(()=>import("./ReportsRoutes-3IlP_YGU.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),sa=l(()=>a(()=>import("./AddressRoutes-CMaX3PoD.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),aa=l(()=>a(()=>import("./PeopleRoutes--3fASQ5h.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),na=l(()=>a(()=>import("./PandLWithForecastRoutes-DE9xTiJG.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),ta=l(()=>a(()=>import("./CustomerOnboardingRoutes-_VvrC-ga.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),ia=l(()=>a(()=>import("./VendorsRoutes-CavsRr3z.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),ra=l(()=>a(()=>import("./TransactionDetailRoutes-DZjZQ9RI.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-BJQoxnJC.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),oa=l(()=>a(()=>import("./DashboardRoutes-Dovp7HGT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),Re=l(()=>a(()=>import("./BillPayRoutes-DzxfBsX4.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),la=l(()=>a(()=>import("./SettingsRoutes-D8sH0k-9.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),De=l(()=>a(()=>import("./ReimbursementRoutes-C_8B-Cx9.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ca=l(()=>a(()=>import("./ZeniAccountRoutes-CYGjvO6a.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),da=l(()=>a(()=>import("./TreasuryRoutes-BQN9aD4y.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),ma=l(()=>a(()=>import("./TransactionListRoutes-BhOdNCNy.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ua=l(()=>a(()=>import("./ChargeCardRoutes-BozcfSlm.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21]))),_a=l(()=>a(()=>import("./NotificationRoutes-BkpJw4hc.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),Ea=l(()=>a(()=>import("./PerformanceRoutes-zr7-gR8p.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),pa=l(()=>a(()=>import("./ExpenseAutomationRoutes-BEvk-l6F.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),Aa=l(()=>a(()=>import("./RewardsRoutes-Bn0Tad-r.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),xa=l(()=>a(()=>import("./TaskRoutes-BEWp0wJa.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),ga=l(()=>a(()=>import("./AiCfoScreen-BtMMWn6B.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),ye=l(()=>a(()=>import("./CardsAiCfoScreen-Dk4_VP17.js"),__vite__mapDeps([61,1,2,3,7,4,5,6,21]))),D=l(()=>a(()=>import("./NotFoundScreen-98Ef_Sqs.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ia=l(()=>a(()=>import("./TaskListScreen-VdSyXs6p.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wa({setTenantEmailDomain:i}){const U=Ss(),V=Ns(),{tenantEmailDomain:o}=Ms(),S=zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),y=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),J=ls(j),$=Zs(),[N,Ce]=v.useState(!1),r=G(n=>cs(n)),{useFeatureGate:P}=$s(),w=qs(),ve=Ys(),{isFeatureEnabled:Oe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Pe}=P(L.isExpenseAutomationEnabledV2),Fe=Pe||Oe&&J,{isFeatureEnabled:Le}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=P(L.isTreasuryEnabled),{isFeatureEnabled:Be}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=P(L.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),p=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||h==="Completed"?ds(ne,r):void 0,q=p==="Completed"||h==="Completed"?ms(r):void 0,Ve=p==="Completed"||h==="Completed"?us(r):void 0,Se=Be||ne||!!Ve||!!q||!!u,{isFeatureEnabled:Ne}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:K}=P(L.isAiCfoFileUploadEnabled),Y=G(n=>_s(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&be(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},te=Es(),E=Ws(),Me=r.company==null||E?.loggedInUserRoleMap!=null&&Ae(E.loggedInUserRole),Ze=ps(E?.loggedInUserRoleMap),ie=v.useRef(!0),re=he("/:tenantEmailDomain/onboarding/*")!==null,X=he("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),we=G(n=>z.tenantId!=null?As(n,z.tenantId):void 0);v.useEffect(()=>{f(k.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(X!=null&&y!=null){const n=X.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=xs(Number(b[0])),s=Number(b[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,Ue.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Is();m.isAfter(M,"month")===!1?U(Ts(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[X,y]),v.useEffect(()=>{N||(Ce(!0),f(k.TENANT_FETCHING)),ie.current?ie.current=!1:!js(te,z)&&H.isSignedIn()&&(f(k.TENANT_FETCHING),function(n,b,d,s){if(ge(b?.userId,b?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Ue.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?se.identify(n.userId,{tenant_id:n.tenantId}):se.resetUserIdentity()}(z,j,U,we))},[z,te,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(k.TENANT_FETCHING),function(n,b,d,s,m,M,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,is=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,os=d!=null&&d.externalConnections==null;if(W&&is){B(Ie(s));const Q=H.getSignedInUserTenantWithId(s);Q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),ge(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(m.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Te(m.userId,s))),W&&os&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(m.userId,s)));if(W){se.identify(m.userId,{tenant_id:s});const Q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(k.TENANT_FETCHING),B(Vs(m.userId,s,m.zeniSessionId))),Q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(m.userId,m.zeniSessionId)))}}(h,p,r,y,j,f,U))},[y,p]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(k.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),j!=null&&be(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{p==="In-Progress"&&f(k.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),Z(k.TENANT_FETCHING),Z(k.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[p,h,y,N]);const oe=v.useRef(!1);v.useEffect(()=>{!oe.current&&p==="Completed"&&N&&(oe.current=!0,function(n=Xs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Ks[m];M!=null?M().then(()=>ae(()=>d(s+1))).catch(()=>ae(()=>d(s+1))):d(s+1)};ae(()=>d(0))},b)}())},[p,N]);const C=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:ze}=P(L.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,ce=Se&&!C,qe=bs(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,ue=me&&Hs(E?.loggedInUserRoleMap),_e=Le&&!C,We=r.company!=null&&Rs(r.company),Qe=ke&&We===!0&&!C,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ce&&ys(E?.loggedInUserRoleMap),Xe=_e&&fs(E?.loggedInUserRoleMap),es=Cs(E?.loggedInUserRoleMap),ss=vs(E?.loggedInUserRoleMap),A=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),I=Ls(E?.loggedInUserRoleMap),T=ks(E?.loggedInUserRoleMap),Ee=le&&I,pe=me&&T,as=_e&&A,ns=Qe&&x,ee=ce&&g,ts=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||qe===!0||es===!0||ss===!0;return H.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||h==="Completed"?(de===!0||J&&!re)&&Ye===!1&&u===!1&&q===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||de!==!1||re||J?N&&r?.userRole&&u!=null&&q!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(ws,{children:e.jsxs(t,{element:e.jsx(Qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Ta,{isDashboardAccess:F,isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:q})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(oa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(ea,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ts||F?e.jsx(aa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(na,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(ta,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||Ge||$e?e.jsx(ra,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(ma,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ia,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(xa,{})}),e.jsx(t,{path:"address/*",element:Je||ue||Xe||Ke?e.jsx(sa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:as?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:ns?e.jsx(da,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ve?e.jsx(Ea,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:Fe&&C===!1?e.jsx(pa,{}):e.jsx(fe,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_a,{})}),e.jsx(t,{path:"vendors/*",element:Me?e.jsx(ia,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(Re,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:pe?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:A,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Ne?e.jsx(la,{hasAdminLevelAccess:ue}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:ee&&w?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:ee?e.jsx(ua,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(Aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(ga,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Ta=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ba,{tenantEmailDomain:O}):S?e.jsx(Ua,{tenantEmailDomain:O}):U?e.jsx(Ha,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(ja,{tenantEmailDomain:O}):e.jsx(D,{}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ba=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),fe=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wa as default};
@@ -1 +0,0 @@
1
- import{j as u}from"./liveblocks-DtJmjn-F.js";import{a as f,b as T,q as A}from"./sentry-DJoVhts9.js";import{u as z,h as D,j as c,g as M,N as O,n as j}from"./core-B1V19BTM.js";import{u as P,z as s,m as F,e as w,O as _,f as B,g as N,Y as V,h as $,E as q,i as v}from"./index-B1BV6O_s.js";import{eT as J,L8 as W,L9 as Y,f6 as G,fz as H,Le as K,gj as Q,cU as R,Lf as y,Lg as X,Lh as Z,bU as b}from"./zeni-epic-state-Ct7fOB-u.js";import"./mui-D6ES9V4N.js";import{u as ee}from"./useDeviceId-zuDOu7ni.js";import{f as te}from"./analyticsHelper-BkTwMm2V.js";import{t as ne}from"./getLocaleForTenant-BaJta4jx.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="d3345a39-b7b9-44c7-bed9-3ceb08037c6a",t._sentryDebugIdIdentifier="sentry-dbid-d3345a39-b7b9-44c7-bed9-3ceb08037c6a")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{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:b(l),sourceUri:b(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(y())}}})(q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:U,accountUnlockTime:h}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>J(e)),I=c(e=>W(e)),m=M(),E=F().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),f.useEffect(()=>{t(void 0)},[]),f.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(Y(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Q().then(()=>{const e=$();e!=null&&B(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,k,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&h!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:h}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-DtJmjn-F.js";import{a as n}from"./sentry-DJoVhts9.js";import{u as c,g,h as m,N as p}from"./core-B1V19BTM.js";import{z as d,B as y,t as h,e as f,g as b}from"./index-B1BV6O_s.js";import{go as x,gp as I,Lw as w}from"./zeni-epic-state-Ct7fOB-u.js";import{n as j}from"./mui-D6ES9V4N.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="942ae280-88d8-4d14-98a9-f33640550d64",e._sentryDebugIdIdentifier="sentry-dbid-942ae280-88d8-4d14-98a9-f33640550d64")}catch{}})();function q(){const e=c(),t=g(),i=m(),a=n.useRef(!1),l=d.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),w(),h.reset(),f.trackLogout(b.Event.logoutSuccess),f.resetUserIdentity()}catch(u){console.error("Error during sign out:",u)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{q as default};
@@ -1,9 +0,0 @@
1
- import{j as u}from"./liveblocks-DtJmjn-F.js";import{a as G}from"./sentry-DJoVhts9.js";import{h as _,u as v,g as H,j as S,i as K,n as z}from"./core-B1V19BTM.js";import{z as F,a as V,d as p,_ as W,w as Z,e as M,g as O,d1 as Q,n as g,p as X}from"./index-B1BV6O_s.js";import{eT as q,SP as R,Ih as C,SQ as x,SL as Y,HF as I,SR as J,HN as y,H7 as aa,Ii as E,SS as B,hC as ea,I8 as ta,Id as sa,I0 as oa,H_ as w,Ie as na,HX as ia,ST as la,SU as ra,SV as ca,SW as ka,SX as T,ef as da,SY as ua,SZ as pa}from"./zeni-epic-state-Ct7fOB-u.js";import{n as Ta}from"./mui-D6ES9V4N.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{M as ga}from"./MobileAppDrawer-DY_LJNf1.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.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]="2d05d157-c331-428d-8fc1-38a89a5c2b8a",e._sentryDebugIdIdentifier="sentry-dbid-2d05d157-c331-428d-8fc1-38a89a5c2b8a")}catch{}})();const fa=Ta.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,ha=z(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,n=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,d=Y(e),i=F.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:c,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ka(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=b(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ca({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=X(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(I({taskDetailLocalData:s}));const k=b(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(k,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(E({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(E({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(y(a,[s]))},handleNewTaskInitialization:a=>{if(e(I({taskDetailLocalData:{...J,name:a}})),t.localData.defaultTaskGroupId!=null){const s=b(i,t.localData.defaultTaskGroupId),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Q);function ja(){const e=_(),t=v(),o=H(),c=F.getSignedInUser(),n=S(r=>q(r)),{taskGroupId:d}=K(),{useFeatureGate:i}=V(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,N]=G.useState(!1),h=S(r=>R(r,l)),D=S(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:j}=ma({mobileExploreReferrer:"Task Checklist"});if(W({isDataReady:m==="Completed"}),G.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(Z,{analytics:M,onLoad:r=>(U=>U.trackPageLoaded(O.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{N(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,onAskAiCfoClick:j})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,b=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{ja as default};
@@ -1,9 +0,0 @@
1
- import{j as n}from"./liveblocks-DtJmjn-F.js";import se from"./NotFoundScreen-98Ef_Sqs.js";import{a as c}from"./sentry-DJoVhts9.js";import{h as A,u as M,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-B1V19BTM.js";import{Hk as O,Hn as le,Hh as de,eT as Z,SL as J,HB as W,He as pe,I5 as ue,H_ as ke,SM as X,SN as N,Ha as me,H7 as fe,rv as ge,rj as he,kZ as Se,Hv as Ie,SO as Te,HM as be,HJ as Ee,Hq as Ge,HG as Ce,HF as De}from"./zeni-epic-state-Ct7fOB-u.js";import{z as C,c$ as xe,s as je,a as ye,d as b,p as Y,n as w,w as ve,e as z,g as we,d0 as Re,i as V,at as Fe}from"./index-B1BV6O_s.js";import{n as Be}from"./mui-D6ES9V4N.js";import{u as Ue}from"./useInitialThreadRequest-BrZkGF4L.js";import{M as He}from"./MobileAppDrawer-DY_LJNf1.js";import Pe from"./TaskListScreen-VdSyXs6p.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./useAskAiCfoHostNavButtonProps-B1ysHqFw.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]="abb948db-f340-40f7-90cf-0a692c275955",e._sentryDebugIdIdentifier="sentry-dbid-abb948db-f340-40f7-90cf-0a692c275955")}catch{}})();function Le(){const e=A(),t=M(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=X(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(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=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=A(),t=M(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Ue(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,K]=c.useState(!1),[F,Q]=c.useState(!1),[B,ee]=c.useState(!1),[U,j]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),H=g(i=>J(i)),P=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(K(!0),t(W(!1,r)))},[p,t]),c.useEffect(()=>{F||H.fetchState==="Completed"||(Q(!0),t(pe()))},[F,t,H.fetchState]),c.useEffect(()=>{B||P==="Completed"||(ee(!0),t(ue()))},[B,t,P]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))},[t,r]);c.useEffect(()=>{if(U)if(G!=="In-Progress"){if(T.current){if(G==="Error")return j(!1),void(T.current=!1);if(G==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[U,G,l,s,e]);const L=g(i=>X(i,r)),y=L.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&L.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(He,{isAppContentDrawerOpen:x,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:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Be.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(v,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(v,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Pe,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(Le,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(v,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-DtJmjn-F.js";import i from"./NotFoundScreen-98Ef_Sqs.js";import{T as r}from"./TransactionDetailScreen-idWMKJZo.js";import"./sentry-DJoVhts9.js";import{o as a,p as o}from"./core-B1V19BTM.js";import"./zeni-epic-state-Ct7fOB-u.js";import"./recharts-C_sYuD8f.js";import"./index-B1BV6O_s.js";import"./mui-D6ES9V4N.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import"./decodeURIComponentSafe-62zSMNJP.js";import"./routePaths-BaN0YLzj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};