@zeniai/web-app-ui 5.0.85-dev → 5.0.85-next

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 (103) hide show
  1. package/dist/assets/AddressRoutes-BTrd57s2.js +1 -0
  2. package/dist/assets/{AddressScreen-iadLC3wL.js → AddressScreen-BvMQB8FF.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DnNvzRXg.js → AiCfoScreen-DNmotkk5.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-aEVqsC6X.js → BillPayApprovalRoutes-BqycijzY.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-OhgtAqt5.js → BillPayRoutes-DcPzz5vY.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-Bpcf42MJ.js → BusinessVerificationPageScreen-x0C706ZJ.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-CC3rUcEx.js → ChargeCardRoutes-BZN_rT-F.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-Bo8U2F7k.js → CompanyPassportScreen-D6yPFCfS.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-B8zFmWwE.js → ConnectionAuthScreen-BpVpKcdb.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-NQu_T9jk.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-oUdkgm9z.js → CustomerOnboardingRoutes-BGlngZ6e.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-CIv9TwmX.js → DashboardRoutes-W9H9Wk5O.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CzfX63rA.js → DefaultTenantHome-CaDzFVa8.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-cxtSnsYA.js → DomesticWireDetailScreen-D0UoKqzj.js} +1 -1
  15. package/dist/assets/{DrawerScreen-ZPO4Ypa0.js → DrawerScreen-DTAMBHDh.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DmfoaR8r.js → EntityDetailRoutes-CwZL3vFL.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-70ubL0r1.js → ExpenseAutomationRoutes-C8rYvumd.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-D78u7iOi.js → FeaturePreviewScreen-IL56yObW.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-C9fFwBcJ.js → HubSpotOAuthCallbackScreen-Bn1S03Qv.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-DhAnytU9.js → MagicLinkRoutes-C5zFGH0x.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-ni2a4_kD.js → MagicLinkSignInScreen-C_AC7KhO.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-DuLLFVYe.js → MobileAppDrawer-CuP4fq1B.js} +1 -1
  23. package/dist/assets/NotFoundScreen-YKkxofho.js +1 -0
  24. package/dist/assets/{NotificationRoutes-DHzbPPiF.js → NotificationRoutes-Bg72dHqS.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-Dck3ttsM.js → OAuthConsentScreen-ClYHEuXL.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-j7pNIg3t.js → PandLWithForecastRoutes-DLv_fyFO.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-BKKvfS70.js → PeopleRoutes-DYVLissD.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-DSCVYWBr.js → PerformanceRoutes-CGjcWKBJ.js} +1 -1
  29. package/dist/assets/{Preview-DHZ-1chc.js → Preview-OfbNwl97.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-eKsh6fZL.js → QBOConnectionScreen-DOLdLoS0.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-De_dGEop.js → ReferralListScreen-vfg1s_YP.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-uuEexwT2.js → ReimbursementApprovalRoutes-jiOOsHvW.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BOkWTXGa.js → ReimbursementApprovalRuleDetailScreen-Bbsz8QQ6.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-CcnOfRVK.js → ReimbursementRoutes-B5Sw13Ed.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-BSCnGMpO.js → ReportsRoutes-LZJ0MKKr.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-SW6jGQWJ.js → RewardsRoutes-D5g_M2XG.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-D7t2GB4Z.js → ScreenRoutes-BNgaE4bd.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-C7bM-RTm.js → SettingsRoutes-Dv_Ka7i6.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-BbrLzo4b.js → SetupPagesScreen-DeN_QNf8.js} +1 -1
  40. package/dist/assets/{SignInScreen-B8X6mEk8.js → SignInScreen-Xb-rwCEV.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DDvMBRd7.js → SignOutScreen-7Dwf7rnU.js} +1 -1
  42. package/dist/assets/{TaskListScreen-CUOhqgD-.js → TaskListScreen-BwXGWL1j.js} +1 -1
  43. package/dist/assets/{TaskRoutes-v8AsLlq0.js → TaskRoutes-B2WWoSAP.js} +1 -1
  44. package/dist/assets/TransactionDetailRoutes-DY2UJC6b.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-718LSRWk.js → TransactionDetailScreen-CxbLldkU.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-BhS0v3iK.js → TransactionListRoutes-CasY9nUL.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-Dde0CrN8.js → TreasuryRoutes-BWDk7gT_.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-CRJAC3dc.js → VendorsRoutes-nJ4B-tBU.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-CUB6U8zj.js → WiseConfirmationScreen-BszKriUp.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-BPbGWjLj.js → ZeniAccountRoutes-DyN4j1Qq.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-DOfTHOXY.js → ZeniAccountStatementScreen-BRW8WxDR.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-DIs9XlFT.js → accountMappingHelper-4acz-SwQ.js} +1 -1
  53. package/dist/assets/{analytics-cU6JjHUB.js → analytics-DyMyvTxh.js} +1 -1
  54. package/dist/assets/{analyticsHelper-1nvJW90-.js → analyticsHelper-DN-X1P8T.js} +1 -1
  55. package/dist/assets/{core-CjgV1pRV.js → core-aR0qKEiV.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-N2eflqcZ.js → decodeURIComponentSafe-imXO9fsR.js} +1 -1
  57. package/dist/assets/{dnd-DHtwlo1Y.js → dnd-CZ0pE10o.js} +1 -1
  58. package/dist/assets/{empty-DDprIUHc.js → empty-9TGazCdO.js} +1 -1
  59. package/dist/assets/{empty-CyGd8cnQ.js → empty-DcODLT1b.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DNVEo2Xc.js → emptyVideoElement-BQz-nkII.js} +1 -1
  61. package/dist/assets/{epic-D4aEg97H.js → epic-uNwbwWI4.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-D5dw7iAh.js → getLocaleForTenant-DhBtn3Ee.js} +1 -1
  63. package/dist/assets/{index-vm-rweqa.js → index-4FSocmrF.js} +1 -1
  64. package/dist/assets/{index-6IUOh0lu.js → index-B7d7MSWD.js} +1 -1
  65. package/dist/assets/{index-DFlDlBb4.js → index-BkZ9kaZ9.js} +1 -1
  66. package/dist/assets/{index-CEFWvyAZ.js → index-ChczZgz4.js} +1 -1
  67. package/dist/assets/{index-BcVOuC0n.js → index-Cy593RGQ.js} +7 -7
  68. package/dist/assets/{index-BnsuU_HD.js → index-DH1VA1sJ.js} +1 -1
  69. package/dist/assets/{index-DLy2V-c8.js → index-ooKt2AnX.js} +1 -1
  70. package/dist/assets/{index-CWaji86e.js → index-zeRn3DGw.js} +2 -2
  71. package/dist/assets/{lexical-MibAVFD6.js → lexical-oQNXHxEc.js} +1 -1
  72. package/dist/assets/{liveblocks-FqlsN9l2.js → liveblocks-CLqAhud6.js} +1 -1
  73. package/dist/assets/{lottie-wdoglqbL.js → lottie-Bz1bpTt2.js} +1 -1
  74. package/dist/assets/{mui-DV0w8xOn.js → mui-BY8zvgs4.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DjdAyrK6.js → pathToGoBack-BgMfa4Fs.js} +1 -1
  76. package/dist/assets/{pdf-FCPcIMVR.js → pdf-DGbhE1eo.js} +3 -3
  77. package/dist/assets/{pdf-lib-CMxizmxK.js → pdf-lib-BYGY-M64.js} +1 -1
  78. package/dist/assets/{plaid-BkGpAOW9.js → plaid-BgClSQ5E.js} +1 -1
  79. package/dist/assets/{pusher-BEl5dYf3.js → pusher-CtTjQ1YW.js} +1 -1
  80. package/dist/assets/{react-CxQwwzka.js → react-CMnFYwb8.js} +1 -1
  81. package/dist/assets/{react-jKiqoE8I.js → react-CV_JpCVX.js} +1 -1
  82. package/dist/assets/{react-D-sP_7d_.js → react-DW03PVpd.js} +1 -1
  83. package/dist/assets/{react-D83iag70.js → react-DdvtD_V9.js} +1 -1
  84. package/dist/assets/{react-CNcx_TR6.js → react-DhBpDFIR.js} +1 -1
  85. package/dist/assets/{react-DgxhZd-z.js → react-eqWonw_S.js} +1 -1
  86. package/dist/assets/{recharts-Bc1ZLC_I.js → recharts-RPqam0Wx.js} +1 -1
  87. package/dist/assets/{routePaths-em7mZQJi.js → routePaths-Cr_t1xHP.js} +1 -1
  88. package/dist/assets/{sentry-D49LOZ1j.js → sentry-Cx_bjk1I.js} +1 -1
  89. package/dist/assets/{url-DR56GGlL.js → url-DTcdHmle.js} +1 -1
  90. package/dist/assets/{url-CmiyMP1N.js → url-TomWfXax.js} +1 -1
  91. package/dist/assets/{useAskAiCfoHostNavButtonProps-CjtZhD5y.js → useAskAiCfoHostNavButtonProps-BHH5iUyl.js} +1 -1
  92. package/dist/assets/{useDeviceId-204emeAp.js → useDeviceId-BYnqlZ2w.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-CM8iKDtd.js → useFetchSuggestedQuestionsWhenReady-Csr1Wwy2.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-CFG3lo7l.js → useInitialThreadRequest-B-1U2ylt.js} +1 -1
  95. package/dist/assets/{utils-RiJ_hKSI.js → utils-B5-1mb3v.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-BevSoIGb.js → withTransactionSidePanel-4Qi1EecU.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-CZMuxCUG.js → zeni-epic-state-deE-VpAu.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +1 -1
  100. package/dist/assets/AddressRoutes-ph_CA4HZ.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-B4vyHJSH.js +0 -1
  102. package/dist/assets/NotFoundScreen-Bjx2V_hY.js +0 -1
  103. package/dist/assets/TransactionDetailRoutes-LD__juBl.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-CLqAhud6.js";import{A as i}from"./AddressScreen-BvMQB8FF.js";import s from"./NotFoundScreen-YKkxofho.js";import"./sentry-Cx_bjk1I.js";import{n as d,o as r}from"./core-aR0qKEiV.js";import"./zeni-epic-state-deE-VpAu.js";import"./recharts-RPqam0Wx.js";import"./index-Cy593RGQ.js";import"./mui-BY8zvgs4.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="624154e3-3694-4a3c-b645-a66b8e12404c",t._sentryDebugIdIdentifier="sentry-dbid-624154e3-3694-4a3c-b645-a66b8e12404c")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-FqlsN9l2.js";import{a as h}from"./sentry-D49LOZ1j.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-CjgV1pRV.js";import{Z as $,m as D,z as L,d as K,x as G,A as J,e as C,g as S,p as z,j as b,k as F}from"./index-BcVOuC0n.js";import{JG as k,gY as R,eQ as U,JH as H,c2 as N,JI as O,ki as V}from"./zeni-epic-state-CZMuxCUG.js";import{n as q}from"./mui-DV0w8xOn.js";import Q from"./NotFoundScreen-Bjx2V_hY.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]="cb9a0169-009e-49a5-8048-4438c25844c5",e._sentryDebugIdIdentifier="sentry-dbid-cb9a0169-009e-49a5-8048-4438c25844c5")}catch{}})();const Y=q.div`
1
+ import{j as d}from"./liveblocks-CLqAhud6.js";import{a as h}from"./sentry-Cx_bjk1I.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-aR0qKEiV.js";import{Z as $,m as D,z as L,d as K,x as G,A as J,e as C,g as S,p as z,j as b,k as F}from"./index-Cy593RGQ.js";import{JG as k,gY as R,eQ as U,JH as H,c2 as N,JI as O,ki as V}from"./zeni-epic-state-deE-VpAu.js";import{n as q}from"./mui-BY8zvgs4.js";import Q from"./NotFoundScreen-YKkxofho.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]="cb9a0169-009e-49a5-8048-4438c25844c5",e._sentryDebugIdIdentifier="sentry-dbid-cb9a0169-009e-49a5-8048-4438c25844c5")}catch{}})();const Y=q.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-FqlsN9l2.js";import{a as l}from"./sentry-D49LOZ1j.js";import{h as de,j as me,u as pe,g as N,l as he,k as fe}from"./core-CjgV1pRV.js";import{T as Se,cJ as ge,z as Ce,Z as ke,cK as be,cL as we,cM as V,cN as Ie,cO as J,k as U,A as q,e as T,cP as z,cQ as Ee,W as Pe,g as Te,a3 as ye,cR as xe,X as _e,r as ve,aY as Oe,cS as Ae}from"./index-BcVOuC0n.js";import{fG as Qe,f5 as K,eQ as Ue,hC as je,Qe as De,eP as Fe,hM as Be,hI as Le,fw as W,fq as Me,fj as Re,fn as H,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-CZMuxCUG.js";import{D as ze,n as b,S as We,P as He}from"./mui-DV0w8xOn.js";import{p as Ye}from"./pathToGoBack-DjdAyrK6.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="157d290e-a0ab-4735-bbea-8b701974556a",s._sentryDebugIdIdentifier="sentry-dbid-157d290e-a0ab-4735-bbea-8b701974556a")}catch{}})();const X="chat-response-generated",Je=fe(function(s,r){const t=K(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:u}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),d=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:y}=J(C,d);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,d,Ae(y,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,w?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,d,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(H(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ye(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(H(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),u(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Re());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Me({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(ye(xe)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=de(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Qe())},[t]);const{customPageTitle:C}=ge(),u=N(i=>K(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),d=N(i=>Ue(i)),a=u.uiState.currentChatSessionId,w=d.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:Z}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),x=we({currentTenant:d,currentChatSessionId:a,aiCfoView:u}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=d.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:M}=Ie(a),A=u.fetchState,Q=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,R=a!=null?u.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(u.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=J($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[d.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:M.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,ue)=>ue.onEventReceived(i,g)}),[M]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Be())},[A,Q,t]),l.useEffect(()=>{a!=null&&R!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Le(a,e.userId))},[R,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&u.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),x.drawerElement,h.jsx(Ze,{children:h.jsx(Y,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{d.userRoleId!=null&&t(W(d.userRoleId))}})})})]}):h.jsxs(Ke,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&x.drawerElement,h.jsx(Je,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:d,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?x.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:y}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(Y,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||d.userRoleId==null||t(W(d.userRoleId)),f(!1)}})})})]})},Y=b(We)`
1
+ import{j as h}from"./liveblocks-CLqAhud6.js";import{a as l}from"./sentry-Cx_bjk1I.js";import{h as de,j as me,u as pe,g as N,l as he,k as fe}from"./core-aR0qKEiV.js";import{T as Se,cJ as ge,z as Ce,Z as ke,cK as be,cL as we,cM as V,cN as Ie,cO as J,k as U,A as q,e as T,cP as z,cQ as Ee,W as Pe,g as Te,a3 as ye,cR as xe,X as _e,r as ve,aY as Oe,cS as Ae}from"./index-Cy593RGQ.js";import{fG as Qe,f5 as K,eQ as Ue,hC as je,Qe as De,eP as Fe,hM as Be,hI as Le,fw as W,fq as Me,fj as Re,fn as H,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-deE-VpAu.js";import{D as ze,n as b,S as We,P as He}from"./mui-BY8zvgs4.js";import{p as Ye}from"./pathToGoBack-BgMfa4Fs.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="157d290e-a0ab-4735-bbea-8b701974556a",s._sentryDebugIdIdentifier="sentry-dbid-157d290e-a0ab-4735-bbea-8b701974556a")}catch{}})();const X="chat-response-generated",Je=fe(function(s,r){const t=K(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:u}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),d=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:y}=J(C,d);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,d,Ae(y,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,w?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,d,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(H(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ye(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(H(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),u(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Re());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Me({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(ye(xe)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=de(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Qe())},[t]);const{customPageTitle:C}=ge(),u=N(i=>K(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),d=N(i=>Ue(i)),a=u.uiState.currentChatSessionId,w=d.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:Z}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),x=we({currentTenant:d,currentChatSessionId:a,aiCfoView:u}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=d.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:M}=Ie(a),A=u.fetchState,Q=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,R=a!=null?u.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(u.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=J($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[d.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:M.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,ue)=>ue.onEventReceived(i,g)}),[M]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Be())},[A,Q,t]),l.useEffect(()=>{a!=null&&R!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Le(a,e.userId))},[R,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&u.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),x.drawerElement,h.jsx(Ze,{children:h.jsx(Y,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{d.userRoleId!=null&&t(W(d.userRoleId))}})})})]}):h.jsxs(Ke,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&x.drawerElement,h.jsx(Je,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:d,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?x.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:y}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(Y,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||d.userRoleId==null||t(W(d.userRoleId)),f(!1)}})})})]})},Y=b(We)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-FqlsN9l2.js";import{a as y}from"./sentry-D49LOZ1j.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as O,n as F,o as h}from"./core-CjgV1pRV.js";import{eQ as N,MZ as R,MF as b,xr as x,xl as L,xp as I,xe as M,MH as z,xh as W,xt as q,xs as C}from"./zeni-epic-state-CZMuxCUG.js";import{m as P,z as k,x as V,a3 as H,by as Q,ac as _,bz as Z}from"./index-BcVOuC0n.js";import"./mui-DV0w8xOn.js";import{i as G}from"./ReimbursementApprovalRuleDetailScreen-BOkWTXGa.js";import J from"./NotFoundScreen-Bjx2V_hY.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]="840dd8c1-03a7-44ba-9f52-68f8d8b8666c",e._sentryDebugIdIdentifier="sentry-dbid-840dd8c1-03a7-44ba-9f52-68f8d8b8666c")}catch{}})();const w="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(z(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(H(Q)),X=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Y=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!G(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(Z);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Y,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-CLqAhud6.js";import{a as y}from"./sentry-Cx_bjk1I.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as O,n as F,o as h}from"./core-aR0qKEiV.js";import{eQ as N,MZ as R,MF as b,xr as x,xl as L,xp as I,xe as M,MH as z,xh as W,xt as q,xs as C}from"./zeni-epic-state-deE-VpAu.js";import{m as P,z as k,x as V,a3 as H,by as Q,ac as _,bz as Z}from"./index-Cy593RGQ.js";import"./mui-BY8zvgs4.js";import{i as G}from"./ReimbursementApprovalRuleDetailScreen-Bbsz8QQ6.js";import J from"./NotFoundScreen-YKkxofho.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]="840dd8c1-03a7-44ba-9f52-68f8d8b8666c",e._sentryDebugIdIdentifier="sentry-dbid-840dd8c1-03a7-44ba-9f52-68f8d8b8666c")}catch{}})();const w="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(z(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(H(Q)),X=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Y=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!G(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(Z);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Y,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-FqlsN9l2.js";import{j as J,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-CjgV1pRV.js";import{eQ as Z,Mf as Le,bv as It,H8 as oa,bo as wt,bF as pe,Mg as xt,wL as Bt,xV as Ve,xi as la,bn as De,Mh as sa,Mi as ra,c2 as ca,Mj as da,jC as Ct,Mk as At,Ml as Et,yu as _e,w_ as Ce,Mm as ua,wz as tt,Mn as pa,BG as ma,wD as ba,wJ as Dt,Mo as ke,Mp as Ge,xW as Oe,Mq as ha,Mr as ga,xZ as Ne,Ms as ya,ya as Sa,Mt as jt,xG as at,xL as fa,Mu as ka,Mv as ue,Mw as Tt,Mx as Pt,My as Ft,fK as va,x3 as $e,cx as Rt,Mz as Ia,gO as wa,MA as xa,MB as Ba,eW as Mt,eU as Vt,MC as ze,MD as Ca,ME as Aa,J_ as Ze,MF as Ea,J$ as oe,K0 as He,MG as Da,MH as ja,MI as Ta,xN as nt,xK as Pa,MJ as Fa,MK as Ra,ML as Ma,xw as Va,MM as $a,MN as Ua,MO as La,cl as $t,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,vR as Oa,MP as Na,Bt as za,Bz as Za,so as Ha,xX as Wa,yB as qa,j_ as fe,MQ as Ka,MR as Gt,ks as Ja,jU as Ot,kd as Nt,kc as it,bE as be,bK as Qa,MS as Xa,MT as ve,ix as Ya,MU as ot,MV as en,iB as tn,iW as an,yP as nn,MW as on,kl as ln,yF as sn,MX as lt,yJ as rn,yO as cn,yL as dn,yD as un,MY as zt,wU as pn,MZ as mn,M_ as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,pQ as kn,ka as vn,yH as In,iH as wn,kz as xn,M$ as Bn,iz as Cn,pH as An,N0 as En,xC as Dn,bG as jn,bs as Tn,IU as Pn,cP as Fn,cO as Rn,cw as Mn,cC as Vn}from"./zeni-epic-state-CZMuxCUG.js";import{m as me,z as M,d as Ie,y as le,S as y,aK as Ae,x as re,o as A,A as je,e as D,b5 as $n,k as z,X as We,r as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,I as _n,aE as Gn,F as Zt,D as qe,O as Ke,b9 as On,aq as Ht,ba as Nn,U as zn,g as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Qn,bh as Xn,bi as Yn,bj as ei,v as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-BcVOuC0n.js";import{n as U,S as si}from"./mui-DV0w8xOn.js";import{A as dt}from"./AddressScreen-iadLC3wL.js";import{g as ie,a as Te,i as qt,V as Je,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-cxtSnsYA.js";import{a as f}from"./sentry-D49LOZ1j.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CjtZhD5y.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-CM8iKDtd.js";import{u as Kt}from"./useInitialThreadRequest-CFG3lo7l.js";import Ee from"./NotFoundScreen-Bjx2V_hY.js";import{D as ui}from"./DrawerScreen-ZPO4Ypa0.js";import{M as Jt}from"./MobileAppDrawer-DuLLFVYe.js";import{F as Qt}from"./FeaturePreviewScreen-D78u7iOi.js";import{S as Pe}from"./SetupPagesScreen-BbrLzo4b.js";import{B as pi}from"./BillPayApprovalRoutes-aEVqsC6X.js";import{FallBackRoute as mi}from"./ScreenRoutes-D7t2GB4Z.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";import"./analyticsHelper-1nvJW90-.js";import"./routePaths-em7mZQJi.js";import"./BusinessVerificationPageScreen-Bpcf42MJ.js";import"./ReimbursementApprovalRuleDetailScreen-BOkWTXGa.js";import"./getLocaleForTenant-D5dw7iAh.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]="77949c54-e777-49a5-bce4-16872cf9084c",e._sentryDebugIdIdentifier="sentry-dbid-77949c54-e777-49a5-bce4-16872cf9084c")}catch{}})();const bi=X(function(e,t){const l=Le(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Le(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(L(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-CLqAhud6.js";import{j as J,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-aR0qKEiV.js";import{eQ as Z,Mf as Le,bv as It,H8 as oa,bo as wt,bF as pe,Mg as xt,wL as Bt,xV as Ve,xi as la,bn as De,Mh as sa,Mi as ra,c2 as ca,Mj as da,jC as Ct,Mk as At,Ml as Et,yu as _e,w_ as Ce,Mm as ua,wz as tt,Mn as pa,BG as ma,wD as ba,wJ as Dt,Mo as ke,Mp as Ge,xW as Oe,Mq as ha,Mr as ga,xZ as Ne,Ms as ya,ya as Sa,Mt as jt,xG as at,xL as fa,Mu as ka,Mv as ue,Mw as Tt,Mx as Pt,My as Ft,fK as va,x3 as $e,cx as Rt,Mz as Ia,gO as wa,MA as xa,MB as Ba,eW as Mt,eU as Vt,MC as ze,MD as Ca,ME as Aa,J_ as Ze,MF as Ea,J$ as oe,K0 as He,MG as Da,MH as ja,MI as Ta,xN as nt,xK as Pa,MJ as Fa,MK as Ra,ML as Ma,xw as Va,MM as $a,MN as Ua,MO as La,cl as $t,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,vR as Oa,MP as Na,Bt as za,Bz as Za,so as Ha,xX as Wa,yB as qa,j_ as fe,MQ as Ka,MR as Gt,ks as Ja,jU as Ot,kd as Nt,kc as it,bE as be,bK as Qa,MS as Xa,MT as ve,ix as Ya,MU as ot,MV as en,iB as tn,iW as an,yP as nn,MW as on,kl as ln,yF as sn,MX as lt,yJ as rn,yO as cn,yL as dn,yD as un,MY as zt,wU as pn,MZ as mn,M_ as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,pQ as kn,ka as vn,yH as In,iH as wn,kz as xn,M$ as Bn,iz as Cn,pH as An,N0 as En,xC as Dn,bG as jn,bs as Tn,IU as Pn,cP as Fn,cO as Rn,cw as Mn,cC as Vn}from"./zeni-epic-state-deE-VpAu.js";import{m as me,z as M,d as Ie,y as le,S as y,aK as Ae,x as re,o as A,A as je,e as D,b5 as $n,k as z,X as We,r as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,I as _n,aE as Gn,F as Zt,D as qe,O as Ke,b9 as On,aq as Ht,ba as Nn,U as zn,g as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Qn,bh as Xn,bi as Yn,bj as ei,v as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-Cy593RGQ.js";import{n as U,S as si}from"./mui-BY8zvgs4.js";import{A as dt}from"./AddressScreen-BvMQB8FF.js";import{g as ie,a as Te,i as qt,V as Je,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-D0UoKqzj.js";import{a as f}from"./sentry-Cx_bjk1I.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-BHH5iUyl.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-Csr1Wwy2.js";import{u as Kt}from"./useInitialThreadRequest-B-1U2ylt.js";import Ee from"./NotFoundScreen-YKkxofho.js";import{D as ui}from"./DrawerScreen-DTAMBHDh.js";import{M as Jt}from"./MobileAppDrawer-CuP4fq1B.js";import{F as Qt}from"./FeaturePreviewScreen-IL56yObW.js";import{S as Pe}from"./SetupPagesScreen-DeN_QNf8.js";import{B as pi}from"./BillPayApprovalRoutes-BqycijzY.js";import{FallBackRoute as mi}from"./ScreenRoutes-BNgaE4bd.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./analyticsHelper-DN-X1P8T.js";import"./routePaths-Cr_t1xHP.js";import"./BusinessVerificationPageScreen-x0C706ZJ.js";import"./ReimbursementApprovalRuleDetailScreen-Bbsz8QQ6.js";import"./getLocaleForTenant-DhBtn3Ee.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]="77949c54-e777-49a5-bce4-16872cf9084c",e._sentryDebugIdIdentifier="sentry-dbid-77949c54-e777-49a5-bce4-16872cf9084c")}catch{}})();const bi=X(function(e,t){const l=Le(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Le(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(L(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-FqlsN9l2.js";import{a as V}from"./sentry-D49LOZ1j.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-CjgV1pRV.js";import{d as ce,y as ue,aK as de,z as B,A as pe,e as z,ac as x,g as E,bu as le,aq as me,r as M,ar as P}from"./index-BcVOuC0n.js";import{MN as fe,eQ as G,rP as ye,Hc as Se,xw as ge,Ad as Ie,CM as he,Dp as be,Ei as Te,N8 as De,N9 as Oe,Na as ke,Nb as Ce,Nc as Ve,JH as Ne,Ma as we,JT as Ae,ki as _e,fC as ve,fB as Fe,fA as xe,pQ as Ee,pH as Be,pE as ze,ka as Me,rY as Pe,rW as R,bE as L,s8 as U,cv as Re}from"./zeni-epic-state-CZMuxCUG.js";import{n as Le}from"./mui-DV0w8xOn.js";import{c as j}from"./routePaths-em7mZQJi.js";import{M as Ue}from"./MobileAppDrawer-DuLLFVYe.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="24d959d1-2255-40db-a7ea-45416c468677",e._sentryDebugIdIdentifier="sentry-dbid-24d959d1-2255-40db-a7ea-45416c468677")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-CLqAhud6.js";import{a as V}from"./sentry-Cx_bjk1I.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-aR0qKEiV.js";import{d as ce,y as ue,aK as de,z as B,A as pe,e as z,ac as x,g as E,bu as le,aq as me,r as M,ar as P}from"./index-Cy593RGQ.js";import{MN as fe,eQ as G,rP as ye,Hc as Se,xw as ge,Ad as Ie,CM as he,Dp as be,Ei as Te,N8 as De,N9 as Oe,Na as ke,Nb as Ce,Nc as Ve,JH as Ne,Ma as we,JT as Ae,ki as _e,fC as ve,fB as Fe,fA as xe,pQ as Ee,pH as Be,pE as ze,ka as Me,rY as Pe,rW as R,bE as L,s8 as U,cv as Re}from"./zeni-epic-state-deE-VpAu.js";import{n as Le}from"./mui-BY8zvgs4.js";import{c as j}from"./routePaths-Cr_t1xHP.js";import{M as Ue}from"./MobileAppDrawer-CuP4fq1B.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="24d959d1-2255-40db-a7ea-45416c468677",e._sentryDebugIdIdentifier="sentry-dbid-24d959d1-2255-40db-a7ea-45416c468677")}catch{}})();const je=Le.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-FqlsN9l2.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as ut,n as Wt,o as te}from"./core-CjgV1pRV.js";import{eQ as ie,bs as Ue,OF as ka,eU as be,eV as ye,eW as Se,fR as $e,cs as Ge,OG as Ze,OH as Ma,t2 as ba,jK as ya,OI as Sa,gO as oa,zw as Je,zy as za,zz as $a,jA as mt,OJ as Ye,zk as Ct,OK as qt,OL as Xt,zn as Da,OM as Qt,N5 as _a,re as pt,zt as Ga,gZ as Jt,ON as ht,OO as Ke,bq as en,OP as an,fC as Pa,fB as wa,A1 as tn,fA as Ta,MN as nn,OQ as ft,cl as gt,cN as rn,N4 as da,AD as sn,OR as tt,Ad as Fa,OS as bt,AE as on,Nw as cn,AF as dn,Bz as ln,so as un,Bt as mn,zO as yt,zH as Cn,OT as pn,fT as hn,zX as St,z$ as It,fS as fn,OU as gn,Ap as At,OV as bn,OW as yn,OX as Sn,zZ as Et,zK as kt,zq as Dt,zT as _t,zR as Pt,zV as In,zx as nt,OY as wt,OZ as va,Aa as Ia,JM as Tt,cO as Za,O_ as An,O$ as En,P0 as kn,P1 as Dn,A7 as Na,Aw as _n,As as Pn,A3 as wn,Au as Tn,Ak as Fn,Am as vn,P2 as Ft,AC as vt,H8 as xn,P3 as Ln,P4 as Bn,P5 as On,P6 as xt,P7 as Un,AZ as Rn,Ac as Lt,A6 as ca,Ab as jn,P8 as Nn,P9 as Vn,zh as Hn,Pa as Bt,Pb as Ot,Pc as Mn,zj as zn,zi as rt,Pd as $n,Pe as Gn,Pf as Zn,JI as Yn,Pg as Ya,Ph as Kn,vU as Ut,ki as Wn,gP as qn,B2 as Xn,Pi as Rt,Pj as Qn,B3 as Jn,Pk as er,df as ar,sY as tr,AU as nr,AO as Oe,bv as rr,bF as sr,cx as or,bG as cr,IU as ir}from"./zeni-epic-state-CZMuxCUG.js";import{z as J,d as je,y as ce,S as Z,x as la,bY as xa,c7 as dr,k as ve,c8 as lr,c9 as ur,Z as ua,aK as Fe,r as fe,bf as Ka,ca as mr,F as ma,j as La,m as Wa,e as X,D as qa,cb as Cr,an as Xa,br as Xe,cc as Va,cd as pr,A as Qa,a3 as hr,ce as fr,aq as jt,X as Ha,U as Nt,g as Vt,cf as gr,cg as br,ch as yr,ci as Sr,cj as Ir,ck as Ar,o as Aa,cl as Er,cm as kr,cn as Ua,v as Dr,co as _r,cp as Pr,cq as wr,cr as Tr,cs as Fr,a6 as vr}from"./index-BcVOuC0n.js";import{n as _e,D as Ht,S as xr}from"./mui-DV0w8xOn.js";import{a as i}from"./sentry-D49LOZ1j.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Re,f as Ne,A as Lr,h as Ja,P as Br,i as et,s as Qe,j as zt,k as Me,l as $t,m as Or,n as Gt,p as Ur,S as st}from"./SetupPagesScreen-BbrLzo4b.js";import Ba from"./NotFoundScreen-Bjx2V_hY.js";import{M as ze}from"./MobileAppDrawer-DuLLFVYe.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-CjtZhD5y.js";import{c as Yt}from"./useFetchSuggestedQuestionsWhenReady-CM8iKDtd.js";import{v as ot}from"./utils-RiJ_hKSI.js";import{t as Rr}from"./AddressScreen-iadLC3wL.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./analyticsHelper-1nvJW90-.js";import"./routePaths-em7mZQJi.js";import"./BusinessVerificationPageScreen-Bpcf42MJ.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]="dca7affe-f452-48d0-894d-2f74cdefea27",e._sentryDebugIdIdentifier="sentry-dbid-dca7affe-f452-48d0-894d-2f74cdefea27")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(Q=>ie(Q)),C=je(),p=Ue(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=u(Z.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>$e(Q,n.companyId)),N=Ge(v.controllers),{creditAccount:B,creditAccountRepayment:w}=y(Q=>Ze(Q)),V=y(Q=>Q.classListState.fetchState),m=!_&&d&&f,l=y(Q=>Ma(Q,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,O=H?.cardCreatedByUser?.userId,K=y(Q=>O!=null?ba(Q.userRoleState,O):void 0),I=K?.accountingClassIDs[0],L=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,R=y(Q=>j!=null?ba(Q.userRoleState,j):void 0),W=R?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,G]),i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&d&&f&&p&&a(za()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[B.fetchState,w.fetchState,a,d,f,p,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,g,D,f),ae=Ca(d,f,p,B,w),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:B,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:L?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(Ba,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},zr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Xt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Z.isDebitCardFeatureEnabled),w=Se(B,k),V=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&O&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,O)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Qt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const L=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ze,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx($r,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:L,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:La.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-CLqAhud6.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as ut,n as Wt,o as te}from"./core-aR0qKEiV.js";import{eQ as ie,bs as Ue,OF as ka,eU as be,eV as ye,eW as Se,fR as $e,cs as Ge,OG as Ze,OH as Ma,t2 as ba,jK as ya,OI as Sa,gO as oa,zw as Je,zy as za,zz as $a,jA as mt,OJ as Ye,zk as Ct,OK as qt,OL as Xt,zn as Da,OM as Qt,N5 as _a,re as pt,zt as Ga,gZ as Jt,ON as ht,OO as Ke,bq as en,OP as an,fC as Pa,fB as wa,A1 as tn,fA as Ta,MN as nn,OQ as ft,cl as gt,cN as rn,N4 as da,AD as sn,OR as tt,Ad as Fa,OS as bt,AE as on,Nw as cn,AF as dn,Bz as ln,so as un,Bt as mn,zO as yt,zH as Cn,OT as pn,fT as hn,zX as St,z$ as It,fS as fn,OU as gn,Ap as At,OV as bn,OW as yn,OX as Sn,zZ as Et,zK as kt,zq as Dt,zT as _t,zR as Pt,zV as In,zx as nt,OY as wt,OZ as va,Aa as Ia,JM as Tt,cO as Za,O_ as An,O$ as En,P0 as kn,P1 as Dn,A7 as Na,Aw as _n,As as Pn,A3 as wn,Au as Tn,Ak as Fn,Am as vn,P2 as Ft,AC as vt,H8 as xn,P3 as Ln,P4 as Bn,P5 as On,P6 as xt,P7 as Un,AZ as Rn,Ac as Lt,A6 as ca,Ab as jn,P8 as Nn,P9 as Vn,zh as Hn,Pa as Bt,Pb as Ot,Pc as Mn,zj as zn,zi as rt,Pd as $n,Pe as Gn,Pf as Zn,JI as Yn,Pg as Ya,Ph as Kn,vU as Ut,ki as Wn,gP as qn,B2 as Xn,Pi as Rt,Pj as Qn,B3 as Jn,Pk as er,df as ar,sY as tr,AU as nr,AO as Oe,bv as rr,bF as sr,cx as or,bG as cr,IU as ir}from"./zeni-epic-state-deE-VpAu.js";import{z as J,d as je,y as ce,S as Z,x as la,bY as xa,c7 as dr,k as ve,c8 as lr,c9 as ur,Z as ua,aK as Fe,r as fe,bf as Ka,ca as mr,F as ma,j as La,m as Wa,e as X,D as qa,cb as Cr,an as Xa,br as Xe,cc as Va,cd as pr,A as Qa,a3 as hr,ce as fr,aq as jt,X as Ha,U as Nt,g as Vt,cf as gr,cg as br,ch as yr,ci as Sr,cj as Ir,ck as Ar,o as Aa,cl as Er,cm as kr,cn as Ua,v as Dr,co as _r,cp as Pr,cq as wr,cr as Tr,cs as Fr,a6 as vr}from"./index-Cy593RGQ.js";import{n as _e,D as Ht,S as xr}from"./mui-BY8zvgs4.js";import{a as i}from"./sentry-Cx_bjk1I.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Re,f as Ne,A as Lr,h as Ja,P as Br,i as et,s as Qe,j as zt,k as Me,l as $t,m as Or,n as Gt,p as Ur,S as st}from"./SetupPagesScreen-DeN_QNf8.js";import Ba from"./NotFoundScreen-YKkxofho.js";import{M as ze}from"./MobileAppDrawer-CuP4fq1B.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-BHH5iUyl.js";import{c as Yt}from"./useFetchSuggestedQuestionsWhenReady-Csr1Wwy2.js";import{v as ot}from"./utils-B5-1mb3v.js";import{t as Rr}from"./AddressScreen-BvMQB8FF.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./analyticsHelper-DN-X1P8T.js";import"./routePaths-Cr_t1xHP.js";import"./BusinessVerificationPageScreen-x0C706ZJ.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]="dca7affe-f452-48d0-894d-2f74cdefea27",e._sentryDebugIdIdentifier="sentry-dbid-dca7affe-f452-48d0-894d-2f74cdefea27")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(Q=>ie(Q)),C=je(),p=Ue(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=u(Z.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>$e(Q,n.companyId)),N=Ge(v.controllers),{creditAccount:B,creditAccountRepayment:w}=y(Q=>Ze(Q)),V=y(Q=>Q.classListState.fetchState),m=!_&&d&&f,l=y(Q=>Ma(Q,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,O=H?.cardCreatedByUser?.userId,K=y(Q=>O!=null?ba(Q.userRoleState,O):void 0),I=K?.accountingClassIDs[0],L=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,R=y(Q=>j!=null?ba(Q.userRoleState,j):void 0),W=R?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,G]),i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&d&&f&&p&&a(za()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[B.fetchState,w.fetchState,a,d,f,p,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,g,D,f),ae=Ca(d,f,p,B,w),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:B,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:L?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(Ba,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},zr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Xt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Z.isDebitCardFeatureEnabled),w=Se(B,k),V=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&O&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,O)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Qt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const L=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ze,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx($r,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:L,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:La.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-FqlsN9l2.js";import{a as g}from"./sentry-D49LOZ1j.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-CjgV1pRV.js";import{z as N,b1 as P,A as F,e as V,g as A,ac as C,b2 as j,aq as L,ar as M,r as U}from"./index-BcVOuC0n.js";import{eQ as b,fE as B,rP as R,fz as _,c2 as z,Ma as G,bn as Q,pQ as Y,pE as q,ka as H,lG as S,Mb as Z,bE as $,cv as D,lO as J,lR as K}from"./zeni-epic-state-CZMuxCUG.js";import"./mui-DV0w8xOn.js";import{c as W}from"./routePaths-em7mZQJi.js";import{M as X}from"./MobileAppDrawer-DuLLFVYe.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="331402ed-e840-4f95-a3f5-ac6711e7d60c",n._sentryDebugIdIdentifier="sentry-dbid-331402ed-e840-4f95-a3f5-ac6711e7d60c")}catch{}})();const ee=E(function(n){const t=_(n),i=N.getSignedInUser(),l=b(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:Q(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(K())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(Z(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(q(e))},onEditFileName:(e,a)=>{n(Y(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>b(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(R())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(P,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-CLqAhud6.js";import{a as g}from"./sentry-Cx_bjk1I.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-aR0qKEiV.js";import{z as N,b1 as P,A as F,e as V,g as A,ac as C,b2 as j,aq as L,ar as M,r as U}from"./index-Cy593RGQ.js";import{eQ as b,fE as B,rP as R,fz as _,c2 as z,Ma as G,bn as Q,pQ as Y,pE as q,ka as H,lG as S,Mb as Z,bE as $,cv as D,lO as J,lR as K}from"./zeni-epic-state-deE-VpAu.js";import"./mui-BY8zvgs4.js";import{c as W}from"./routePaths-Cr_t1xHP.js";import{M as X}from"./MobileAppDrawer-CuP4fq1B.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="331402ed-e840-4f95-a3f5-ac6711e7d60c",n._sentryDebugIdIdentifier="sentry-dbid-331402ed-e840-4f95-a3f5-ac6711e7d60c")}catch{}})();const ee=E(function(n){const t=_(n),i=N.getSignedInUser(),l=b(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:Q(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(K())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(Z(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(q(e))},onEditFileName:(e,a)=>{n(Y(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>b(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(R())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(P,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-FqlsN9l2.js";import{a}from"./sentry-D49LOZ1j.js";import{h as D,u as v,g as m,N as w}from"./core-CjgV1pRV.js";import{IQ as A,eQ as O,fl as U,mx as _,fN as h,fk as j,eR as L,IX as k}from"./zeni-epic-state-CZMuxCUG.js";import{u as F,z as u,L as g,D as $,o as H}from"./index-BcVOuC0n.js";import{n as Q}from"./mui-DV0w8xOn.js";import{t as R}from"./getLocaleForTenant-D5dw7iAh.js";import{g as z,Q as P}from"./QBOConnectionScreen-eKsh6fZL.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";import"./empty-CyGd8cnQ.js";import"./pdf-lib-CMxizmxK.js";import"./index-CEFWvyAZ.js";import"./url-DR56GGlL.js";import"./index-6IUOh0lu.js";import"./decodeURIComponentSafe-N2eflqcZ.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]="a34130d6-502c-4dfc-89da-eeff561da64a",t._sentryDebugIdIdentifier="sentry-dbid-a34130d6-502c-4dfc-89da-eeff561da64a")}catch{}})();const G=Q.div`
1
+ import{j as C}from"./liveblocks-CLqAhud6.js";import{a}from"./sentry-Cx_bjk1I.js";import{h as D,u as v,g as m,N as w}from"./core-aR0qKEiV.js";import{IQ as A,eQ as O,fl as U,mx as _,fN as h,fk as j,eR as L,IX as k}from"./zeni-epic-state-deE-VpAu.js";import{u as F,z as u,L as g,D as $,o as H}from"./index-Cy593RGQ.js";import{n as Q}from"./mui-BY8zvgs4.js";import{t as R}from"./getLocaleForTenant-DhBtn3Ee.js";import{g as z,Q as P}from"./QBOConnectionScreen-DOLdLoS0.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./empty-DcODLT1b.js";import"./pdf-lib-BYGY-M64.js";import"./index-ChczZgz4.js";import"./url-DTcdHmle.js";import"./index-B7d7MSWD.js";import"./decodeURIComponentSafe-imXO9fsR.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]="a34130d6-502c-4dfc-89da-eeff561da64a",t._sentryDebugIdIdentifier="sentry-dbid-a34130d6-502c-4dfc-89da-eeff561da64a")}catch{}})();const G=Q.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-CLqAhud6.js";import{z as a}from"./index-Cy593RGQ.js";import{g as n}from"./QBOConnectionScreen-DOLdLoS0.js";import"./sentry-Cx_bjk1I.js";import{u as p,N as s}from"./core-aR0qKEiV.js";import"./zeni-epic-state-deE-VpAu.js";import"./recharts-RPqam0Wx.js";import"./mui-BY8zvgs4.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./empty-DcODLT1b.js";import"./pdf-lib-BYGY-M64.js";import"./index-ChczZgz4.js";import"./url-DTcdHmle.js";import"./index-B7d7MSWD.js";import"./decodeURIComponentSafe-imXO9fsR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-FqlsN9l2.js";import{t as $e,A as Ce}from"./AddressScreen-iadLC3wL.js";import ze from"./NotFoundScreen-Bjx2V_hY.js";import{a as g}from"./sentry-D49LOZ1j.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Qe,n as Me,o as Q}from"./core-CjgV1pRV.js";import{v as de,d as le,z as B,y as ue,m as qe,S as _,r as V,A as W,e as N,x as ve,g as X,am as Je,Z as Ke,an as ke,j as te,ao as Ze,ap as Ie,o as We,aq as He,ar as Ee,as as Xe}from"./index-BcVOuC0n.js";import{bn as Ye,eQ as ee,fd as et,eW as pe,eU as me,bv as tt,mv as at,f9 as nt,bO as ot,je as ae,jh as we,Jk as st,bT as it,c2 as ge,s1 as fe,rO as rt,JR as Y,s2 as _e,Hc as ct,ki as Ue,JS as Ve,JT as dt,JU as lt,JV as ut,jc as pt,jf as mt,rQ as Be,s0 as gt,bE as Te,cv as ft,se as xe,pQ as ht,pE as yt,ka as St,fC as bt,fB as Ct,fA as kt,JW as It,rI as Et,sf as Tt,si as xt,sl as Ot,sr as At,cU as Pt}from"./zeni-epic-state-CZMuxCUG.js";import{n as he}from"./mui-DV0w8xOn.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-eKsh6fZL.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";import"./empty-CyGd8cnQ.js";import"./pdf-lib-CMxizmxK.js";import"./index-CEFWvyAZ.js";import"./url-DR56GGlL.js";import"./index-6IUOh0lu.js";import"./decodeURIComponentSafe-N2eflqcZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="01a41e00-2ce2-4e4c-9df5-a79fdd821a5a",t._sentryDebugIdIdentifier="sentry-dbid-01a41e00-2ce2-4e4c-9df5-a79fdd821a5a")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Je),vt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const v=pe(F,c),A=me(c),P=[],J=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),w=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),w===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||v||A||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,P)))},[d,O,v,A,i,c.tenantId,s]),g.useEffect(()=>{(v||A)&&setTimeout(()=>{S(!0)},5e3)},[v,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(v)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(ve,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-CLqAhud6.js";import{t as $e,A as Ce}from"./AddressScreen-BvMQB8FF.js";import ze from"./NotFoundScreen-YKkxofho.js";import{a as g}from"./sentry-Cx_bjk1I.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Qe,n as Me,o as Q}from"./core-aR0qKEiV.js";import{v as de,d as le,z as B,y as ue,m as qe,S as _,r as V,A as W,e as N,x as ve,g as X,am as Je,Z as Ke,an as ke,j as te,ao as Ze,ap as Ie,o as We,aq as He,ar as Ee,as as Xe}from"./index-Cy593RGQ.js";import{bn as Ye,eQ as ee,fd as et,eW as pe,eU as me,bv as tt,mv as at,f9 as nt,bO as ot,je as ae,jh as we,Jk as st,bT as it,c2 as ge,s1 as fe,rO as rt,JR as Y,s2 as _e,Hc as ct,ki as Ue,JS as Ve,JT as dt,JU as lt,JV as ut,jc as pt,jf as mt,rQ as Be,s0 as gt,bE as Te,cv as ft,se as xe,pQ as ht,pE as yt,ka as St,fC as bt,fB as Ct,fA as kt,JW as It,rI as Et,sf as Tt,si as xt,sl as Ot,sr as At,cU as Pt}from"./zeni-epic-state-deE-VpAu.js";import{n as he}from"./mui-BY8zvgs4.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DOLdLoS0.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./empty-DcODLT1b.js";import"./pdf-lib-BYGY-M64.js";import"./index-ChczZgz4.js";import"./url-DTcdHmle.js";import"./index-B7d7MSWD.js";import"./decodeURIComponentSafe-imXO9fsR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="01a41e00-2ce2-4e4c-9df5-a79fdd821a5a",t._sentryDebugIdIdentifier="sentry-dbid-01a41e00-2ce2-4e4c-9df5-a79fdd821a5a")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Je),vt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const v=pe(F,c),A=me(c),P=[],J=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),w=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),w===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||v||A||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,P)))},[d,O,v,A,i,c.tenantId,s]),g.useEffect(()=>{(v||A)&&setTimeout(()=>{S(!0)},5e3)},[v,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(v)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(ve,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-FqlsN9l2.js";import{l as $,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-CjgV1pRV.js";import{eQ as L,Ka as Ye,bE as Vt,bq as he,Ln as qa,i2 as Za,Lo as wt,Lp as Ha,i5 as rt,Lq as je,Lr as Qa,ia as Wa,Ls as Dt,Lt as Xa,ie as it,Lu as Me,Lv as Ja,cl as lt,Lw as en,Lx as tn,Ku as an,j8 as nn,Ly as on,bn as Ee,Lz as Nt,J_ as ae,bc as zt,jm as $t,mF as Kt,j5 as qt,K0 as ne,J$ as H,f5 as sn,eN as rn,fn as cn,LA as ln,LB as dn,LC as Zt,LD as _e,tT as Ie,tU as Te,uf as fe,u9 as oe,tY as xe,LE as un,LF as mn,LG as pn,LH as Ht,LI as ke,LJ as hn,dE as Ge,qo as Qt,LK as fn,LL as gn,LM as Cn,LN as dt,Jn as ut,jC as ge,un as mt,qw as bn,LO as _n,tV as Ft,qr as me,qn as Wt,LP as ie,LQ as kn,LR as pt,Jl as ht,sv as Xt,LS as Sn,LT as yn,LU as An,LV as ft,sI as vn,LW as En,tX as Ot,su as Jt,LX as ce,LY as In,bv as ea,ur as ta,LZ as Tn,L_ as xn,L$ as wn,M0 as gt,um as Dn,M1 as Fn,tW as Pt,uq as aa,M2 as le,M3 as On,M4 as Pn,M5 as na,jr as oa,mC as sa,jw as ra,mA as ia,mz as ca,my as la,rT as Bn,fd as Rn,cO as Ln,cP as jn,mv as Mn,f9 as Un,mM as Yn,Dv as Bt,M6 as Gn,M7 as Vn,M8 as Nn,M9 as zn,b5 as Ct,f0 as $n,gM as Kn,fE as qn,mG as Zn,i_ as Hn,mD as Qn,mB as Wn,eW as Xn,eU as Jn}from"./zeni-epic-state-CZMuxCUG.js";import{z as R,X as W,r as D,e as E,D as K,aR as eo,A as we,aS as da,g as G,aT as to,d as De,aU as ua,y as Ve,S as j,m as ao,aV as no,aW as oo,T as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,W as lo,aZ as uo,a_ as mo,an as po,k as ho,U as fo,a$ as go,b0 as ye}from"./index-BcVOuC0n.js";import{n as bt}from"./mui-DV0w8xOn.js";import{a as b}from"./sentry-D49LOZ1j.js";import{w as fa}from"./withTransactionSidePanel-BevSoIGb.js";import{b as ga,t as Ce,e as se,a as _t,v as Co}from"./routePaths-em7mZQJi.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-CjtZhD5y.js";import{c as Fe,b as bo,u as _o}from"./useFetchSuggestedQuestionsWhenReady-CM8iKDtd.js";import ve from"./NotFoundScreen-Bjx2V_hY.js";import{t as Ca}from"./analyticsHelper-1nvJW90-.js";import{C as ko}from"./CompanyPassportScreen-Bo8U2F7k.js";import{F as So}from"./FeaturePreviewScreen-D78u7iOi.js";import{R as yo}from"./ReferralListScreen-De_dGEop.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";import"./TransactionDetailScreen-718LSRWk.js";import"./decodeURIComponentSafe-N2eflqcZ.js";import"./MobileAppDrawer-DuLLFVYe.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]="8bf362e3-8425-45ef-a6f2-41b1fff2e369",e._sentryDebugIdIdentifier="sentry-dbid-8bf362e3-8425-45ef-a6f2-41b1fff2e369")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(I=>I.tenantState.currentTenantId),d=S(I=>L(I)),{tenantEmailDomain:p}=$(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ye()}),[]),m=b.useMemo(()=>r!=null?Vt(r):he(),[r]),h=N(),f=Z(),k=S(I=>qa(I,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),C=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((I,z)=>{h(wt({sortKey:I,sortOrder:z}))},[]),T=b.useCallback(I=>{h(wt({downloadState:I}))},[]),M=b.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(p!=null){const z=ga({id:I.transactionId,type:I.transactionType},p);f(z);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(z,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&E.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:E,onTransactionClick:M,onReload:y,onBackClick:C,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${W}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(je({searchString:A}))},[]),h=b.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(je({downloadState:A}))},[]),y=b.useCallback((A,T)=>{},[]),C=b.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:E,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:C,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Eo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ye()}),[]),c=b.useMemo(()=>r!=null?Vt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),C=b.useCallback((F,I)=>{m(Dt({sortKey:F,sortOrder:I}))},[]),A=b.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const I=ga({id:F.transactionId,type:F.transactionType},d);h(I);const z=D(p.state?.pathnameStackToGoBack,p.pathname);h(I,{state:{pathnameStackToGoBack:z}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&E.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:E,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:C,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=N(),a=Z(),t=S(C=>Xa(C)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(C=>L(C)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${W}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(C=>{e(Me({searchString:C}))},[]),m=b.useCallback((C,A)=>{e(Me({sortKey:A,sortOrder:C}))},[]),h=b.useCallback(C=>{a(`./${C}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=b.useCallback(C=>{e(Me({downloadState:C}))},[]),k=b.useCallback((C,A)=>{e(Me({selectedDate:C,agingDateSelectionType:A})),e(it(C))},[]),y=b.useCallback((C,A)=>{e(Ja({nodeId:C,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:C=>C.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:E,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ba=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Ce(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?E.trackZeniAccountsCashBalancePromoClicked("Move Money"):(E.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else E.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>ba(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:E}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>ba(o,r)),t=R.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:E}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=bt.div`
1
+ import{j as l}from"./liveblocks-CLqAhud6.js";import{l as $,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-aR0qKEiV.js";import{eQ as L,Ka as Ye,bE as Vt,bq as he,Ln as qa,i2 as Za,Lo as wt,Lp as Ha,i5 as rt,Lq as je,Lr as Qa,ia as Wa,Ls as Dt,Lt as Xa,ie as it,Lu as Me,Lv as Ja,cl as lt,Lw as en,Lx as tn,Ku as an,j8 as nn,Ly as on,bn as Ee,Lz as Nt,J_ as ae,bc as zt,jm as $t,mF as Kt,j5 as qt,K0 as ne,J$ as H,f5 as sn,eN as rn,fn as cn,LA as ln,LB as dn,LC as Zt,LD as _e,tT as Ie,tU as Te,uf as fe,u9 as oe,tY as xe,LE as un,LF as mn,LG as pn,LH as Ht,LI as ke,LJ as hn,dE as Ge,qo as Qt,LK as fn,LL as gn,LM as Cn,LN as dt,Jn as ut,jC as ge,un as mt,qw as bn,LO as _n,tV as Ft,qr as me,qn as Wt,LP as ie,LQ as kn,LR as pt,Jl as ht,sv as Xt,LS as Sn,LT as yn,LU as An,LV as ft,sI as vn,LW as En,tX as Ot,su as Jt,LX as ce,LY as In,bv as ea,ur as ta,LZ as Tn,L_ as xn,L$ as wn,M0 as gt,um as Dn,M1 as Fn,tW as Pt,uq as aa,M2 as le,M3 as On,M4 as Pn,M5 as na,jr as oa,mC as sa,jw as ra,mA as ia,mz as ca,my as la,rT as Bn,fd as Rn,cO as Ln,cP as jn,mv as Mn,f9 as Un,mM as Yn,Dv as Bt,M6 as Gn,M7 as Vn,M8 as Nn,M9 as zn,b5 as Ct,f0 as $n,gM as Kn,fE as qn,mG as Zn,i_ as Hn,mD as Qn,mB as Wn,eW as Xn,eU as Jn}from"./zeni-epic-state-deE-VpAu.js";import{z as R,X as W,r as D,e as E,D as K,aR as eo,A as we,aS as da,g as G,aT as to,d as De,aU as ua,y as Ve,S as j,m as ao,aV as no,aW as oo,T as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,W as lo,aZ as uo,a_ as mo,an as po,k as ho,U as fo,a$ as go,b0 as ye}from"./index-Cy593RGQ.js";import{n as bt}from"./mui-BY8zvgs4.js";import{a as b}from"./sentry-Cx_bjk1I.js";import{w as fa}from"./withTransactionSidePanel-4Qi1EecU.js";import{b as ga,t as Ce,e as se,a as _t,v as Co}from"./routePaths-Cr_t1xHP.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-BHH5iUyl.js";import{c as Fe,b as bo,u as _o}from"./useFetchSuggestedQuestionsWhenReady-Csr1Wwy2.js";import ve from"./NotFoundScreen-YKkxofho.js";import{t as Ca}from"./analyticsHelper-DN-X1P8T.js";import{C as ko}from"./CompanyPassportScreen-D6yPFCfS.js";import{F as So}from"./FeaturePreviewScreen-IL56yObW.js";import{R as yo}from"./ReferralListScreen-vfg1s_YP.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./TransactionDetailScreen-CxbLldkU.js";import"./decodeURIComponentSafe-imXO9fsR.js";import"./MobileAppDrawer-CuP4fq1B.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]="8bf362e3-8425-45ef-a6f2-41b1fff2e369",e._sentryDebugIdIdentifier="sentry-dbid-8bf362e3-8425-45ef-a6f2-41b1fff2e369")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(I=>I.tenantState.currentTenantId),d=S(I=>L(I)),{tenantEmailDomain:p}=$(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ye()}),[]),m=b.useMemo(()=>r!=null?Vt(r):he(),[r]),h=N(),f=Z(),k=S(I=>qa(I,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),C=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((I,z)=>{h(wt({sortKey:I,sortOrder:z}))},[]),T=b.useCallback(I=>{h(wt({downloadState:I}))},[]),M=b.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(p!=null){const z=ga({id:I.transactionId,type:I.transactionType},p);f(z);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(z,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&E.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:E,onTransactionClick:M,onReload:y,onBackClick:C,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${W}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(je({searchString:A}))},[]),h=b.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(je({downloadState:A}))},[]),y=b.useCallback((A,T)=>{},[]),C=b.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:E,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:C,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Eo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ye()}),[]),c=b.useMemo(()=>r!=null?Vt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),C=b.useCallback((F,I)=>{m(Dt({sortKey:F,sortOrder:I}))},[]),A=b.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const I=ga({id:F.transactionId,type:F.transactionType},d);h(I);const z=D(p.state?.pathnameStackToGoBack,p.pathname);h(I,{state:{pathnameStackToGoBack:z}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&E.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:E,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:C,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=N(),a=Z(),t=S(C=>Xa(C)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(C=>L(C)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${W}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(C=>{e(Me({searchString:C}))},[]),m=b.useCallback((C,A)=>{e(Me({sortKey:A,sortOrder:C}))},[]),h=b.useCallback(C=>{a(`./${C}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=b.useCallback(C=>{e(Me({downloadState:C}))},[]),k=b.useCallback((C,A)=>{e(Me({selectedDate:C,agingDateSelectionType:A})),e(it(C))},[]),y=b.useCallback((C,A)=>{e(Ja({nodeId:C,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:C=>C.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:E,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ba=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Ce(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?E.trackZeniAccountsCashBalancePromoClicked("Move Money"):(E.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else E.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>ba(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:E}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>ba(o,r)),t=R.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:E}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=bt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-FqlsN9l2.js";import{a as u}from"./sentry-D49LOZ1j.js";import{h as y,g as p,k as w,u as A,N as k}from"./core-CjgV1pRV.js";import{IQ as N,eQ as _,fl as R,IR as U,mx as L,IS as z}from"./zeni-epic-state-CZMuxCUG.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-BcVOuC0n.js";import"./mui-DV0w8xOn.js";import{t as Q}from"./getLocaleForTenant-D5dw7iAh.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.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]="cfe0b159-02e1-4a39-bea7-ba47bb43fa75",t._sentryDebugIdIdentifier="sentry-dbid-cfe0b159-02e1-4a39-bea7-ba47bb43fa75")}catch{}})();const P=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),b=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=b.get("question")?.replace(/^["']|["']$/g,"")??null,e=b.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,b);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),b=u.useRef(null),m=p(e=>N(e)),n=p(e=>e.tenantState.fetchState),i=p(e=>e.tenantState.error),a=p(e=>e.tenantState.activeTenantFetchState.fetchState),c=p(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;b.current!==e&&(b.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(R(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!U(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(Q(c)),o())},[n,a,c]),v.jsx(P,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-CLqAhud6.js";import{a as u}from"./sentry-Cx_bjk1I.js";import{h as y,g as p,k as w,u as A,N as k}from"./core-aR0qKEiV.js";import{IQ as N,eQ as _,fl as R,IR as U,mx as L,IS as z}from"./zeni-epic-state-deE-VpAu.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-Cy593RGQ.js";import"./mui-BY8zvgs4.js";import{t as Q}from"./getLocaleForTenant-DhBtn3Ee.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.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]="cfe0b159-02e1-4a39-bea7-ba47bb43fa75",t._sentryDebugIdIdentifier="sentry-dbid-cfe0b159-02e1-4a39-bea7-ba47bb43fa75")}catch{}})();const P=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),b=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=b.get("question")?.replace(/^["']|["']$/g,"")??null,e=b.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,b);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),b=u.useRef(null),m=p(e=>N(e)),n=p(e=>e.tenantState.fetchState),i=p(e=>e.tenantState.error),a=p(e=>e.tenantState.activeTenantFetchState.fetchState),c=p(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;b.current!==e&&(b.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(R(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!U(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(Q(c)),o())},[n,a,c]),v.jsx(P,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-FqlsN9l2.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-CjgV1pRV.js";import{MT as k,M_ as O,fC as J,fB as Q,fA as W,iz as q,J$ as K,pH as L,eQ as V,Mp as D,ix as T,MU as S,N1 as F,iv as G,iS as j}from"./zeni-epic-state-CZMuxCUG.js";import{bn as X,Z as N,y as R,z as U,m as Z,k as b,S as v,x as _,bo as Y,o as z,bp as ee,r as te}from"./index-BcVOuC0n.js";import{n as H}from"./mui-DV0w8xOn.js";import"./sentry-D49LOZ1j.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]="78a1ffe5-fe7c-47d5-961c-f07dd2c7ea2d",e._sentryDebugIdIdentifier="sentry-dbid-78a1ffe5-fe7c-47d5-961c-f07dd2c7ea2d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(Q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(O(n,a,o))}}})(X);function M({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-CLqAhud6.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-aR0qKEiV.js";import{MT as k,M_ as O,fC as J,fB as Q,fA as W,iz as q,J$ as K,pH as L,eQ as V,Mp as D,ix as T,MU as S,N1 as F,iv as G,iS as j}from"./zeni-epic-state-deE-VpAu.js";import{bn as X,Z as N,y as R,z as U,m as Z,k as b,S as v,x as _,bo as Y,o as z,bp as ee,r as te}from"./index-Cy593RGQ.js";import{n as H}from"./mui-BY8zvgs4.js";import"./sentry-Cx_bjk1I.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]="78a1ffe5-fe7c-47d5-961c-f07dd2c7ea2d",e._sentryDebugIdIdentifier="sentry-dbid-78a1ffe5-fe7c-47d5-961c-f07dd2c7ea2d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(Q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(O(n,a,o))}}})(X);function M({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-FqlsN9l2.js";import{Z as c,F as l,m as f}from"./index-BcVOuC0n.js";import{D as b}from"./mui-DV0w8xOn.js";import"./sentry-D49LOZ1j.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]="b5be3e28-c03d-4845-afab-c42c4b43f04b",e._sentryDebugIdIdentifier="sentry-dbid-b5be3e28-c03d-4845-afab-c42c4b43f04b")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{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
+ import{j as i}from"./liveblocks-CLqAhud6.js";import{Z as c,F as l,m as f}from"./index-Cy593RGQ.js";import{D as b}from"./mui-BY8zvgs4.js";import"./sentry-Cx_bjk1I.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]="b5be3e28-c03d-4845-afab-c42c4b43f04b",e._sentryDebugIdIdentifier="sentry-dbid-b5be3e28-c03d-4845-afab-c42c4b43f04b")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{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 +1 @@
1
- import{j as s}from"./liveblocks-FqlsN9l2.js";import{a as d}from"./sentry-D49LOZ1j.js";import{j as B,h as G,u as q,l as K,g as l,N as F,k as O,n as _,o as N}from"./core-CjgV1pRV.js";import{L6 as H,eQ as $,Kv as J,kC as L,H4 as C,Lb as M,J_ as R,jC as W,H5 as S,KA as Y,KB as z,K0 as Q,J$ as V}from"./zeni-epic-state-CZMuxCUG.js";import{aO as U,e as X,k as Z,r as tt}from"./index-BcVOuC0n.js";import"./mui-DV0w8xOn.js";import{d as k}from"./decodeURIComponentSafe-N2eflqcZ.js";import{w as et}from"./withTransactionSidePanel-BevSoIGb.js";import{e as at,b as nt}from"./routePaths-em7mZQJi.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";import"./useAskAiCfoHostNavButtonProps-CjtZhD5y.js";import"./useFetchSuggestedQuestionsWhenReady-CM8iKDtd.js";import"./TransactionDetailScreen-718LSRWk.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]="ff8535d6-d554-4068-aaf1-b8ef8f62d631",a._sentryDebugIdIdentifier="sentry-dbid-ff8535d6-d554-4068-aaf1-b8ef8f62d631")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:W(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(Q({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(V("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a(z()),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(C(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=B(),o=G(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:x}=K(),r=k(j??""),f=k(x??""),p=rt(r,f),v=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>$(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>J(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(L(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(C(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(v.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 xt({entityType:a}){return s.jsx(_,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-CLqAhud6.js";import{a as d}from"./sentry-Cx_bjk1I.js";import{j as B,h as G,u as q,l as K,g as l,N as F,k as O,n as _,o as N}from"./core-aR0qKEiV.js";import{L6 as H,eQ as $,Kv as J,kC as L,H4 as C,Lb as M,J_ as R,jC as W,H5 as S,KA as Y,KB as z,K0 as Q,J$ as V}from"./zeni-epic-state-deE-VpAu.js";import{aO as U,e as X,k as Z,r as tt}from"./index-Cy593RGQ.js";import"./mui-BY8zvgs4.js";import{d as k}from"./decodeURIComponentSafe-imXO9fsR.js";import{w as et}from"./withTransactionSidePanel-4Qi1EecU.js";import{e as at,b as nt}from"./routePaths-Cr_t1xHP.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./useAskAiCfoHostNavButtonProps-BHH5iUyl.js";import"./useFetchSuggestedQuestionsWhenReady-Csr1Wwy2.js";import"./TransactionDetailScreen-CxbLldkU.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]="ff8535d6-d554-4068-aaf1-b8ef8f62d631",a._sentryDebugIdIdentifier="sentry-dbid-ff8535d6-d554-4068-aaf1-b8ef8f62d631")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:W(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(Q({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(V("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a(z()),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(C(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=B(),o=G(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:x}=K(),r=k(j??""),f=k(x??""),p=rt(r,f),v=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>$(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>J(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(L(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(C(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(v.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 xt({entityType:a}){return s.jsx(_,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-FqlsN9l2.js";import xn from"./NotFoundScreen-Bjx2V_hY.js";import{a,b as Tt}from"./sentry-D49LOZ1j.js";import{n as Fe,S as Rn}from"./mui-DV0w8xOn.js";import{h as ce,j as wt,u as qe,g as U,k as Dn,l as rt,n as Un,o as ze}from"./core-CjgV1pRV.js";import{eQ as Re,Pq as Fn,mH as Se,fg as Bn,qi as _n,mZ as xt,ni as Rt,Pr as Dt,ns as Mn,Ps as Ut,mS as On,pQ as Vn,e$ as pe,Pt as De,so as Ft,Bz as Bt,Pu as _t,Pv as jn,pv as Je,L7 as dt,L9 as zn,jF as Ln,La as $n,jM as Gn,cW as qn,tr as Ne,n3 as Mt,nx as Ue,Pw as Jn,K0 as ut,J$ as Te,Px as mt,k1 as Nn,Py as Yn,Pz as Kn,PA as Qn,PB as Hn,na as Wn,mX as ie,nA as we,PC as Zn,PD as Xn,PE as ea,nH as ta,jQ as na,jH as aa,PF as oa,jP as ht,Lh as sa,PG as ca,PH as ia,pr as la,p6 as ra,ny as ge,p5 as Le,PI as da,PJ as ua,lk as ma,bq as ha,lf as pt,l1 as pa,PK as ga,gO as gt,fS as Ca,lc as Sa,vk as Ia,PL as fa,o6 as ka,o1 as Ea,o5 as va,nS as ya,PM as ba,f2 as Ot,nl as Pa,n6 as Aa,fh as Ct,nC as Ta,PN as wa,nz as Vt,PO as xa,PP as Ra,PQ as Da,PR as Ua,PS as St,pD as Fa,oY as Ba,J_ as _a,jO as Ma,PT as Oa,G5 as Va,jN as ja,jC as za,f1 as La,ox as jt,oQ as $a,nw as It,nB as Ga,bE as qa,l9 as Ja,l6 as Na,PU as Ya,nR as ft,oO as kt,oM as Ka,oC as Qa,oh as Ha,oP as Wa,PV as Za,PW as Xa,ol as eo,PX as to,ob as no,ok as ao,oi as oo,oT as so}from"./zeni-epic-state-CZMuxCUG.js";import{y as zt,S as Ce,e as z,r as H,U as Lt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,x as $t,cz as ro,an as $e,D as uo,cA as mo,X as ho,cB as po,T as go,cC as Co,cD as So,v as Io,d as fo,aK as ko,b1 as Eo,F as vo,cE as yo}from"./index-BcVOuC0n.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-CjtZhD5y.js";import{c as qt}from"./useFetchSuggestedQuestionsWhenReady-CM8iKDtd.js";import{c as vt,C as bo}from"./TransactionDetailScreen-718LSRWk.js";import{w as Po}from"./withTransactionSidePanel-BevSoIGb.js";import{h as Ao,v as To}from"./routePaths-em7mZQJi.js";import{g as Ge}from"./accountMappingHelper-DIs9XlFT.js";import{D as wo}from"./DrawerScreen-ZPO4Ypa0.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.js";import"./decodeURIComponentSafe-N2eflqcZ.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]="d6437a37-149f-4501-bb90-f1a5e584a508",t._sentryDebugIdIdentifier="sentry-dbid-d6437a37-149f-4501-bb90-f1a5e584a508")}catch{}})();const xo=()=>{const t=ce(),i=wt(),P=qe(),f=U(d=>Re(d)),{useFeatureGate:E}=zt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=P.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=P.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(P.state?.pathnameStackToGoBack,P.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=Lt();return qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=P.state?.referrer;z.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-CLqAhud6.js";import xn from"./NotFoundScreen-YKkxofho.js";import{a,b as Tt}from"./sentry-Cx_bjk1I.js";import{n as Fe,S as Rn}from"./mui-BY8zvgs4.js";import{h as ce,j as wt,u as qe,g as U,k as Dn,l as rt,n as Un,o as ze}from"./core-aR0qKEiV.js";import{eQ as Re,Pq as Fn,mH as Se,fg as Bn,qi as _n,mZ as xt,ni as Rt,Pr as Dt,ns as Mn,Ps as Ut,mS as On,pQ as Vn,e$ as pe,Pt as De,so as Ft,Bz as Bt,Pu as _t,Pv as jn,pv as Je,L7 as dt,L9 as zn,jF as Ln,La as $n,jM as Gn,cW as qn,tr as Ne,n3 as Mt,nx as Ue,Pw as Jn,K0 as ut,J$ as Te,Px as mt,k1 as Nn,Py as Yn,Pz as Kn,PA as Qn,PB as Hn,na as Wn,mX as ie,nA as we,PC as Zn,PD as Xn,PE as ea,nH as ta,jQ as na,jH as aa,PF as oa,jP as ht,Lh as sa,PG as ca,PH as ia,pr as la,p6 as ra,ny as ge,p5 as Le,PI as da,PJ as ua,lk as ma,bq as ha,lf as pt,l1 as pa,PK as ga,gO as gt,fS as Ca,lc as Sa,vk as Ia,PL as fa,o6 as ka,o1 as Ea,o5 as va,nS as ya,PM as ba,f2 as Ot,nl as Pa,n6 as Aa,fh as Ct,nC as Ta,PN as wa,nz as Vt,PO as xa,PP as Ra,PQ as Da,PR as Ua,PS as St,pD as Fa,oY as Ba,J_ as _a,jO as Ma,PT as Oa,G5 as Va,jN as ja,jC as za,f1 as La,ox as jt,oQ as $a,nw as It,nB as Ga,bE as qa,l9 as Ja,l6 as Na,PU as Ya,nR as ft,oO as kt,oM as Ka,oC as Qa,oh as Ha,oP as Wa,PV as Za,PW as Xa,ol as eo,PX as to,ob as no,ok as ao,oi as oo,oT as so}from"./zeni-epic-state-deE-VpAu.js";import{y as zt,S as Ce,e as z,r as H,U as Lt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,x as $t,cz as ro,an as $e,D as uo,cA as mo,X as ho,cB as po,T as go,cC as Co,cD as So,v as Io,d as fo,aK as ko,b1 as Eo,F as vo,cE as yo}from"./index-Cy593RGQ.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-BHH5iUyl.js";import{c as qt}from"./useFetchSuggestedQuestionsWhenReady-Csr1Wwy2.js";import{c as vt,C as bo}from"./TransactionDetailScreen-CxbLldkU.js";import{w as Po}from"./withTransactionSidePanel-4Qi1EecU.js";import{h as Ao,v as To}from"./routePaths-Cr_t1xHP.js";import{g as Ge}from"./accountMappingHelper-4acz-SwQ.js";import{D as wo}from"./DrawerScreen-DTAMBHDh.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.js";import"./decodeURIComponentSafe-imXO9fsR.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]="d6437a37-149f-4501-bb90-f1a5e584a508",t._sentryDebugIdIdentifier="sentry-dbid-d6437a37-149f-4501-bb90-f1a5e584a508")}catch{}})();const xo=()=>{const t=ce(),i=wt(),P=qe(),f=U(d=>Re(d)),{useFeatureGate:E}=zt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=P.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=P.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(P.state?.pathnameStackToGoBack,P.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=Lt();return qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=P.state?.referrer;z.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-FqlsN9l2.js";import{a as r}from"./sentry-D49LOZ1j.js";import{Y as i,$ as l,a0 as p,k as m}from"./index-BcVOuC0n.js";import"./mui-DV0w8xOn.js";import f from"./NotFoundScreen-Bjx2V_hY.js";import{j as u,u as b}from"./core-CjgV1pRV.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]="38164943-7e55-44dc-9548-c9d1b513ec33",e._sentryDebugIdIdentifier="sentry-dbid-38164943-7e55-44dc-9548-c9d1b513ec33")}catch{}})();const D=()=>{const e=u(),t=b(),o=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),a=i(t.pathname);return a!=null?s.jsx(l,{menuItem:p(a),onDemoClick:o,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t};export{D as F};
1
+ import{j as s}from"./liveblocks-CLqAhud6.js";import{a as r}from"./sentry-Cx_bjk1I.js";import{Y as i,$ as l,a0 as p,k as m}from"./index-Cy593RGQ.js";import"./mui-BY8zvgs4.js";import f from"./NotFoundScreen-YKkxofho.js";import{j as u,u as b}from"./core-aR0qKEiV.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]="38164943-7e55-44dc-9548-c9d1b513ec33",e._sentryDebugIdIdentifier="sentry-dbid-38164943-7e55-44dc-9548-c9d1b513ec33")}catch{}})();const D=()=>{const e=u(),t=b(),o=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),a=i(t.pathname);return a!=null?s.jsx(l,{menuItem:p(a),onDemoClick:o,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t};export{D as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-D49LOZ1j.js";import{h as l,j as f,u as m}from"./core-CjgV1pRV.js";import{gv as p,Jc as g,Jd as b}from"./zeni-epic-state-CZMuxCUG.js";import{u as _,L as h,z as y}from"./index-BcVOuC0n.js";import"./liveblocks-FqlsN9l2.js";import"./recharts-Bc1ZLC_I.js";import"./mui-DV0w8xOn.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.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]="b08a22db-e1b7-48cc-aff0-08c345244467",e._sentryDebugIdIdentifier="sentry-dbid-b08a22db-e1b7-48cc-aff0-08c345244467")}catch{}})();function C(){const e=l(),n=f(),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"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
1
+ import{a as r}from"./sentry-Cx_bjk1I.js";import{h as l,j as f,u as m}from"./core-aR0qKEiV.js";import{gv as p,Jc as g,Jd as b}from"./zeni-epic-state-deE-VpAu.js";import{u as _,L as h,z as y}from"./index-Cy593RGQ.js";import"./liveblocks-CLqAhud6.js";import"./recharts-RPqam0Wx.js";import"./mui-BY8zvgs4.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.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]="b08a22db-e1b7-48cc-aff0-08c345244467",e._sentryDebugIdIdentifier="sentry-dbid-b08a22db-e1b7-48cc-aff0-08c345244467")}catch{}})();function C(){const e=l(),n=f(),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"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-FqlsN9l2.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-CjgV1pRV.js";import{J5 as k,J6 as v,J7 as T,za as B,yY as G,J8 as D,J9 as oe,Ja as se,z0 as ie,eR as $,z7 as le,z4 as re}from"./zeni-epic-state-CZMuxCUG.js";import{Z as g,o as r,n as de,e as j,j as J,p as ce,k as me,q as pe,r as H,y as ue,S as he,s as xe,v as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,F as je,G as $e}from"./index-BcVOuC0n.js";import{n as m}from"./mui-DV0w8xOn.js";import f from"./NotFoundScreen-Bjx2V_hY.js";import{a as I}from"./sentry-D49LOZ1j.js";import"./recharts-Bc1ZLC_I.js";import"./analytics-cU6JjHUB.js";import"./plaid-BkGpAOW9.js";import"./dnd-DHtwlo1Y.js";import"./stripe-DMRn4zHo.js";import"./lottie-wdoglqbL.js";import"./lexical-MibAVFD6.js";import"./pdf-FCPcIMVR.js";import"./utils-RiJ_hKSI.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]="4679fdf8-9368-4c69-9eda-5973968562f9",e._sentryDebugIdIdentifier="sentry-dbid-4679fdf8-9368-4c69-9eda-5973968562f9")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-CLqAhud6.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-aR0qKEiV.js";import{J5 as k,J6 as v,J7 as T,za as B,yY as G,J8 as D,J9 as oe,Ja as se,z0 as ie,eR as $,z7 as le,z4 as re}from"./zeni-epic-state-deE-VpAu.js";import{Z as g,o as r,n as de,e as j,j as J,p as ce,k as me,q as pe,r as H,y as ue,S as he,s as xe,v as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,F as je,G as $e}from"./index-Cy593RGQ.js";import{n as m}from"./mui-BY8zvgs4.js";import f from"./NotFoundScreen-YKkxofho.js";import{a as I}from"./sentry-Cx_bjk1I.js";import"./recharts-RPqam0Wx.js";import"./analytics-DyMyvTxh.js";import"./plaid-BgClSQ5E.js";import"./dnd-CZ0pE10o.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bz1bpTt2.js";import"./lexical-oQNXHxEc.js";import"./pdf-DGbhE1eo.js";import"./utils-B5-1mb3v.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]="4679fdf8-9368-4c69-9eda-5973968562f9",e._sentryDebugIdIdentifier="sentry-dbid-4679fdf8-9368-4c69-9eda-5973968562f9")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;